Dynamic Visibility
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 System.Collections.ObjectModel;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using LiveChartsCore;
using LiveChartsCore.SkiaSharpView;
namespace ViewModelsSamples.General.Visibility;
public partial class ViewModel : ObservableObject
{
public ISeries[] Series { get; set; } =
{
new ColumnSeries<double>
{
Values = new ObservableCollection<double> { 2, 5, 4, 3 },
IsVisible = true
},
new ColumnSeries<double>
{
Values = new ObservableCollection<double> { 6, 3, 2, 8 },
IsVisible = true
},
new ColumnSeries<double>
{
Values = new ObservableCollection<double> { 4, 2, 8, 7 },
IsVisible = true
}
};
[RelayCommand]
public void ToggleSeries0()
{
Series[0].IsVisible = !Series[0].IsVisible;
}
[RelayCommand]
public void ToggleSeries1()
{
Series[1].IsVisible = !Series[1].IsVisible;
}
[RelayCommand]
public void ToggleSeries2()
{
Series[2].IsVisible = !Series[2].IsVisible;
}
}
Form code behind
using System.Windows.Forms;
using LiveChartsCore.SkiaSharpView.WinForms;
using ViewModelsSamples.General.Visibility;
namespace WinFormsSample.General.Visibility;
public partial class View : UserControl
{
private readonly CartesianChart cartesianChart;
public View()
{
InitializeComponent();
Size = new System.Drawing.Size(100, 100);
var viewModel = new ViewModel();
cartesianChart = new CartesianChart
{
Series = viewModel.Series,
// out of livecharts properties...
Location = new System.Drawing.Point(0, 50),
Size = new System.Drawing.Size(100, 50),
Anchor = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top | AnchorStyles.Bottom
};
Controls.Add(cartesianChart);
var b1 = new Button { Text = "toggle 1", Location = new System.Drawing.Point(0, 0) };
b1.Click += (object sender, System.EventArgs e) => viewModel.ToggleSeries0();
Controls.Add(b1);
var b2 = new Button { Text = "toggle 2", Location = new System.Drawing.Point(80, 0) };
b2.Click += (object sender, System.EventArgs e) => viewModel.ToggleSeries1();
Controls.Add(b2);
var b3 = new Button { Text = "toggle 3", Location = new System.Drawing.Point(160, 0) };
b3.Click += (object sender, System.EventArgs e) => viewModel.ToggleSeries2();
Controls.Add(b3);
}
}