1. Components
  2. Charts

Third-Party Plugins

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.

How to use

  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 area chart

Theme:

Multiple area chart

Theme:

Multiple area chart (Compare Two Tooltip)

Theme:

Multiple area chart (Compare Two Tooltip Alternative)

Theme:

Curved area charts

Use curve: 'smooth' to make the chart lines curved.

Theme:

Single bar chart

Theme:

Multiple bar charts

Theme:

Single line chart

Theme:

Multiple line charts

Theme:

Curved line charts

Use curve: 'smooth' to make the chart lines curved.

Theme:

Horizontal bar chart

Theme:

Doughnut chart

Theme:

Bubble chart

Theme:

Pie chart

Theme:

Small sized sparklines

Theme: