ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Need help with series chart, please (https://www.excelbanter.com/excel-programming/330685-need-help-series-chart-please.html)

jamie392

Need help with series chart, please
 

Here is my code:

Charts.Add
ActiveChart.Location Whe=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

--
jamie39
-----------------------------------------------------------------------
jamie392's Profile: http://www.excelforum.com/member.php...fo&userid=2325
View this thread: http://www.excelforum.com/showthread.php?threadid=37577


jamie392[_2_]

Need help with series chart, please
 

anyone have any ideas to thi

--
jamie39
-----------------------------------------------------------------------
jamie392's Profile: http://www.excelforum.com/member.php...fo&userid=2325
View this thread: http://www.excelforum.com/showthread.php?threadid=37577



All times are GMT +1. The time now is 11:28 AM.

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