New to Telerik UI for Blazor? Download free 30-day trial

Plot Bands

Plot Bands are colored ranges in the Telerik UI for Blazor Chart. Their purpose is to highlight areas of the chart by changing the background in a predefined axis range.

Plot bands are supported for categorical and numerical charts.

Creating Plot Bands

  1. Add PlotBand instances inside the PlotBands collection of a Chart axis.
  2. Provide a valid CSS color to the Color parameter.
  3. (Optional) Set the Opacity parameter.
  4. Set the From and To plot band parameters, according to the instructions below.

Setting From and To

There are two different ways to configure the From and To values. The correct approach depends on:

  • Whether the Chart is numeric or categorical.
  • Whether the plot band is for the vertical or horizontal axis.

How to set PlotBand From and To

Axis Tag Axis Description Valid PlotBand From and To Values
ChartYAxis vertical numeric axis Any numeric value that makes sense for the series data, e.g. within the axis Min and Max range. The plot band will display between the specified values.
ChartXAxis horizontal numeric axis
ChartValueAxis vertical category axis
including date axis
horizontal category axis Zero-based index, which corresponds to a major vertical grid line that intersects the axis. The plot band will display between the specified grid lines.

Categorical Chart PlotBands

@* Plot bands for the Column series type *@

        <ChartSeries Type="ChartSeriesType.Column" Name="Product 1" Data="@series1Data">
        <ChartSeries Type="ChartSeriesType.Column" Name="Product 2" Data="@series2Data">

        <ChartCategoryAxis Categories="@xAxisItems">
                <ChartCategoryAxisPlotBand From="0" To="1" Color="blue" Opacity="0.2" />
                <ChartCategoryAxisPlotBand From="2" To="3" Color="#00f" Opacity="0.2" />

                <ChartValueAxisPlotBand From="3" To="8" Color="green" Opacity="0.4"></ChartValueAxisPlotBand>

    <ChartTitle Text="Quarterly revenue per product"></ChartTitle>

    <ChartLegend Position="ChartLegendPosition.Right">

@code {
    public List<object> series1Data = new List<object>() { 10, 2, 5, 6 };
    public List<object> series2Data = new List<object>() { 5, 8, 2, 7 };
    public string[] xAxisItems = new string[] { "Q1", "Q2", "Q3", "Q4" };

Numerical Chart PlotBands

@* Plot bands for the Scatter series type *@

    <ChartTitle Text="Unrecoverable Errors Per Minute vs. Signal Level"></ChartTitle>

        <ChartSeries Type="ChartSeriesType.Scatter"
                     Name="APSK modulation"

        <ChartXAxis Max="-30" AxisCrossingValue="@(new object[] { -100 })">
            <ChartXAxisTitle Text="Signal Strength, dBm"></ChartXAxisTitle>
                <ChartXAxisPlotBand From="-90" To="-80" Color="blue" Opacity=".2" />
                <ChartXAxisPlotBand From="-50" To="-40" Color="orange" Opacity=".2" />

        <ChartYAxis Max="20">
            <ChartYAxisTitle Text="Error count"></ChartYAxisTitle>
                <ChartYAxisPlotBand From="0" To="3" Color="green" Opacity="0.2"></ChartYAxisPlotBand>
                <ChartYAxisPlotBand From="12" To="20" Color="red" Opacity="0.2"></ChartYAxisPlotBand>

@code {
    private List<ModelData> SeriesData { get; set; }

    protected override void OnInitialized()
        SeriesData = new List<ModelData>();

        var rnd = new Random();

        for (int i = 0; i < 60; i++)
            SeriesData.Add(new ModelData
                Strength = rnd.Next(-90 + i / 3, -90 + i),
                Errors = rnd.Next(i / 20, i / 3)


    public class ModelData
        public double Strength { get; set; }
        public double Errors { get; set; }

See Also

In this article