Bars Background

sample image sample image

Razor

@page "/Bars/WithBackground"
@using LiveChartsCore.SkiaSharpView.Blazor
@using LiveChartsCore;
@using LiveChartsCore.SkiaSharpView;
@using LiveChartsCore.SkiaSharpView.Painting;
@using SkiaSharp;

<CartesianChart
    Series="@series"
    YAxes="@yAxes">
</CartesianChart>

@code {
    private static double[] values1 = new double[] { 10, 10, 10, 10, 10, 10, 10 };
    private static double[] values2 = new double[] { 3, 10, 5, 3, 7, 3, 8 };

    private ISeries[] series = new ISeries[]
    {
        new ColumnSeries<double>
        {
            Values = values1,
            Fill = new SolidColorPaint(new SKColor(180, 180, 180, 50)),
            IgnoresBarPosition = true,
            IsHoverable = false
        },
        new ColumnSeries<double>
        {
            Values = values2,
            IgnoresBarPosition = true
        }
    };

    private Axis[] yAxes = new Axis[]
    {
        new Axis
        {
            MinLimit = 0,
            MaxLimit = 10
        }
    };
}

Articles you might also find useful: