Tee chart not updating internals
Tee chart not updating internals
Argh! I am going crazy here!
I need TChart to update its internals so that I can access the updated objects such a positions of series point, labels and such (in the container) after I move them, otherwise, my functions that manipulate the same objects but are called seperatly from different routes (but still prior to the message loop from being executed) will receive old data which was valid at the start when my code was executed.
This is just unacceptable as it would mean to get around the problem would be to maintain my own set of data structures to duplicate those in TChart, which would be a definate headache.
How do I force an update?! I'm writing in C++/MFC.
Thanks for your help,
Adrian
I need TChart to update its internals so that I can access the updated objects such a positions of series point, labels and such (in the container) after I move them, otherwise, my functions that manipulate the same objects but are called seperatly from different routes (but still prior to the message loop from being executed) will receive old data which was valid at the start when my code was executed.
This is just unacceptable as it would mean to get around the problem would be to maintain my own set of data structures to duplicate those in TChart, which would be a definate headache.
How do I force an update?! I'm writing in C++/MFC.
Thanks for your help,
Adrian
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Adrian,
To force the full chart bein redrawn you can use:
But be very careful where you use it because you could easily fall in an endless loop.
To force the full chart bein redrawn you can use:
Code: Select all
m_Chart1.GetEnvironment().InternalRepaint();
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Hi Adrian,
The InternalRepaint method repaints the internal Chart canvas, which is the canvas TeeChart uses as a "mock-up" before painting to the Chart canvas itself.
This Chart method forces the Chart to Repaint, but when it has been painted.
The InternalRepaint method repaints the internal Chart canvas, which is the canvas TeeChart uses as a "mock-up" before painting to the Chart canvas itself.
This Chart method forces the Chart to Repaint, but when it has been painted.
Pep Jorge
http://support.steema.com
http://support.steema.com
Hello Adrian,
I think it unlikely that we are going to able to return updated Chart internals information lists without modifying the whole Chart (as is presently done with InternalRepaint). That is because of the interrelation between elements, ie. the position of a Mark depends on knowing how manay data points are to be displayed, their position depending on the new point count. The same could be said for Axis scale, min and max, legend size, header position, etc.
To maintain a subset of other information (ie. not new paint position) I recommend you do so apart and as such you can also optimise the performance of doing so and choose when to paint the Chart.
Regards,
Marc Meumann
I think it unlikely that we are going to able to return updated Chart internals information lists without modifying the whole Chart (as is presently done with InternalRepaint). That is because of the interrelation between elements, ie. the position of a Mark depends on knowing how manay data points are to be displayed, their position depending on the new point count. The same could be said for Axis scale, min and max, legend size, header position, etc.
To maintain a subset of other information (ie. not new paint position) I recommend you do so apart and as such you can also optimise the performance of doing so and choose when to paint the Chart.
Regards,
Marc Meumann
Steema Support
Hi Marc,
I understand what you are saying, but the inter-relation of which you speak is one of non-cyclic dependency. If I want to get a portion of the Chart Internals list to be updated, it should only need to update those nodes that it depends upon first as far back as is needed prior to updating the information list node in question and _only_ those nodes that have been modified since the last recalculation request. This then becomes relatively innocuous change by adding a recalc function at the node points.
I am currently maintaining a bunch of separate bounding rectangles, which is a bit tricky and does not work in all circumstances. I.e. I have to call internal repaint more times than I would like causing the system to slow down.
Thanks,
Adrian
I understand what you are saying, but the inter-relation of which you speak is one of non-cyclic dependency. If I want to get a portion of the Chart Internals list to be updated, it should only need to update those nodes that it depends upon first as far back as is needed prior to updating the information list node in question and _only_ those nodes that have been modified since the last recalculation request. This then becomes relatively innocuous change by adding a recalc function at the node points.
I am currently maintaining a bunch of separate bounding rectangles, which is a bit tricky and does not work in all circumstances. I.e. I have to call internal repaint more times than I would like causing the system to slow down.
Sorry, I do not understand, what exactly did you mean by "not new paint position"?To maintain a subset of other information (ie. not new paint position)
Thanks,
Adrian