你好
目的是按给定的时间段和 NumericComboBox1里填入的数字(数字代表前几位,比如5则显示出现次数最多的前5位设备的信息)生成图表。怎么写前几位代码?
Dim mc As WinForm.NumericComboBox = e.Form.Controls("NumericComboBox1")
Dim Chart As WinForm.Chart
Dim Series As WinForm.ChartSeries
Dim t As DataTable = DataTables("设备维修单")
Dim pds As List(of String) = t.SQLGetValues("设备编号","[日期] > = '" & sqrq.value & " ' And [日期] < = ' " & zzrq.value & "'")
Dim sm As Integer = t.SQLCompute("Count(设备编号)","[日期] > = '" & sqrq.value & " ' And [日期] < = ' " & zzrq.value & "'")
Chart= e.Form.Controls("Chart1")
Chart.SeriesList.Clear()
Chart.AxisX.ClearValueLabel
Chart.VisualEffect = True
Chart.ChartType = ChartTypeEnum.Pie
For i As Integer = 0 To pds.Count - 1
Series = Chart.SeriesList.Add()
Series.Length = 1
Dim pdt = val(t.SQLCompute("Count(设备编号)", "设备编号 = '" & pds(i) & "' and [日期] > = '" & sqrq.value & " ' And [日期] < = ' " & zzrq.value & "'"))
Series.Text = pds(i) & "(" & pdt & ")"
Series.Y(0) = pdt
Series.DataLabelText = Math.Round(pdt * 100 / sm,1) & "%"
Next