vissu

Simple Example - No Data To Display

Recommended Posts

Hi,

 

We are having difficulty with a simple Fusions charts example:

 

here is the HTML generated by servlet. Servlet does response.getPrintwriter().println(); and then does close on print writer. The foll. appears in page source in browser. Charts directory is placed directly under webapps dir in Tomcat. We get No Data to Display message in thr browser. BTW, we';ve seen examples on the internet that have <chart> tag as well as <graph> tag. We downloaded recently from your website, whatever version it is.

 

Any help is appreciated.

 

Thanks

 

Vissu

 

<html>

<head><title>Sonamine Reports</title>

<script language="JavaScript" src="Charts/FusionCharts.js"></script>

</head>

<body>

<p>This is Init Servlet</p>

<table width='875' align='center' cellspacing='0' cellpadding='0'>

<tr><td>

<!-- START Script Block for Chart-->

<div id='CatCumDiv' align='center'>

Chart.

</div>

<script type='JavaScript'>

var chart_CatCum = new FusionCharts('Charts/MSColumn2D.swf', 'CatCum', '850', '300', '0', '0');

// Provide entire XML data using dataXML method

chart_CatCum.setDataXML("<graph caption='Weekly Sales Summary' xAxisName='Week' yAxisName='Sales' numberPrefix=' > <set value='14400' /> <set value='19600' /> <set value='24000' /> <set value='15700' /> </graph>");

// Finally, render the chart.

chart_CatCum.render("CatCumDiv");

</script>

<!--END Script Block for Chart-->

 

</td></tr>

</table>

</body></html>

Share this post


Link to post
Share on other sites

Hi

 

Please modify the xml from

 

<graph caption='Weekly Sales Summary' xAxisName='Week' yAxisName='Sales' numberPrefix=' > <set value='14400' /> <set value='19600' /> <set value='24000' /> <set value='15700' /> </graph>

 

to

 

<graph caption='Weekly Sales Summary' xAxisName='Week' yAxisName='Sales'> <set label='Monday' value='14400' /> <set label='Tuesday' value='19600' /> <set label='Wednesday' value='24000' /> <set label='Thursday' value='15700' /> </graph>

 

and try once.

Share this post


Link to post
Share on other sites

Applied your suggestion. Dont get the "no data to display" any more but graph does not show. Here is the new HTML generated by Servlet (copied from page source):

 

<html>

<head><title>Sonamine Reports</title>

<script language="JavaScript" src="Charts/FusionCharts.js"></script>

</head>

<body>

<p>This is Init Servlet</p>

<table width='875' align='center' cellspacing='0' cellpadding='0'>

<tr><td>

<!-- START Script Block for Chart-->

<div id='CatCumDiv' align='center'>

Chart.

</div>

<script type='JavaScript'>

var chart_CatCum = new FusionCharts('Charts/MSColumn2D.swf', 'CatCum', '850', '300', '0', '0');

// Provide entire XML data using dataXML method

chart_CatCum.setDataXML("<graph caption='Weekly Sales Summary' xAxisName='Week' yAxisName='Sales'> <set label='Monday' value='14400' /> <set label='Tuesday' value='19600' /> <set label='Wednesday' value='24000' /> <set label='Thursday' value='15700' /> </graph>");

// Finally, render the chart.

chart_CatCum.render("CatCumDiv");

</script>

<!--END Script Block for Chart-->

 

</td></tr>

</table>

 

 

</body></html>

Share this post


Link to post
Share on other sites

Hi

 

If you are using free version, then you have to use : root tag as <graph> and name attribute instead of label attribute : <set name='' value=''/>

 

On the other hand, if you are using v3 version, root tag will be <chart> and label is the attribute name in set tag.

 

Please confirm the version of FusionCharts you are using.

Share this post


Link to post
Share on other sites

Chart with label attribute and graph with name attribute has same effect - no graph shows. It is free version - just downloaded from your website. Any other tips?

 

<html>

<head><title>Reports</title>

<script language="JavaScript" src="Charts/FusionCharts.js"></script>

</head>

<body>

<p>This is Init Servlet</p>

<table width='875' align='center' cellspacing='0' cellpadding='0'>

<tr><td>

<!-- START Script Block for Chart-->

<div id='CatCumDiv' align='center'>

Chart.

</div>

<script type='JavaScript'>

var chart_CatCum = new FusionCharts('Charts/MSColumn2D.swf', 'CatCum', '850', '300', '0', '0');

// Provide entire XML data using dataXML method

chart_CatCum.setDataXML("<chart caption='Weekly Sales Summary' xAxisName='Week' yAxisName='Sales'> <set label='Monday' value='14400' /> <set label='Tuesday' value='19600' /> <set label='Wednesday' value='24000' /> <set label='Thursday' value='15700' /> </chart>");

// Finally, render the chart.

chart_CatCum.render("CatCumDiv");

</script>

<!--END Script Block for Chart-->

 

</td></tr>

</table>

 

</body></html>

Share this post


Link to post
Share on other sites

Here is the example with graph and name attribute, using free version. Now I get the No data to display problem back when we have <script type='text/javascript'> in HTML. If we use

<script type='JavaScript'>, then we see nothing, i.e no graph.

 

Thanks for any help

 

<html>

<head><title>Reports</title>

<script language="JavaScript" src="Charts/FusionCharts.js"></script>

</head>

<body>

<p>This is Init Servlet</p>

<table width='875' align='center' cellspacing='0' cellpadding='0'>

<tr><td>

<!-- START Script Block for Chart-->

<div id='CatCumDiv' align='center'>

Chart.

</div>

<script type='text/javascript'>

var chart_CatCum = new FusionCharts('Charts/MSColumn2D.swf', 'CatCum', '850', '300', '0', '0');

// Provide entire XML data using dataXML method

chart_CatCum.setDataXML("<graph caption='Weekly Sales Summary' xAxisName='Week' yAxisName='Sales'> <set name='Monday' value='14400' /> <set name='Tuesday' value='19600' /> <set name='Wednesday' value='24000' /> <set name='Thursday' value='15700' /> </graph>");

// Finally, render the chart.

chart_CatCum.render("CatCumDiv");

</script>

<!--END Script Block for Chart-->

 

</td></tr>

</table>

</body></html>

Share this post


Link to post
Share on other sites
Guest Angie

Hi,

 

Welcome to FusionCharts Forum!smile.gif

 

Since, you are providing data in single series format, you would need to use single series swf file instead of muliseries swf file.

 

For this reason, you are getting "No Data to Display" error.

 

Please find the modified code below:

 

var chart_CatCum = new FusionCharts('Charts/Column2D.swf', 'CatCum', '850', '300', '0', '0');

For more details, please refer to the link: http://www.fusioncha...ebug/Basic.html

 

Hope this helps.smile.gif

Share this post


Link to post
Share on other sites
Guest Angie

Hi,

 

Thank you very much for your appreciation.

 

We are glad to know that your problem has been resolved.

 

Keep FusionCharting!biggrin.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