Skip to content

Instantly share code, notes, and snippets.

@pranitkhadilkar7
Last active April 6, 2025 09:02
Show Gist options
  • Save pranitkhadilkar7/6f77b178dbb693a117a27c5620c14be1 to your computer and use it in GitHub Desktop.
Save pranitkhadilkar7/6f77b178dbb693a117a27c5620c14be1 to your computer and use it in GitHub Desktop.
Line Chart Example
import React from 'react';
import Highcharts from 'highcharts';
import HighchartsReact from 'highcharts-react-official';
const LineChart = () => {
const options = {
chart: {
type: 'line'
},
title: {
text: 'Monthly Sales Data'
},
xAxis: {
categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun']
},
yAxis: {
title: {
text: 'Sales ($)'
}
},
series: [{
name: 'Sales 2023',
data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0]
}]
};
return <HighchartsReact highcharts={Highcharts} options={options} />;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment