如何解决在 MS Access 365 上循环 MS Modern Chart 的 ChartSeriesCollection
在旧的 MS Chart
上,我曾经能够使用以下代码更改系列集合的 Point Interior 颜色。
Private Sub Form_Load()
Dim j As Integer
Dim i As Integer
With Me.oldGraph
For j = 1 To .SeriesCollection(1).Points.Count
.SeriesCollection(1).Points(j).Interior.Color = 65280
.SeriesCollection(2).Points(j).Interior.Color = 10053222
If CDbl(.SeriesCollection(1).Points(j).DataLabel.Text) > CDbl(.SeriesCollection(2).Points(j).DataLabel.Text) Then
.SeriesCollection(1).Points(j).Interior.Color = RGB(250,0)
Else
.SeriesCollection(1).Points(j).Interior.Color = 65280
End If
Next j
Me.oldGraph.Requery
End With
End Sub
结果是这样的:
但是在新的 MS Modern Chart
上,.Points
和 .DataLabel
方法似乎不存在。有人遇到过他们还是他们变成了别的东西?
我想根据 FillColor
更改 ChartSeriesCollection
的 DataLabel
。
我正在为 If CDbl(.SeriesCollection(1).Points(j).DataLabel.Text) > CDbl(.SeriesCollection(2).Points(j).DataLabel.Text)
寻找等效的 Modern Chart
。
这是我目前拥有的 Modern Chart
代码。
With Me.modernGraph
.RowSource = "qryDonationAndAllocation"
.ChartAxis = "[DonorArea]"
.ChartValues = "[Allocation];[Donation]"
.ChartSeriesCollection.Item("Allocation").FillColor = RGB(0,255,0)
.ChartSeriesCollection.Item("Allocation").BorderColor = RGB(0,0)
.ChartSeriesCollection.Item("Donation").FillColor = RGB(128,128)
.ChartSeriesCollection.Item("Donation").BorderColor = RGB(0,0)
.ChartSeriesCollection.Item("Allocation").displayDataLabel = True
.ChartSeriesCollection.Item("Donation").displayDataLabel = True
.PrimaryValuesAxisFormat = "£0,000.00"
End With
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。