grimaldou
Posts: 9
Joined: Mon Mar 26, 2018 9:46 pm

using Pareto type with NPM Highcharts

Hi guys I'm using Highcharts node package but when I select type "pareto" in the series type, send me the error number 17 referring me to the error type of chart.

Code: Select all

import Highcharts from 'highcharts';

Highcharts.chart("target", chartObject);
I check the configuration of the chart and is correctly, once I remove the type it works fine, I can not find how to import this module in node, I found in the examples the link to the CDN but is not how Im working on this, how can I use pareto chart with npm?
daniel_s
Posts: 753
Joined: Fri Sep 01, 2017 11:01 am

Re: using Pareto type with NPM Highcharts

hi grimaldou,

Welcome on forum and thank you for report.
Error 17 means that "the requested series type does not exist". As I see, you are importing only Highcharts library in your project, so after that you can use only basic types of chart (more precisely - area, areaspline, bar, column, line, spline, pie, and scatter). In order to use other series types, you need to import it as a module and call it passing Highcharts object as an argument. Please take a look at code below:

Using import syntax:

Code: Select all

import Highcharts from 'highcharts';
import pareto from 'highcharts/modules/pareto';

// Then call it
pareto(Highcharts);
Using node require syntax:

Code: Select all

var Highcharts = require('highcharts/highcharts');

// Loading Pareto as a module
require('highcharts/modules/pareto')(Highcharts);
Now your chart should work as you expecting.

Best regards!
Daniel Studencki,
Highcharts Developer
grimaldou
Posts: 9
Joined: Mon Mar 26, 2018 9:46 pm

Re: using Pareto type with NPM Highcharts

Thank you it works, the load module and the inject process work perfect. Thank you
dev1234
Posts: 1
Joined: Tue Aug 09, 2022 5:20 pm

Re: using Pareto type with NPM Highcharts

how to use Pareto type with npm highcharts in angular
michal.f
Posts: 1114
Joined: Thu Aug 12, 2021 12:04 pm

Re: using Pareto type with NPM Highcharts

Hello,

Welcome to our forum and thanks for contacting us with your question!

It is not necessary to install additional packages, just add this module just like any other.
Demo: https://stackblitz.com/edit/highcharts- ... onent.html

Let me know if you have any further questions!
Best regards!
Michał Filipiec
Highcharts Developer
https://blacklabel.pl/highcharts/

Return to “Highcharts Usage”