mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-24 22:34:24 +02:00
Remove useless width and height properties from PieChart
This commit is contained in:
parent
f77cd9cafa
commit
a9eec0d672
@ -51,46 +51,6 @@ class PieChart extends Chart
|
|||||||
*/
|
*/
|
||||||
private $noCaption = false;
|
private $noCaption = false;
|
||||||
|
|
||||||
/**
|
|
||||||
* Scaling level of the rendered svgs width in percent.
|
|
||||||
*
|
|
||||||
* @var float
|
|
||||||
*/
|
|
||||||
private $width = 100;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Scaling level of the rendered svgs height in percent.
|
|
||||||
*
|
|
||||||
* @var int
|
|
||||||
*/
|
|
||||||
private $height = 100;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set the size of the rendered pie-chart svg.
|
|
||||||
*
|
|
||||||
* @param $width int The width in percent.
|
|
||||||
*
|
|
||||||
* @return self Fluent interface
|
|
||||||
*/
|
|
||||||
public function setWidth($width)
|
|
||||||
{
|
|
||||||
$this->width = $width;
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set the size of the rendered pie-chart svg.
|
|
||||||
*
|
|
||||||
* @param $height int The height in percent.
|
|
||||||
*
|
|
||||||
* @return self Fluent interface
|
|
||||||
*/
|
|
||||||
public function setHeight($height)
|
|
||||||
{
|
|
||||||
$this->height = $height;
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test if the given pies have the correct format
|
* Test if the given pies have the correct format
|
||||||
*
|
*
|
||||||
@ -111,10 +71,7 @@ class PieChart extends Chart
|
|||||||
*/
|
*/
|
||||||
protected function build()
|
protected function build()
|
||||||
{
|
{
|
||||||
$this->renderer = new SVGRenderer(
|
$this->renderer = new SVGRenderer(($this->type === self::STACKED) ? 1 : count($this->pies), 1);
|
||||||
$this->type === self::STACKED ? $this->width : count($this->pies) * $this->width,
|
|
||||||
$this->width
|
|
||||||
);
|
|
||||||
foreach ($this->pies as &$pie) {
|
foreach ($this->pies as &$pie) {
|
||||||
$this->normalizeDataSet($pie);
|
$this->normalizeDataSet($pie);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user