react-highcharts icon indicating copy to clipboard operation
react-highcharts copied to clipboard

Highcharts Error #17 The requested series type does not exist

Open zyMacro opened this issue 7 years ago • 12 comments

when I plot an chart whose type is 'solidgauge', It went to an error. After I search for material,I tried below code , but same error comes.

`var ReactHighcharts = require('react-highcharts');

var HighchartsMore = require('highcharts-more');

HighchartsMore(ReactHighcharts.Highcharts);

var HighchartsExporting = require('highcharts-exporting');

HighchartsExporting(ReactHighcharts.Highcharts);

require('highcharts/js/highcharts-more')(ReactHighcharts.Highcharts);`

How can I deal with it?

zyMacro avatar Mar 27 '17 09:03 zyMacro

I have added below code to deal with this problem. require('highcharts/modules/solid-gauge.js')(ReactHighcharts.Highcharts);

zyMacro avatar Mar 27 '17 14:03 zyMacro

Ran into the same problem, your workaround nor the one in the readme is working, though. I can render a normal line chart, but I can't render a solid gauge.

aaronbeall avatar May 01 '17 15:05 aaronbeall

This ended up working through the initial barrage of runtime errors:

const ReactHighcharts = require("react-highcharts");

require("highcharts/js/highcharts-more")(ReactHighcharts.Highcharts);
require("highcharts/js/modules/solid-gauge.js")(ReactHighcharts.Highcharts);

const config: Options = {
  chart: {
    type: "solidgauge"
  },
  // ...
}

<ReactHighcharts config={config} />

However, the gauge doesn't render properly. For example, the bar background doesn't render, even if I copy paste the gauge-activity demo config code. The rest of the gauge does render, though the labels and such are mis-aligned. :hurtrealbad:

aaronbeall avatar May 01 '17 19:05 aaronbeall

Import the whole package instead of specific files and it should work ok with the proper styling

// `highcharts-more` needs to load before gauge
require('highcharts-more')(ReactHighcharts.Highcharts)
require('highcharts-solid-gauge')(ReactHighcharts.Highcharts)

lorezzed avatar Jan 28 '18 08:01 lorezzed

@aaronbeall's solution works for xrange series, but @lorezzed 's does not, as webpack can't resolve the module.

Update: adding 'highcharts-xrange-series': path.resolve(__dirname, 'node_modules/highcharts/modules/xrange-series.js') to webpack's resolve.alias seems to have fixed this.

spacedarcy avatar Mar 29 '18 20:03 spacedarcy

@spacedarcy hi. Same configuration, Originally should get the following result: xrange-dome image

But in ReactHighcharts it is such a result: image

Do you know why?

yanbeixiang avatar Apr 12 '18 08:04 yanbeixiang

Hi @yanbeixiang ! Look at my example https://stackblitz.com/edit/react-mcob3t

ilyjs avatar Apr 12 '18 09:04 ilyjs

@ilyjs thanks. But your example can’t access

image

yanbeixiang avatar Apr 12 '18 10:04 yanbeixiang

@yanbeixiang sorry! https://stackblitz.com/edit/react-highcharts-xrange

ilyjs avatar Apr 12 '18 10:04 ilyjs

@ilyjs thank you very much.

yanbeixiang avatar Apr 13 '18 01:04 yanbeixiang

This works if you want to use import instead of require -

import * as Highcharts from "highcharts";
import HighchartsReact from "highcharts-react-official";
import highcharts from "highcharts/modules/bullet";
highcharts(Highcharts);

rishabh0206 avatar Jul 12 '19 07:07 rishabh0206

This worked for me for React for speedometer/Guage: https://www.highcharts.com/blog/snippets/speedometer-with-animation/

import Highcharts from 'highcharts';
import HighchartsReact from "highcharts-react-official";
import HC_more from 'highcharts/highcharts-more'
import Guage from "highcharts/modules/solid-gauge";

HC_more(Highcharts);
Guage(Highcharts);

options = {
    chart: {
      type: 'gauge'
    },
}

1xKarthik avatar Oct 18 '19 07:10 1xKarthik