Initial Update Problem

TeeChart for ActiveX, COM and ASP
Post Reply
LAL
Newbie
Newbie
Posts: 40
Joined: Fri Jun 20, 2008 12:00 am

Initial Update Problem

Post by LAL » Tue Jul 08, 2008 4:18 am

I'm using v8 ActiveX with VC6 in an MFC application.

I'm drawing a surface series representing topographical data and I'm adjusting Chart3DPercent or TimesZOrder to get my X / Y data roughly in proportion. I 'm adding a 'Rotate' tool in code too.

This seems to work reasonably well, but the initial update of my dialog (when it first opens) is 'wrong':

Image

You can see that it isn't in the correct proportions.

If I then use the rotate tool to fractionally move the graph (the slightest click and drag), it "pops" to the correct size:

Image

So, I have two questions...

1) How do I make my chart appear correctly as soon as my dialog opens?
I've tried RefreshData, Repaint, InternalRepaint and they don't work.

2) Is there any way to check if my whole chart is visible or to make sure that it is visible straight away i.e., auto-set the zoom so we can see the whole chart like this:

Image

LAL
Newbie
Newbie
Posts: 40
Joined: Fri Jun 20, 2008 12:00 am

Post fairy strikes again...

Post by LAL » Tue Jul 08, 2008 4:23 am

:oops:

OK, so I discovered the answer to the first problem...I needed to make sure 'Orthogonal' was not set initially.

But I'd still welcome ideas on the auto-zooming thing....

Cheers

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

Post by Narcís » Tue Jul 08, 2008 8:08 am

Hi LVL,

You can try using something like this:

Code: Select all

    TChart1.Aspect.Zoom = 80
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

LAL
Newbie
Newbie
Posts: 40
Joined: Fri Jun 20, 2008 12:00 am

Post by LAL » Tue Jul 08, 2008 8:44 pm

Hi Narcis,

I appreciate the use of the zoom property, but I was wondering if the control 'knows' when it isn't displaying the full chart. In the example above, my chart is initially displaying as in the second picture and it is necessary to zoom out a little bit to see the whole thing (as in the third picture). I've attached the zoom to my mouse wheel, so that isn't too hard, but I would like it if the whole chart would be displayed first.

So, is it possible to tell if the drawing area of the panel is larger than the control? Or some way of telling that the whol chart is not displayed so that I can automatically zoom out to see the whole thing?

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

Post by Narcís » Wed Jul 09, 2008 8:01 am

Hi LVL,

The only solution I can think of is checking if all axes fit in chart's plotting area and if they don't unzoom the chart a little bit.

You can obtain axes size like this:

Code: Select all

    TChart1.Axis.Bottom.IAxisSize
You could try implementing this in the OnAfterDraw event.

Hope this helps!
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

Post Reply