wpf中TeeChart的x軸為時間軸,如何設(shè)置只訪問某一段時間的數(shù)據(jù)?
發(fā)表于2019-05-10
回復(fù):0
查看:5997 |
wpf中我做了個接受實時數(shù)據(jù)然后畫成曲線的上位機程序,x軸為時間軸(DateTime),我現(xiàn)在想通過設(shè)置來實現(xiàn)只顯示我想要觀察的某一段時間的數(shù)據(jù),不知道如何實現(xiàn)。
第一步我先通過一個按鍵來實現(xiàn)選擇顯示某一段時間,
<pre class='brush:csharp'>
Axis bottomAxis;
bottomAxis = tChart1.Axes.Bottom;
private void btnTimeSpan_Click(object sender, RoutedEventArgs e)
{
bottomAxis.Automatic = false;
bottomAxis.Maximum = (new DateTime(2016, 4, 28, 14, 16, 10)); //這邊有問題
bottomAxis.Minimum=
}
</pre>
我的本意是設(shè)置顯示的最大時間和最小時間,但是bottomAxis.Maximum 的類型是double型,而時間是DateTime類型,這個該如何解決?
登錄 慧都網(wǎng)發(fā)表評論