Custom Bars
This web site builds the control from code behind but you could also grab it from the toolbox, this sample also uses a ViewModel to populate the properties of the control(s) in this sample.

View model
using CommunityToolkit.Mvvm.ComponentModel;
using LiveChartsCore;
using LiveChartsCore.Drawing;
using LiveChartsCore.SkiaSharpView;
using LiveChartsCore.SkiaSharpView.Drawing.Geometries;
namespace ViewModelsSamples.Bars.Custom;
public partial class ViewModel : ObservableObject
{
public ISeries[] Series { get; set; } =
{
new ColumnSeries<double>
{
Values = new double[] { 2, 1, 4},
},
// You can also use SVG paths to draw the geometry
// LiveCharts already provides some predefined paths in the SVGPoints class.
new ColumnSeries<double, SVGPathGeometry>
{
Values = new double[] { -2, 2, 1 },
GeometrySvg = SVGPoints.Star
},
// you can declare your own gemetry and use the SkiaSharp api to draw it
new ColumnSeries<double, MyGeometry>
{
Values = new double[] { 4, 5, 2 },
},
};
}
MyGeometry.cs
using LiveChartsCore.SkiaSharpView.Drawing;
using LiveChartsCore.SkiaSharpView.Drawing.Geometries;
using SkiaSharp;
namespace ViewModelsSamples.Lines.Custom;
public class MyGeometry : SizedGeometry
{
public override void OnDraw(SkiaSharpDrawingContext context, SKPaint paint)
{
var canvas = context.Canvas;
canvas.DrawRect(X, Y, Width, Height, paint);
canvas.DrawLine(X, Y, X + Width, Y + Height, paint);
canvas.DrawLine(X + Width, Y, X, Y + Height, paint);
}
}
Form code behind
using System.Windows.Forms;
using LiveChartsCore.SkiaSharpView.WinForms;
using ViewModelsSamples.Bars.Custom;
namespace WinFormsSample.Bars.Custom;
public partial class View : UserControl
{
private readonly CartesianChart cartesianChart;
public View()
{
InitializeComponent();
Size = new System.Drawing.Size(50, 50);
var viewModel = new ViewModel();
cartesianChart = new CartesianChart
{
Series = viewModel.Series,
// out of livecharts properties...
Location = new System.Drawing.Point(0, 0),
Size = new System.Drawing.Size(50, 50),
Anchor = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top | AnchorStyles.Bottom
};
Controls.Add(cartesianChart);
}
}