)
We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Essential JS2

Syncfusion jQuery based widgets are no longer in active development. Switch to our pure JavaScript based next generation Essential JS 2 library.

Syncfusion Feedback

What are the options available in ejChart to place data labels in the accumulation series?

Platform: jQuery |
Control: ejChart |
Published Date: August 6, 2015 |
Last Revised Date: July 3, 2019

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.

 

Inside data labels

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.

Outside data labels

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.

Outside with extended position

Figure 3: Data labels at the outside extended position

 

JS Playground Sample Link: Pie Chart

ADD COMMENT
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon