mschart画散点图.docx_第1页
mschart画散点图.docx_第2页
mschart画散点图.docx_第3页
mschart画散点图.docx_第4页
mschart画散点图.docx_第5页
免费预览已结束,剩余1页可下载查看

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

Private Sub Form_Load()Dim MyData(20, 1) As Double -x轴坐标值-Y轴坐标值- MyData(0, 0) = 0: MyData(0, 1) = 180 本句代表了:第一点数据的X轴坐标为0,Y轴坐标为180 MyData(1, 0) = 6: MyData(1, 1) = 60 MyData(2, 0) = 8: MyData(2, 1) = 60 MyData(3, 0) = 11: MyData(3, 1) = 0 MyData(4, 0) = 16: MyData(4, 1) = 0 MyData(5, 0) = 19: MyData(5, 1) = 60 MyData(6, 0) = 25.8: MyData(6, 1) = 60 MyData(7, 0) = 28.8: MyData(7, 1) = 0 MyData(8, 0) = 31.8: MyData(8, 1) = 60 MyData(9, 0) = 40.3: MyData(9, 1) = 60 MyData(10, 0) = 43.3: MyData(10, 1) = 0 MyData(11, 0) = 93.3: MyData(11, 1) = 0 MyData(12, 0) = 96.3: MyData(12, 1) = 60 MyData(13, 0) = 99.3: MyData(13, 1) = 0 MyData(14, 0) = 105.3: MyData(14, 1) = 0 MyData(15, 0) = 135.3: MyData(15, 1) = 0 MyData(16, 0) = 144.3: MyData(16, 1) = 180 MyData(17, 0) = 148.8: MyData(17, 1) = 270 MyData(18, 0) = 405.03: MyData(18, 1) = 270 MyData(19, 0) = 409.53: MyData(19, 1) = 180 MyData(20, 0) = 564.17: MyData(20, 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.Maximum = 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轴主要网格数量 .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 = VtPenStyleDotted MSChart1.Plot.AutoLayout = False MSChart1.Plot.UniformAxis = False MSChart1.chartType = VtChChartType2dXY 设置图形为二维散点图 MSChart1.ChartData = MyData 数据End WithEnd Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Me.AxMSChart1.chartType = MSChart20Lib.VtChChartType.VtChChartType2dLine Me.AxMSChart1.ChartData = x Dim i As Integer For i = 1 To Me.AxMSChart1.RowCount If i Mod 3 = 0 Then AxMSChart1.Row = i AxMSChart1.RowLabel = 第 + i.ToString + 周 Else AxMSChart1.Row = i AxMSChart1.RowLabel = End If Next Dim currentaxis As MSChart20Lib.Axis Dim currentlabel As MSChart20Lib.Label get a reference to the y axis currentaxis = AxMSChart1.Plot.Axis(MSChart20Lib.VtChAxisId.VtChAxisIdY) Debug.WriteLine(currentaxis.AxisTitle) loop through and set the font of each label For Each currentlabel In currentaxis.Labels currentlabel.VtFont.Name = Courier currentlabel.VtFont.Size = 16 Next currentlabel For i = 1 To 2 AxMSChart1.Plot.SeriesCollection(i).LegendText = Y & i Next i AxMSChart1.Plot.SeriesCollection(1).Pen.Width = 30 AxMSChart1.Plot.SeriesCollection(1).Pen.Style = MSChart20Lib.VtPenStyle.VtPenStyleSolid AxMSChart1.Plot.AutoLayout = False AxMSChart1.Plot.UniformAxis = False AxMSChart1.Plot.Axis(MSChart20Lib.VtChAxisId.VtChAxisIdY).ValueScale.Auto = False AxMSChart1.Plot.Axis(MSChart20Lib.VtChAxisId.VtChAxisIdY).ValueScale.Minimum = 0 AxMSChart1.Plot.Axis(MSChart20Lib.VtChAxisId.VtChAxisIdY).ValueScale.Maximum = 1000 AxMSChart

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论