• Hello and welcome to our new forums. We upgraded our forum sites to a more robust and modern system which we hope you will enjoy. Be sure to check out your profile by clicking the button on the top right and configure your preferences, signature, time zone, avatar, etc. as you wish. If you need help with using this new forum'ware try the help link on the bottom right.

    Click here to review your account now.

datavisualization charting functions

bones

Well-known member
Joined
Aug 23, 2014
Messages
143
Programming Experience
Beginner
Code:
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?
 
Top Bottom