diff options
author | sgiehl <stefan@piwik.org> | 2015-10-11 02:05:26 +0300 |
---|---|---|
committer | sgiehl <stefan@piwik.org> | 2015-10-11 15:46:02 +0300 |
commit | ef0da68a473a58acd1d844193a00a7f1327455d7 (patch) | |
tree | a536f892d2d57745be25d8e42a2f7860ded9f576 /plugins/ImageGraph | |
parent | b33917db3c6b46841e98482863a48ab86e67b994 (diff) |
use number formats in SMS/PDF reports and in static image graphs
Diffstat (limited to 'plugins/ImageGraph')
-rw-r--r-- | plugins/ImageGraph/StaticGraph.php | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/plugins/ImageGraph/StaticGraph.php b/plugins/ImageGraph/StaticGraph.php index eb4d0a1289..e70e4f8fbe 100644 --- a/plugins/ImageGraph/StaticGraph.php +++ b/plugins/ImageGraph/StaticGraph.php @@ -13,6 +13,7 @@ use Exception; use pData; use pImage; use Piwik\Container\StaticContainer; +use Piwik\NumberFormatter; use Piwik\Piwik; use Piwik\BaseFactory; @@ -249,6 +250,8 @@ abstract class StaticGraph extends BaseFactory } } + $this->pData->setAxisDisplay(0, AXIS_FORMAT_CUSTOM, '\\Piwik\\Plugins\\ImageGraph\\formatYAxis'); + $this->pData->addPoints($this->abscissaSeries, self::ABSCISSA_SERIE_NAME); $this->pData->setAbscissa(self::ABSCISSA_SERIE_NAME); } @@ -341,3 +344,15 @@ abstract class StaticGraph extends BaseFactory } } } + +/** + * Global format method + * + * required to format y axis values using pcharts internal format callbacks + * @param $value + * @return mixed + */ +function formatYAxis($value) +{ + return NumberFormatter::getInstance()->format($value); +} |