On 25 Nov 2010, at 11:26, Atif Musaddaq wrote:
> for ($i = 0; $i < sizeof($name); $i++) {
> $piChart->addDataSet(array($val[$i]));
> $piChart->setLegend(array($name[$i]));
> $piChart->setLabels(array($name[$i]));
> //$piChart->setColors(array("ff3344", "11ff11", "22aacc", "3333aa",
> "3375bb"));
You're replacing the data, labels and legends every time around the loop - you
don't need the loop at all! Try this:
$piChart->addDataSet($val);
$piChart->setLegend($name);
$piChart->setLabels($name);
Marcus
--
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.