I have an Access report with several Pie charts (placed in a GroupFooter
). Access doesn't select unique colors for each slice category, which make the charts incomparable.
For example: in the first chart the slice for "Apple"
is red, in the next Chart it's blue.
Each chart consists of five categories (let's say Apple, Orange, Lemon, Strawberry, Raspberry). If one category is zero, it's not shown in the chart. To make the charts comparable, I'd like to predefine the category colors.
I tried several codes that I found in the internet, but none of them works for me. Last one I tried was:
Private Sub Report_Current()
ChartName.SeriesCollection(1).Points("Apple").Interior.Color = RGB(204, 51, 0)
ChartName.SeriesCollection(1).Points("Orange").Interior.Color = RGB(255, 117, 117)
ChartName.SeriesCollection(1).Points("Lemon").Interior.Color = RGB(197, 90, 17)
ChartName.SeriesCollection(1).Points("Strawberry").Interior.Color = RGB(244, 177, 131)
ChartName.SeriesCollection(1).Points("Raspberry").Interior.Color = RGB(255, 192, 0)
End Sub
OnLoad
function of the the form containing the graph and use numerical indexes instead of the name of the points. I.E:.Points(1).
I am getting issues referencing the Points by name on my end. Perhaps it would resolve your issue as well. - hisoka