That work perfectly, another time thx a lot for your precious help, i've
tried to put "2 chart" in one : like the demo :
https://developers.google.com/chart/interactive/docs/gallery/areachart
but my problem is that the data for my second chart is from another xml, so
i've tried to make this :
i'm loading the second xml : $sxml2 =
simplexml_load_file('graphyesterday.xml');
i've added a third Column : data.addColumn('number2', 'yesterday');
and here is my problem, i don't know how to wright it right : foreach
($sxml->Row as $row) AND ($sxml2->Row as $row2)
this is my complete code :
<script type='text/javascript'>
google.load('visualization', '1', {packages: ['corechart']});
google.setOnLoadCallback(drawChart);
function drawChart () {
var data = new google.visualization.DataTable();
data.addColumn('string', 'heures');
data.addColumn('number', 'today');
data.addColumn('number2', 'yesterday');
<?php
$sxml = simplexml_load_file('graph.xml');
$sxml2 = simplexml_load_file('graphyesterday.xml');
foreach ($sxml->Row as $row) AND ($sxml2->Row as $row2) {
echo "data.addRow([ '{$row[Dim1]}', {$row[Metric1]} ,
{$row2[Metric1]}]);";
}
?>
var options = {
title: 'test',
hAxis: {title: 'heures', titleTextStyle: {color: 'red'}}
};
var chart = new
google.visualization.AreaChart(document.getElementById('chart_div'));
chart.draw(data, options);
}
</script>
>
--
You received this message because you are subscribed to the Google Groups
"Google Visualization API" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/google-visualization-api/-/A1EOwdERXVAJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-visualization-api?hl=en.