Articles in this section
Category / Section

How to inverse chart axis in Blazor Chart?

2 mins read

This KB article explains how to inverse the chart axis in the Blazor Chart component.

Inverse X Axis in Blazor Chart

Blazor Charts provides support for inversing the chart axis. By setting the IsInversed property to true, you can invert the X axis.

The following code example demonstrates how to inverse the X axis:

Index.razor


<ChartPrimaryXAxis IsInversed="true"/> 

The following code illustrates how to inverse the primary axis(X-Axis) of the column series in Blazor Chart.

Index.razor

@using Syncfusion.Blazor.Charts

<SfChart Title="Weather Reports">

   <ChartPrimaryXAxis ValueType="Syncfusion.Blazor.Charts.ValueType.Category" IsInversed="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 result of the above code snippet.

Output:

inverse-axis-in-blazor-chart.png

View the sample in GitHub

Conclusion

I hope you enjoyed learning how to invert the chart axis in the 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)
Please  to leave a comment
Access denied
Access denied