8
차트가 있으며 DataPoints가없는 LineSeries를 동적으로 추가하고 싶습니다. 일부 맞춤 색상의 선만 추가하려고합니다. 나는 데이터 포인트를 숨길 수있는 유일한 방법입니다 : 내가 할 때포인트가없고 다른 선 색상이있는 wpf 툴킷 선 차트
는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,
};
불행하게도이 모든 라인은 노란색이되고 나는 그들의 색상을 변경할 수 없습니다.
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,
};
를하지만 도움이되지 않습니다 - 나는 선 색상을 변경할 수 없습니다 ...
series.Background = brush;
+1 굉장! 고마워요! – Legend
이 대답을 받아 들여야합니다. +1을 통해 문제를 해결할 수 있습니다. 이것은 XAML에서도 잘 작동합니다. –