S
Scott Ewald
I'm trying to add a Secondary X-Axis to a chart. I've been able to add
Secondary Y-Axis with success, just can't do it properly with a category
axis. I have the same number of values for both axes. When I add the second
axis, both the Primary and Secondary scales are identical (even if I scale
them differently) and both contain the categories of both axes (so both axes
are twice as big as they are supposed to be). The code:
Public Sub AddSecondaryXAxis(ByVal SecondSeriesCategories As Object())
Dim oseries
oseries = Me.Chart.SeriesCollection.Add()
oseries.ungroup(True)
With oseries
.SetData(OWC11.ChartDimensionsEnum.chDimCategories,
OWC11.ChartSpecialDataSourcesEnum.chDataLiteral, SecondSeriesCategories)
End With
Dim axaxis
axaxis =
Me.Chart.Axes.Add(oseries.Scalings(OWC11.ChartDimensionsEnum.chDimValues))
With axaxis
.position = OWC11.ChartAxisPositionEnum.chAxisPositionTop
.HasMajorGridlines = False
.HasTickLabels = True
.TickMarkSpacing = 30
.TickLabelSpacing = 120
.MajorTickMarks = OWC11.ChartTickMarkEnum.chTickMarkCross
.MinorTickMarks = OWC11.ChartTickMarkEnum.chTickMarkInside
.Orientation =
OWC11.ChartLabelOrientationEnum.chLabelOrientationUpward
axaxis.scaling.minimum = 1142
axaxis.scaling.maximum = 2282
End With
End Sub
any help?
Secondary Y-Axis with success, just can't do it properly with a category
axis. I have the same number of values for both axes. When I add the second
axis, both the Primary and Secondary scales are identical (even if I scale
them differently) and both contain the categories of both axes (so both axes
are twice as big as they are supposed to be). The code:
Public Sub AddSecondaryXAxis(ByVal SecondSeriesCategories As Object())
Dim oseries
oseries = Me.Chart.SeriesCollection.Add()
oseries.ungroup(True)
With oseries
.SetData(OWC11.ChartDimensionsEnum.chDimCategories,
OWC11.ChartSpecialDataSourcesEnum.chDataLiteral, SecondSeriesCategories)
End With
Dim axaxis
axaxis =
Me.Chart.Axes.Add(oseries.Scalings(OWC11.ChartDimensionsEnum.chDimValues))
With axaxis
.position = OWC11.ChartAxisPositionEnum.chAxisPositionTop
.HasMajorGridlines = False
.HasTickLabels = True
.TickMarkSpacing = 30
.TickLabelSpacing = 120
.MajorTickMarks = OWC11.ChartTickMarkEnum.chTickMarkCross
.MinorTickMarks = OWC11.ChartTickMarkEnum.chTickMarkInside
.Orientation =
OWC11.ChartLabelOrientationEnum.chLabelOrientationUpward
axaxis.scaling.minimum = 1142
axaxis.scaling.maximum = 2282
End With
End Sub
any help?