以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  图表数据乱?  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=191183)

--  作者:lin98
--  发布时间:2024/3/29 16:37:00
--  图表数据乱?

图片点击可在新窗口打开查看此主题相关图片如下:图表数据乱.png
图片点击可在新窗口打开查看


Dim b2 As New GroupTableBuilder("统计表1", DataTables("订单"))
b2.Groups.AddDef("客户") \'
b2.Groups.AddDef("产品") \'
b2.Totals.AddDef("数量") \'
b2.Totals.AddDef("金额") 

Tables("窗口2_Table1").DataSource = b2.BuildDataSource() 



Dim Chart As WinForm.Chart \'
Dim Series As WinForm.ChartSeries \'
Dim t As Table = Tables("窗口2_Table1") \'
Chart = Forms("窗口2").Controls("Chart1") \' 

Chart.VisualEffect = True \'
Chart.ChartType = ChartTypeEnum.Pie 
\'Chart.DataSource = "窗口2_Table1" \'
Chart.SeriesList.Clear() \'

For Each r As Row In t.Rows
    Series = Chart.SeriesList.Add() \'
    Series.Length = 1 \'
    Series.Text = r("产品") & "(" & r("数量") & ")" \'
    Series.Y(0) = r("数量") \'
    If r("产品") = "PD05" Then \'
        Series.Offset = 20 \'
    End If
Next
Chart.LegendVisible = True \'
Chart.LegendCompass = CompassEnum.East \'

图表数据乱?统计表没有那么多数据,图表上多出很多,如何解决?

--  作者:有点蓝
--  发布时间:2024/3/29 16:39:00
--  
Dim b2 As New GroupTableBuilder("统计表1", DataTables("订单"))
b2.Groups.AddDef("产品") \'
b2.Totals.AddDef("数量") \'
b2.Totals.AddDef("金额") 

Tables("窗口2_Table1").DataSource = b2.BuildDataSource()