Documentation

chartItem

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 = ''

$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
mixed

setLabel()

Set Item label

public final setLabel( $label : type ) : $this
Parameters
$label : type
Return values
$this

setFill()

Set fill flag

public final setFill( $fill : bool ) : $this
Parameters
$fill : bool
Return values
$this

setBorderColor()

Set border color

public final setBorderColor( $borderColor : string ) : $this
Parameters
$borderColor : string
Return values
$this

assignData()

Assigns data from chart item

public final assignData( &$data : array , $index : int ) : $this
Parameters
$data : array
$index : int
Return values
$this

getRandomColor()

Fetch random color hex code

public final static getRandomColor( ) : string
Return values
string

Search results