Hello,
On my Columnserie, i have customised the color. I have 2 color on this serie (blue and green column).
So i need a special legend and i haven't found any easy way to implemt a legend for theses 2 colors.
I use this code, but i don't know how to set an icon and his color to a legenditem.
private void CreateLegend()
{
LegendItem item = new LegendItem();
item.CheckBoxVisibility = Visibility.Collapsed;
item.Interior = Brushes.Green;
item.IconHeight = 10;
item.IconWidth = 10;
item.IconVisibility = Visibility.Visible;
item.Stroke = Brushes.Black;
item.StrokeThickness = 1;
item.Label = "Week";
item.Series = ColSerie;
....
....
ChartLegend legend2 = new ChartLegend();
legend2.Header = "CA";
legend2.FontFamily = new FontFamily("Bradley Hand ITC");
legend2.FontSize = 16;
legend2.Items.Add(item);
....
....
this.lineChart.Legend = legend2;
}