I can get diameter of external ring by plotHeight but is there any way to get diameter of inner ring of pie highchart? (https://jsfiddle.net/noy986m7/23/)
Highcharts.chart('container', {
chart: {
type: 'pie',
},
series: [{
innerSize: "40%",
data: [{
y: 70.67,
}, {
y: 14.77
}]
}]
});
<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/modules/variable-pie.js"></script>
<script src="https://code.highcharts.com/modules/exporting.js"></script>
<script src="https://code.highcharts.com/modules/export-data.js"></script>
<script src="https://code.highcharts.com/modules/accessibility.js"></script>
<figure class="highcharts-figure">
<div id="container"></div>
</figure>
2
Answers
If you are using
innerSize
with percentage you can approximate the diameter withchart.plotHeight * (innerSize / 100)
where e.g.innerSize = 40
.For example (see this JSFiddle demonstration):
As you can see from the fiddle there appears to be a very minor overlap. I’m unsure of the source of this overlap, but the approximation is quite good.