+ -
当前位置:首页 → 问答吧 → MSChart 大量数据显示不清该如何解决.怎样分屏显示求指教

MSChart 大量数据显示不清该如何解决.怎样分屏显示求指教

时间:2011-08-06

来源:互联网

附上代码:求各位师傅能给帮忙修改下解决这个问题,我现在晕的不知道怎么改好了.
Private Sub Command2_Click()
 On Error GoTo DealErr
MSChart1.Visible = True
Call OpenCn(a, b, c) '连接数据库
Call openRs("select 片区,sum(if (细菌总数<= 50 and 细菌总数 <> '',净重,0))/sum(if (细菌总数 <> '',净重,0))*100 as 合格率 From 质量数据 where 片区 <> ''group by 片区 order by 合格率 desc")
Set MSChart1.DataSource = rs
 With MSChart1
  .Plot.AutoLayout = False
  .Plot.LocationRect.Min.Set 0, 0
  .Plot.LocationRect.Max.Set MSChart1.Width, MSChart1.Height
  .ChartType = 1
  .Plot.Axis(VtChAxisIdY).ValueScale.Auto = True
  .Plot.Axis(VtChAxisIdY).ValueScale.Maximum = 0.6
  .Plot.Axis(VtChAxisIdY).ValueScale.Minimum = 0.3
  .Plot.Axis(VtChAxisIdY).ValueScale.MinorDivision = 0
  .ColumnCount = 1
  .Plot.Axis(VtChAxisIdX, 0).AxisTitle = "片区"
  .Plot.Axis(VtChAxisIdY, 0).AxisTitle = "合格率"
  .Plot.Axis(VtChAxisIdX, 0).AxisTitle.VtFont.Size = 50
  .Plot.Axis(VtChAxisIdY, 0).AxisTitle.VtFont.Size = 50
  .Title.Text = ""
  .ShowLegend = False
  For i = 1 To .Plot.SeriesCollection.Count
  .Plot.SeriesCollection(i).DataPoints(-1).DataPointLabel.LocationType = VtChLabelLocationTypeAbovePoint
  Next
  If rs.RecordCount > 0 Then
  rs.MoveFirst
  Else
  Exit Sub
  End If
  For i = 0 To rs.RecordCount - 1
  .RowCount = rs.RecordCount
  .Row = i + 1
  .RowLabel = rs("片区")
  .Data = rs("合格率")
  rs.MoveNext
  Next
  End With
  Exit Sub
DealErr:
  MsgBox "程序运行出错" & Err.Description
End Sub

作者: huilei_001   发布时间: 2011-08-06

两个方法,1、减少数据量;2、增加绘图区面积。随便你喜欢。

作者: icansaymyabc   发布时间: 2011-08-18

热门下载

更多