如何在WPF折线图上动态更改datapiontstyle? [英] How to dynamically change datapiontstyle on WPF line chart?

查看:200
本文介绍了如何在WPF折线图上动态更改datapiontstyle?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用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 is Style and, you try to set to it a value of type Color...

这篇关于如何在WPF折线图上动态更改datapiontstyle?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆