How to Render a Stripline Behind the Series in Blazor Chart?
This article describes how to render stripline behind the series in Blazor Chart Component.
Creating Stripline behind the series in Blazor Chart
Blazor Chart supports rendering stripline behind the series by using ZIndex property of stripline. This property takes values as Behind and Over. By default, stripline appears behind the series.
The following code example demonstrates how to render stripline behind the series in Blazor Chart.
Index.razor
@using Syncfusion.Blazor.Charts
<SfChart>
<ChartPrimaryXAxis ValueType="Syncfusion.Blazor.Charts.ValueType.Category">
<ChartStriplines>
<ChartStripline StartFromAxis="true" Size="4" ZIndex="ZIndex.Behind" Opacity="0.5" Color="green" />
</ChartStriplines>
</ChartPrimaryXAxis>
<ChartSeriesCollection>
<ChartSeries Type="ChartSeriesType.Column" DataSource="@WeatherReports" XName="X" YName="Y">
</ChartSeries>
</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 = 28 },
new ChartData { X = "Mon", Y = 27 },
new ChartData { X = "Tue", Y = 33 },
new ChartData { X = "Wed", Y = 36 },
new ChartData { X = "Thu", Y = 28 },
new ChartData { X = "Fri", Y = 30 },
new ChartData { X = "Sat", Y = 31 }
};
}
The following image screenshot illustrates the output of the above code snippet.
Output:
Conclusion
I hope you enjoyed learning how to render stripline behind the series 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!