Sign in to follow this  
sreesh

Getting Data Back From Chart

Recommended Posts

hi,

 

I am not able to view the data of the chart, that I have created. I have just followed the steps given at http://docs.fusioncharts.com/charts/. The only change that i have done is keep the xml in a separate file instead of entering it in the html file.

 

This is my html file:

 

<html>

<head>

<title>My First chart using FusionCharts</title>

<script type="text/javascript" src="FusionCharts/FusionCharts.js">

</script>

</head>

<body>

<div id="chartContainer">FusionCharts XT will load here!</div>

<script type="text/javascript"><!--

 

var myChart = new FusionCharts( "FusionCharts/StackedColumn3D.swf",

"myChartId", "400", "300", "0", "1" );

myChart.setXMLUrl("MSData.xml");

myChart.render("chartContainer");

 

// -->

</script>

<input onclick = "alert(FusionCharts('myChartId').getDataAsCSV())" type="button" value="Get CSV Data from chart">

</body>

</html>

Share this post


Link to post
Share on other sites

Hi,

 

hi,

 

I am not able to view the data of the chart, that I have created. I have just followed the steps given at http://docs.fusioncharts.com/charts/. The only change that i have done is keep the xml in a separate file instead of entering it in the html file.

 

This is my html file:

 

<html>

<head>

<title>My First chart using FusionCharts</title>

<script type="text/javascript" src="FusionCharts/FusionCharts.js">

</script>

</head>

<body>

<div id="chartContainer">FusionCharts XT will load here!</div>

<script type="text/javascript"><!--

 

var myChart = new FusionCharts( "FusionCharts/StackedColumn3D.swf",

"myChartId", "400", "300", "0", "1" );

myChart.setXMLUrl("MSData.xml");

myChart.render("chartContainer");

 

// -->

</script>

<input onclick = "alert(FusionCharts('myChartId').getDataAsCSV())" type="button" value="Get CSV Data from chart">

</body>

</html>

 

Could you please let us know in case you are facing any issue while getting back the data in CSV format?

 

It seems to be working perfectly at our end. Please check with the attached sample for your reference.

 

Hope this helps. :)

StackedColumn3D.zip

Share this post


Link to post
Share on other sites

Thank you so much for your reply, I have figured out the mistake that I had made.

But the xml data is still not getting displayed when I run it in chrome.

Can't figure out what is the issue there, it works perfectly in all other browsers.

 

 

Hi,

 

 

 

Could you please let us know in case you are facing any issue while getting back the data in CSV format?

 

It seems to be working perfectly at our end. Please check with the attached sample for your reference.

 

Hope this helps. :)

 

 

 

Share this post


Link to post
Share on other sites

Hi,

 

Thank you so much for your reply, I have figured out the mistake that I had made.

But the xml data is still not getting displayed when I run it in chrome.

Can't figure out what is the issue there, it works perfectly in all other browsers.

 

 

It seems that you are providing data as a URL and rendering JavaScript chart Google Chrome from Local file system.

 

In case yes, please note that if Flash Player is not available on certain devices (like iPad and iPhone), FusionCharts JavaScript library automatically renders the same chart using JavaScript. If you are running the sample from local file system, please note that you will need to provide the data using Data String method, that is, passing the data (XML/JSON) to the chart as String or JSON Object. Many browsers, like, Chrome restrict JavaScript from accessing the local file system owing to security reasons.

 

If you had provided data as a URL, the JavaScript charts will not be able to access the same, when running locally. If you run the files from a server, it will run absolutely fine, though. When running locally, however, if you provide the data as string (using the Data String method), it works fine.

 

Hope this helps. :)

Share this post


Link to post
Share on other sites

Thank you so much for your help,

now I completely understand what is going on. Can I export the data to a .csv file in my hard drive instead of displaying it as an alert?

if so what is the javascript code for that?

 

Hi,

 

 

 

It seems that you are providing data as a URL and rendering JavaScript chart Google Chrome from Local file system.

 

In case yes, please note that if Flash Player is not available on certain devices (like iPad and iPhone), FusionCharts JavaScript library automatically renders the same chart using JavaScript. If you are running the sample from local file system, please note that you will need to provide the data using Data String method, that is, passing the data (XML/JSON) to the chart as String or JSON Object. Many browsers, like, Chrome restrict JavaScript from accessing the local file system owing to security reasons.

 

If you had provided data as a URL, the JavaScript charts will not be able to access the same, when running locally. If you run the files from a server, it will run absolutely fine, though. When running locally, however, if you provide the data as string (using the Data String method), it works fine.

 

Hope this helps. :)

 

 

 

Share this post


Link to post
Share on other sites

Hi,

 

Thank you so much for your help,

now I completely understand what is going on. Can I export the data to a .csv file in my hard drive instead of displaying it as an alert?

if so what is the javascript code for that?

 

Please note that exporting the CSV data is stored in some JavaScript variable. The alert is the simplest example to demonstrate it. Hence, in case you wish to do anything with the exported CSV data, you would need to use the data in the variable and process it in the server location and make it downloadable, as per your requirement.

 

You would need to do this at your end, as per your requirement as we only provide the API to export the chart data as CSV.

 

Hope this helps. :)

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
Sign in to follow this