)
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

How to rotate data labels in the ejChart?

Platform: jQuery |
Control: ejChart |
Published Date: July 13, 2015 |
Last Revised Date: May 23, 2019

Essential Chart supports rotating data labels by using the angle property of the Data Label. Data label rotation can be performed for all the series in the Chart by using the commonSeriesOptions or for a specific series in the series collection.

The following code example illustrates the use of commonSeriesOptions to rotate Data Labels of all the series in the Chart.

JS

$("#container").ejChart({
    commonSeriesOptions: {
        marker: {
            dataLabel: {
                visible: true,
                //Rotating data label 90 degrees anti-clockwise of the Chart series. 
                angle: -90,
                offset: -40,
                verticalTextAlignment: "near",
                font: { color: "white", size: "14px" }            
           }
        }
    },
    . . . . . . . . . . . .
    . . . . . . . . . . . .
});

 

The following screenshot displays the chart with rotated data labels.

Rotated data labels

Figure 1: Chart with rotated data labels

JS Playground sample link: Data label rotation using CommonSeriesOptions

The following code example illustrates rotating data labels of individual series in the series collection.

JS

$("#container").ejChart({
    title:{text:'Medals'},
    series: [{
        marker: {
            dataLabel: {
                visible: true,
                //Rotating data label 90 degrees anti-clockwise for the first series of the Chart.
                angle: -90,
                offset: -40,
                verticalTextAlignment: "near",
                font: { color: "white", size: "14px" }            
            }
        },
        . . . . . 
        . . . . .                    
    },
    . . . . . 
    . . . . .             
    ],
    . . . . .  
    . . . . .
});

 

The following screenshot displays the Chart with data labels only for the first series (Gold).

Rotated label for first series

 

Figure 2: Chart with data labels only for the first series

 

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