I am attempting to showcase a doughnut or semi-circle chart within a materialize card, which is a responsive div element.
My goal is to present simple data and utilize the chart as a progress bar. I took inspiration from the example provided in the HighCharts documentation.
Currently, I am facing an issue with positioning the plot at the bottom while eliminating the excess white space at the top. If I set the position at center: [50%, 50%], there appears to be an empty space at the bottom of the container.
Is there a way to adjust the height of the container without distorting the aspect ratio?
Below is the code snippet I am using:
var data = [
{
name: 'Done',
y: 76.1,
color: "#ff6666",
dataLabels: {
enabled: false
}
},
{
name: 'To do',
y: 23.9,
color:"#dddddd",
dataLabels: {
enabled: false
}
}
];
Highcharts.chart('container', {
chart: {
plotBorderWidth: 0,
height: "400px"
},
title: {
text: 'Title'
},
tooltip: {
pointFormat: '<b>{point.percentage:.1f}%</b>'
},
plotOptions: {
pie: {
dataLabels: {
enabled: true,
distance: -50,
style: {fontWeight: 'bold', color: 'white'}
},
startAngle: -90,
endAngle: 90,
center: ['50%', '100%']
}
},
series: [{type: 'pie', name: 'Value', innerSize: '70%', data: data}]
});
Here is the current output I am seeing: