Sign in to follow this  
cancan97

How can i use drill down chart in php array

Recommended Posts

Hi,

I try to use dril down chart in array but i can't. This is my code ;

   //print_r($grafik); die(); 

 

//print_r($baslik[0]['ADI']); die();  

 

for($i=0; $i<sizeof($grafik); $i++){

 

 $arrData[$i][0] = $grafik[$i]['YIL']."-".$grafik[$i]['AY'];

$arrData[$i][1] = $grafik[$i]['ROUND(SUM(NVL(DEGER,0)))']; //SUM(NVL(DEGER,0))

}

  // print_r($arrData); die();

 

 

 # Create FusionCharts PHP Class object for multiseies column3d chart

$FC = new FusionCharts("Column3D","100%","100%");

 # Set Relative Path of swf file.

$FC->setSWFPath("http://localhost/ProjeYatirim/js/FusionCharts/");

 

 # Define chart attributes

$FC->setInitParam("scalemode","exactfit");

 

 //echo "<pre>";

 //print_r($arrData); die;

 

 

$strParam="caption=".$baslik[0]['ADI'].";formatNumberScale=0;rotateValues=1;decimals=0;canvasBgColor=FFFFFF,FF5904;canvasBgAlpha=100,40;canvasBgRatio=0,100; canvasBgAngle=180;labelDisplay=Rotate;showValues=0;".

   for($i=0; $i<sizeof($grafik); $i++){

 

echo"clickURL=http://localhost/ProjeYatirim/index.php?/proje/zamanAltGrafik/".$arrData[$i][0];

 

 

}."";

 

  //paletteColors=FF5904,0372AB,FF0000

# Set chart attributes

$FC->setChartParams($strParam);

 

 # Pass the 2 arrays storing data and category names to

 # FusionCharts PHP Class function addChartDataFromArray

 $FC->addChartDataFromArray($arrData);

 

  # Render the Chart

  $FC->renderChart();

?>

PC : i use PHPCLass structure to get chart data from array  therefore  "link" properties does not work. (link properties work only data from xml). What can i do to solve this?

Thanks

Share this post


Link to post
Share on other sites

Hello,

 

 

 

Could you please attach the XML that is generated, so that we may have a look?

 

 

 

You can get the XML by going to 'View Source' in the browser.

Share this post


Link to post
Share on other sites

Hi Saptarshi,

 

 

 

i dont use xml file to draw chart. use php codeigniter framework and get my data from oracle db. so put my data in to array. Drawing chart with "$FC->addChartDataFromArray($arrData);" code.

 

 

 

Fussion PHP Array Chart usage allows only "clickURL" attribute set the entire chart. but i can do this.

 

 

 

("$FC->addChartDataFromArray($arrData);") this property not allowed to use "link" properties to pass array specific data to drill down chart. i want to use like "link" attribute for using drill down chart.

 

 

 

Thanks.

Share this post


Link to post
Share on other sites

From the php class documentation, it doesn't look like the addchartdatafromarray method allows adding link parameters for drilldown charts.

 

 

 

It does look like, however, you can add links with the addDataFromDatabase method in php, which might be an option. You could probably create an array that was structurally similar to the database return, and use this method instead.

 

 

 

In practice, however, it would be much more useful to add these parameters to the addchartdatafromarray method, as most database reads require some manipulation before passing directly into the chart rendering engine. In other words, I don't want to have to write a query for each graph I draw...I want to be able to draw multiple graphs from the same query.

 

 

 

If there isn't a better option, I'll probably write my own method and add it to the php class.

 

 

 

Can I please get confirmation from an admin on this?

 

 

 

Thanks! Great product so far.

Share this post


Link to post
Share on other sites

Hi,

 

 

 

ClickURL attributes work in PHPClass too. Please make sure you are using v3 charts, as this feature is not available in FusionCharts vFREE version.

 

 

 

Could you please right click on the browser (say, Internet Explorer ) and get the generate HTML from "View Source" menu option?

 

 

 

This would give us the XML generated as well as other discrepancies that might be occurring.

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