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 JS

Note that this component requires the use of the third-party Apexcharts plugin.

How to use

  1. Install Apexcharts

    Install apexcharts via npm

    npm i apexcharts
  2. Add the Apexcharts CSS

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

    <link rel="stylesheet" href="./node_modules/apexcharts/dist/apexcharts.css">
  3. Add the Apexcharts JavaScript

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

    <script src="./node_modules/lodash/lodash.min.js"></script><script src="./node_modules/apexcharts/dist/apexcharts.min.js"></script>

    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 hs-apexcharts-helpers.js file.

    <script src="https://preline.co/assets/js/hs-apexcharts-helpers.js"></script>

Single area chart

Multiple area chart

Income
Outcome

Multiple area chart (Compare Two Tooltip)

Income
Outcome

Multiple area chart (Compare Two Tooltip Alternative)

Income
Outcome

Curved area charts

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

Income
Outcome

Single bar chart

Multiple bar charts

Income
Outcome

Single line chart

Multiple line charts

Income
Outcome
Others

Curved line charts

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

Income
Outcome
Others

Horizontal bar chart

Doughnut chart

Income
Outcome
Others

Bubble chart

Income
Outcome
Others

Pie chart

Income
Outcome
Others

Small sized sparklines

  • Chart Types
  • Inline area chart
  • Inline bar chart
  • Inline pie chart
  • Inline line chart
  • Inline candles chart