How to use highcharts themes?
sebastianmacias opened this issue · 3 comments
sebastianmacias commented
If I want to use one of these themes how would I set it up using vue-highcharts?
Thanks
weizhenye commented
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 });
sebastianmacias commented
Perfect, thanks! I think you should add this to the README or I could make a PR if want to.
weizhenye commented
Actually theme can be changed after initialization by calling vm.Highcharts.setOptions(smplTheme);
, I think it's more related to Highcharts itself.