Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
all series on secondary axis
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.Ind ex + 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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
all series on secondary axis
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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
all series on secondary axis
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 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
SECONDARY AXIS/series next to column | Charts and Charting in Excel | |||
Secondary Axis Selected Data Series | Charts and Charting in Excel | |||
Secondary y-axis for certain x-axis categories (not by series) | Charts and Charting in Excel | |||
Stacked bar for multiple series + secondary axis | Charts and Charting in Excel | |||
Primary/Secondary Axis series count | Charts and Charting in Excel |