PC Review


Reply
Thread Tools Rate Thread

all series on secondary axis

 
 
Arne
Guest
Posts: n/a
 
      20th Dec 2008
I am creating a xlXYScatterLines chart that has a series for each date
segment (1st quarter, 2nd quarter, ...) and would like the xlValue axis
values to be displayed on the right hand side of the chart.



I've tried to have each series designated as xlSecondary, but only the first
series will appear:

For Each ChtObj In ChtSht.ChartObjects

For Each s In ChtObj.Chart.SeriesCollection
'creates a simple series for each Measurement Unit

s.XValues = Range(DataRangeInterval(DataSht.Range("Col_Date"),
s.PlotOrder))
s.Values = Range(DataRangeInterval(Range(colHdrSet(ChtObj.Index +
NumMeasUnits)), s.PlotOrder))
s.MarkerStyle = xlMarkerStyleNone
s.AxisGroup = xlSecondary 'THIS WILL ONLY SHOW THE FIRST SERIES

With s.Border
.Weight = xlMedium
.LineStyle = xlContinuous
.ColorIndex = 5 'Blue RGB(0,112,192)
End With

Next s

Next ChtObj

The over-all chart range is set with the VBA code (there does not seem to be
a way to set the axis to xlSecondary):

For Each ChtObj In ChtSht.ChartObjects

dateMin = "some calculated value"
dateMax="some calculated value"
valueMin = "some calculated value"
valueMax = "some calcualted value"

If (ChtObj.Index) Mod 2 = 1 Then 'xDBar Chart

With ChtObj.Chart

.Axes(xlCategory).MinimumScale = dateMin
.Axes(xlCategory).MaximumScale = dateMax

.Axes(xlValue).MinimumScale = valueMin
.Axes(xlValue).MaximumScale = valueMax

End With

Else 'sBar Chart

With ChtObj.Chart

.Axes(xlCategory).MinimumScale = dateMin
.Axes(xlCategory).MaximumScale = dateMax

.Axes(xlValue).MinimumScale = valueMin
.Axes(xlValue).MaximumScale = valueMax

End With

End If

Next ChtObj



Thanks,

Arne
 
Reply With Quote
 
 
 
 
Arne
Guest
Posts: n/a
 
      20th Dec 2008
yeah, that works nicely.

Arne

"shg" wrote:

>
> Perhaps
>
> Code:
> --------------------
> .Axes(xlCategory).Crosses = xlMaximum
> --------------------
>
>
> --
> shg
> ------------------------------------------------------------------------
> shg's Profile: http://www.thecodecage.com/forumz/member.php?userid=13
> View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=43052
>
>

 
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
how do you change the way a series in plotted on a secondary axis Tricia Microsoft Excel Charting 1 17th Mar 2009 04:02 PM
SECONDARY AXIS/series next to column Raf Rollier Microsoft Excel Charting 0 23rd Jan 2009 04:46 PM
Secondary Axis Selected Data Series dsteven Microsoft Excel Charting 1 19th Feb 2008 10:16 PM
Secondary y-axis for certain x-axis categories (not by series) =?Utf-8?B?U29uekFNb256?= Microsoft Excel Charting 2 19th Jun 2007 01:33 PM
Stacked bar for multiple series + secondary axis gilbertcn Microsoft Excel Charting 2 25th Oct 2005 08:01 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:21 AM.