datavisualization charting functions

bones

Well-known member
Joined
Aug 23, 2014
Messages
143
Programming Experience
Beginner
VB.NET:
Select Case True
                Case RBtnPort1.Checked = True
                    Chart1.Series(0).ChartType = DataVisualization.Charting.SeriesChartType.Spline
                    Chart1.Series(0).Points.Clear()
                    For Count As Integer = 0 To DataGridView1.Rows.Count - 2
                        Chart1.Series(0).Points.AddXY(DataGridView1.Item(0, Count).Value, DataGridView1.Item(2, Count).Value)
                    Next
            End Select
            Select Case True
                Case RBtnPort2.Checked = True
                    Chart1.Series(1).ChartType = DataVisualization.Charting.SeriesChartType.Spline
                    Chart1.Series(1).Points.Clear()
                    For Count As Integer = 0 To DataGridView1.Rows.Count - 2
                        Chart1.Series(1).Points.AddY(DataGridView1.Item(2, Count).Value)
                         Next

Currently I'm calling the chart type as Spline. I would like to make chart type an option selected from a combobox containing several chart types. I see a potential problem as there are actually 6 series that get charted.

a] can I declare the chart type globally for this sub instead doing it for each series individually? How would I go about it ?

b] if it is possible, then does my concept of the selectable chart type list make sense?
 

Latest posts

Back
Top