/**
* Set chart type horizontal.
*
* @return self Returns instance of the Chart class.
*
* @access public
*/
public function horizontal(): self
Examples
Set Chart element type horizontal using fluent interface
use function Thermage\chart;
use function Thermage\render;
// ...
$data = [
'apple' => [
'label' => 'Apple',
'value' => 100,
'color' => 'red',
],
'orange' => [
'label' => 'Orange',
'value' => 270,
'color' => 'orange',
],
'lime' => [
'label' => 'Lime',
'value' => 220,
'color' => 'green',
],
];
render(
chart()->data($data)->horizontal()
);
Set Chart element type horizontal using using magic classes pipeline
use function Thermage\chart;
use function Thermage\render;
// ...
$data = [
'apple' => [
'label' => 'Apple',
'value' => 100,
'color' => 'red',
],
'orange' => [
'label' => 'Orange',
'value' => 270,
'color' => 'orange',
],
'lime' => [
'label' => 'Lime',
'value' => 220,
'color' => 'green',
],
];
render(
chart('', 'horizontal')->data($data)
);
Terminal
$ php thermage.php
Apple
Orange
Lime
Getting Started
Methods
- d Set Chart element display style.
- data Set Chart element data.
- getShortcodes Get Chart element shortcodes instance.
- getTheme Get Chart element theme.
- horizontal Set Chart element type horizontal.
- inline Set Chart element type inline.
- render Render Chart element.
- setShortcodes Set Chart element shortcodes instance.
- setTheme Set Chart element theme instance.
- showPercents Set Chart element show percents flag true.
- showValues Set Chart element show values flag true.
- valuesSufix Set Chart element values sufix true.