I use a callback:

============================================
$myfunc = '
if ($b == 0) return "1kbit/s";
if ($b == 1) return "  10k";
if ($b == 2) return " 100k";
if ($b == 3) return "1Mbit/s";
if ($b == 4) return "  10M";
if ($b == 5) return " 100M";
if ($b == 6) return "1Gbit/s";
if ($b == 7) return "  10G";
return " ";
';

$graph->yAxis->labelCallback = create_function('$a, $b', $myfunc);
$output_file = "/home/jmf/images/hello.svg"; 
$graph->render( 700, 250, "$output_file");
echo "\nChart image generated to ".$output_file."\n";
==============================================

:)




On Tue, 2009-05-12 at 17:13 +0200, Stefan Gasser wrote:
> Hi everybody,
> 
> I've to create a bar-chart with following y-axis labels: 0, 5, 10, 50,
> 100 and 1000. The example_1.png shows how the bar-chart should be.
> My problem is to change the label from 0, 1, 2, 3, 4, 5 to 0, 5, 10,
> 50 ,100, 1000.
> Is it possible?
> 
> Regards
> Stefan
> 
> 
> My data Array:
> array
>   'GEN' => int 0
>   'FEB' => int 1
>   'MAR' => int 2
>   'APR' => int 3
>   'MAG' => int 4
>   'GIU' => int 5
>   'LUG' => int 5
>   'AGO' => int 4
>   'SET' => int 3
>   'OTT' => int 2
>   'NOV' => int 1
>   'DIC' => int 0

-- 
Components mailing list
[email protected]
http://lists.ez.no/mailman/listinfo/components

Reply via email to