Highcharts-Vue Integration

2.0.1 · active · verified Sun Apr 19

highcharts-vue is the official integration package for using the Highcharts charting library within Vue.js applications. Currently at version 2.0.1, it provides first-class support exclusively for Vue 3 applications. The 2.x.x series represents a major shift, with previous 1.x.x versions supporting Vue 2. This package requires both `vue` (>=3.0.0) and `highcharts` (>=5.0.0) as peer dependencies, which must be installed separately. It facilitates declarative chart rendering, module loading, and interaction with the underlying Highcharts chart instance. The project maintains an active release cadence, with recent updates focusing on Vue 3 features and documentation. Its primary differentiator is being the official Highcharts integration, ensuring optimal compatibility and adherence to best practices for Vue developers.

Common errors

Warnings

Install

Imports

Quickstart

Demonstrates how to locally register the `Chart` component, render a basic line chart with a required `options` prop, and enable the exporting module.

import { createApp, defineComponent, ref } from 'vue';
import Highcharts from 'highcharts';
import { Chart } from 'highcharts-vue';
import exportingInit from 'highcharts/modules/exporting';

// Initialize the exporting module for Highcharts
exportingInit(Highcharts);

const App = defineComponent({
  components: {
    HighchartsChart: Chart // Renamed for clarity, can use 'Chart' directly
  },
  setup() {
    const chartOptions = ref({
      chart: {
        type: 'line'
      },
      title: {
        text: 'My First Highcharts Vue Chart'
      },
      xAxis: {
        categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May']
      },
      series: [{
        name: 'Sample Data',
        data: [1, 3, 2, 4, 5]
      }],
      credits: {
        enabled: false // Disable Highcharts credits
      },
      exporting: {
        enabled: true // Enable exporting functionality via the module
      }
    });

    return {
      chartOptions
    };
  },
  template: `
    <div id="app">
      <h1>Highcharts-Vue Demo</h1>
      <HighchartsChart :options="chartOptions" />
    </div>
  `,
});

createApp(App).mount('#app');

view raw JSON →