试试
Dim Chart1 As WinForm.Chart
Dim Series1 As WinForm.ChartSeries
Dim t1 As Table = Tables("库存")
Chart1= Forms("查看库存").Controls("Chart2")
Chart1.ChartType = ChartTypeEnum.Bar' 引用窗口中的图表
Chart1.SeriesList.Clear()
Chart1.AxisX.ClearValueLabel
Series1 = Chart1.SeriesList.Add()
Series1.Length = t1.Rows.Count
For i As Integer = 0 To t1.Rows.Count - 1
Series1.X(i) = i
Series1.Y(i) = t1.Rows(i)("库存")
Chart1.AxisX.SetValueLabel(i, t1.Rows(i)("球拍型号"))
Next
Chart1.AxisX.AnnoWithLabels = True