mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-31 01:34:09 +02:00
Make `InlinePie's setters fluent
This commit is contained in:
parent
27650be481
commit
119e23e79e
@ -149,21 +149,27 @@ EOD;
|
|||||||
* Set if the tooltip for the empty area should be hidden
|
* Set if the tooltip for the empty area should be hidden
|
||||||
*
|
*
|
||||||
* @param bool $hide Whether to hide the empty area
|
* @param bool $hide Whether to hide the empty area
|
||||||
|
*
|
||||||
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function setHideEmptyLabel($hide = true)
|
public function setHideEmptyLabel($hide = true)
|
||||||
{
|
{
|
||||||
$this->hideEmptyLabel = $hide;
|
$this->hideEmptyLabel = $hide;
|
||||||
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the data to be displayed.
|
* Set the data to be displayed.
|
||||||
*
|
*
|
||||||
* @param $data array
|
* @param $data array
|
||||||
|
*
|
||||||
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function setData(array $data)
|
public function setData(array $data)
|
||||||
{
|
{
|
||||||
$this->data = $data;
|
$this->data = $data;
|
||||||
$this->url->setParam('data', implode(',', $data));
|
$this->url->setParam('data', implode(',', $data));
|
||||||
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -171,7 +177,7 @@ EOD;
|
|||||||
*
|
*
|
||||||
* @param mixed $label The label of the displayed value, or null for no labels
|
* @param mixed $label The label of the displayed value, or null for no labels
|
||||||
*
|
*
|
||||||
* @return $this Fluent interface
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function setLabel($label)
|
public function setLabel($label)
|
||||||
{
|
{
|
||||||
@ -192,6 +198,8 @@ EOD;
|
|||||||
* Set the colors used by the slices of the pie chart.
|
* Set the colors used by the slices of the pie chart.
|
||||||
*
|
*
|
||||||
* @param array $colors
|
* @param array $colors
|
||||||
|
*
|
||||||
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function setColors(array $colors = null)
|
public function setColors(array $colors = null)
|
||||||
{
|
{
|
||||||
@ -201,16 +209,20 @@ EOD;
|
|||||||
} else {
|
} else {
|
||||||
$this->url->setParam('colors', null);
|
$this->url->setParam('colors', null);
|
||||||
}
|
}
|
||||||
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the used number format
|
* Set the used number format
|
||||||
*
|
*
|
||||||
* @param $format string 'bytes' or 'time'
|
* @param $format string 'bytes' or 'time'
|
||||||
|
*
|
||||||
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function setNumberFormat($format)
|
public function setNumberFormat($format)
|
||||||
{
|
{
|
||||||
$this->format = $format;
|
$this->format = $format;
|
||||||
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -225,13 +237,20 @@ EOD;
|
|||||||
* <li><b>percent</b>: The percentage of the current value </li>
|
* <li><b>percent</b>: The percentage of the current value </li>
|
||||||
* </ul>
|
* </ul>
|
||||||
* Note: Changes will only affect JavaScript sparklines and not the SVG charts used for fallback
|
* Note: Changes will only affect JavaScript sparklines and not the SVG charts used for fallback
|
||||||
|
*
|
||||||
|
* @param $format
|
||||||
|
*
|
||||||
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function setTooltipFormat($format)
|
public function setTooltipFormat($format)
|
||||||
{
|
{
|
||||||
$this->tooltipFormat = $format;
|
$this->tooltipFormat = $format;
|
||||||
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Set the height
|
||||||
|
*
|
||||||
* @param $height
|
* @param $height
|
||||||
*
|
*
|
||||||
* @return $this
|
* @return $this
|
||||||
@ -246,16 +265,21 @@ EOD;
|
|||||||
* Set the border width of the pie chart
|
* Set the border width of the pie chart
|
||||||
*
|
*
|
||||||
* @param float $width Width in px
|
* @param float $width Width in px
|
||||||
|
*
|
||||||
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function setBorderWidth($width)
|
public function setBorderWidth($width)
|
||||||
{
|
{
|
||||||
$this->borderWidth = $width;
|
$this->borderWidth = $width;
|
||||||
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the color of the pie chart border
|
* Set the color of the pie chart border
|
||||||
*
|
*
|
||||||
* @param string $col The color string
|
* @param string $col The color string
|
||||||
|
*
|
||||||
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function setBorderColor($col)
|
public function setBorderColor($col)
|
||||||
{
|
{
|
||||||
@ -263,6 +287,8 @@ EOD;
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Set the width
|
||||||
|
*
|
||||||
* @param $width
|
* @param $width
|
||||||
*
|
*
|
||||||
* @return $this
|
* @return $this
|
||||||
@ -277,6 +303,8 @@ EOD;
|
|||||||
* Set the styling of the created HtmlElement
|
* Set the styling of the created HtmlElement
|
||||||
*
|
*
|
||||||
* @param string $style
|
* @param string $style
|
||||||
|
*
|
||||||
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function setStyle($style)
|
public function setStyle($style)
|
||||||
{
|
{
|
||||||
@ -287,10 +315,13 @@ EOD;
|
|||||||
* Set the title of the displayed Data
|
* Set the title of the displayed Data
|
||||||
*
|
*
|
||||||
* @param string $title
|
* @param string $title
|
||||||
|
*
|
||||||
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function setTitle($title)
|
public function setTitle($title)
|
||||||
{
|
{
|
||||||
$this->title = $title;
|
$this->title = $title;
|
||||||
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user