Hi !
We have a logging software which plots every second one point to the chart / to the series (we use fastline Series).
Everytime a new point is added to a series the chart is repainted. So the increment of the x axis is only one point.
Is there a way to increment the x axis with a custom percentage?
A simple example:
Lets say you have one FastLine Series with 100 datapoints. The X axis shows 0 at the left and 100 at the right. Now you add an addition datapoint to the series. The x axis only increments to 101 on the right side.
But it would be much more efficient if the x axis would increment to 120 instead of 101. If you do so the next 19 datapoints don´t need a complete repaint of the chart. You simple enhance the actual one.
If you have 120 datapoints you enhance the x axis again with 20%.
Is this possible with TeeChart?
Increment of x Axis
Increment of x Axis
Greetz Dominik
http://www.logview.info
http://www.logview.info
Hi Dominik,
this can be accomplished using the SetMinMax method, it will allow you to specify the min and max for the bottom axis after the point has been added.
this can be accomplished using the SetMinMax method, it will allow you to specify the min and max for the bottom axis after the point has been added.
Pep Jorge
http://support.steema.com
http://support.steema.com
Hi Pep,
I write some code in FormCreate:
Then I add datapoints with a timer:
The x Axis increments great
But I don´t understand why the chart is repainted every time a new datapoint is added. In the OnAfterDraw Event I put in some Debugcode and it is fired every time you add a datapoint.
Wouldn´t it be much faster if the chart will only be redrawn if the axis have to be recalculated?
I write some code in FormCreate:
Code: Select all
Series1.GetHorizAxis.Automatic := False;
Series1.GetHorizAxis.SetMinMax(0, 10);
Code: Select all
procedure TForm1.Timer1Timer(Sender: TObject);
var NewMax : Double;
begin
inc(Count);
if Count > Series1.GetHorizAxis.Maximum then begin
NewMax := round(Chart1.Series[0].Count * 1.2);
Series1.GetHorizAxis.SetMinMax(0, NewMax);
end;
Chart1.Series[0].AddXY(Count, Sin(Count / 30));
Chart1.Series[1].AddXY(Count, Cos(Count / 30));
end;
But I don´t understand why the chart is repainted every time a new datapoint is added. In the OnAfterDraw Event I put in some Debugcode and it is fired every time you add a datapoint.
Wouldn´t it be much faster if the chart will only be redrawn if the axis have to be recalculated?
Greetz Dominik
http://www.logview.info
http://www.logview.info
Hi Dominik,
The most usual wish is to show each new point added to a series. I don't understand what exactly you would like to achieve.
You would like to control OnAfterDraw calls? You can control chart repaints by:
If what you want is to add some values in one time you can use the AddArray method:
The most usual wish is to show each new point added to a series. I don't understand what exactly you would like to achieve.
You would like to control OnAfterDraw calls? You can control chart repaints by:
Code: Select all
Chart1.AutoRepaint := False;
Code: Select all
Series1.AddArray([2,3,5,7,1]);
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |