Home Forums Chart Support Pie chart, add text in the middle? Reply To: Pie chart, add text in the middle?

#24216

@crystalcode,

As suggested by @shashiranjan, title & subtitle can be positioned in the center of the pie/doughnut by setting dockInsidePlotArea and verticalAlign properties.

As your requirement includes having a title to the top of the chart, you can use subtitles to be positioned at the center of the chart ( You can add as many subtitles as you want to a chart – so even if you like to have a subtitle at the top of the chart, you can still add another subtitle at the center of the chart). Please find the code-snippet for the same below.

title: {
    text: "Doughnut Chart"
},
subtitles: [{
    text: "Subtitle 1"
}, {
    text: "Subtitle 2",
    verticalAlign: "center",
    dockInsidePlotArea: true
}],

Please take a look at this updated JSFiddle for complete code.
doughnut chart with subtitles to the center


Vishwas R
Team CanvasJS