Quantcast
Channel: Visual Studio General Questions forum
Viewing all articles
Browse latest Browse all 21115

vb 2012 chart axis Y2 doesn't show

$
0
0

The following code displays data just fine, but I want an additional y axis to be shown on the right hand side.  It doesn't show.

        ChartInvestment.ChartAreas(0).AxisY.IntervalAutoMode = IntervalAutoMode.VariableCount
        ChartInvestment.ChartAreas(0).AxisY2.IntervalAutoMode = IntervalAutoMode.VariableCount
        ChartInvestment.ChartAreas(0).AxisY.Minimum = Int(y_lower_bound)
        ChartInvestment.ChartAreas(0).AxisY.Maximum = Int(y_upper_bound)
        ChartInvestment.ChartAreas(0).AxisY2.Minimum = Int(y_lower_bound)
        ChartInvestment.ChartAreas(0).AxisY2.Maximum = Int(y_upper_bound)
        If RadioButtonValue.Checked = True Then
            ChartInvestment.ChartAreas(0).AxisY.LabelStyle.Format = "$###,###"
            ChartInvestment.ChartAreas(0).AxisY2.LabelStyle.Format = "$###,###"
        ElseIf RadioButtonPrice.Checked = True Then
            ChartInvestment.ChartAreas(0).AxisY.LabelStyle.Format = "$###,###.00"
            ChartInvestment.ChartAreas(0).AxisY2.LabelStyle.Format = "$###,###.00"
        Else
            ChartInvestment.ChartAreas(0).AxisY.LabelStyle.Format = "$###,###.00"
            ChartInvestment.ChartAreas(0).AxisY2.LabelStyle.Format = "$###,###.00"
        End If
        series_name = Investments.TextBoxSelectedAccountNumber.Text
        ChartInvestment.ChartAreas(0).AxisX.IntervalAutoMode = IntervalAutoMode.VariableCount
        ChartInvestment.ChartAreas(0).AxisX.MajorGrid.Interval = 2
        ChartInvestment.ChartAreas(0).AxisX.LabelStyle.Format = "m/dd/yy"
        ChartInvestment.Series(0).Name = series_name
        For i = 0 To count - 1
            ChartInvestment.Series(series_name).Points.AddXY(x_values(i), y_values(i))
        Next
        ChartInvestment.Series(series_name).ChartType = SeriesChartType.Line

How can I get the secondary Y axis (Y2) to show?


RONATMOODYLAKE


Viewing all articles
Browse latest Browse all 21115

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>