Unwanted chart plot area resized when .Axes(xlValue).MinimumScale = "-0.1"

F

Frank

I like big graphs and have written the following code

(maximum1 and minimum1 are the max and min in the charted source)

major_unit = .Axes(xlValue).MajorUnit
If Application.RoundUp((.Axes(xlValue).MaximumScale - maximum1) /
major_unit, 0) > 1 Then _
.Axes(xlValue).MaximumScale = .Axes(xlValue).MaximumScale -
major_unit * (Application.RoundUp((.Axes(xlValue).MaximumScale -
maximum1) / major_unit, 0) - 1)
If Application.RoundUp((minimum1 - .Axes(xlValue).MinimumScale) /
major_unit, 0) > 1 Then _
.Axes(xlValue).MinimumScale = .Axes(xlValue).MinimumScale +
major_unit * (Application.RoundUp((minimum1
- .Axes(xlValue).MinimumScale) / major_unit, 0) - 1)

It works wonderfully except when after the routine,
if .Axes(xlValue).MinimumScale = "-0.1", it shifts the y axis to the
right and reduces the plot area.

So I added the following line of code:

If .Axes(xlValue).MinimumScale = "-0.1"
Then .Axes(xlValue).MinimumScale = "-0.1" and it works.

This only happens with -0.1

I’ve uploaded images of what it looks like:

http://www.gingins.info/2.gif and http://www.gingins.info/1.gif

Anyone knows about this?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top