如何在WPF折线图上动态更改datapiontstyle? [英] How to dynamically change datapiontstyle on WPF line chart?
问题描述
我使用WPFToolkit创建一个包含多个LineSeries(多种颜色)的折线图
我想动态更改线条颜色,
请任何人帮助我plzz ..
i尝试过它不工作
thnax。
我尝试了什么:
Im using the WPFToolkit to create a line chart with multiple LineSeries(multiple colors)
I want to change the line color dynamically,
please can anyone help me plzz..
i tried bt it is not working
thnax.
What I have tried:
Style style = new Style(typeof(LineSeries));
var color = (Color)ColorConverter.ConvertFromString(linecontrolWindow.BatchTimeLine);
style.Setters.Add(new Setter(LineSeries.DataPointStyleProperty, color));
Series1.Style = style;
显示错误:
'#FF800000'不是Setter上'System.Windows.Controls.DataVisualization.Charting.DataPointSingleSeriesWithAxes.DataPointStyle'属性的有效值。
showing error:
'#FF800000' is not a valid value for the 'System.Windows.Controls.DataVisualization.Charting.DataPointSingleSeriesWithAxes.DataPointStyle' property on a Setter.
推荐答案
看起来
DataPoint Style
属性的类型是Style
和,您尝试将其设置为颜色
...
It looks like the type of the
DataPointStyle
property isStyle
and, you try to set to it a value of typeColor
...
这篇关于如何在WPF折线图上动态更改datapiontstyle?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!