Hi,
did not worked Complete code below.
<?php
ini_set('display_errors','1');
$n = array('Home', 'Office', 'INCAS', 'Kaufland', 'Bib');
$v = array(100, 200, 300, 400, 500);
require ('gChart.php');
$piChart = new gPieChart();
for ($i=0;$i<n.length;$i++){
$piChart->addDataSet(array(v[i]));
$piChart->setLegend(array(n[i]));
$piChart->setLabels(array(n[i]));
$piChart->setColors(array("ff3344", "11ff11", "22aacc", "3333aa",
"3375bb"));
}
?>
<img src="<?php print $piChart->getUrl();?>" />
</body>
</html>
Error: *Parse error*: parse error, expecting `')'' in *
C:\wamp\www\visualmicroblogging\gChartExample.php* on line *8*
*
*
If i remove the for loop and do it manually which i don't want then it
works. Problem is in the for loop, See code below.
<?php
ini_set('display_errors','1');
$n = array('Home', 'Office', 'INCAS', 'Kaufland', 'Bib');
$v = array(100, 200, 300, 400, 500);
require ('gChart.php');
$piChart = new gPieChart();
$piChart->addDataSet(array(100, 200, 300, 400, 500));
$piChart->setLegend(array('Home', 'Office', 'INCAS', 'Kaufland', 'Bib'));
$piChart->setLabels(array('Home', 'Office', 'INCAS', 'Kaufland', 'Bib'));
$piChart->setColors(array("ff3344", "11ff11", "22aacc", "3333aa",
"3375bb"));
?>
<img src="<?php print $piChart->getUrl();?>" />
</body>
</html>
On Thu, Nov 25, 2010 at 10:34 AM, Fons Seesink <[email protected]>wrote:
> 32. for (i=0;i<n.length;i++){
>
> should be
> 32. for ($i=0;$i<n.length;$i++){
>
>
>
> On Thu, Nov 25, 2010 at 10:21 AM, Marcus Bointon <[email protected]
> > wrote:
>
>>
>> On 25 Nov 2010, at 09:54, Atif Musaddaq wrote:
>>
>> > for (i=0;i<n.length;i++){
>>
>> $s?
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Google Chart API" group.
>> To post to this group, send email to [email protected].
>> To unsubscribe from this group, send email to
>> [email protected]<google-chart-api%[email protected]>
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/google-chart-api?hl=en.
>>
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Chart API" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<google-chart-api%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/google-chart-api?hl=en.
>
--
Atif Musaddaq
Master in Media Informatics,
RWTH Aachen & University of Bonn,
Germany.
[email protected]
*”Design can be art. Design can be aesthetics. Design is so simple, that’s
why it is so complicated.” —Paul Rand*
--
You received this message because you are subscribed to the Google Groups
"Google Chart API" group.
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-chart-api?hl=en.