我拿着我的活海图,绘制了5种来自档案/空中港口的不同类型的数据,但这些数据都是在同一系列上。
我有2个Y轴线显示,但不能向每一方补充飞行数据。 活图文件是可怕的。
我已经建立了2个系列,但数据似乎并未确定。
<lvc:CartesianChart x:Name=“lc_MainChart” Hoverable=“False” Grid.Row=“0” Grid.Column=“1”, DisableAnimations=“True” ThuLocation=“Right” Loaded=“CartesianChart_Loaded” Margin=2,2,2,2,2”“Brush=“Black” 边界Thickness=”2,2,2,2,2,2,2”,2,2,2,2”
<lvc:CartesianChart.AxisX >
<lvc:Axis Title="DATA POINTS" FontSize="18" MinValue="0" MaxValue="512" Labels="{Binding Labels}"></lvc:Axis>
</lvc:CartesianChart.AxisX>
<lvc:CartesianChart.AxisY>
<lvc:Axis Title="MOTOR VOLTAGE (mV)" FontSize="18" MinValue="0" MaxValue="8000" ></lvc:Axis>
<lvc:Axis Title="MOTOR CURRENT (mA)" FontSize="18" MinValue="0" MaxValue="800" Position="RightTop" ></lvc:Axis>
</lvc:CartesianChart.AxisY>
<lvc:CartesianChart.Series>
<lvc:LineSeries Name="Chart1" Values="{Binding ChartValues}"/>
<lvc:LineSeries Name="Chart2" Values="{Binding ChartValues2}"/>
</lvc:CartesianChart.Series>
</lvc:CartesianChart>
// Setup chart
ChartSeries = new SeriesCollection
{
new LineSeries
{
Title = "Motor Current",
Values = new ChartValues<Int16> {0},
PointForeground = Brushes.Red,
PointGeometry = null
},
new LineSeries
{
Title = "Voltage",
Values = new ChartValues<Int16> {0},
PointForeground = Brushes.Blue,
PointGeometry = null
}
};
// Setup chart series
ChartSeries2 = new SeriesCollection
{
new LineSeries
{
Title = "Motor Speed",
Values = new ChartValues<Int16> {0},
PointForeground = Brushes.Green,
PointGeometry = null
},
new LineSeries
{
Title = "Force",
Values = new ChartValues<Int16> {0},
PointForeground = Brushes.Blue,
PointGeometry = null
}
};
YFormatter = value => value.ToString("F");
lc_MainChart.LegendLocation = LegendLocation.Right;
ChartSeries[0].Values.Add(MotorCurrent[i]);
ChartSeries[1].Values.Add(VBat[i]);
ChartSeries2[0].Values.Add(MotorSpeed[i]);
ChartSeries2[1].Values.Add(Force[i]);
DataContext = this;