Reputation: 3159
I'm using highcharts and I want to add text inside a circular progress pie chart. here is the example I'm working on:
var gaugeOptions = {
'chart': {
'type': 'solidgauge'
},
'title': null,
'tooltip': {
'enabled': false
},
'pane': {
'center': ['50%', '50%'],
'size': '500px',
'startAngle': 0,
'endAngle': 360,
'background': {
'backgroundColor': '#EEE',
'innerRadius': '90%',
'outerRadius': '100%',
'borderWidth': 0
}
},
'yAxis': {
'min': 0,
'max': 100,
'labels': {
'enabled': false
},
'lineWidth': 0,
'minorTickInterval': null,
'tickPixelInterval': 400,
'tickWidth': 0
},
'plotOptions': {
'solidgauge': {
'innerRadius': '90%'
}
},
'series': [{
'name': 'Speed',
'data': [80],
'dataLabels': {
'enabled': false
}
}]
};
I want to mention the percentage inside with a text: 80% of Total List How to add this text inside the circle? Thanks
Upvotes: 0
Views: 527
Reputation: 11633
You can use the dataLabel and format feature to achieve it.
Demo: https://jsfiddle.net/BlackLabel/mokatgdf/
dataLabels: {
borderWidth: 0,
format: '<div style="text-align:center">' +
'<span style="font-size:25px">{y}% of Total List</span><br/>' +
'</div>'
},
API: https://api.highcharts.com/highcharts/plotOptions.series.dataLabels.format
Upvotes: 1