Winsher McCoy
Winsher McCoy

Reputation: 11

PHP variable inside a chart tag for fusionchart

I have this php code for creating a line chart, i have put the whole chart tag inside a PHP variable

$XMLNPK = "<chart formatNumberScale='0' showValues='1' decimals='0' shadowAlpha='40' bgColor='FFFFFF,99CCFF' labelDisplay='ROTATE' rotateValues='1' slantLabels='1' formatNumberScale='0' decimalPrecision='0' showvalues='1' animation='1' numdivlines='5' numVdivlines='0' caption='Plant Population Vs Yield - FCV' adjustDiv='0' yAxisMinValue='1900' yAxisMaxValue='2100' numDivLines='5'>";

What I wanted to do is to add this php variables which contains the max and min value of a field into the yAxisMinValue and yAxisMaxValue

<?php 
            $maxfcv = max($yieldfcv);
            $minfcv = min($yieldfcv);

?>

I tried this following code but it doesn't show the value:

...numVdivlines='0' caption='Plant Population Vs Yield - FCV' adjustDiv='0' yAxisMinValue='".$minfcv."' yAxisMaxValue='".$maxfcv."' numDivLines='5'>

Can anyone help me on this. Thank you in advance. :-)

Upvotes: 0

Views: 262

Answers (1)

sudipto
sudipto

Reputation: 2482

Make sure any of the chart's value is not beyond (greater than the max or lower than the min) the limits you are setting. If true, the chart does not crop the overflowing sections, rather it auto-calculates new min and max to make the line properly visible int he canvas.

Upvotes: 0

Related Questions