Update v4.2 - New components, 10+ framework guides, and quality improvements. Visit Changelog

Tailwind CSS Charts

Charts are graphical representations used to showcase and simplify complex data sets, making information more comprehensible and visually appealing. They vary in types-from line to bar to pie-each highlighting specific data patterns and trends.

Requires Additional Installation

Note that this component requires the use of the third-party Apexcharts plugin. Preline uses ApexCharts v4.7, which was released before the June 2025 licensing change. Please review ApexCharts licensing terms if you plan to use newer versions.

Installation

  1. Install Apexcharts

    Install apexcharts via npm

    Terminal
                              
                                npm i apexcharts
                              
                            
  2. Add the Apexcharts CSS

    Include the CSS <script> near the end of your </head> tag:

    HTML
                              
                            
  3. Add the Apexcharts JavaScript

    Include the JavaScript <script> near the end of your </body> tag:

    HTML
                              
                            

    Certain JavaScript Helpers in Preline UI make use of Lodash plugin. Don't forget to install it, if you haven't done so already: npm i lodash

  4. Add the Preline Helper JavaScript

    Include the JavaScript <script> after the helper-apexcharts.js file. If you also need to use the varToColor function, include the helper-shared.js file as well.

    HTML
                              
                            

Single-series area chart

Use an area chart to show one data series with a filled region beneath the line.

Multi-series area chart

Plot multiple area series on the same axes to compare trends over the same period.

Synced area chart tooltips

Synchronize hover tooltips across two related area charts for side-by-side comparison.

Synced area chart tooltips (alt)

Use an alternative synced-tooltip layout when comparing two area charts with shared hover states.

Smoothed area chart

Use curve: 'smooth' to render softer area-chart lines and transitions.

Single-series bar chart

Use a bar chart to display one series across a set of categories.

Multi-series bar chart

Compare multiple bar series within the same category groups.

Single-series line chart

Use a line chart to show how a single series changes over time.

Multi-series line chart

Compare several line series on the same chart to spot differences in trend.

Smoothed line chart

Use curve: 'smooth' to render line-chart paths with softer transitions.

Horizontal bar chart

Flip the bars horizontally when labels are long or when you want a ranking-style layout.

Doughnut chart

Use a doughnut chart to show how segments contribute to a whole while leaving room for center content.

Bubble chart

Use a bubble chart to compare values across two axes and a third value through bubble size.

Pie chart

Use a pie chart to show how each category contributes to the total.

Compact sparklines

Use small sparkline charts when you need compact trend indicators inside cards, tables, or dashboards.

© 2026 Preline Labs.