FusionChart displays blank

I can successfully execute the sample examples using Charts. Now I am trying this with actual data using DMI datasource.

I am able to retrive all the data successfully, but the graph/chart is not displayed. I see blank in place/position of the chart.

I am unable to figure out what is missing here ?

Please refer the code that I am using

<%@ taglib uri="isomorphic" prefix="isomorphic" %>
<HTML><HEAD>
	<TITLE>
		Volume Matrix
</TITLE>
</HEAD>
<isomorphic:loadISC skin="SmartClient" includeModules="ISC_Analytics,ISC_PluginBridges"/> 

<BODY BGCOLOR=#D3D3D3>

<SCRIPT>
<isomorphic:loadDS ID="histogramGraphSpringDMI"/>

		// databound ListGrid
		isc.ListGrid.create({
			ID:"boundList1",
		    leaveScrollbarGap:false, 
			height:180, 
		    canEdit:false, 
			editEvent:'click', 
			alternateRecordStyles:true, 
			autoDraw: false,
  
    // editing a cell triggers an update of the chart

    cellChanged:"boundList1.updateChart({chartType:'Column'})",
	recordClick:"boundList1.updateChart({chartType:'Column'})",
    updateChart : function (props) {
        // store chart configuration

       if (props) this.chartProps = props;

        // if there's already a chart, destroy it

      if (this.lastChart) this.lastChart.destroy();

        // generate chart

	   this.lastChart = this.chartData("date",null, null, this.chartProps);
    
        // show it

        volumeStack.addMember(this.lastChart, 4);
    },
  
    dataSource:histogramGraphSpringDMI
		});

		// toolbar to perform various actions using the boundForm values (see helpText above)
		isc.Toolbar.create({
			ID:"toolButton",
			autoDraw:false,
			membersMargin:10,
            buttonConstructor: "IButton",
            height: 22,
			buttons:[
				{title:"Histogram", click:"boundList1.fetchData(boundForm1.getValuesAsCriteria());"}
			]
		});
		
		// Search the form on these criteria
		isc.SearchForm.create({
	    	ID:"boundForm1",
	    	dataSource: histogramGraphSpringDMI,
	    	numCols:"2",
	    	autoFocus:false,
	    	useAllDataSourceFields: false,
	    	fields:[
	    	        {name:"startdate",type:"date"},
	    	        {name:"enddate",type:"date"}
	    	        ]
		});

isc.VLayout.create({
    ID:"volumeLayout1",
	left:0, top:0,
	width:"100%",
	height:"100%",
	membersMargin:0,
	members:[	
			isc.HTMLPane.create({
			left:0, top:0,
			width:"100%", height:125, showEdges:false,
			contentsType:"page", overflow: "hidden",
			contentsURL:"/citweb/header.html"
			}),
			isc.VStack.create({
				 ID:"volumeStack",
   				 width:"100%", height:"100%", membersMargin:0,
					members:[boundForm1,toolButton,boundList1]
				})
	]
});

		

	
</SCRIPT>
</BODY></HTML>

No way to tell, all the relevant information (DataSource definition and data returned) is missing.

FusionChart displays blank

Here I am providing more information on datasource defination and implementation class. Also attaching the snapshot of the data retrieved.

Please note that /citweb/header.html is not attached as it is just a header file which doesn’t have any smartclient components

Can you please help me on this.

DataSource Defination
=======================

<DataSource
    ID="histogramGraphSpringDMI"
    serverType="generic" 
>
    <fields>
    	<field name="startdate" type="date" 	hidden="true" title="Start Date"/>
    	<field name="enddate" 	type="date" 	hidden="true"	title="End Date"/>
        <field name="date"	title="Date"   type="date"     required="true"/>
        <field name="transcount" type="float"     title="Transcount"   />
    </fields>

    <serverObject lookupStyle="spring" bean="HistogramDao"/>

    <!-- You can define an operationBindings section to bind operation names to server method
         (potentially additionally discriminated by the operationId).
         In the absence of this section, the server will look for a server method named after
         the operationType.  
    -->
    
    <operationBindings>
        <binding operationType="fetch" serverMethod="fetch">
        <serverObject  lookupStyle="spring" bean="HistogramDao"/>
        </binding>
    </operationBindings>
      
</DataSource>

This is the class implementing request/response
=====================
public class HistogramDao extends SqlMapClientDaoSupport{
	Logger log = new Logger(HistogramDaoImpl.class.getName());

	public DSResponse fetch(DSRequest dsRequest) throws Exception{
		
		SqlMapClientTemplate template = getSqlMapClientTemplate();
		DSResponse dsResponse = new DSResponse();
		
		
		// DataSource protocol: get filter criteria
		HashMap<String,Date> Period =new HashMap<String, Date>();
        Period.put("startdate",(Date)dsRequest.getFieldValue("startdate"));
        Period.put("enddate",(Date)dsRequest.getFieldValue("enddate"));
      
        
        // DataSource protocol: get requested row range
        long startRow = (int)dsRequest.getStartRow();
        long endRow = (int)dsRequest.getEndRow();
        
        List<?> matchingItems=template.queryForList("selectafew",Period);
        // DataSource protocol: return matching item beans
        long totalRows = matchingItems.size();
        dsResponse.setTotalRows(totalRows);
        dsResponse.setStartRow(startRow);

        endRow = Math.min(endRow, totalRows);
        dsResponse.setEndRow(endRow);

        List<?> results;
        if (totalRows > 0) {
            results = matchingItems.subList((int)dsResponse.getStartRow(), 
                                                 (int)dsResponse.getEndRow());
        } else {
            results = matchingItems;
        }
        
        dsResponse.setData(results);
        
		return dsResponse;
	}

It looks like your loadISC tag is wrong (should be just “Analytics” - leave off the ISC_ prefix).

This would lead to a very very obvious JS error. Become familiar with Firebug so you can solve simple problems like this.

If that’s not the only problem, use the Watch tab to figure out if the chart was created but isn’t visible for some reason (eg, is 1px tall).

If there’s some other JS error, post the stack trace for it (available in the Developer Console in IE).

FusionChart displays blank

Thanks for the response.

As suggested, I have removed the ISC_ prefix, but I still don’t see the graph being displayed.

<isomorphic:loadISC skin="SmartClient" includeModules="Analytics,PluginBridges"/>

The problem still persist. I just see a blank/white box in place of graph.

I do have Firebug installed. But I don’t see any errors.

Regards,

Girish

Use the Watch tab (see previous post).

Use Firebug or Fiddler to determine if there are 404 errors or similar preventing the chart from loading.

There’s a working sample included in the SDK, so please refer to that sample and compare it to your code to identify the problem.

FusionChart displays blank

As mentioned in my earlier posts, I am able to run the example code (GridCharting) without any problems. This obviously uses embeded tomcat server and settings. so works without any issues.

But this prototype development is being done within my eclipse workspace. I have tomcat server running within eclipse. I have implemented other features using smartclient successfully.
However, when I try to implement this graph using fusionChart, I get a blank/white box in place of graph. This is clearly visible in the image that I attached earlier.

Is there any special setting required for FusionCharts. Does it require any additional plug-in / patch to be applied.

I have been struggling with this since 1 week now. I have firebug, but I don’t see any errors there.

Any help on this will be really appreciated.

You are still not taking the recommended steps. Use the Watch Tab to figure out if the component has been created with the size and position you intended. Use Firebug to see if resources being loaded by the chart widget are being found (eg, the .swf files for FusionCharts, normally placed in a directory called “FusionCharts” directly under webroot.

Sorry for delayed feedback/response on this.

With the help of the firebug I found that the path for the FusionCharts being used is incorrect as shown below code.

This path doesn’t exist.
http://10.158.219.74:8080/myapp/isomorphic/../FusionCharts/Charts/Column3D.swf

As I mentioned earlier, I am not using embedded tomcat server. I have my application deployed on external tomcat server.

How do I fix this ? I want to overide this url to point it to correct FusionChart path.

<object id="boundList1_chart$261" width="100%" height="100%" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000">
<param value="&chartWidth=900&chartHeight=300&dataXML=%3Cgraph%20caption%3D%22%22%20subCaption%3D%22%22%20yAxisName%3D%22%22%20xAxisName%3D%22%22%20animation%3D%221%22%20showValues%3D%220%22%20%3E%3Ccategories%3E%3Ccategory%20name%3D%22Date%22%2F%3E%3Ccategory%20name%3D%22Transcount%22%2F%3E%3C%2Fcategories%3E%3C%2Fgraph%3E" name="FlashVars"/>
<param value="http://10.158.219.74:8080/myapp/isomorphic/../FusionCharts/Charts/Column3D.swf" name="movie"/>
<param value="opaque" name="wmode"/>
<embed width="100%" height="100%" wmode="opaque" movie="http://10.158.219.74:8080/myapp/isomorphic/../FusionCharts/Charts/Column3D.swf" flashvars="&chartWidth=900&chartHeight=300&dataXML=%3Cgraph%20caption%3D%22%22%20subCaption%3D%22%22%20yAxisName%3D%22%22%20xAxisName%3D%22%22%20animation%3D%221%22%20showValues%3D%220%22%20%3E%3Ccategories%3E%3Ccategory%20name%3D%22Date%22%2F%3E%3Ccategory%20name%3D%22Transcount%22%2F%3E%3C%2Fcategories%3E%3C%2Fgraph%3E" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" src="http://10.158.219.74:8080/myapp/isomorphic/../FusionCharts/Charts/Column3D.swf" name="boundList1_chart$261"/>
</object>

Looks like you need to set chartURL.

We did try setting chartURL as show in the code below.

But we still see a blank object in place of chart.

We even tried to debug by setting breakpoints and stepping into functions using Firebug. But unable to find any problems / cause.

Can you please help.

<%@ taglib uri="isomorphic" prefix="isomorphic" %>
<HTML><HEAD>
	<TITLE>
		Volume Matrix
</TITLE>
</HEAD>
<isomorphic:loadISC skin="SmartClient" includeModules="Analytics,PluginBridges"/> 

<BODY BGCOLOR=#D3D3D3>

<SCRIPT>
<isomorphic:loadDS ID="histogramGraphSpringDMI"/>

		// databound ListGrid
		isc.ListGrid.create({
			ID:"boundList1",
			height:180, 
			editEvent:'click', 
		    canEdit:false, 
			alternateRecordStyles:true, 
			autoDraw: true,
  
    // editing a cell triggers an update of the chart

	recordClick:"boundList1.updateChart()",
    updateChart : function (props) {
        // store chart configuration

       if (props) this.chartProps = props;

        // if there's already a chart, destroy it

      if (this.lastChart) this.lastChart.destroy();

        // generate chart

	   this.lastChart = this.chartData("date",["date","transcount"], null, {chartType: "Column",width: "900", height: "300",chartURL:"http://10.158.219.74:8080/webapps/smartclientSDK/FusionCharts/Charts/Column3D.swf",
			src:"http://10.158.219.74:8080/webapps/smartclientSDK/FusionCharts/Charts/Column3D.swf" });
    
        // show it

        volumeStack.addMember(this.lastChart, 3);
    },
  
    dataSource:histogramGraphSpringDMI
		});

		// toolbar to perform various actions using the boundForm values (see helpText above)
		isc.Toolbar.create({
			ID:"toolButton",
			autoDraw:false,
			membersMargin:10,
            buttonConstructor: "IButton",
            height: 22,
			buttons:[
				{title:"Histogram", click:"boundList1.fetchData(boundForm1.getValuesAsCriteria());"}
			]
		});
		
		// Search the form on these criteria
		isc.SearchForm.create({
	    	ID:"boundForm1",
	    	dataSource: histogramGraphSpringDMI,
	    	numCols:"2",
	    	autoFocus:false,
	    	useAllDataSourceFields: false,
	    	fields:[
	    	        {name:"startdate",type:"date"},
	    	        {name:"enddate",type:"date"}
	    	        ]
		});

isc.VLayout.create({
    ID:"volumeLayout1",
	left:0, top:0,
	width:"100%",
	height:"100%",
	membersMargin:0,
	members:[	
			isc.HTMLPane.create({
			left:0, top:0,
			width:"100%", height:125, showEdges:false,
			contentsType:"page", overflow: "hidden",
			contentsURL:"/myapp/header.html"
			}),
			isc.VStack.create({
				 ID:"volumeStack",
   				 width:"100%", height:"100%", membersMargin:0,
					members:[boundForm1,toolButton,boundList1]
				})
	]
});

		
boundList1.updateChart();
	
</SCRIPT>
</BODY></HTML>

FusionChart displays blank

Still waiting for your response on my last post.

I have tried all possible tips/solutions suggested by Isomorphic.

Is this a bug ? or there is any workaround to make FusionCharts work with SmartClient

Again, the development environment consists of Eclipse IDE with a tomcat plug-in. the examples run fine when hosted on the embedded tomcat server.

Not sure what your difficult is - you have reported that there is a request to load the chart via Firebug and it fails because the chart file (Column3d.swf) is not there.

So put the chart file there.

Or, use the chartURL property to change where the chart is loaded from.

Perhaps the problem is that you don’t know where to get these files? In the SmartClient SDK, evaluation copies are in the top-level directory (smartclientSDK/FusionCharts). Licensed files can be purchased at fusioncharts.com.

Thanks for the reply, Isomorphic.
We believed that this would already be addressed and taken care of by the full path of the .swf file under ChartURL (as seen in the code above) -

chartURL:“http://10.158.219.74:8080/webapps/smartclientSDK/FusionCharts/Charts/Column3D.swf”

There must be something else we are missing here, surely ?

And is the file actually available at that URL? Are you seeing a request to that URL and does it succeed?

Why are you specifying a full URL starting with HTTP? It may work, but it’s bad practice. At most, make the URL absolute but omit the host IP.

Awesome, It Worked !!

full path from within the context without the IP works like a charm.
Thanks !