Graphing

E

Eric

Is there away to have two (2) y-axises? I want english measurements on the
left and metric on the right. I have both calculated out in cells but am
wondering how to make the right side of the graph have anything. Any help
would be appreciated. Thank you in advance.
Eric
 
B

Barb Reinhardt

What units do you want displayed on each axis? Inches/Feet/Miles cm/m/km???

That would help.
 
B

Barb Reinhardt

You're going to have to add a second series to the chart and have it use the
secondary axis. To "match" the scales, use something like this for code.
I converted from Feet to Meters here. Change the points for the second
series so they aren't displayed.

With ActiveChart.Axes(xlValue)
myMax = .MaximumScale
myMin = .MinimumScale
End With

With ActiveChart.Axes(xlValue, xlSecondary)
.MaximumScale = myMax * 0.3062
.MinimumScale = myMin * 0.3062
End With
 
E

Eric

Barb,
I have tried the code below and still am getting an error here is what I
have for the code. By the way I am going from pounds per cubic foot to
kilograms per meter cubed. Thank you for your help

ActiveSheet.DrawingObjects("chart 7").Select
ActiveSheet.ChartObjects("chart 7").Activate
With ActiveChart.Axes(xlValue)
..MinimumScale = 1
..MaximumScale = 1
..MinorUnitIsAuto = True
..MajorUnitIsAuto = True
..Crosses = xlAutomatic
..ReversePlotOrder = False
..ScaleType = False
End With
ActiveWindow.Visible = False
Range("b41").Select

ActiveSheet.DrawingObjects("chart 7").Select
ActiveSheet.ChartObjects("chart 7").Activate
ActiveChart.Axes(xlValue).Select
With ActiveChart.Axes(xlValue)
..MaximumScale = ActiveSheet.Range("t12")
..MinimumScale = ActiveSheet.Range("s12")
..MinorUnit = 20
..MajorUnit = 1
..Crosses = xlAutomatic
..ReversePlotOrder = False
ScaleType = False
..TickLabels.NumberFormat = "0.0"

End With

'secondary axis
ActiveSheet.DrawingObjects("chart 7").Select
ActiveSheet.ChartObjects("chart 7").Activate
ActiveChart.Axes(xlValue).Select
With ActiveChart.Axes(xlValue, xlSecondary)
..MaximumScale = ActiveSheet.Range("t12") * 16.01846
..MinimumScale = ActiveSheet.Range("s12") * 16.01846
End With
 
E

Eric

Barb,
I have figured out the problem that I was having but of coarse there is a
new issue now. when I run the macro for the chart it doesn't graph anything
out. The x and y axises are there but nothing for a series. When I go to
the series to check there is no x axis pick but the y axis is. When I pick
the x axis location it then graphs for me and all is well. Any help would be
appreciated. Thank you
 
Top