Search code examples
c#winformslivecharts

LiveCharts change color for legend names C# WinForms


Graph

This is my graph showing everything right except "Legend" area. I have used this code to set up where legend will be. cartesianChart1.LegendLocation = LegendLocation.Bottom;

Also every time I add new value I added title for each value and it works as intended as you can see: Values work but not on legend

How do I change color of each value in legend? (You can see better when you zoom in picture its black)


Solution

  • Thanks to this topic I managed to do it

    DefaultLegend customLegend = new DefaultLegend();
    customLegend.Foreground = System.Windows.Media.Brushes.White;
    cartesianChart1.DefaultLegend = customLegend;
    cartesianChart1.LegendLocation = LegendLocation.Bottom;