In a FastLine Series I want to display a line that represents a percent level at different times. The y-axis is % and the x-axis is DateTime.
I update the line in an asynchronous event where I add the new data point to the series including the according timestamp and the color, like below.
fastLine.Add(timestamp, yValue, color);
The TeeChart is set up like this:
In xaml:
<DockPanel x:Name="dpMain">
<WPF:TChart x:Name="tChart" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/>
</DockPanel>
In code-behind:
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;
The update events are triggered every 10 seconds, but this timespan may change.
My problem is that as soon as the second event arrives, the chart is filled with a lot of data points resulting in a horizontal line being displayed and the bottom axis is filled with a lot of date entries. Moreover, it seems as if the color I provide in the "Add" function is ignored.
How can I have the FastLine display only the point that are added in the async event?
Is there an easy way to achieve a "windowing" effect? I want the newest points to be visible all the time (like scrolling to the right).
Regards,
tabina