I am trying to add a Variable Radius Pie Chart in a Next.js Project. I have downloaded the latest versions of Highcharts and the Highcharts React Wrapper and have imported them:
import styles from '../../src/styles/VariableRadiusPie.module.css'
import HighchartsReact from 'highcharts-react-official';
import Highcharts from 'highcharts';
import variablePie from 'highcharts/modules/variable-pie';
variablePie(Highcharts);
Here is my component that I am trying to render:
const RadiusPie = ( { prop } ) => {
const options = {
chart: {
type: 'variablepie'
},
title: {
text: 'Variable Radius Pie Chart'
},
series: [{
name: 'Sales',
data: [{
name: 'Product A',
y: 45,
z: 10
}, {
name: 'Product B',
y: 25,
z: 5
}, {
name: 'Product C',
y: 20,
z: 15
}, {
name: 'Product D',
y: 10,
z: 20
}]
}]
};
return (
<>
<div className={styles.RadiusPieParent}>
<div className={styles.RadiusTitle}>
<div className={styles}>
<p>Revenue By Geographical Location</p>
</div>
</div>
<div className={styles.RadiusPie}>
<HighchartsReact highcharts={Highcharts} options={options} constructorType={''} />
</div>
</div>
</>
)
}
export default RadiusPie;
Unfortunately, I come across the error
TypeError: Cannot read properties of undefined (reading 'Core/Series/SeriesRegistry.js')
I believe the Error originates from this line of code:
variablePie(Highcharts);
But after Removing this line I am presented with the error:
Error: Highcharts error #17: www.highcharts.com/errors/17/?missingModuleFor=variablepie
I do not know how to get rid of this error and any help would be appreciated.