Hi all,
Hope someone can assist with this query :-
I've a chart control on a windows form & am using the following code to populate it :-
The data to populate the chart is supplied by the user & then the above code is actioned from a button click event.Code:' Create a data series Dim series1 As New Series() Dim series2 As New Series() Dim series3 As New Series() ' Add data points to the first series series1.Points.Add(L_Data_1) series2.Points.Add(L_Data_2) series3.Points.Add(L_Data_3) ' Add series to the chart Chart.Series.Add(series1) Chart.Series.Add(series2) Chart.Series.Add(series3) ' Charting the main results Graph Chart.Series(1)("DrawingStyle") = "Wedge" Chart.Series(1).Color = Color.Green Chart.Series(1).Font = New Font("Microsoft Sans Serif", 12, FontStyle.Bold) Chart.Series(1).Label = L_Data_1 Chart.Series(2)("DrawingStyle") = "Wedge" Chart.Series(2).Color = Color.Yellow Chart.Series(2).Font = New Font("Microsoft Sans Serif", 12, FontStyle.Bold) Chart.Series(2).Label = L_Data_3 Chart.Series(3)("DrawingStyle") = "Wedge" Chart.Series(3).Color = Color.Red Chart.Series(3).Font = New Font("Microsoft Sans Serif", 12, FontStyle.Bold) Chart.Series(3).Label = L_Data_3
I am looking for the user to be able to change the data that is inputted & re-run the graph, so my question is - how do I create a new instance of the chart each time the button is clicked ?
Many thanks for any pointers.
Ciao
Charlie




Reply With Quote