I have multiple column series chart getting generated in C#. I am further trying to get the legend for this chart with the checkboxes. Such that the chart displays the column series for only legend items that are checked.
I need to do this in C# code behind and not in HTML. I have the below existing code that creates the multiple dynamic column series -
foreach (KeyValuePair<int, string> item in list)
{
foreach (System.Data.DataRow dRow in dtTable.Rows)
{
<formation of listSource>
}
ColumnSeries ser = new ColumnSeries { Title = item.Value, IndependentValueBinding = new Binding("Key"), DependentValueBinding = new Binding("Value") };
ser.ItemsSource = null;
ser.ItemsSource = listSource;
ser.DataPointStyle = columnStyleBrown;
mcChart.Series.Add(ser);
i++;
}
}
And I further want to add something to -
ser.LegendItemStyle =
So I need to know how to create a legend style with the check boxes in c#.
There can be 2 ways of achieving this-
- Either by modifying the existing legend to contain check boxes also (preferred)
- Or to create a new legend altogether
Can anyone please help?
Thanks in advance!