What are the options available in ejChart to place data labels in the accumulation series in ASp.NET MVC chart?
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
In the inside position, the data labels are placed inside the segments of the accumulation series. The following code example illustrates this.
@(Html.EJ().Chart("container") .CommonSeriesOptions(options=> options.Type(SeriesType.Pie) .Marker(marker=> marker.DataLabel(label=> label.Font(font=> font.Color("white").Size("16px").FontFamily("arial")) .Visible(true))) .LabelPosition(ChartLabelPosition.Inside) ) )
The following screenshot displays the data labels placed inside the segments of a pie series.
Figure 1: The data labels placed inside
Outside
In the outside position, the data labels are placed outside the segment of the accumulation series. The following code example illustrates this.
@(Html.EJ().Chart("container") .CommonSeriesOptions(options=> options.Type(SeriesType.Pie) .Marker(marker=> marker.DataLabel(label=> label.Font(font=> font.Color("black").Size("16px").FontFamily("arial")) .Visible(true))) .LabelPosition(ChartLabelPosition.Outside) ) )
The following screenshot displays the data labels at the outside position.
Figure 2: Data labels at the outside position
Outside extended
In the outside extended position, the data labels are placed outside the segments of the accumulation series. 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.
@(Html.EJ().Chart("container") .CommonSeriesOptions(options=> options.Type(SeriesType.Pie) .Marker(marker=> marker.DataLabel(label=> label.Font(font=> font.Color("black").Size("16px").FontFamily("arial")) .Visible(true))) .LabelPosition(ChartLabelPosition.OutsideExtended) ) )
The following screenshot displays labels at the outside extended position.
Figure 3: Data labels at the outside extended position
Sample Link: Pie Chart