Created
April 6, 2025 13:05
-
-
Save pranitkhadilkar7/ca5bde863372c5182c2476263fd85352 to your computer and use it in GitHub Desktop.
Chart Types Example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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} />; | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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