I have some chart and I want to add dynamicly LineSeries without DataPoints, just lines with some custom colors. The only way I found to hide data points is:
Style style = new Style(typeof(LineDataPoint));
style.Setters.Add(new Setter(LineDataPoint.TemplateProperty, null));
var series = new LineSeries()
{
Title = name,
DependentValuePath = "Y",
IndependentValuePath = "X",
ItemsSource = new ObservableCollection<FloatingPoint>(),
DataPointStyle = style,
};
Unfortunately when I do this all lines become yellow and I can't change their colors. I tried to do this:
Style style = new Style(typeof(LineDataPoint));
style.Setters.Add(new Setter(LineDataPoint.TemplateProperty, null));
SolidColorBrush brush = new SolidColorBrush(Colors.Red);
var series = new LineSeries()
{
Title = name,
DependentValuePath = "Y",
IndependentValuePath = "X",
ItemsSource = new ObservableCollection<FloatingPoint>(),
DataPointStyle = style,
Background = brush,
};
But it doesn't help - I can't change line color... Even if I write
series.Background = brush;