以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- 图表问题 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=186890) |
-- 作者:lin98 -- 发布时间:2023/6/6 23:05:00 -- 图表问题 Dim b As New GroupTableBuilder("统计表1", DataTables("文件清单")) b.Groups.AddDef("文件分类") \'添加客户列用于分组 \'b.HGroups.AddDef("客户") b.Groups.AddDef("编制日期", DateGroupEnum.Year, "年") \' b.Groups.AddDef("编制日期", "月份") b.Totals.AddDef("文件分类", AggregateEnum.Count, "份数") Tables("文件统计窗口_Table1").DataSource = b.BuildDataSource() Dim Chart As WinForm.Chart \' Dim Series As WinForm.ChartSeries \' Dim t As Table = Tables("文件统计窗口_Table1") \' Chart = e.Form.Controls("Chart1") \' Chart.ChartType = ChartTypeEnum.Bar \' Chart.DataSource = "文件统计窗口_Table1" \' Chart.SeriesList.Clear() \' For Each c As Col In t.Cols If c.Name <> "文件分类" Then Series = Chart.SeriesList.Add() \' Series.Text = c.Name \' Series.X.DataField = " Series.Y.DataField = c.Name \' End If Next Chart.VisualEffect = True \' Chart.LegendVisible = True \' Chart.LegendCompass = CompassEnum.South \' 执行上面的代码,图表与表的数据不符,如何解决? |
-- 作者:有点蓝 -- 发布时间:2023/6/6 23:12:00 -- http://www.foxtable.com/webhelp/topics/0968.htm |
-- 作者:lin98 -- 发布时间:2023/6/7 0:09:00 -- Dim Chart As WinForm.Chart \' Dim Series As WinForm.ChartSeries \' Dim t As Table = Tables("文件统计窗口_Table1") \' Chart = e.Form.Controls("Chart1") \' Chart.ChartType = ChartTypeEnum.Bar \' Chart.DataSource = "文件统计窗口_Table1" \' Chart.SeriesList.Clear() \' For Each c As Col In t.Cols If c.Name <> "文件分类" Then Series = Chart.SeriesList.Add() \' Series.Text = c.Name \' Series.X.DataField = "文件分类" \' Series.Y.DataField = c.Name \' Series.Y.DataField = "编制日期" \'设置Y轴的绑定列 Chart.AxisX.SetValueLabel(1, "一月份") End If Next Chart.VisualEffect = True \' Chart.LegendVisible = True \' Chart.LegendCompass = CompassEnum.South \' 没有按年月、份数(b.Totals.AddDef("文件分类", AggregateEnum.Count, "份数")显示
|
-- 作者:有点蓝 -- 发布时间:2023/6/7 8:47:00 -- 要什么效果,手工画图说明一下 |
-- 作者:lin98 -- 发布时间:2023/6/7 10:31:00 -- 此主题相关图片如下:图表显示问题.jpg |
-- 作者:有点蓝 -- 发布时间:2023/6/7 10:41:00 -- Foxtable没有这种图表 |