Using this property you can define whether to render indexLabel “inside” or “outside” the dataPoint.
Default: Automatically handled
- “inside” for stacked charts.
- “outside” for pie/doughnut charts.
- “auto” for all other chart types.
Example: “outside”, “inside”, “auto”
- If the indexLabelPlacement is inside, it is advised to have smaller labels or to reduce indexLabelFontSize so that indexLabels can be accommodated.
- When set to “auto”, the chart automatically decides whether to place labels inside or outside based on the available space, except in pie/doughnut charts. Incase of pie/doughnut charts, “auto” sets indexLabelPlacement to “outside”.
- In case of rangeColumn / rangeBar charts indexLabels are displayed at the extreme end when indexLabelPlacement is set to “inside” – because they have two indexLabels.
var chart = new CanvasJS.Chart("container",
{
.
.
data: [{
indexLabelPlacement: "inside",
},
]
.
.
});
chart.render();
Hello,
When I use the “inside” placement for stacked column chart, it shows the label attached to the top of column. Can I show it in the middle?
Thanks
Amer,
As of now it is not possible. But we are considering it for future version.
OK, thanks. Looking forward to next update.
Would you consider making bubble type charts compatible with indexLabelPlacement? Right now it seems only inside is available, but for some data (small bubbles, f.i., it would be great to been able to show the label outside. Thanks!
Thanks for your suggestion. We will consider this for future versions.
Ohhh, good OK, thanks.