Chart colours

H

hughess7

Hi all

Finally got my chart working the way I want it! More or less ;-)

I found this code for changing colours depending on value:

Set objDataSheet = objGraph.Application.DataSheet
Set objDataSeries = objGraph.SeriesCollection(1) 'only assuming 1 series
intCntValues = objDataSeries.Points.Count 'get the number of bars
For i = 1 To intCntValues
Select Case objDataSheet.Range("A" & i).Value 'XL style syntax
Case Is > 100
objDataSeries.Points(i).interior.Color = 225 'Red
End Select
Next i

It only affects the first bar though, do I need to repeat the same code for
each bar displayed?

Also, ideally what I would like instead is the same bar to be multi-coloured
- green below 100 and red for the section above - is this possible?

Thanks in advance for any help.
Sue
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top