我需要在窗口中以“HH:mm:ss”格式显示时间。
Plot = new PlotModel();
Plot.TextColor = OxyColors.Black;
Plot.Axes.Add(new LinearAxis(AxisPosition.Left, 0, 100));
Plot.Axes.Add(new DateTimeAxis(AxisPosition.Bottom)
{
//StringFormat = "h:mm",
IsZoomEnabled = false,
IntervalType = DateTimeIntervalType.Seconds,
IntervalLength = 80
});
但它不起作用。
我想在 DateTimeAxis: 0:00:01 - 0:00:05 - 0:00:10 等中看到这个结果。请帮帮我。
private double _xAxisCounter;
private void UpdateChart(int mixerNumber)
{
DetailsPlot details = _mixerDetailsPlots[mixerNumber];
UpdateChart(details.LineOfCurrent, details.Mixer.Current.Value);
UpdateChart(details.LineOfMaximumCurrent, details.Mixer.MaximumCurrent);
}
private void UpdateChart(LineSeries line, double value)
{
if (line.Points.Count > 500)
{
line.Points.RemoveAt(0);
}
line.Points.Add(new DataPoint(_xAxisCounter, value));
}