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. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to position the primary and secondary axes as the center of chart?

Platform: WPF |
Control: SfChart |
Published Date: February 10, 2015 |
Last Revised Date: June 27, 2019

Typically, scaling for the chart bounds is within a single quadrant, but some scenarios demand scaling across the quadrants. To achieve this requirement with the chart, adjust the position of axis by using the Origin and ShowAxisNextToOrigin properties. The Origin property manages the axis position and represents the axis value. When this is the primary axis, the corresponding axis is positioned on the secondary axis according to the Origin property's value. You also have to enable the ShowAxisNextToOrigin property to enable the Origin property to work.


For CategoryAxis, specify the label index as a value for the Origin property as given in the following code example. This value is not a pixel value, but it is an axis value.


Origin="137" ShowAxisNextToOrigin="True" EdgeLabelsDrawingMode="Shift"/>
 Origin="2" ShowAxisNextToOrigin="True" EdgeLabelsDrawingMode="Shift"/>                               


            this.sampleChart.PrimaryAxis = new CategoryAxis();
            this.sampleChart.PrimaryAxis.Origin = 137;
            this.sampleChart.PrimaryAxis.ShowAxisNextToOrigin = true;
            this.sampleChart.SecondaryAxis = new NumericalAxis();
            this.sampleChart.SecondaryAxis.Origin = 2;
            this.sampleChart.SecondaryAxis.ShowAxisNextToOrigin = true;

The following screenshot illustrates the chart with four quadrants.


Chart X AXIS and Y AXIS positioned to the center of the chart area

2X faster development

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