ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Unwanted chart plot area resized when .Axes(xlValue).MinimumScale = "-0.1" (https://www.excelbanter.com/excel-programming/444106-unwanted-chart-plot-area-resized-when-axes-xlvalue-minimumscale-%3D-0-1-a.html)

Frank[_28_]

Unwanted chart plot area resized when .Axes(xlValue).MinimumScale = "-0.1"
 
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?


All times are GMT +1. The time now is 06:31 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com