以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- 图表问题 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=194500) |
-- 作者:g1j2h3 -- 发布时间:2024/12/16 22:10:00 -- 图表问题 下边的统计表如何写代码,请大师指导 Dim Chart As WinForm.Chart \'定义一个图表变量 Dim Series As WinForm.ChartSeries \'定义一个图系变量 Dim t As Table = Tables("窗口3_Table1") \'定义一个变量t引用数据表 Chart = e.Form.Controls("Chart1") \' 引用窗口中的图表 Chart.ChartType = ChartTypeEnum.Bar \'图表类型改为Bar(条形) Chart.VisualEffect = False Chart.SeriesList.Clear() \'清除图表原来的图系 For r As Integer = 0 To t.Rows.count - 1 Series = Chart.SeriesList.Add() \'增加一个图系 Series.Text = t.rows(r)("年") \'设置图系的标题 Series.Length = t.Cols.Count - 1 \'设置图系的长度 For c As Integer = 1 To t.Cols.count - 1 Series.X(c - 1) = t.Rows(0)(t.Cols(c).caption) Series.Y(c - 1) = t.Rows(r)(c) \' Chart.AxisX.SetValueLabel(c - 1, t.Cols(c).caption) \'指定字符表示 Next Next Chart.AxisX.AnnoWithLabels = True \'启用字符标示 Chart.LegendVisible = True \'显示图列 Chart.LegendCompass = CompassEnum.South \'图列显示在南方(底端) |
-- 作者:g1j2h3 -- 发布时间:2024/12/16 22:13:00 -- 我想达到下边的效果,每个月的接单金额和发货金额并在一起, |
-- 作者:有点蓝 -- 发布时间:2024/12/16 22:28:00 -- …… Chart.SeriesList.Clear() \'清除图表原来的图系 dim ss() as string = {"接单金额","发货金额"} For r As Integer = 0 To ss.length - 1 Series = Chart.SeriesList.Add() \'增加一个图系 Series.Text = t.rows(0)("年") \'设置图系的标题 Series.Length = (t.Cols.Count - 1) / 2 \'设置图系的长度 dim i2 as integer = 0 For c As Integer = 1 To t.Cols.count - 1 dim kk() as string = t.Cols(c).caption.split("_") if kk(1) = ss(r) Series.X(i2) = i2 Series.Y(i2) = t.Rows(0)(t.Cols(c).name) Chart.AxisX.SetValueLabel(i2 , kk(0)) \'指定字符表示 i2 = i2 + 1 end if Next Next Chart.AxisX.AnnoWithLabels = True \'启用字符标示 ……
|
-- 作者:g1j2h3 -- 发布时间:2024/12/17 7:24:00 -- 感谢蓝老师! |