This project has moved. For the latest updates, please go here.

Second Axis properties overwrite first axis properties

Aug 31, 2012 at 8:22 AM
Working with the code of the examples:
chart = ws.Drawings.AddChart("xy" & zCharts.ToString, Drawing.Chart.eChartType.XYScatterLinesNoMarkers)
chart.SetPosition(100, 100)
chartType2 = chart.PlotArea.ChartTypes.Add(Drawing.Chart.eChartType.XYScatterLinesNoMarkers)

chart.SetSize(800, 400)

chart.XAxis.MinValue = 0
chart.XAxis.MaxValue = 10
chart.YAxis.MinValue = 1
chart.YAxis.MaxValue = 10000
chart.XAxis.LogBase = Nothing
chart.YAxis.LogBase = 10

chart.XAxis.CrossesAt = chart.YAxis.MinValue
chart.YAxis.CrossesAt = chart.XAxis.MinValue

chartType2.XAxis.MinValue = 0
chartType2.XAxis.MaxValue = 10
chartType2.YAxis.MinValue = -100
chartType2.YAxis.MaxValue = 100
chartType2.XAxis.LogBase = Nothing
chartType2.YAxis.LogBase = Nothing

chartType2.XAxis.CrossesAt = chartType2.YAxis.MinValue
chartType2.YAxis.CrossesAt = chartType2.XAxis.MinValue

'Add some series

chartType2.XAxis.Deleted = False
chartType2.XAxis.TickLabelPosition = Drawing.Chart.eTickLabelPosition.High

Values of charts axis are now the values of the chartType2 axis. Why?
The hidden XAxis is not shown, but the first horizontally is now on top.
When I work with only one axis(chart), in Excel2010 changing one series yaxis property to secondary, its xaxis is also now secondary, but not displayed. You can change the xaxis log property and you can see that series on the primary yaxis are rescaled, series on the secondary yaxis not.
That's a bug in Excel to not have displayed an axis where a series is calculated and displayed from.
Can anybody help me?