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: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to bind series with a secondary axis?

Platform: ASP.NET MVC |
Control: Chart |
Published Date: May 25, 2015 |
Last Revised Date: July 1, 2019

Essential Chart supports using multiple axes in Chart. By default, the primary X axis and primary Y axis are used as horizontal and vertical axes for a series. You can add additional axes to chart by using the Axes collection in chart.

To bind series to an axis, assign axis name for XAxisName or YAxisName property of series. The default value for Name property of axis is not defined, hence it is mandatory to provide a name for axis before binding it with series.

Use the XAxisName property for binding a horizontal axis and YAxisName property for binding a vertical axis. When these properties are not assigned any value, primary X axis is considered as the horizontal axis for series and primary Y axis is considered as the vertical axis for series.

CSHTML

@(Html.EJ().Chart("container")
    .Axes(axis =>
        {
            axis.Name("Secondary Axis")
            .Orientation("vertical")
            .OpposedPosition(true)
            .Add();
            . . . . . . . . . .
            . . . . . . . . . .
        })
    .Series(ser =>
    {
        . . . . . . . .
        ser.YAxisName("Secondary Axis").Add();
        . . . . . . . . 
    })
    . . . . . . . . .
    . . . . . . . . .
)

The output of the above code example is similar to the following screenshot.

Binding series with a secondary axis

Figure 1: Output

 

2X faster development

The ultimate ASP.NET MVC UI toolkit to boost your development speed.
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.

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