作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我想覆盖 DataPointStyle
的LineSeries
在我的 WPF 工具包中 Chart
:
<chart:LineSeries>
<chart:DataPointSeries.DataPointStyle>
<Style
BasedOn="{StaticResource {x:Type chart:LineDataPoint}}"
TargetType="{x:Type chart:LineDataPoint}">
<Setter Property="Width" Value="20" />
<Setter Property="Height" Value="20" />
</Style>
</chart:DataPointSeries.DataPointStyle>
</chart:LineSeries>
DataPointStyle
导致它们全部变成橙色。
最佳答案
在有人提出更好的方法之前,我已经手动设置了颜色。我想我现在不会使用自动调色板。
<Style
x:Key="SimpleDataPointStyle"
BasedOn="{StaticResource {x:Type charting:LineDataPoint}}"
TargetType="{x:Type charting:LineDataPoint}">
<Setter Property="Width" Value="20" />
<Setter Property="Height" Value="20" />
</Style>
...
<chart:LineSeries ... >
<chart:DataPointSeries.DataPointStyle>
<Style
BasedOn="{StaticResource SimpleDataPointStyle}"
TargetType="{x:Type charting:LineDataPoint}">
<Setter Property="Background" Value="Green" />
</Style>
</chart:DataPointSeries.DataPointStyle>
</chart:LineSeries>
<chart:LineSeries ... >
<chart:DataPointSeries.DataPointStyle>
<Style
BasedOn="{StaticResource SimpleDataPointStyle}"
TargetType="{x:Type charting:LineDataPoint}">
<Setter Property="Background" Value="Red" />
</Style>
</chart:DataPointSeries.DataPointStyle>
</chart:LineSeries>
关于wpf - 覆盖 WPF 工具包图表中的 DataPointStyle,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5042488/
我想覆盖 DataPointStyle的LineSeries在我的 WPF 工具包中 Chart :
我正在生成一些动态 vizframe 柱形图,方法是循环处理从我的 Odata 服务获得的响应。我对图表的要求之一是根据数据中的字段值以不同颜色显示列。我们称之为验证状态。 我非常清楚如何在正常情况下
我有 WPFToolkit 图表,它有几个线条: 如何将 lineserias DataPointStyle 从圆形更改为方形、三角形...等? 最佳答案 下面是一些创建 DataPointStyle
我是一名优秀的程序员,十分优秀!