It should be:
echo "data.addRow([{$row[Dim1]}, {$row[Metric1]}]);";
On Thursday, September 27, 2012 3:43:14 AM UTC-4, thecatz wrote:
>
> ok i've fixe this line :
>
> var chart = new
> google.visualization.BarChart(document.getElementById('chart_div'));
>
> and the javascript rendered by the server this time say this :
>
> data.addRow([0h, 5347);data.addRow([1h, 3121);data.addRow([2h,
> 2362);data.addRow([3h, 1591);data.addRow([4h, 1692);data.addRow([5h,
> 2206);data.addRow([6h, 4684);data.addRow([7h, 10821);data.addRow([8h,
> 19478);data.addRow([9h, 22051);
>
> And i understand that i need those thing : data.addRow(['0h', 5347]);
>
> so i need to modifiy : <?php
> $sxml = simplexml_load_file('graph.xml');
> foreach ($sxml->Row as $row) {
> echo "data.addRow([{$row[Dim1]}, {$row[Metric1]});";
> }
> ?>
>
> but have any idea to make this :) i just know that i need to put, result of
> $row[Dim1] on ' ' and to close result with a ]
>
>
>
>
>
>
>
--
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/-/UHvOeCs5FJ0J.
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.