I have a 'line' of values where some information might be missing.
e.g.:
Jan - 10, Feb - 20, Mar - 15, Apr - null, Jun - 45 ... etc
I would expect that in the chart the NULL value will simply appear 'empty' (missing) from the line.
e.g.
内放置图像中的文本(纵向和横向)我尝试过使用ChartValues<decimal?>
,但图表在XAML中抱怨它does not know how to plot Nullable
1`。
帮助?
答案 0 :(得分:3)
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>