标题:MSChart控件不显示轴标题
只看楼主
wcb8302
Rank: 1
等 级:新手上路
帖 子:32
专家分:0
注 册:2012-12-17
结帖率:88.89%
 问题点数:0 回复次数:1 
MSChart控件不显示轴标题
为什么我的MSChart控件不显示2个轴的标题及日期数据呢?代码如下,求大家解答,老半天也没有解决,感谢!
数据表字段:日期,合计
Private Sub Command1_Click()
  Adodc1.RecordSource = "select * from out"
  Adodc1.Refresh
  Set MSChart1.DataSource = Adodc1
  With MSChart1
    .chartType = VtChChartType2dLine
    .Plot.Axis(VtChAxisIdY).ValueScale.Auto = False
    .Plot.Axis(VtChAxisIdY).ValueScale.Maximum = 1000
    .Plot.Axis(VtChAxisIdY).ValueScale.Minimum = 0
    .Plot.Axis(VtChAxisIdY).ValueScale.MinorDivision = 1
    .Plot.Axis(VtChAxisIdY).ValueScale.MajorDivision = 5
    .ColumnCount = 1
    .Plot.Axis(VtChAxisIdX, 0).AxisTitle.Text = "日期"
    .Plot.Axis(VtChAxisIdY, 0).AxisTitle.Text = "合计"
    .Plot.Axis(VtChAxisIdX, 0).AxisTitle.VtFont.Size = 50
    .Plot.Axis(VtChAxisIdY, 0).AxisTitle.VtFont.Size = 50
    .Title.Text = "每日支出折线图"
    .ShowLegend = True
    Dim i As Integer
    For i = 1 To .Plot.SeriesCollection.Count
      .Plot.SeriesCollection(i).DataPoints(-1).DataPointLabel.LocationType = VtChLabelLocationTypeAbovePoint
    Next
    If Adodc1.Recordset.RecordCount > 0 Then
      Adodc1.Recordset.MoveFirst
    Else
      Exit Sub
    End If
    For i = 0 To Adodc1.Recordset.RecordCount - 1
      .Column = 1
      .RowCount = Adodc1.Recordset.RecordCount
      .Row = i + 1
      .RowLabel = CStr(Adodc1.Recordset.Fields("日期"))
      .Data = Adodc1.Recordset.Fields("合计")
      .ColumnLabel = "每日支出合计"
      Adodc1.Recordset.MoveNext
    Next
  End With
  
End Sub

搜索更多相关主题的帖子: False 数据表 
2013-01-16 16:12
wcb8302
Rank: 1
等 级:新手上路
帖 子:32
专家分:0
注 册:2012-12-17
得分:0 
此问题本人已解决,忽然想到了属性,通过右击MSChart--属性,在里面设置了一下,就好了!
2013-01-16 17:51



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-396780-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 1.425107 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved