VB用mschart画折线图
答案:2 悬赏:80 手机版
解决时间 2021-01-28 04:41
- 提问者网友:浩歌待明月
- 2021-01-27 13:53
已知一个二维数组,现在以其中一列为横坐标,一列为纵坐标画折线图,没分了,求大神指导
最佳答案
- 五星知识达人网友:风格不统一
- 2021-01-27 14:08
Dim i As Integer
Dim Values(1 To 10, 1 To 10) As Single
For i = 1 To 10
Randomize
Values(i, i) = Int((100 * Rnd) + 1)
Next i
' Send the data to the chart.
Chart1.chartType = VtChChartType2dXY
Chart1.RowCount = 10
Chart1.ColumnCount = 10
Chart1.ChartData = Values
Dim Values(1 To 10, 1 To 10) As Single
For i = 1 To 10
Randomize
Values(i, i) = Int((100 * Rnd) + 1)
Next i
' Send the data to the chart.
Chart1.chartType = VtChChartType2dXY
Chart1.RowCount = 10
Chart1.ColumnCount = 10
Chart1.ChartData = Values
全部回答
- 1楼网友:低血压的长颈鹿
- 2021-01-27 14:49
首先:
imports system.windows.forms.datavisualization.charting
然后定义图表类型为折线图:
chart1.series("series1").charttype = seriescharttype.line;
最后使用1-99之间的随机数生成图表:
dim random as new random()
dim index as integer
for index = 0 to 9
chart1.series("series1").points.addy(random.next(1, 99))
next index
希望对你有帮助,还有疑问请追问或是hi
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯