karen m

Linked Charts Using Json:

Recommended Posts

I am experiencing problems getting the data to render for linked charts. I reviewed the document for FusionCharts and made references to configureLinks JavaScript function but I cannot find an example of how to include the configureLinks when using JSTL to render the chart content. Below is my JSON message being generated (Note: I switched from newchart-json- to newchart-xml because newchart-json wasn't working at all; now I get a message stating there is no data to display).

 

{"chart":{"caption":"Web Orders",

"showLabels":"0",

"enablesmartlabels":"0",

"showlegend":"1",

"pieRadius":"90",

"showPercentValues":"1",

"showBorder":"1",

"baseFont":"Verdana, Geneva, Arial, Helvetica, sans-serif",

"baseFontSize":"10",

"bgColor":"CC9900,FFFFFF",

"canvasbgColor":"CC9900,FFFFFF"

},

"data":[{"label":"Total Web Orders","value":1747,"color":"FF0000","link":"newchart-xml-WebOrders1" },

{"label":"Total Non-Web Orders","value":198,"color":"FF0000","link":"newchart-xml-TotalsOrders1" }

],

"linkeddata":[{"id":"WebOrders1",

"linkedcharts":{"chart":{"caption":"Web Orders",

"showLabels":"0",

"enablesmartlabels":"0",

"showlegend":"1",

"pieRadius":"90",

"showPercentValues":"1",

"showBorder":"1",

"baseFont":"Verdana, Geneva, Arial, Helvetica, sans-serif",

"baseFontSize":"10",

"bgColor":"CC9900,FFFFFF",

"canvasbgColor":"CC9900,FFFFFF"

},

"data":[{"label":"NE","value":767},

{"label":"MA","value":527},

{"label":"MW","value":307},

{"label":"SE","value":146}

]

}

},

{"id":"TotalsOrders1",

"linkedcharts":{"chart":{"caption":"Total Orders",

"showLabels":"1",

"showlegend":"1",

"showBorder":"1",

"baseFont":"Verdana, Geneva, Arial, Helvetica, sans-serif",

"baseFontSize":"10",

"bgColor":"CC9900,FFFFFF",

"canvasbgColor":"CC9900,FFFFFF"

},

"categories":[{"category":[{"label":"Total Web Orders"},

{"label":"Total Non-Web Orders"},

{"label":"Total Orders"}

]

}

],

"dataset":[{"seriesname":"NE",

"data":[{"value":767},

{"value":64},

{"value":831}

]

},

{"seriesname":"MA",

"data":[{"value":527},

{"value":69},

{"value":596}

]

},

{"seriesname":"MW",

"data":[{"value":307},

{"value":34},

{"value":341}

]

},

{"seriesname":"SE",

"data":[{"value":146},

{"value":31},

{"value":177}

]

}

]

}

]

}

 

 

 

JSP Snippet:

<c:set var="pathToChart" value="<%=chartPath%>"/>

<c:set var="pos" value="0"/>

<br/>

<table border="0" cellpadding="1" cellspacing="1" width="800px" class="tblBox">

<c:forEach var="chart" items="<%=charts%>">

<c:set var="name" value="${chart.chartName}"/>

<c:if test="${pos eq 0}">

<tr>

</c:if>

<td>

<fc:render chartId="${chart.id}" swfFilename="${pathToChart}/${name}" debugMode="false" jsonData="${chart.json}" width="360" height="250"/>

</td>

<c:choose>

<c:when test="${pos eq 2}">

<c:set var="pos" value="0"/>

</tr>

</c:when>

<c:otherwise>

<c:set var="pos" value="${pos + 1}"/>

</c:otherwise>

</c:choose>

</c:forEach>

 

<c:if test="${pos < 2}">

<c:forEach var="i" begin="${pos}" end="2" step="1">

<td> </td>

</c:forEach>

</tr>

</c:if>

</table>

 

Based on your documentation configureLink will allow me to configure each child chart to user a certain chart swf file. This is the error I am getting:

 

Scale Mode: noScale

Debug Mode: Yes

Application Message Language: EN

Version: 3.2.1

Chart Type: 3D Pie Chart

Chart Objects:

BACKGROUND

CANVAS

CAPTION

SUBCAPTION

DATALABELS

DATAPLOT

TOOLTIP

LEGEND

 

INFO: Chart registered with external script. DOM Id of chart is chartobject-1

INFO: XML Data provided using dataXML method.

XML Data: null

No Data to Display: No data was found in the XML data document provided. Possible cases can be:

There isn't any data generated by your system. If your system generates data based on parameters passed to it using dataURL, please make sure dataURL is URL Encoded.

You might be using a Single Series Chart .swf file instead of Multi-series .swf file and providing multi-series data or vice-versa.

Share this post


Link to post
Share on other sites
Guest Angshu

Hi,

Welcome to FusionCharts Forum! smile.gif

 

If your chart shows a "No data to display" message, it could be the following scenarios:

 

1. Your XML data doesn't contain any data that could be plotted by FusionCharts. In this case, your XML just contains the <chart> or <dataset> tags without any data between them.

 

2. You might be using a single-series chart SWF and providing data in multi-series format or vice-versa. In this case too, you'll get a "No data to display" message.

 

Hope this helps.smile.gif

 

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now