Skip to content

Instantly share code, notes, and snippets.

@pranitkhadilkar7
Created April 6, 2025 13:05
Show Gist options
  • Save pranitkhadilkar7/ca5bde863372c5182c2476263fd85352 to your computer and use it in GitHub Desktop.
Save pranitkhadilkar7/ca5bde863372c5182c2476263fd85352 to your computer and use it in GitHub Desktop.
Chart Types Example
import Highcharts from 'highcharts';
import HighchartsReact from 'highcharts-react-official';
export const GaugeChart = () => {
const options = {
chart: {
type: 'gauge',
plotBorderWidth: 0,
plotShadow: false
},
pane: {
startAngle: -90,
endAngle: 89.9,
center: ['50%', '75%'],
size: '110%'
},
yAxis: {
tickPixelInterval: 72,
tickPosition: 'inside',
tickLength: 10,
tickWidth: 2
}
};
return <HighchartsReact highcharts={Highcharts} options={options} />;
};
import Highcharts from 'highcharts';
import HighchartsReact from 'highcharts-react-official';
export const PieChart = () => {
const options = {
chart: {
type: 'pie'
},
plotOptions: {
pie: {
dataLabels: {
enabled: true,
format: '<b>{point.name}</b>: {point.percentage:.1f}%'
},
cursor: 'pointer',
point: {
events: {
click: function() {
// Handle click events
}
}
}
}
}
};
return <HighchartsReact highcharts={Highcharts} options={options} />;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment