Hi,
Trying to make a simple multi-line chart and get "No data to display" message.
I don't understand why, can you help me with code below please?
What's wrong?
$arrData = array(
"chart" => array(
"theme" => "candy",
"showValues"=> "1"
),
"dataset" => array()
);
$score_chart["P1"]=array("30", "60", "120", "240", "480", "160");
$score_chart["P2"]=array("-15", "-30", "-60", "", "-240", "-80");
foreach($score_chart as $player=>$player_score) {
$datavalues=array();
foreach($player_score as $value) array_push($datavalues, array("value" => $value));
array_push($arrData["dataset"], array("seriesname" => $player, "data" => $datavalues));
unset($datavalues);
}
$jsonEncodedData = json_encode($arrData);
$Chart = new FusionCharts("msline", "Scores" , "100%", "400", "chart-container", "json", $jsonEncodedData);
$Chart->render();
Fusioncharts seems amazing, can not wait to use it