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