Page 1 of 1

Tee chart not updating internals

Posted: Thu Jul 27, 2006 6:25 pm
by 9525016
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

Posted: Thu Jul 27, 2006 9:10 pm
by 9525016
Oh, and please do not tell me to find out the information that I seek in the callback OnAfterDrawTChart() because it makes the code very convoluted.

Thanks,


Adrian

Posted: Fri Jul 28, 2006 7:40 am
by narcis
Hi Adrian,

To force the full chart bein redrawn you can use:

Code: Select all

	m_Chart1.GetEnvironment().InternalRepaint();
But be very careful where you use it because you could easily fall in an endless loop.

Posted: Fri Jul 28, 2006 2:19 pm
by 9525016
What is the difference between m_Chart1.GetEnvironment().InternalRepaint() and m_Chart1.Repaint()?


Adrian

Posted: Mon Jul 31, 2006 10:01 am
by Pep
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.

Posted: Wed Aug 09, 2006 7:33 pm
by 9525016
Well this is better, but I would like to optimise this a bit since the InternalRepaint() function is quite slow. Is there a way of updating only one axis or only one series?

Thanks,


Adrian

Posted: Thu Aug 10, 2006 10:29 am
by Pep
Hi Adrian,

I'm afraid there's not other way.

Posted: Thu Aug 10, 2006 2:22 pm
by 9525016
Can you please add this to the wish list then?

Thanks.


Adrian

Posted: Fri Aug 11, 2006 9:50 am
by Pep
Hi Adrian,

yes, of course, added !

Posted: Thu Aug 24, 2006 10:45 am
by Marc
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

Posted: Thu Sep 07, 2006 6:16 pm
by 9525016
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.
To maintain a subset of other information (ie. not new paint position)
Sorry, I do not understand, what exactly did you mean by "not new paint position"?

Thanks,


Adrian