Highcharts and highcharts-mroe

This is more of a FYI for fellow developers who is new to meteor and developing highcharts app. I spent a good week searching for info. I found pieces here and there but all are very old. It seems nobody is doing this lately.

Highcharts has two major packages, highcharts, and highcharts-more. However, when you install npm packages, you only need to install highcharts package and the the second one is budled within the first one. DO NOT install the npm package highcharts-more, or highchartss-more-node. They are old and not really necessary.

Now down to coding.

To use basic charts, you need to
import Highcharts from ‘highcharts’;

To use more complex charts in the ‘more’ package, you do
import Highcharts from ‘highcharts’;
import HighchartsMore from ‘highcharts/highcharts-more’;
HighchartsMore(Highcharts);

To use advanced individual chart module, you do
import Highcharts from ‘highcharts’;
import HighchartsMore from ‘highcharts/highcharts-more’;
HighchartsMore(Highcharts);
require(‘highcharts/modules/solid-gauge’)(Highcharts);
require(‘highcharts/modules/variwide’)(Highcharts);

in the code, you always use Highcharts object:
Highcharts.chart(‘container’, {…})

Hope this will help someone like me

2 Likes

Full marks for doing the research :slight_smile: - many people don’t.

However, maybe ask the question here first and then start the research. I, for one, could have saved you that week - and I know there are several other members who have used Highcharts successfully and could also have helped.

That was a week of research, which you could have spent coding!

2 Likes

very good advice. I will for sure post my questions here first next time. thanks.

1 Like