Articles in this section

How to change the position of the axis in Blazor Chart?

This article explains how to change the position of the axis in Blazor Chart Component.

Customizing the axis position in a Blazor Chart

Blazor Chart supports to positioning the chart axis on its default position or to the other side of the chart. To change the axis position, set the OpposedPosition property to true in the ChartAxis.

The following code example illustrates how to customize the position of chart axis.

Index.razor


@using Syncfusion.Blazor.Charts

<SfChart Title="Weather Reports">

    <ChartPrimaryXAxis ValueType="Syncfusion.Blazor.Charts.ValueType.Category" OpposedPosition=true/>

    <ChartPrimaryYAxis OpposedPosition="true"/>    

    <ChartSeriesCollection>
        <ChartSeries DataSource="@WeatherReports" XName="X" YName="Y" Type="ChartSeriesType.Column"/>
    </ChartSeriesCollection>

</SfChart>

@code {

    public class ChartData
    {
        public string X { get; set; }
        public double Y { get; set; }
    }

    public List<ChartData> WeatherReports = new List<ChartData>
    {
        new ChartData { X = "Sun", Y = 35 },
        new ChartData { X = "Mon", Y = 40 },
        new ChartData { X = "Tue", Y = 80 },
        new ChartData { X = "Wed", Y = 70 },
        new ChartData { X = "Thu", Y = 65 },
        new ChartData { X = "Fri", Y = 55 },
        new ChartData { X = "Sat", Y = 50 }
    };
}

The following screenshot illustrates the output of the above code snippet.

Output:

opposed_axis.png

View the sample in GitHub

Conclusion

I hope you enjoyed learning how to customize the position of chart axis in Blazor Chart Component.

You can refer to our Blazor Chart feature tour page to know about its other groundbreaking feature representations and documentation, and how to quickly get started for configuration specifications. You can also explore our Blazor Chart example to understand how to create and manipulate data.

For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forums, support portal, or feedback portal. We are always happy to assist you!

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Access denied
Access denied