Installation
Load the script once in your layout:
Load the script once in your layout:
Examples
Bar Chart - Multiple
Bar Chart - Horizontal
Bar Chart - Negative
Bar Chart - Stacked
Line Chart
Line Chart - Linear
Line Chart - Step
Line Chart - Multiple
RawConfig - Mixed Chart
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
Chart
Main chart component that renders various chart types.
| Name | Type | Default |
|---|---|---|
Unique identifier for the chart element | | |
Type of chart to render | | |
Chart data configuration including labels and datasets | | |
Chart configuration options | | |
Passes a JSON-serializable Chart.js config through directly and bypasses the helper props | | |
Whether to display the chart legend | | |
Whether to display the X-axis | | |
Whether to display the Y-axis | | |
Whether to display X-axis labels | | |
Whether to display Y-axis labels | | |
Whether to display X-axis grid lines | | |
Whether to display Y-axis grid lines | | |
Whether to render the chart horizontally | | |
Whether to stack chart elements | | |
Minimum value for the Y-axis scale | | |
Maximum value for the Y-axis scale | | |
Whether the Y-axis should start at zero. Defaults to true if not specified | | |
Additional CSS classes to apply to the chart container | | |
Additional HTML attributes to apply to the chart container | | |
Use RawConfig as an escape hatch when you need native Chart.js settings that are not covered by the simplified API. When set, templui forwards that config directly to Chart.js and ignores the helper props above.