Ship faster with goilerplate templUI Pro

Chart

Beautiful charts. Built using Chart.js.

Source Tailwind CSS JavaScript

Installation

templui add chart

Examples

Bar Chart - Multiple

Bar Chart - Horizontal

Bar Chart - Negative

Bar Chart - Stacked

Line Chart

Line Chart - Linear

Line Chart - Step

Line Chart - Multiple

Area Chart

Area Chart - Linear

Area Chart - Step

Area Chart - Stacked

Pie Chart

Pie Chart - Stacked

Pie Chart - Legend

Doughnut Chart

Doughnut Chart - Stacked

Doughnut Chart - Legend

Radar Chart

Radar Chart - Stacked

API Reference

Required parameter
Hover for description

Chart

Main chart component that renders various chart types.

Name Type Default
ID
string
chart-{randomID}
Variant
Variant
-
Data
Data
-
Options
Options
{}
ShowLegend
bool
false
ShowXAxis
bool
false
ShowYAxis
bool
false
ShowXLabels
bool
false
ShowYLabels
bool
false
ShowXGrid
bool
false
ShowYGrid
bool
false
Horizontal
bool
false
Stacked
bool
false
YMin
*float64
nil
YMax
*float64
nil
BeginAtZero
*bool
nil (true)
Class
string
""
Attributes
templ.Attributes
nil