Tee chart not updating internals

TeeChart for ActiveX, COM and ASP
Post Reply
Vivo
Newbie
Newbie
Posts: 36
Joined: Fri Nov 26, 2004 5:00 am
Contact:

Tee chart not updating internals

Post by Vivo » Thu Jul 27, 2006 6:25 pm

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

Vivo
Newbie
Newbie
Posts: 36
Joined: Fri Nov 26, 2004 5:00 am
Contact:

Post by Vivo » Thu Jul 27, 2006 9:10 pm

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

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Fri Jul 28, 2006 7:40 am

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.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Vivo
Newbie
Newbie
Posts: 36
Joined: Fri Nov 26, 2004 5:00 am
Contact:

Post by Vivo » Fri Jul 28, 2006 2:19 pm

What is the difference between m_Chart1.GetEnvironment().InternalRepaint() and m_Chart1.Repaint()?


Adrian

Pep
Site Admin
Site Admin
Posts: 3274
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Mon Jul 31, 2006 10:01 am

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.

Vivo
Newbie
Newbie
Posts: 36
Joined: Fri Nov 26, 2004 5:00 am
Contact:

Post by Vivo » Wed Aug 09, 2006 7:33 pm

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

Pep
Site Admin
Site Admin
Posts: 3274
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Thu Aug 10, 2006 10:29 am

Hi Adrian,

I'm afraid there's not other way.

Vivo
Newbie
Newbie
Posts: 36
Joined: Fri Nov 26, 2004 5:00 am
Contact:

Post by Vivo » Thu Aug 10, 2006 2:22 pm

Can you please add this to the wish list then?

Thanks.


Adrian

Pep
Site Admin
Site Admin
Posts: 3274
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Fri Aug 11, 2006 9:50 am

Hi Adrian,

yes, of course, added !

Marc
Site Admin
Site Admin
Posts: 1220
Joined: Thu Oct 16, 2003 4:00 am
Location: Girona
Contact:

Post by Marc » Thu Aug 24, 2006 10:45 am

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
Steema Support

Vivo
Newbie
Newbie
Posts: 36
Joined: Fri Nov 26, 2004 5:00 am
Contact:

Post by Vivo » Thu Sep 07, 2006 6:16 pm

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

Post Reply