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 |
This page will automatically be redirected to the sign-in page in 10 seconds.