Hi,
I am using google visualization api script from phpclasses site.
Below is a sample fiile script for outputing in pie chart form.
I would like to replace the figures in the setValues with a variable that i am getting from a function i made. The function is successfully printing the value
and saved in a variable.
for example:
[code=php]$i_support = Print_no_of_Support($rid,$gid);
echo “$i_support “; //prints 2
but once i replace it with the values below in the SetValue section, the graph does not work.
However, if i assign any variable to a number like this: $s = 10;
then, it will work. Even though i printed the $i_support variable .
?
Anyway, here is the code
[code=php]<html>
<head>
</head>
<body>
<?php
include_once ‘config.inc.php’;
$chart = new QPiechartGoogleGraph;
$chart ->addDrawProperties(
array(
“title”=>’General Visualization’,
)
)
->addColumns(
array(
array(‘string’, ‘Task’),
array(‘number’, ‘Hours per Day’)
)
)
->setValues(
array(
array(0, 0, ‘Work’),
array(0, 1, 11),
array(1, 0, ‘Eat’),
array(1, 1, 2),
array(2, 0, ‘Commute’),
array(2, 1, 2),
array(3, 0, ‘Watch TV’),
array(3, 1, 2),
)
);
echo $chart->render();
echo $chart->getReferenceLink();
?></body>
</html>
anyone got idea ???