Page 1 of 1

Labels and Panning

Posted: Thu May 11, 2017 5:59 am
by 16580759
Hi there.

I have a large series of data (17 series with 85 000 points in each). Load it in to Teechart (Standard) with AddXY function. Just using the X and Y pos.
The X was directly inserted as TDateTime in this case. Change the X-axis format to TDateTime to present the data properly.

When I'm panning in TeeChart it responds without any issue.

For reasons I want to use labels instead and keep X-axis as default. As element position in the array and put a label on them instead. The label is the corresponding TDateTime.
When I do so TeeChart becomes slow. Too slow to be used. Now I am considering to use pages to downsize number of points on the screen or go back to the previous method and solve that problem.

I'm curious if there are something I'm missing here or doing incorrect.
What could be the reason for this?
Only thing I can think of is that there are 3 elements to process instead of two if I use a label.

Cheers,
MrI

Re: Labels and Panning

Posted: Thu May 11, 2017 9:49 am
by yeray
Hello,

The problem is when you work with labels you must loop almost all them to check the widths of the strings to avoid overlapping; and this has to be done at each repaint.

The workaround would be to set your labels manually.
See the "Custom Labels" checkbox in the attached example:
testLabelsSpeed.zip
(2.21 KiB) Downloaded 634 times

Re: Labels and Panning

Posted: Fri May 12, 2017 7:28 am
by 16580759
Hi Mr Yeray

This looks very promising, will get back to you when I have implemented it in my software.

Until then,
Cheers!

Re: Labels and Panning

Posted: Mon May 22, 2017 1:10 am
by 16580759
Hi again, very nice example.

Works much better now.

Thank you!