Documentation

chartItem
in package

Chart.js dataset item

Tags
author

Stefan Seehafer aka imagine fanpress@nobody-knows.org

copyright

(c) 2019, Stefan Seehafer

license

http://www.gnu.org/licenses/gpl.txt GPLv3

since
4.3

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 = []

$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
Return values
$this

Search results