[英]Plotting a SciChart series with a TimeSpan X-Axis when the plotted TimeSpan value is greater than 24 hours
我有一個 SciChart 表面,它綁定到一個名為ObservableCollection<IRenderableSeriesViewModel>
的ObservableCollection<IRenderableSeriesViewModel>
。 我的XyDataSeries<TimeSpan, double>
類型是XyDataSeries<TimeSpan, double>
。
當我的時間跨度范圍小於 24 小時時,我的 X 軸顯示正確。 當我繪制 TimeSpan 值大於 24 小時的點時,X 軸(時間)錯誤地顯示了 00:00:00 到 00:00:00 的范圍。
當我繪制時間跨度大於 24 小時的值時,如何讓我的 X 軸正確顯示?
<s:SciChartSurface RenderableSeries="{s:SeriesBinding TrendSeries}">
<!-- Define X Axis -->
<s:SciChartSurface.XAxis>
<s:TimeSpanAxis AxisTitle="Time"
AutoRange="Always" GrowBy="0.1, 0.1"
AxisAlignment="Bottom"/>
</s:SciChartSurface.XAxis>
<!-- Define Y Axis -->
<s:SciChartSurface.YAxis>
<s:NumericAxis AxisTitle="Value" AutoRange="Always" GrowBy="0.1, 0.1"/>
</s:SciChartSurface.YAxis>
</s:SciChartSurface>
這是一個與此類似的問題: SciChart WPF Y-Axis and Data labels do hot have precision and show the same number
基本上你看到的是 TimeSpanAxis 上的默認 TextFormatting 設置為“-hh:mm:ss”
將此更改為另一個 .NET 格式字符串,或使用此答案中提供的技術動態更改它會給您所需的行為
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.