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
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
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28