forked from pacbard/gChartPhp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gMeterChart.php
28 lines (28 loc) · 867 Bytes
/
gMeterChart.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<?php
namespace gchart;
class gMeterChart extends gChart
{
/**
* @brief Google-o-Meter Chart constructor.
*
* Please see documentation for specia usage of functions setVisibleAxes(), addAxisLabel(), and setColors().
*/
function __construct($width = 200, $height = 200)
{
$this->setDimensions($width, $height);
$this->setProperty('cht','gom');
}
public function getApplicableLabels($labels)
{
return array_splice($labels, 0, count($this->values[0]));
}
/**
* @brief Sets the labels for each arrow
*
* You can obtain the same result of this function by setting visible axis x and adding the labels on that axis.
*/
public function setLabels($labels)
{
$this->setProperty('chl', urlencode($this->encodeData($this->getApplicableLabels($labels),"|")));
}
}