I am using the System.Windows.Forms.DataVisualization.Charting.Chart
class to draw a chart with some data.
Now I want to suppress the automatic generation of entries within the legend and replace them with custom items. I have already found the way to add custom items but no way of suppressing the autogeneration.
My Code:
var legend = new Legend();
legend.LegendStyle = LegendStyle.Table;
legend.TableStyle = LegendTableStyle.Wide;
legend.IsEquallySpacedItems = true;
legend.IsTextAutoFit = true;
legend.BackColor = Color.White;
legend.Font = new Font(Config.FontFamily, 9);
legend.Docking = Docking.Bottom;
legend.Alignment = StringAlignment.Center;
legend.CustomItems.Add(new LegendItem("test", Color.Green, string.Empty));
ch.Legends.Add(legend);
Has anyone done something like this before?