weizhenye/vue-highcharts

How to use highcharts themes?

sebastianmacias opened this issue · 3 comments

If I want to use one of these themes how would I set it up using vue-highcharts?

Thanks

See document https://www.highcharts.com/docs/chart-design-and-style/themes

For example, the simple theme, it's in JSON format, you should add export default at the begin of this file if you want use ES Module, then use like this:

import Vue from 'vue';
import VueHighcharts from 'vue-highcharts';
import Highcharts from 'highcharts';
import smplTheme from './path/to/smpl.js';

Highcharts.theme = smplTheme;
Highcharts.setOptions(Highcharts.theme);

Vue.use(VueHighcharts, { Highcharts });

Perfect, thanks! I think you should add this to the README or I could make a PR if want to.

Actually theme can be changed after initialization by calling vm.Highcharts.setOptions(smplTheme);, I think it's more related to Highcharts itself.