我在Windows应用程序中使用实时图表。我有一个基本的折线图,需要在正反两个方向上进行绘制。
我当前的代码如下:
cartesianChart1.Series = new SeriesCollection
{
new LineSeries
{
Title = "Series 1",
Values = new ChartValues<double> { 2 , 0 ,-9,6,12},
PointGeometry = DefaultGeometries.Circle,
LineSmoothness=0,
Fill=Brushes.Transparent,
Foreground=Brushes.Red
}
};
cartesianChart1.AxisX.Add(new Axis
{
Title = "X-Axis",
MinValue = -10,
//Labels = new[] { "0", "0.2", "0.4", "0.6", "0.8" },
//Separator = new Separator { StrokeThickness = 0 }
});
cartesianChart1.AxisY.Add(new Axis
{
Title = "Y-Axis",
//LabelFormatter = value => value.ToString("C"),
//Separator = new Separator { StrokeThickness = 0 }
});
基于某些事件一段时间后,我需要从当前点到(-2,5)再到(0,0)画一条线。在当前代码之上,我必须要做什么?请帮助我。
(提及的值仅出于示例目的)。