0

I have already using the fusioncharts and i am getting the values from database. I am searching for how to set the trendvalues for a line graph in fusion charts php. Actually i have to get the value from database and set the trendline. Is there any way to do it. I google a lot but i didnt find the answer.

Here is my code:

while ($row = mysql_fetch_array($result)) { 
    $categories .= "<category name='" . $row["ondate"] . "' />";
    $systolic .= "<set  value='" . $row["systole_reading"] . "'  hoverText='Systolic' />";
    $diaolic .= "<set value='" . $row["diastole_reading"] . "'  hoverText='Diastolic'/>";
    $map.="<set value='" . $row["map"] . "' hoverText='Mean Arterial Pressure'/>";
    }
$strXML .=" <trendlines>
    <line startValue='".$row["target"]."'  color='ff0000' displayValue='Systolic Target'  showOnTop='1' valueOnRight = '1'/>
  </trendlines>";

TAI

ramsai
4

1 回答 1

0

要在 PHP 中为折线图设置 TrendValues,您需要以与数据点类似的方式连接 XML 字符串。

参考。代码:

$strXML =" ";
while ($row = mysql_fetch_array($result)) { 
 $categories .= "<category name='" . $row["ondate"] . "' />";
 $systolic .= "<set  value='" . $row["systole_reading"] . "'  hoverText='Systolic' />";
 $diaolic .= "<set value='" . $row["diastole_reading"] . "'  hoverText='Diastolic'/>";
 $map .="<set value='" . $row["map"] . "' hoverText='Mean Arterial Pressure'/>";
 $target .= "<line startValue='" . $row["target"] . "' color='ff0000' displayValue='Systolic Target' showOnTop='1' valueOnRight = '1'/>";
}

$strXML .= "<chart><categories>" . $categories . "</categories><dataset>" . $systolic . "</dataset><dataset>" . $diaolic . "</dataset><trendLines>" . $target . "</trendLines></chart>"; 
于 2012-07-06T11:52:23.607 回答