1

I am trying to use Dumbbell chart of highcharts in react app. As per the link below, I have imported dumbbell module. https://www.npmjs.com/package/highcharts-react-official#how-to-add-a-module

import highchartsDumbbell from 'highcharts/modules/dumbbell';
import Highcharts from 'highcharts'
import HighchartsReact from 'highcharts-react-official';

highchartsDumbbell(Highcharts);

And wrapping the options and data in HichartsReact component as below:

<HighchartsReact highcharts={Highcharts} options={options} />

Getting below error:

Uncaught TypeError: Cannot read property 'prototype' of undefined
at dumbbell.js:16
at h (dumbbell.js:8)
at dumbbell.js:15

Could you please suggest if anything is missing here.

santosh
  • 23
  • 4

1 Answers1

1

Notice that the dumbbell series requires also the highcharts-more package.

API: https://api.highcharts.com/highcharts/series.dumbbell

Demo: https://stackblitz.com/edit/react-xhxdyv?file=index.js

Sebastian Wędzel
  • 11,417
  • 1
  • 6
  • 16
  • Thanks a lot for the suggestion. It worked. I was importing depcrecated highcharts-more npm package! – santosh Feb 04 '21 at 04:27