chart
in package
implements
JsonSerializable, Stringable, JsModuleFiles
Chart.js component
Tags
Interfaces, Classes, Traits and Enums
- JsonSerializable
- Stringable
- JsModuleFiles
- JavaScript ECMA module files interface
Table of Contents
- TYPE_BAR = 'bar'
- TYPE_BUBBLE = 'bubble'
- TYPE_DOUGHNUT = 'doughnut'
- TYPE_LINE = 'line'
- TYPE_PIE = 'pie'
- TYPE_POLAR = 'polarArea'
- TYPE_RADAR = 'radar'
- TYPE_SCATTER = 'scatter'
- $data : array<string|int, mixed>
- Chart data
- $id : string
- Chart id
- $options : array<string|int, mixed>
- Chart data
- $scales : array<string|int, mixed>
- Chart scales
- $type : string
- Charts typ
- __construct() : mixed
- Constructor
- addOptions() : $this
- Add chart config option
- getCssFiles() : array<string|int, mixed>
- Returns list of CSS files
- getJsFiles() : array<string|int, mixed>
- Returns list of JS files
- getJsModuleFiles() : array<string|int, mixed>
- Returns list of JS files
- jsonSerialize() : array<string|int, mixed>
- JSON serializer
- setLabels() : $this
- Adds label to data
- setLegend() : $this
- Set chart legend config
- setScales() : $this
- Set charts cales
- setValues() : $this
- Sets chart values
Constants
TYPE_BAR
public
mixed
TYPE_BAR
= 'bar'
TYPE_BUBBLE
public
mixed
TYPE_BUBBLE
= 'bubble'
TYPE_DOUGHNUT
public
mixed
TYPE_DOUGHNUT
= 'doughnut'
TYPE_LINE
public
mixed
TYPE_LINE
= 'line'
TYPE_PIE
public
mixed
TYPE_PIE
= 'pie'
TYPE_POLAR
public
mixed
TYPE_POLAR
= 'polarArea'
TYPE_RADAR
public
mixed
TYPE_RADAR
= 'radar'
TYPE_SCATTER
public
mixed
TYPE_SCATTER
= 'scatter'
Properties
$data
Chart data
protected
array<string|int, mixed>
$data
= []
$id
Chart id
protected
string
$id
= ''
$options
Chart data
protected
array<string|int, mixed>
$options
= []
$scales
Chart scales
protected
array<string|int, mixed>
$scales
= ['x' => ['beginAtZero' => true], 'y' => ['beginAtZero' => true]]
Tags
$type
Charts typ
protected
string
$type
= ''
Methods
__construct()
Constructor
public
__construct(string $type, string $id) : mixed
Parameters
- $type : string
-
Chart.js chart type
- $id : string
-
Chart id
Return values
mixed —addOptions()
Add chart config option
public
addOptions(string $var, mixed $value) : $this
Parameters
- $var : string
- $value : mixed
Tags
Return values
$this —getCssFiles()
Returns list of CSS files
public
getCssFiles() : array<string|int, mixed>
Return values
array<string|int, mixed> —getJsFiles()
Returns list of JS files
public
getJsFiles() : array<string|int, mixed>
Return values
array<string|int, mixed> —getJsModuleFiles()
Returns list of JS files
public
getJsModuleFiles() : array<string|int, mixed>
Return values
array<string|int, mixed> —jsonSerialize()
JSON serializer
public
final jsonSerialize() : array<string|int, mixed>
Return values
array<string|int, mixed> —setLabels()
Adds label to data
public
setLabels(array<string|int, mixed> $labels) : $this
Parameters
- $labels : array<string|int, mixed>
Return values
$this —setLegend()
Set chart legend config
public
final setLegend(mixed $value) : $this
Parameters
- $value : mixed
Tags
Return values
$this —setScales()
Set charts cales
public
setScales(array<string|int, mixed> $scales) : $this
Parameters
- $scales : array<string|int, mixed>
Tags
Return values
$this —setValues()
Sets chart values
public
setValues(chartItem $item, int $index) : $this
Parameters
- $item : chartItem
- $index : int