Foxtable(狐表)用户栏目专家坐堂 → [求助]数据雷达图


  共有1613人关注过本帖树形打印复制链接

主题:[求助]数据雷达图

帅哥哟,离线,有人找我吗?
sunion
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:童狐 帖子:241 积分:2569 威望:0 精华:0 注册:2018/1/11 14:52:00
[求助]数据雷达图  发帖心情 Post By:2019/6/30 10:41:00 [只看该作者]

各位大神、各位老师,由下面一个表A,按要求做了雷达图,现在遇到的问题是:如何绑定数值列呢?请大家指教啊!感谢不尽!!!


图片点击可在新窗口打开查看此主题相关图片如下:微信图片_20190630103851.png
图片点击可在新窗口打开查看

图片点击可在新窗口打开查看此主题相关图片如下:微信图片_20190630103833.png
图片点击可在新窗口打开查看

图片点击可在新窗口打开查看此主题相关图片如下:微信图片_20190630110119.png
图片点击可在新窗口打开查看


具体代码如下
'初始化图表
Dim c1Chart1 = Forms("窗口1").Controls("Chart1").BaseControl
c1Chart1.ChartGroups(0).ChartType = C1.Win.C1Chart.Chart2DTypeEnum.Radar
c1Chart1.BackColor = Color.White

' Setup the header and footer
c1Chart1.Header.Style.Font = New Font("Microsoft Sans Serif", 9, FontStyle.Bold)
c1Chart1.Header.Text = "Employment Candidate Review"
c1Chart1.Footer.Visible = False

' Setup the legend
c1Chart1.Legend.Compass = C1.Win.C1Chart.CompassEnum.South
c1Chart1.Legend.Orientation = C1.Win.C1Chart.LegendOrientationEnum.Horizontal
c1Chart1.Legend.Visible = True

' Setup the Axis X
Dim ax As C1.Win.C1Chart.Axis = c1Chart1.ChartArea.AxisX
ax.Font = New Font("Arial", 8)
ax.Thickness = 2
ax.AnnoMethod = C1.Win.C1Chart.AnnotationMethodEnum.ValueLabels
ax.GridMajor.Color = Color.DarkGray
ax.GridMajor.Pattern = C1.Win.C1Chart.LinePatternEnum.Solid
ax.GridMajor.Thickness = 2
ax.GridMajor.Visible = True
 
' Setup the value labels
Dim vlbl As C1.Win.C1Chart.ValueLabel = ax.ValueLabels.AddNewLabel()
vlbl.NumericValue = 1
vlbl.Text = "A商品"
vlbl = ax.ValueLabels.AddNewLabel()
vlbl.NumericValue = 2
vlbl.Text = "B商品"

vlbl = ax.ValueLabels.AddNewLabel()
vlbl.NumericValue = 3
vlbl.Text = "C商品"

vlbl = ax.ValueLabels.AddNewLabel()
vlbl.NumericValue = 4
vlbl.Text = "D商品"

vlbl = ax.ValueLabels.AddNewLabel()
vlbl.NumericValue = 5
vlbl.Text = "E商品"

' Setup the Axis Y
Dim ay As C1.Win.C1Chart.Axis = c1Chart1.ChartArea.AxisY
ay.Min = 0
ay.Max = 50
ay.UnitMinor = 0
ay.UnitMajor = 10
ay.Compass = C1.Win.C1Chart.CompassEnum.North
c1Chart1.UseAntiAliasedGraphics = True

'输入具体数据生成图表
c1Chart1.ChartGroups(0).ChartType = C1.Win.C1Chart.Chart2DTypeEnum.Radar
Dim series As C1.Win.C1Chart.ChartDataSeriesCollection = c1Chart1.ChartGroups(0).ChartData.SeriesList
series.RemoveAll()
' Fill the X array
Dim x As Integer() = CType(Array.CreateInstance(Gettype(Integer), 6), Integer())
Dim i As Integer
For i = 0 To x.Length - 1
   x(i) = i + 1
Next i

' Add one series
Dim s As C1.Win.C1Chart.ChartDataSeries = series.AddNewSeries()
s.LineStyle.Color = Color.SeaGreen
s.LineStyle.Thickness = 2
s.LineStyle.Pattern = C1.Win.C1Chart.LinePatternEnum.Solid
s.SymbolStyle.Color = Color.FromArgb(90, Color.Lime)
s.SymbolStyle.Shape = C1.Win.C1Chart.SymbolShapeEnum.Tri
s.SymbolStyle.Size = 6
s.Label = "Michael Johnson"
s.Display = C1.Win.C1Chart.SeriesDisplayEnum.Show

Dim y() As Integer = {10, 8, 23, 4, 18}   '问题:如何自动绑定A表中的数值列?????数组?

s.X.CopyDataIn(x)
s.Y.CopyDataIn(y)
[此贴子已经被作者于2019/6/30 11:50:06编辑过]

 回到顶部
帅哥哟,离线,有人找我吗?
有点甜
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2019/6/30 11:54:00 [只看该作者]

1、翻转

 

c1Chart1.ChartArea.AxisY.Reversed = True '翻转Y轴

 

2、参考

 

http://foxtable.com/bbs/dispbbs.asp?BoardID=2&ID=83047&skin=0

 


 回到顶部