class LineChart extends Component

Traits

Properties

string|null $title from  HasChartStyling
bool $border from  HasChartStyling
string|null $borderColor from  HasChartStyling
string|null $backgroundColor from  HasChartStyling
mixed $chartColor from  HasChartStyling
array $data
float|null $max
string $height
bool $showGrid
bool $showYAxis
string $formatValues
string $label
string $value
bool $showPoints
string $dataLabels
string|null $xAxisTitle
string|null $yAxisTitle
string $legendPosition

Methods

void
initializeChartStyling(string|null $title = null, bool $border = true, string|null $borderColor = null, string|null $backgroundColor = null, mixed $chartColor = null)

No description

array
getStylingVariables()

No description

bool
isCssColor(string $color)

No description

bool
isTailwindClass(string $color)

No description

array
getColorPalette()

No description

string|null
getTailwindColorValue(string $colorName)

Convert internal palette color names to CSS hex values.

__construct(array $data = [], float|null $max = null, string $height = 'h-64', mixed $chartColor = null, string|null $backgroundColor = null, string|null $title = null, bool $showGrid = true, bool $showYAxis = true, string $formatValues = '%s', string $label = 'label', string $value = 'value', bool $showPoints = true, string $dataLabels = 'hover', string|null $xAxisTitle = null, string|null $yAxisTitle = null, bool $border = true, string|null $borderColor = null, string $legendPosition = 'bottom')

No description

render()

No description

void
resolveLabelOverlaps(array $datasets)

No description

void
setLabelPosition(array $datasets, int $dsIndex, int $pIndex, string $position)

No description

array
extractXAxisLabels()

No description

array
prepareDatasets()

No description

array
extractValues(array $data)

No description

Details

in HasChartStyling at line 13
protected void initializeChartStyling(string|null $title = null, bool $border = true, string|null $borderColor = null, string|null $backgroundColor = null, mixed $chartColor = null)

No description

Parameters

string|null $title
bool $border
string|null $borderColor
string|null $backgroundColor
mixed $chartColor

Return Value

void

in HasChartStyling at line 27
protected array getStylingVariables()

No description

Return Value

array

in HasChartStyling at line 37
protected bool isCssColor(string $color)

No description

Parameters

string $color

Return Value

bool

in HasChartStyling at line 44
protected bool isTailwindClass(string $color)

No description

Parameters

string $color

Return Value

bool

in HasChartStyling at line 55
protected array getColorPalette()

No description

Return Value

array

in HasChartStyling at line 81
protected string|null getTailwindColorValue(string $colorName)

Convert internal palette color names to CSS hex values.

This prevents dynamic Tailwind class construction which doesn't work with JIT compilation.

Parameters

string $colorName

The color name (e.g., 'blue', 'red')

Return Value

string|null

The hex color value or null if not found

at line 26
__construct(array $data = [], float|null $max = null, string $height = 'h-64', mixed $chartColor = null, string|null $backgroundColor = null, string|null $title = null, bool $showGrid = true, bool $showYAxis = true, string $formatValues = '%s', string $label = 'label', string $value = 'value', bool $showPoints = true, string $dataLabels = 'hover', string|null $xAxisTitle = null, string|null $yAxisTitle = null, bool $border = true, string|null $borderColor = null, string $legendPosition = 'bottom')

No description

Parameters

array $data
float|null $max
string $height
mixed $chartColor
string|null $backgroundColor
string|null $title
bool $showGrid
bool $showYAxis
string $formatValues
string $label
string $value
bool $showPoints
string $dataLabels
string|null $xAxisTitle
string|null $yAxisTitle
bool $border
string|null $borderColor
string $legendPosition

at line 63
render()

No description

at line 132
protected void resolveLabelOverlaps(array $datasets)

No description

Parameters

array $datasets

Return Value

void

at line 178
protected void setLabelPosition(array $datasets, int $dsIndex, int $pIndex, string $position)

No description

Parameters

array $datasets
int $dsIndex
int $pIndex
string $position

Return Value

void

at line 185
protected array extractXAxisLabels()

No description

Return Value

array

at line 213
protected array prepareDatasets()

No description

Return Value

array

at line 271
protected array extractValues(array $data)

No description

Parameters

array $data

Return Value

array