PC Review


Reply
Thread Tools Rate Thread

reverse axis not working as before...

 
 
Bruce Bowler
Guest
Posts: n/a
 
      7th Feb 2012
This code "worked" in 2003, but doesn't "work" in 2007...

In this context, "worked" means that in 2003, the X axis for both Y axes
were reversed, as requested. In 2007, only the X axis for the primary Y
axis is reversed, with the X axis for the secondary Y axis remains the
same (but the labels are reversed, so the graph looks odd and is hard/
impossible to interpret properly).

Also, the line marked with <<<<'s throws an error in 2007 but worked in
2003. Any ideas how to fix it?

Thanks!
Bruce


Charts.Add
ActiveChart.ChartType = xlXYScatter
ActiveChart.SetSourceData Source:=Sheets(mainsheet$).Range("E:G"),
PlotBy:=xlColumns
ActiveChart.Location Where:=xlLocationAsNewSheet, Name:="tempsal"
ActiveChart.SeriesCollection(2).Select
ActiveChart.SeriesCollection(2).AxisGroup = 2
ActiveChart.PlotArea.Select
With ActiveChart
.HasTitle = True
.ChartTitle.Characters.Text = cruiseid$
.ChartTitle.AutoScaleFont = False
.Axes(xlCategory, xlPrimary).HasTitle = True
.Axes(xlCategory, xlPrimary).AxisTitle.Characters.Text = "Distance
(km)"
End With
With ActiveChart.Axes(xlValue)
.HasMajorGridlines = False
.HasMinorGridlines = False
End With
ActiveChart.HasLegend = False
ActiveChart.PlotArea.Select
With Selection.Border
.ColorIndex = 16
.Weight = xlThin
.LineStyle = xlContinuous
End With
With Selection.Interior
.ColorIndex = 2
.PatternColorIndex = 1
.Pattern = xlSolid
End With
With ActiveChart.Axes(xlCategory)
.HasMajorGridlines = False
.HasMinorGridlines = False
.MinimumScale = 0
.MaximumScale = 350
.MinorUnitIsAuto = True
.MajorUnitIsAuto = True
.Crosses = xlAutomatic
.ReversePlotOrder = True
' .ScaleType = xlLinear <<<<<<<<<<<<<<<<<<<<<
End With
ActiveChart.SeriesCollection(2).AxisGroup = 1
ActiveChart.SeriesCollection(1).AxisGroup = 2
With ActiveChart
.Axes(xlValue, xlPrimary).HasTitle = True
.Axes(xlValue, xlPrimary).AxisTitle.Characters.Text = "Salinity
(ppt)"
.Axes(xlValue, xlSecondary).HasTitle = True
.Axes(xlValue, xlSecondary).AxisTitle.Characters.Text =
"Temperature (degrees c)"
End With
For i = 1 To 2
ActiveChart.SeriesCollection(i).Select
With Selection.Border
.Weight = xlThin
.LineStyle = xlAutomatic
End With
With Selection
.MarkerStyle = xlNone
.Smooth = False
.MarkerSize = 5
.Shadow = False
End With
Next i
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Reverse y-axis, with maximum number at x-axis Elise Microsoft Excel Charting 1 10th Feb 2010 03:41 PM
Need PivotChart x axis to cross Y axis at minimum Y axis value =?Utf-8?B?QWFyb24=?= Microsoft Excel Charting 1 17th Aug 2007 08:51 AM
Secondary X-axis with reverse Y-axis =?Utf-8?B?aGFtb25k?= Microsoft Excel Charting 6 20th Sep 2006 06:04 PM
How to insert X axis scale values next to axis and X axis grid lin =?Utf-8?B?dnAyM2xhcnJ5?= Microsoft Excel Charting 2 23rd Jun 2005 03:45 PM
axis axis, scr axis, etc named folders Windows XP General 1 3rd Jun 2004 01:29 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:02 AM.