Microsoft Office Tutorials and References
In Depth Information
ADJUST XY CHART SCALING FOR CORRECT ASPECT RATIO
PHt = .Height
PWd1 = .InsideWidth
PHt1 = .InsideHeight
End With
The next section calculates the range of extreme x and y values,:
XDiff = MaxX - MinX
YDiff = MaxY - MinY
Part
2
‘Set a buffer space of 10% of XDiff and YDiff so there is
‘a margin between series boundary and plot area
Buffer = 0.1
‘Adjust values of Max/Min X/Y for buffer
MaxX = MaxX + Buffer * XDiff
MinX = MinX - Buffer * XDiff
MaxY = MaxY + Buffer * YDiff
MinY = MinY - Buffer * YDiff
‘Revised range of X and Y Values with buffer
XDiff = MaxX - MinX
YDiff = MaxY - MinY
‘Rescale Axes for max possible magnifi cation
With AxX
.MaximumScale = MaxX
.MinimumScale = MinX
End With
With AxY
.MaximumScale = MaxY
.MinimumScale = MinY
End With
A buffer of 10% of x and y ranges is set to accommodate the series comfortably
within the plot area, the ranges are recalculated (including the buffer zone),
and the Min/Max scales of the axes are set to the newly calculated Min/Max
values.
The fi nal section of code calculates the new scaling of the internal dimensions
of the plot area for the modifi ed x and y ranges:
 
Search JabSto ::




Custom Search