What are the options available in ejChart to place data labels in the accumulation series?
Essential chart supports customizing the placement of labels in the accumulation series by using the labelPosition property. Pie, doughnut, pyramid, and funnel are the different types of the series. Data labels can be placed inside, outside, and at outside extended positions. Labels overlapping can be avoided by setting the enableSmartLabels property to true.
Inside
The labelPosition property should be assigned inside as value to place the data labels inside the segment of the accumulation series. The following code example illustrates this.
$("#container").ejChart({ commonSeriesOptions: { type: 'pie', labelPosition: 'inside', marker:{ dataLabel: { visible: true, font: { color: 'white', size: '16px', fontFamily:'arial' } } } } });
The following screenshot displays the data labels placed inside the segments of a pie series.
Figure 1: The data labels placed inside
Outside
The labelPosition property should be assigned outside as value to place the data labels outside the segment of the accumulation series. The following code example illustrates this.
$("#container").ejChart({ commonSeriesOptions: { type: 'pie', labelPosition: 'outside', marker:{ dataLabel: { visible: true, font: { color: 'black', size: '16px', fontFamily:'arial' } } } } });
The following screenshot displays the data labels at the outside position.
Figure 2: Data labels at the outside position
Outside extended
The labelPosition property should be assigned outsideextended as value to place the data labels outside the segment. The difference between outside and outside extended placement is that the labels are present at the right and left sides of the chart area in the outside extended position; whereas, in the outside position labels are placed outside with respect to the segments instead of the Chart. The following code example illustrates this.
$("#container").ejChart({ commonSeriesOptions: { type: 'pie', labelPosition: 'outsideextended', marker:{ dataLabel: { visible: true, font: { color: 'black', size: '16px', fontFamily:'arial' } } } } });
The following screenshot displays data labels at the outside extended position.
Figure 3: Data labels at the outside extended position
JS Playground Sample Link: Pie Chart
Conclusion
I hope you enjoyed learning about options available in ejChart to place data labels in the accumulation series.
You can refer to our JavaScript Chart feature tour page to know about its other groundbreaking feature representations and documentation, and how to quickly get started for configuration specifications. You can also explore our JavaScript Chart example to understand how to create and manipulate data.
For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our other controls.
If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forums, Direct-Trac, or feedback portal. We are always happy to assist you!