gpt4 book ai didi

livecharts - 如何在 LineSeries 中输入 'null' 值?

转载 作者:行者123 更新时间:2023-12-01 00:35:24 29 4
gpt4 key购买 nike

我有一个“行”值,其中可能缺少某些信息。

例如。:

Jan - 10, Feb - 20, Mar - 15, Apr - null, Jun - 45 ... etc



我希望在图表中,NULL 值将从行中简单地显示为“空”(缺失)。

例如

enter image description here

我试过使用 ChartValues<decimal?>但图表在 XAML 中提示它 does not know how to plot Nullable 1`。

帮助?

最佳答案

LiveCharts 使用 double.NaN而不是 null这是网站中的示例:

https://lvcharts.net/App/examples/v1/wpf/Missing%20Points

Series = new SeriesCollection
{
new LineSeries
{
Values = new ChartValues<double>
{
4,
5,
7,
8,
double.NaN,
5,
2,
8,
double.NaN,
6,
2
}
}
};

XAML
<lvc:CartesianChart Series="{Binding Series}"></lvc:CartesianChart> 

关于livecharts - 如何在 LineSeries 中输入 'null' 值?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41661075/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com