PHP / SVGgraph data amount labels

86 Views Asked by At

Using SVGgraph, is it possible to show only the 'data amount' label but not the label of the data ("l1", "l2" and "l3" in the example)? My code looks like this:

require_once("svggraph/SVGGraph.php");
$data = array("l1" => 45, "l2" => 20, "l3" => 35);
$settings = array('show_data_labels' => true, 'show_label_amount' => true);
$graph = new SVGGraph(300, 200, $settings);
$graph->colours = $cols;
$graph->Values($data);
$graph->Fetch('SemiDonutGraph');

But when I use show_data_labels = true then it's displayed both the value and the labels "l1", "l2" and "l3". If I set it to false then nothing is shown. Is there a way to show only the value amount? Thanks in advance.

1

There are 1 best solutions below

1
testCoder On

It should be done this way:

array([option => value, option2 => value2]); 

$settings = array(['show_data_labels' => true, 'show_label_amount' => true]);