templUI Pro coming soon  

50% OFF Join Waitlist

Chart

Beautiful charts. Built using Chart.js.

Source
TailwindCSS
Vanilla JS

Installation

  1. Install the component

    templui add chart
  2. Add the JavaScript to your layout

    @chart.Script()
    

    Call this template in your base layout file (e.g., in the <head> section).

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
Class
string
""
Attributes
templ.Attributes
nil