Dim Chart As WinForm.Chart
Dim Series As WinForm.ChartSeries
Dim t As DataTable = DataTables("订单")
Dim pds() As String = t.GetValues("产品")
'Dim qq() As Single = = val(t.Compute("Sum(" & pds & ")", "产品 is not null"))
Dim sm As Integer = t.Compute("Sum(数量)")
Chart= Forms("窗口1").Controls("Chart1")
Chart.SeriesList.Clear()
Chart.VisualEffect = True
Chart.ChartType = ChartTypeEnum.Pie
For i As Integer = 0 To pds.length -1
Series = Chart.SeriesList.Add()
Series.Length = 1
Dim sum = val(t.Compute("Sum(" & pds(i) & ")", "产品 is not null"))
Series.Text = pds(i) & "(" & sum & ")"
Series.Y(0) = sum
Series.DataLabelText = Math.Round(sum * 100 / sm,1) & "%"
Next
Chart.LegendVisible = True
Chart.LegendCompass= CompassEnum.South