Hi i have a code that use single line graph... and i want to change it to dual y axis:
I have 3 columns on my database:
POWER_GEN_1_VAL0
POWER_GEN_2_VAL0
FOREBAY_ELEV_vAL0
the 2 power gens will be at the yellow line and the forebay will be at violet line..
i try it many times but i always failed
heres my code:
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
<?php
$conn=odbc_connect('datasourcegaby','','');
$firststring= "Select FOREBAY_ELEV_VAL0,timestamp,POWER_GEN_1_VAL0,POWER_GEN_2_VAL0 FROM generators WHERE convert(datetime,convert(char(10),timestamp,101)) = '$search' ";
$rs=odbc_exec($conn,$firststring);
$strXML ="<graph caption='RESULT' subCaption=' FOR THIS DAY ' decimalPrecision='3' showNames='0' numberSuffix='' pieSliceDepth='' formatNumberScale='1' >";
while (odbc_fetch_row($rs))
{
$g1=odbc_result($rs,"POWER_GEN_1_VAL0");
$g2=odbc_result($rs,"POWER_GEN_2_VAL0");
$timestamp=odbc_result($rs,"timestamp");
$forebayelev=odbc_result($rs,"FOREBAY_ELEV_VAL0");
$timestampx=$timestamp;
$strXML .= "<set name='($timestampx) || (GEN 1)' value='$g1' />";
$strXML .= "<set name='($timestampx) || (GEN 2)' value='$g2' />";
$strXML .= "<set name='($timestampx) || (FOREBAYELEV)' value='$forebayelev' color='525252'/>";
}
$strXML .= "</graph>";
//Create the chart - Column 3D Chart with data from strXML variable using dataXML method
echo renderChartHTML("../../FusionCharts/FCF_Line.swf", "", $strXML, "generators", 1350, 500, false);
?>