Link to home
Start Free TrialLog in
Avatar of ajmilesno1
ajmilesno1

asked on

Changing Row Color in MSChart Controls?!

hey, the title says it all.

I can change the "series" colour, which is technically the column, but is there any way of changing an individual row colour? i.e. 5 columns, 2 rows... and all 10 bars different colours??

thanks very much,

Adam Miles
Avatar of lbertacco
lbertacco

Yes, the following example assumes you have one chart inside your worksheet (not a separate sheet) and set color 3 (red) to the third point of every serires.

Public Sub ChangeRowCol()
    Dim s As Series
    For Each s In ChartObjects(1).Chart.SeriesCollection
        s.Points(3).Interior.ColorIndex = 3
    Next s
End Sub

Avatar of ajmilesno1

ASKER

ermm i have to admit to not knowing how to implement your answer.

I am using vb and have a chart called "timechart", and it was 1 column, 5 rows. I want each of the five rows to be different colours. However the properties of a such a chart only allow you to change the colour of each series/column, and all bars within that series/column appear to have to be the same colour.

If this is what your code does then great, but I'm not quite sure how it works.

thanks,

Adam
ASKER CERTIFIED SOLUTION
Avatar of lbertacco
lbertacco

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial