From fb124b37cfb9ec4acb00d3ab85c4b9f884cdf50b Mon Sep 17 00:00:00 2001 From: Eric Lippmann Date: Mon, 27 Nov 2017 13:33:58 +0100 Subject: [PATCH] Fix float format of donut chart attributes --- library/Icinga/Chart/Donut.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/library/Icinga/Chart/Donut.php b/library/Icinga/Chart/Donut.php index 6fedcca63..1efc9546b 100644 --- a/library/Icinga/Chart/Donut.php +++ b/library/Icinga/Chart/Donut.php @@ -228,7 +228,7 @@ class Donut 'attributes' => array( 'cx' => 20, 'cy' => 20, - 'r' => $this->radius, + 'r' => sprintf('%F', $this->radius), 'fill' => $this->getCenterColor() ) ); @@ -239,7 +239,7 @@ class Donut 'attributes' => array( 'cx' => 20, 'cy' => 20, - 'r' => $this->radius, + 'r' => sprintf('%F', $this->radius), 'fill' => $this->getCenterColor(), 'stroke-width' => $this->getThickness(), 'class' => 'slice-state-not-checked' @@ -263,11 +263,11 @@ class Donut 'attributes' => $slice[1] + array( 'cx' => 20, 'cy' => 20, - 'r' => $this->radius, + 'r' => sprintf('%F', $this->radius), 'fill' => 'transparent', 'stroke-width' => $this->getThickness(), - 'stroke-dasharray' => $slice[0] . ' ' . (99.9 - $slice[0]), // 99.9 prevents gaps (slight overlap) - 'stroke-dashoffset' => $offset + 'stroke-dasharray' => sprintf('%F', $slice[0]) . ' ' . sprintf('%F', (99.9 - $slice[0])), // 99.9 prevents gaps (slight overlap) + 'stroke-dashoffset' => sprintf('%F', $offset) ) ); // negative values shift in the clockwise direction