收藏 分享(赏)

mschart画散点图.docx

上传人:dcjskn 文档编号:8140515 上传时间:2019-06-10 格式:DOCX 页数:6 大小:16.09KB
下载 相关 举报
mschart画散点图.docx_第1页
第1页 / 共6页
mschart画散点图.docx_第2页
第2页 / 共6页
mschart画散点图.docx_第3页
第3页 / 共6页
mschart画散点图.docx_第4页
第4页 / 共6页
mschart画散点图.docx_第5页
第5页 / 共6页
点击查看更多>>
资源描述

1、Private Sub Form_Load()Dim MyData(20, 1) As Double-x 轴坐标值-Y 轴坐标值-MyData(0, 0) = 0: MyData(0, 1) = 180 本句代表了:第一点数据的X 轴坐标为 0,Y 轴坐标为 180MyData(1, 0) = 6: MyData(1, 1) = 60MyData(2, 0) = 8: MyData(2, 1) = 60MyData(3, 0) = 11: MyData(3, 1) = 0MyData(4, 0) = 16: MyData(4, 1) = 0MyData(5, 0) = 19: MyData(5

2、, 1) = 60MyData(6, 0) = 25.8: MyData(6, 1) = 60MyData(7, 0) = 28.8: MyData(7, 1) = 0MyData(8, 0) = 31.8: MyData(8, 1) = 60MyData(9, 0) = 40.3: MyData(9, 1) = 60MyData(10, 0) = 43.3: MyData(10, 1) = 0MyData(11, 0) = 93.3: MyData(11, 1) = 0MyData(12, 0) = 96.3: MyData(12, 1) = 60MyData(13, 0) = 99.3:

3、MyData(13, 1) = 0MyData(14, 0) = 105.3: MyData(14, 1) = 0MyData(15, 0) = 135.3: MyData(15, 1) = 0MyData(16, 0) = 144.3: MyData(16, 1) = 180MyData(17, 0) = 148.8: MyData(17, 1) = 270MyData(18, 0) = 405.03: MyData(18, 1) = 270MyData(19, 0) = 409.53: MyData(19, 1) = 180MyData(20, 0) = 564.17: MyData(20

4、, 1) = 180波形图外观设置With MSChart1.TitleText = “速度 m/min“ 设置图线的外观.Plot.SeriesCollection(1).Pen.Width = 30.Plot.SeriesCollection(1).Pen.Style = VtPenStyleSolid 设置 XY 轴.Plot.Axis(VtChAxisIdX).ValueScale.Auto = False.Plot.Axis(VtChAxisIdY).ValueScale.Auto = False/ 设置最大值.Plot.Axis(VtChAxisIdX).ValueScale.Ma

5、ximum = 600 设置横轴标注最大值.Plot.Axis(VtChAxisIdY).ValueScale.Maximum = 300 设置纵轴标注最大值/ 设置最小值.Plot.Axis(VtChAxisIdY).ValueScale.Minimum = 0.Plot.Axis(VtChAxisIdX).ValueScale.Minimum = 0/.Plot.Axis(VtChAxisIdX).ValueScale.MajorDivision = 6 X 轴主要网格数量.Plot.Axis(VtChAxisIdY).ValueScale.MajorDivision = 6 Y 轴主要网

6、格数量.Plot.Axis(VtChAxisIdX).ValueScale.MinorDivision = 0 X 轴次要网格数量.Plot.Axis(VtChAxisIdY).ValueScale.MinorDivision = 0 Y 轴次要网格数量.Plot.Axis(VtChAxisIdX).AxisGrid.MajorPen.Style = VtPenStyleDotted.Plot.Axis(VtChAxisIdY).AxisGrid.MajorPen.Style = VtPenStyleDottedMSChart1.Plot.AutoLayout = FalseMSChart1.

7、Plot.UniformAxis = FalseMSChart1.chartType = VtChChartType2dXY 设置图形为二维散点图MSChart1.ChartData = MyData 数据End WithEnd SubPrivate Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.ClickMe.AxMSChart1.chartType = MSChart20Lib.VtChChartType.VtChChartType2dLineMe.

8、AxMSChart1.ChartData = xDim i As IntegerFor i = 1 To Me.AxMSChart1.RowCountIf i Mod 3 = 0 ThenAxMSChart1.Row = iAxMSChart1.RowLabel = “第“ + i.ToString + “周“ElseAxMSChart1.Row = iAxMSChart1.RowLabel = “End IfNextDim currentaxis As MSChart20Lib.AxisDim currentlabel As MSChart20Lib.Label get a referenc

9、e to the y axiscurrentaxis = AxMSChart1.Plot.Axis(MSChart20Lib.VtChAxisId.VtChAxisIdY)Debug.WriteLine(currentaxis.AxisTitle) loop through and set the font of each labelFor Each currentlabel In currentaxis.Labelscurrentlabel.VtFont.Name = “Courier“currentlabel.VtFont.Size = 16Next currentlabelFor i =

10、 1 To 2AxMSChart1.Plot.SeriesCollection(i).LegendText = “Y“ & iNext iAxMSChart1.Plot.SeriesCollection(1).Pen.Width = 30AxMSChart1.Plot.SeriesCollection(1).Pen.Style = MSChart20Lib.VtPenStyle.VtPenStyleSolidAxMSChart1.Plot.AutoLayout = FalseAxMSChart1.Plot.UniformAxis = FalseAxMSChart1.Plot.Axis(MSCh

11、art20Lib.VtChAxisId.VtChAxisIdY).ValueScale.Auto = FalseAxMSChart1.Plot.Axis(MSChart20Lib.VtChAxisId.VtChAxisIdY).ValueScale.Minimum = 0AxMSChart1.Plot.Axis(MSChart20Lib.VtChAxisId.VtChAxisIdY).ValueScale.Maximum = 1000AxMSChart1.Plot.Axis(MSChart20Lib.VtChAxisId.VtChAxisIdY).ValueScale.MajorDivision = 5AxMSChart1.Plot.Axis(MSChart20Lib.VtChAxisId.VtChAxisIdY).ValueScale.MinorDivision = 1End Sub

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 医学治疗 > 基础医学

本站链接:文库   一言   我酷   合作


客服QQ:2549714901微博号:道客多多官方知乎号:道客多多

经营许可证编号: 粤ICP备2021046453号世界地图

道客多多©版权所有2020-2025营业执照举报