FastLine シリーズで、さまざまな時点でのパーセント レベルを表す線を表示したいと考えています。Y 軸は % で、X 軸は DateTime です。
以下のように、対応するタイムスタンプと色を含むシリーズに新しいデータ ポイントを追加する非同期イベントで行を更新します。
fastLine.Add(timestamp, yValue, color);
TeeChart は次のように設定されます。
xaml で:
<DockPanel x:Name="dpMain">
<WPF:TChart x:Name="tChart" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/>
</DockPanel>
コード ビハインド:
this.tChart.HorizontalAlignment = HorizontalAlignment.Stretch;
this.tChart.VerticalAlignment = VerticalAlignment.Stretch;
this.tChart.Aspect.View3D = false;
this.tChart.Legend.Visible = false;
this.tChart.Zoom.Allow = false;
//create at least one fast line series.
this.fastLine = new FastLine(this.tChart.Chart);
this.tChart.Series.Add(this.fastLine);
this.tChart.Axes.Left.Automatic = false;
this.tChart.Axes.Left.Maximum = 100;
this.tChart.Axes.Left.Minimum = 0;
//this.tChart.Axes.Bottom.Automatic = false;
this.tChart.Axes.Bottom.Labels.DateTimeFormat = "dd/MM/yy \n HH:mm:ss";
this.tChart.Axes.Bottom.Labels.Angle = 90;
fastLine.Marks.Visible = false;
fastLine.XValues.DateTime = true;
更新イベントは 10 秒ごとにトリガーされますが、この期間は変更される場合があります。
私の問題は、2 番目のイベントが到着するとすぐに、チャートが多数のデータ ポイントで満たされ、その結果水平線が表示され、下の軸が多数の日付エントリで満たされることです。さらに、「追加」機能で指定した色が無視されているようです。
非同期イベントで追加されたポイントのみを FastLine に表示させるにはどうすればよいですか?
「ウィンドウ」効果を実現する簡単な方法はありますか? 最新のポイントが常に表示されるようにします (右にスクロールするなど)。
よろしく、
タビナ