chartItem
in package
Chart.js dataset item
Tags
Table of Contents
- $backgroundColor : array<string|int, mixed>
- Items background colors
- $borderColor : string
- Items border colors
- $data : array<string|int, mixed>
- Item data
- $fill : bool
- Fill items
- $label : string
- Item Label
- __construct() : mixed
- Constructor
- assignData() : $this
- Assigns data from chart item
- getRandomColor() : string
- Fetch random color hex code
- setBorderColor() : $this
- Set border color
- setFill() : $this
- Set fill flag
- setLabel() : $this
- Set Item label
Properties
$backgroundColor
Items background colors
private
array<string|int, mixed>
$backgroundColor
= []
$borderColor
Items border colors
private
string
$borderColor
= '#000'
$data
Item data
private
array<string|int, mixed>
$data
= []
$fill
Fill items
private
bool
$fill
= false
$label
Item Label
private
string
$label
= ''
Methods
__construct()
Constructor
public
final __construct(array<string|int, mixed> $data, array<string|int, mixed> $backgroundColor) : mixed
Parameters
- $data : array<string|int, mixed>
- $backgroundColor : array<string|int, mixed>
Return values
mixed —assignData()
Assigns data from chart item
public
final assignData(array<string|int, mixed> &$data, int $index) : $this
Parameters
- $data : array<string|int, mixed>
- $index : int
Return values
$this —getRandomColor()
Fetch random color hex code
public
final static getRandomColor() : string
Return values
string —setBorderColor()
Set border color
public
final setBorderColor(string $borderColor) : $this
Parameters
- $borderColor : string
Return values
$this —setFill()
Set fill flag
public
final setFill(bool $fill) : $this
Parameters
- $fill : bool
Return values
$this —setLabel()
Set Item label
public
final setLabel(type $label) : $this
Parameters
- $label : type