Page 1 of 1

Initial Update Problem

Posted: Tue Jul 08, 2008 4:18 am
by 15049432
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

Post fairy strikes again...

Posted: Tue Jul 08, 2008 4:23 am
by 15049432
: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

Posted: Tue Jul 08, 2008 8:08 am
by narcis
Hi LVL,

You can try using something like this:

Code: Select all

    TChart1.Aspect.Zoom = 80

Posted: Tue Jul 08, 2008 8:44 pm
by 15049432
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?

Posted: Wed Jul 09, 2008 8:01 am
by narcis
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!