|
|
|
Junior Member
      
Group: Forum Members
Last Login: 7/24/2008 6:47:29 PM
Posts: 18,
Visits: 32
|
|
I'm trying to use the StackBar2d.swf and can't get it to work (similar with simple Column chart works)
FusionCharts Free & JavaScript - Updating chart using updateChartXML() Method
FusionCharts Free & JavaScript - Updating chart using updateChartXML() method
FusionCharts
|
|
|
|
|
Supreme Being
      
Group: Moderators
Last Login: Today @ 11:36:12 PM
Posts: 629,
Visits: 1,915
|
|
Hi lipilates, here you are using Multi serise stack chart so you must provide Multi serise type of XML. please use Multi Serise type of XML DATA insight updateChart function. please see the code.function updateChart(domId){ // Multi Serise type of XML DATA updateChartXML(domId,"<graph><categories><category name='' /></categories><dataset seriesName='Update Value' color='#00FF00' showValues='0'><set name='A' value='32' /></dataset></graph>"); //Disable the button this.document.frmUpdate.btnUpdate.disabled = true; }
Thanks,
Arindam FusionCharts Team
www.fusioncharts.com
|
|
|
|
|
Junior Member
      
Group: Forum Members
Last Login: 7/24/2008 6:47:29 PM
Posts: 18,
Visits: 32
|
|
Thanks!
Essentially I'm trying to render using the FusionCharts_Gen.php class with the $myvar->renderCharts() function in my PHP application but can't make it working...it's probably VERY sensitive to the js and swf location and also to the setDataXML structure. Enclose please fine the stackbar (I need one bar with dynamic sections as you can see from the code that coming from Mysql database HOWEVER I'M getting an EMPTY PAGE when I'm trying to call it inside the application. If you can help me what I need to check and make it working it will be great!
# Include FusionCharts PHP Class
require_once('./Includes/FusionCharts_Gen.php');
# Create Multiseries Column3D chart object using FusionCharts PHP Class
$FC = new FusionCharts("StackedBar2D","350","120");
# Set the right range from the database...in this example I converted it to constant results to allow checking it
$fullscale = 10;
$Score = 6.4;
$LRange = 3;
$RRange = 7.8;
$RiskRange = $LRange - 0;
$LeftNormalSide = $Score - $RiskRange ;
$MarkedPosition = 0.041;
$RightNormalSide = $RRange - ($Score - $MarkedPosition);
$GoodRange = $fullscale - $RRange- .1;
# Set the relative path of the swf file ---- What is the current reference of the PHP file, the Class or my main php program???
$FC->setSWFPath("./Charts/");
# Store chart attributes in a variable
$strParam="caption=;subcaption=;xAxisName=;yAxisName=Scale;numberPrefix=;decimalPrecision=0;showValues=0";
# Set chart attributes
$FC->setChartParams($strParam);
# Add category names
$FC->addCategory("Category 1");
# Create a new dataset
$FC->addDataset("Risk","color=#FF0000");
# Add chart values for the above dataset
$FC->addChartData($RiskRange);
# Create second dataset
$FC->addDataset("Normal", "color=F6BD0F");
# Add chart values for the second dataset
$FC->addChartData($LeftNormalSide);
# Create a new dataset
$FC->addDataset("You are here", "color=black");
# Add chart values for the above dataset
$FC->addChartData($MarkedPosition);
# Create second dataset
$FC->addDataset("", "color=F6BD0F");
# Add chart values for the second dataset
$FC->addChartData($RightNormalSide);
# Create a new dataset
$FC->addDataset("Good", "color=#00CC00");
# Add chart values for the above dataset
$FC->addChartData($GoodRange);
?>
$retHTML= <<
# Render Chart
$FC->renderChart();
Chartsection;
return $retHTML;
?>
|
|
|
|
|
Supreme Being
      
Group: Moderators
Last Login: Today @ 11:36:12 PM
Posts: 629,
Visits: 1,915
|
|
|
|
|
|
Supreme Being
      
Group: Moderators
Last Login: Today @ 11:36:12 PM
Posts: 629,
Visits: 1,915
|
|
Hi, Please note that you would need to include FusionCharts.js in order to render the chart. As we go through the code we find that color for datasets are defined in various invalid ways: color=#FF0000 or color=black etc. Could you please note that you need to use only HEX coded color values WITHOUT hash # and not color names Please follow this format : e.g. color=F6BD0F We could not understand the code : $retHTML= << # Render Chart $FC->renderChart(); Chartsection; return $retHTML; Are you using any function up here to return the rendered chart to another page or so? the PHP is invalid as per PHP coding in : $retHTML= << # Render Chart $FC->renderChart(); Chartsection; You can not put functions in there and should be using <<<. So far returning is concerned, renderChart() prints the chart HTML and does not return anyting. Hence, i am afraid, as of now, you can not do things in this fashion.
Thanks,
Arindam FusionCharts Team
www.fusioncharts.com
|
|
|
|
|
Junior Member
      
Group: Forum Members
Last Login: 7/24/2008 6:47:29 PM
Posts: 18,
Visits: 32
|
|
Thanks for your feedback! I've spent couple of days trying to make it working and went back to the other option of building my setXML alone.
|
|
|
|