以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- [求助]图表问题 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=186461) |
||||
-- 作者:dhyskyworld -- 发布时间:2023/5/5 11:42:00 -- [求助]图表问题 看了很久的帮助,也试了很多次,一直没成功 这个Excel做出来的也不是我想要的最终效果,我想实现帮助里图示多列那样的效果,把男、女分开显示 Dim Chart As WinForm.Chart Dim Series As WinForm.ChartSeries Dim t As Table = Tables("EI") Chart = e.Form.CreateControl("Chart1", ControlTypeEnum.Chart) Chart.ChartType = ChartTypeEnum.Bar Chart.SetBounds(0, 0, 600, 300) Chart.BarClusterWidth = 90 Chart.Dock = System.Windows.Forms.DockStyle.Fill e.Form.Controls("NavBar1").NavPages(2).AddControl(Chart) For Each c As Col In t.Cols If c.Name <> "性别" Then Series = Chart.SeriesList.Add() Series.Text = c.Name Series.Length = t.Rows.Count For r As Integer = 0 To t.Rows.Count - 1 Series.X(r) = r Series.Y(r) = t.Rows(r)(c.Name) Series.DataLabelText = "{#YVAL}" Series.DataLabelCompass = LabelCompassEnum.North Next End If Next For r As Integer = 0 To t.Rows.Count - 1 Chart.AxisX.SetValueLabel(r, t.Rows(r)("性别")) Next Chart.AxisX.AnnoWithLabels = True Chart.VisualEffect = True Chart.LegendVisible = True Chart.LegendCompass = CompassEnum.South 此段编码要怎么改才能实现我想要的效果
|
||||
-- 作者:有点蓝 -- 发布时间:2023/5/5 12:22:00 --
|
||||
-- 作者:dhyskyworld -- 发布时间:2023/5/5 12:29:00 -- 谢谢蓝老师的指点 |
||||
-- 作者:dhyskyworld -- 发布时间:2023/5/5 13:28:00 -- 多问一句,蓝老师,这个效果是不是不能用动态增加控件来实现,还是说使用动态控件来实现非常麻烦? |
||||
-- 作者:有点蓝 -- 发布时间:2023/5/5 13:45:00 -- 和动态不动态的没有什么关系 |