jshaw

Data.xml Being Requested On Linked Chart

Recommended Posts

I created a linked chart like this:

javascript:

  var myChart = new FusionCharts( "../chart/media/swf/fusioncharts/Column2D.swf",
                    "myChartId", "320", "250", "0", "1" );
  myChart.setXMLUrl("summary-data.xml");
  myChart.render('warehouse-content');

 

summary-data.xml

  <chart caption="Yearly Sales" xAxisName="Year" yAxisName="Sales">
    <set label="2004" value="37800" link="newchart-xmlurl-summary-data1.xml" />
    <set label="2005" value="21900" link="newchart-xmlurl-summary-data1.xml" />
    <set label="2006" value="32900" link="newchart-xmlurl-summary-data1.xml" />
    <set label="2007" value="39800" link="newchart-xmlurl-summary-data1.xml" />
  </chart>

 

When I click on the a bar in the chart it successfully makes a request to summary-data.xml, but it looks like the flash object is also making a request to Data.xml(according to firebug). I never specified anywhere to have the javascript or flash make a request to Data.xml as far as I can tell. Could someone tell me why this request is being made and more importantly how to make it stop?

Share this post


Link to post
Share on other sites
Guest Angie

Hi,

 

Welcome to FusionCharts Forum!smile.gif

 

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

 

Awaiting for your reply.

Share this post


Link to post
Share on other sites

I've attached a screen shot of Firefox after clicking on the chart twice.

It would not let me attach attach a javascript file or php file, even after I changed there extensions. Here is the code for those:

 

Javascript

Ext.onReady(function(){
 var myChart = new FusionCharts( "../chart/media/swf/fusioncharts/Column2D.swf", "myChartId", "320", "250", "0", "1" );
  myChart.setXMLUrl("summary-data.xml");
  myChart.render('warehouse-content');

});

 

PHP/HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Warehouse Dashboard Metrics</title>
<link rel="stylesheet" type="text/css" href="../ext-3.3.0/resources/css/ext-all.css" />
<link rel="stylesheet" type="text/css" href="../ext-3.3.0/ux/LockingGridView.css" />

    <!-- GC -->
  <!-- LIBS -->
  <link rel="stylesheet" type="text/css" href="../frontpage/icon.css" />

  <script type="text/javascript" src="../ext-3.3.0/adapter/ext/ext-base.js"></script>
  <script type="text/javascript" src="../ext-3.3.0/ext-all-debug.js"></script>

  <script type="text/javascript" src="../ext-3.3.0/ux/LockingGridView.js"></script>
 <script type="text/javascript" src="../ext-3.3.0/ux/Ext.ux.GridPrinter.js"></script>
  <script type="text/javascript" src="../ext-3.3.0/ux/Ext.ux.GridExportXLS.js"></script>
  <script type="text/javascript" src="../chart/media/js/fusioncharts/FusionCharts.debug.js"></script>
  <script type="text/javascript" src="warehouse_metric_dashboard.js"></script>

  <div id="warehouse-content"></div>


</head>
<body>
<div style="margin-left:0; margin-top:0" id='temp'></div>
</body>
</html>

 

I grep'ed for Data.xml and found this in fusioncharts.debug.js:

3322         // Set initial state of charts
3323         if (obj.options.dataFormat === undefined && obj.options.dataSource === undefined) {
3324             obj.options.dataFormat = FusionChartsDataFormats.XMLURL;
3325             obj.options.dataSource = 'Data.xml';
3326         }

but since the request is not an XMLHTTP request I don't believe this is the problem, further more the condition should fail because options.dataSource and options.dataFormat are defined(I checked). This is the only instance of Data.xml in my entire source.

post-7823-057759000 1299676782_thumb.jpg

summary-data1.xml

summary-data.xml

Edited by jshaw

Share this post


Link to post
Share on other sites

I saw about nesting linked chart example, I do not want to go that direction because of the overhead of generating all that xml.

 

According to the docs you should be able to link through a url. Here is what the docs say.

 

Thanks.

Share this post


Link to post
Share on other sites

I saw about nesting linked chart example, I do not want to go that direction because of the overhead of generating all that xml.

 

According to the docs you should be able to link through a url. Here is what the docs say.

 

Thanks.

 

I've attached another screen shot with the debug window on so you can see the warning.

 

Here is new javascript I tried also:

Ext.onReady(function(){
  var myChart = new FusionCharts( "../chart/media/swf/fusioncharts/Column2D.swf", "myChartId", "320", "250", "0", "1" );
  myChart.setXMLUrl("summarydata.xml");
  myChart.render('warehouse-content');
  var config = {'debugMode':1,'dataXML':'summarydata.php'};//I tried 'dataSource' and 'dataURL' instead of 'dataXML' also
  FusionCharts('myChartId').configureLink([config,config]);

});

linked charts screen shot 2.bmp

Share this post


Link to post
Share on other sites
Guest Angie

Hi,

 

Could you please send us the html and XML files together in zip format to look into the issue?

 

Awaiting for your reply.

Share this post


Link to post
Share on other sites

here is a simple test zip. All it has is the fusionchart.debug.js, a instance of a fusionchart and 2 xml files, for the linked chart. It is still experiencing the same issue. I believe it is a flash problem.

test.zip

Share this post


Link to post
Share on other sites

I went ahead and started implementing my solution, still getting a warning where it looks like the flash is making a request to data.xml, even though it fetches the correct xml.

 

Attached is the resulting screen shot of the warning i'm getting for the following xml:

NOTE: the graph makes a request to the proper url, but it seems the flash isn't detecting the datasource part of the link.

<chart numberPrefix="" labelDisplay="Rotate" slantLabels="1" exportEnabled="1" exportAtClient="0" exportAction="save" exportFileName="ExportedChart" showExportDialog="1" exportHandler="/chart/export" setAdaptiveYMin="1" formatNumberScale="0" decimals="0" showValues="1" caption="Reg/OT Hours Worked">
<categories>
<category label="2010" />
<category label="2011" />
</categories>
<dataset seriesName="regular hours">
<set seriesName="regular hours" link="newchart-xmlurl-warehouse_metric_dashboard_backend.php?chart=whse_reg_ot_hours" label="2010" value="6283.20" />
<set seriesName="regular hours" link="newchart-xmlurl-warehouse_metric_dashboard_backend.php?chart=whse_reg_ot_hours" label="2011" value="0.00" />
</dataset>
<dataset seriesName="overtime hours">
<set seriesName="overtime hours" label="2010" value="311.10" />
<set seriesName="overtime hours" label="2011" value="0.00" />
</dataset>
</chart>

post-7823-055190100 1300802547_thumb.jpg

Share this post


Link to post
Share on other sites
Guest Angie

Hi,

 

Could you please send us the HTML code to look into the issue?

 

Awaiting for your reply.

Share this post


Link to post
Share on other sites

I have sent and resent the code to replicate this problem, see the zip file above. I'm getting tired of this run around, just please just stick and engineer and resolve the problem.

Share this post


Link to post
Share on other sites

Nudge, has this been fixed?

 

Since their links parse hyphens a little differently, you might try to rename your files without them. Shot in the dark, but it might help.

 

Ward

Share this post


Link to post
Share on other sites
Guest Angshu

Hi,

 

Thank you very much for your valuable feedback.

 

Happy 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