Sign in to follow this  
Vijaya_FC

Getting Data Back From Chart Using V3 Free

Recommended Posts

Hi,

 

I am trying to get the data back from the chart using getXMLData function using V3 free version. Its throwing error "getDataXML is not defined.

 

Please help me in resolving this issue

 

Thanks,

Vijaya

Share this post


Link to post
Share on other sites

Hi,

 

 

I tried the example in the above said link: http://www.fusioncha...kFromChart.html

 

But its throwing the error: FusionCharts("myChartId").getDataAsCSV is not a function

 

Code:

<html>

<head>

<title>Getting CSV data from chart</title>

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

</script>

</head>

<body>

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

<script type="text/javascript">

 

var myChart = new FusionCharts( "FusionCharts/Column3D.swf", "myChartId", "400", "300", "0", "0" );

myChart.setXMLData("<chart><set label='A' value='10' /><set label='B' value='11' /></chart>");

myChart.render("chartContainer");

 

</script>

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

</body>

</html>

Edited by Vijaya_FC

Share this post


Link to post
Share on other sites
Guest Angie

Hi,

 

Please enable the registerwithJS parameter to "1" to communicate between FusionCharts and JavaScript.

 

For ex: var myChart = new FusionCharts( "FusionCharts/Column3D.swf", "myChartId", "400", "300", "0", "1" );

 

Hope this helps.smile.gif

Share this post


Link to post
Share on other sites

Hi,

Tried with the suggested change,

 

var myChart = new FusionCharts( "/FusionCharts/Column3D.swf", "myChartId", "400", "300", "0", "1" );

 

But no luck. am still getting the same error

 

registerwithJS parameter is for paid version right?

 

I am using the free version.

 

Thanks,

Vijaya

Share this post


Link to post
Share on other sites
Guest Angie

Hi,

 

I am afraid, FusionCharts free does not support the registerWithJS parameter, at this time.

 

You would need to upgrade to FusionCharts v 3.2.

 

Hope this helps.smile.gif

Share this post


Link to post
Share on other sites

I am using @version 3.2.1-release free version to try with the features supported in v3.2 before going for the licensed version.

Is getDataAsCSV() is not supported in free version?

Thanks,

Vijaya

Share this post


Link to post
Share on other sites

Hi,

 

I am using the latest FusionCharts.js and I am not using highcharts.js and jquerymin.js

 

In rails -

Views : _test.html.erb

 

1.render_chart_html:

 

<html>

<head>

<title>Getting data from chart</title>

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

</script>

</head>

<body>

<%str_xml = "<chart><set label='A' value='10' /><set label='B' value='11' /></chart>"%>

<div id="test">

<% render_chart_html "/FusionCharts/Column3D.swf", '', str_xml,"myChart", 800, 400, false do-%>

<% end -%>

</div>

<input onclick = "alert(FusionCharts('myChart').getChartData('xml'))" type="button" value="Get Data from chart">

</body>

</html>

Its rendering the chart, but on clicking the "Get data from chart" its throwing the error - FusionCharts("myChart") is undefined

 

 

2.render_chart

<html>

<head>

<title>Getting data from chart</title>

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

</script>

</head>

<body>

<%str_xml = "<chart><set label='A' value='10' /><set label='B' value='11' /></chart>"%>

<div id="test">

<% render_chart "/FusionCharts/Column3D.swf", '', str_xml,"myChart", 800, 400, false,false do-%>

<% end -%>

</div>

<input onclick = "alert(FusionCharts('myChart').getChartData('xml'))" type="button" value="Get Data from chart">

</body>

</html>

Its not rendering the chart, But its displaying the text "Chart"

 

3. JavaScript function

 

 

<html>

<head>

<title>Getting CSV data from chart</title>

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

</script>

</head>

<body>

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

<script type="text/javascript">

 

var myChart = new FusionCharts( "/FusionCharts/Column3D.swf", "myChartId", "400", "300", "0", "1" );

myChart.setXMLData("<chart><set label='A' value='10' /><set label='B' value='11' /></chart>");

myChart.render("chartContainer");

 

</script>

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

 

 

</body>

</html>

 

Its working fine.

Its getting the data in xml format

 

 

So why its not working using helper methods?

Edited by Vijaya_FC

Share this post


Link to post
Share on other sites
Guest Angshu

Hi,

 

Welcome to FusionCharts Forum!smile.gif

 

First of all, we would like to thank you for showing interest in FusionCharts.

 

Could you please send us a screenshot or the entire code to look into the issue?

 

Awaiting for your response.

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