Highcharts Tutorial
Chart Types
To create a circular progress bar measurement chart using Highcharts, you can follow these steps:
<script src="https://code.highcharts.com/highcharts.js"></script>
<div id="chart-container"></div>
var value = 75;
Highcharts.chart('chart-container', { chart: { type: 'gauge', plotBackgroundColor: null, plotBackgroundImage: null, plotBorderWidth: 0, plotShadow: false }, title: { text: 'Measurement' }, pane: { startAngle: -150, endAngle: 150, background: [{ backgroundColor: '#EEE', borderWidth: 0, outerRadius: '100%', innerRadius: '90%' }] }, yAxis: { min: 0, max: 100, lineWidth: 0, tickPositions: [] }, plotOptions: { gauge: { dataLabels: { enabled: false }, dial: { radius: '100%', backgroundColor: 'black', borderColor: 'white', borderWidth: 1, baseWidth: 10, topWidth: 1, baseLength: '95%', rearLength: '0%' }, pivot: { radius: 5, backgroundColor: 'white', borderColor: 'black', borderWidth: 1 } } }, series: [{ name: 'Value', data: [value] }] });
Note that we're using the 'pane' option to define the shape of the chart, and the 'yAxis' option to set the range of the chart. We're also using the 'plotOptions' option to style the chart elements, including the dial, pivot, and data labels.
#chart-container { width: 100%; height: 500px; max-width: 800px; margin: 0 auto; text-align: center; }
This will create a circular progress bar measurement chart using the specified data and options, and render it in the 'chart-container' element on your web page. You can customize the chart further by adjusting the options and adding additional features, like tooltips, legends, and labels.
Customizing appearance in Highcharts Circular Progress Bar Measurement Chart:
Highcharts.chart('container', { chart: { type: 'solidgauge', backgroundColor: '#f2f2f2', height: '200px' }, title: null, pane: { startAngle: -90, endAngle: 90, background: [{ backgroundColor: '#64b4dc', outerRadius: '100%', innerRadius: '80%', shape: 'arc' }] }, yAxis: { min: 0, max: 100, lineWidth: 0, tickPositions: [] }, plotOptions: { solidgauge: { dataLabels: { y: 5, borderWidth: 0, useHTML: true } } }, series: [{ name: 'Measurement', data: [75], dataLabels: { format: '<div style="text-align:center"><span style="font-size:20px;color:#333">{y}</span><br/><span style="font-size:12px;color:silver">%</span></div>' }, tooltip: { valueSuffix: ' %' } }] });
Adding data to Highcharts Circular Progress Bar Measurement Chart:
series
array.series: [{ name: 'Measurement', data: [75], // Other configuration options... }]
Interactive features in Highcharts Circular Progress Bar Measurement Chart:
plotOptions: { solidgauge: { dataLabels: { enabled: true, // Other data label options... } } }, tooltip: { valueSuffix: ' %' }
Implementing measurement charts in Highcharts:
chart: { type: 'solidgauge', // Other chart options... }
Circular progress bar chart for measurements using Highcharts:
pane: { startAngle: -90, endAngle: 90, background: [{ backgroundColor: '#64b4dc', outerRadius: '100%', innerRadius: '80%', shape: 'arc' }] }, yAxis: { min: 0, max: 100, // Other yAxis options... }