Dear all,
I have a chart with 4 series bounded to it.
The names of the series are got from a specific string column of the datatable which is bound to the chart through a selection in a databox. Here below the code that is loading data to the chart for the first series (the other three are the same):
The problem here is that for the first series the chart shows on X axis the name of the series (so the corresponding selected value of the column Nome_Cognome, while this is not happening for the other 3 series.Code:Private Sub Cmb1_SelectedValueChanged(sender As Object, e As EventArgs) Handles Cmb1.SelectedValueChanged ConfrontoDataTable1.Columns("Nome_Cognome").Expression = "Nome + ' ' + Cognome" If IsNothing(Cmb1.SelectedValue) Then Me.Label17.Text = "-" Me.Label16.Text = "-" Me.Label15.Text = "-" Me.Label14.Text = "-" Me.Label13.Text = "-" Me.Label12.Text = "-" Else Me.Label17.Text = CDec(CType(Cmb1.SelectedItem, DataRowView)("Media_1")) Me.Label16.Text = CStr(CType(Cmb1.SelectedItem, DataRowView)("Media_2")) Me.Label15.Text = CStr(CType(Cmb1.SelectedItem, DataRowView)("Media_3")) Me.Label14.Text = CStr(CType(Cmb1.SelectedItem, DataRowView)("Media_4")) Me.Label13.Text = CStr(CType(Cmb1.SelectedItem, DataRowView)("Media_5")) Me.Label12.Text = CStr(CType(Cmb1.SelectedItem, DataRowView)("Media_6")) Dim selectedRow1() As DataRow = ConfrontoDataTable1.Select(String.Format("Codice_pers= '{0}'", Me.Cmb1.SelectedValue)) For Each dr As DataRow In selectedRow1 Me.Chrt1.Series("Series1").Points.AddXY(dr("Nome_Cognome"), dr("Media_1"))
I'm not sure whether I'm doing something wrong with the code and/or I'm missing any kind of specific configuration in the chart series and/or I should add something to the code.
Anybody who has any suggestion or has experienced anything similar in the past?
Thanks,
A.




Reply With Quote
