请高手给我提供一个思路,关于MSChart控件的使用

yuxuan 2002-10-13 10:22:47
我用MSChart控件画统计图,可不知道如何在程序中实现?
请高手谈谈数据源的设置等等,最好能提供源码,非常感谢!
...全文
59 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
Montaque 2002-12-16
  • 打赏
  • 举报
回复
Dim Sales(,) As Object = New Object(,) _
{{"Company", "Company A", "Company B"}, _
{"June", 20, 10}, _
{"July", 10, 5}, _
{"August", 30, 15}, _
{"September", 14, 7}}
AxMSChart1.ChartData = Sales

'Add a title and legend.
With Me.AxMSChart1
.Title.Text = "Sales"
.Legend.Location.LocationType = _
MSChart20Lib.VtChLocationType.VtChLocationTypeBottom
.Legend.Location.Visible = True
End With

'Add titles to the axes.
With Me.AxMSChart1.Plot
.Axis(MSChart20Lib.VtChAxisId.VtChAxisIdX).AxisTitle.Text = "Year"
.Axis(MSChart20Lib.VtChAxisId.VtChAxisIdY).AxisTitle.Text = "Millions of $"
End With

'Set custom colors for the bars.
With Me.AxMSChart1.Plot
'Yellow for Company A
' -1 selects all the datapoints.
.SeriesCollection(1).DataPoints(-1).Brush.FillColor.Set(250, 250, 0)
'Purple for Company B
.SeriesCollection(2).DataPoints(-1).Brush.FillColor.Set(200, 50, 200)
End With
yuxuan 2002-12-16
  • 打赏
  • 举报
回复
哪位大侠能回答就结帖了,谢谢
yuxuan 2002-10-14
  • 打赏
  • 举报
回复
大虾,可以说具体点吗?谢谢
yuxuan 2002-10-13
  • 打赏
  • 举报
回复
在线等待。。。
lixigang 2002-10-13
  • 打赏
  • 举报
回复
关于mschart的帖子论坛中有很多,你可以搜索一下

16,554

社区成员

发帖
与我相关
我的任务
社区描述
VB技术相关讨论,主要为经典vb,即VB6.0
社区管理员
  • VB.NET
  • 水哥阿乐
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧