Retrieve Chart Data
FusionCharts Forum
Home       Members    Calendar    Who's On
Welcome Guest ( Login | Register )
        



Retrieve Chart Data Expand / Collapse
Author
Message
Posted 8/9/2007 9:07:36 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 8/10/2007 3:14:48 AM
Posts: 1, Visits: 5
Hi,

I have bound a powerchart to some XML and it displays the chart fine. What I now want to do is to retrieve the current XML data back from the chart but I cannot seem to get this working. I have viewed the online demo at http://www.fusioncharts.com/Demos/ScatterReturn/Default.html and that is what I want to achieve, but when I download the source it doesn't work.

I am programming this in ASP.net 2.0 and C# using masterpages and here is my code:

 

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

<script language="JavaScript" src="<%=Request.ApplicationPath %>/Javascript/FusionCharts.js"></script>

<script language="JavaScript">

/**

* readXMLFromChart() method is called when the user pressed the

* button to return XML data

*/

function test()

{

//Get a reference to our chart

var ourChart = getChartFromId("SelectChart");

//Get the data from chart

var xmlRtn = ourChart.getXMLData();

//Show it to user in alert box.

alert(xmlRtn);

}

</script>

<table width='98%' border ='0' cellspacing='0' cellpadding='3' align='center'>

<tr>

<td valign='top' class ='text' align='center'>

<div id="chartdiv" align="center">

FusionCharts.

</div>

<script type="text/javascript">

var chart = new FusionCharts("DragNode.swf", "SelectChart", "550", "400", "0", "1");

chart.setDataXML("<%=XmlFC %>");

chart.render("chartdiv");

</script>

</td>

</tr>

<tr>

<td>

<input id="Button1" type="button" value="button" onclick="test();" />

</td>

</tr>

</table>

</asp:Content>

Any suggestions??

Post #1925
Posted 8/14/2007 12:09:22 AM
FusionCharts Team

FusionCharts TeamFusionCharts TeamFusionCharts TeamFusionCharts TeamFusionCharts TeamFusionCharts TeamFusionCharts TeamFusionCharts Team

Group: Administrators
Last Login: 7/29/2008 12:15:49 PM
Posts: 2,001, Visits: 474
Do you get any JavaScript errors when you run this code?

Thanks,
Pallav Nadhani
FusionCharts Team
Post #1959
Posted 2/15/2008 12:48:13 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 2/16/2008 2:33:08 AM
Posts: 5, Visits: 11
Hi,

I'm having the same problem. I'm getting "object doesnot support this method" java script error when accessing getXMLData() method.

Any help?

Regards,

Anand

Post #4525
Posted 2/15/2008 4:51:56 AM
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Forum Members
Last Login: Today @ 4:28:13 AM
Posts: 229, Visits: 1,174

Are you using the chart with in form? then use the latest FusionCharts.js

Thanks,
Arindam

FusionCharts Team
www.fusioncharts.com

Post #4527
Posted 2/15/2008 7:08:15 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 2/16/2008 2:33:08 AM
Posts: 5, Visits: 11

Thanks for the Reply.

I think the problem is, I’m using HTML chart declaration and trying to access the chart data using JavaScript. Seems this is not possible. I've changed the chart creation to JavaScript and now i have no problems in accessing getXMLData() method.

I'm not sure this is the expected functionality of power charts

 Anand

Post #4530
Posted 2/15/2008 1:08:27 PM
FusionCharts Team

FusionCharts TeamFusionCharts TeamFusionCharts TeamFusionCharts TeamFusionCharts TeamFusionCharts TeamFusionCharts TeamFusionCharts Team

Group: Administrators
Last Login: 7/29/2008 12:15:49 PM
Posts: 2,001, Visits: 474
Even with HTML rendering, you can access. You need to then make sure that you've specified correct flags like renderWithJS=1

Thanks,
Pallav Nadhani
FusionCharts Team
Post #4535
Posted 4/29/2008 6:17:38 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 4/29/2008 6:11:31 PM
Posts: 1, Visits: 1
Hi... first sorry by my english.. ..  I speak spanish.. but i'll try to response this question..

this is the trick...

when you create the chart..  you set the values...
swfpath, graphname, width, heigth, DEBUG, this last one makes you can retreive the XML with getXML()..

var chart = new FusionCharts("swfpath", "graphname", w, h, "0", "1" );

this method don't work with all the charts..

SALUDOS!

Post #6011
« Prev Topic | Next Topic »


Permissions Expand / Collapse