Need help with series chart, please

J

jamie392

Here is my code:

Charts.Add
ActiveChart.Location Where:=xlLocationAsNewSheet, Name:="Crib "
cribNum & " Graph"
With ActiveChart
.SetSourceDat
Range("VertTop:VertBot,LRLatTop:LRLatBot,HRLatTop:HRLatBot")
PlotBy:=xlColumns
.ChartType = xlXYScatter
.SeriesCollection(1).Name = "=""Weight"""
.SeriesCollection(1).XValues = Range("AxleTop:AxleBot")
.SeriesCollection(2).Name = "=""Low Rail"""
.SeriesCollection(2).XValues = Range("AxleTop:AxleBot")
.SeriesCollection(3).Name = "=""High Rail"""
.SeriesCollection(3).XValues = Range("AxleTop:AxleBot")
.HasTitle = True
.ChartTitle.Characters.text = "Crib " & cribNum & " - "
thisFileName & " Lateral Forces - Leading and Trailing Axles"
.Axes(xlCategory, xlPrimary).HasTitle = True
.Axes(xlCategory, xlPrimary).AxisTitle.Characters.text = "Axl
#"
.Axes(xlValue, xlPrimary).HasTitle = True
.Axes(xlValue, xlPrimary).AxisTitle.Characters.text = _
"Lateral Forces (kips)"
.SeriesCollection(1).AxisGroup = 2
.Axes(xlValue, xlSecondary).HasTitle = True
.Axes(xlValue, xlSecondary).AxisTitle.Characters.text = "Weigh
(kipps)"
.Axes(xlValue, xlSecondary).MinimumScale = -140
.Axes(xlValue, xlSecondary).MaximumScale = 40
.HasLegend = True
.Legend.Position = xlBottom
.PlotArea.Interior.ColorIndex = xlNone

now this all works, but it puts the series collection weight as hig
rail, and high rail as weight. I try switching the order that I entere
the three sourceData entries, but it doesnt make a difference. How do
fix this so the data corresponds to the appriopriate collection.
Thank
 

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