Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 3
Default fixing pie chart colors depending upon value ?

This is really about using an excel chart inside an access report but nobody
in microsoft.access.reports seems to know the answer.

Using a grouped field in a database I end up with two values per record
showing the number of 'goods' and the number of 'bads' The pie chart plots
these two numbers. I want the 'good' slice always to be green and the 'bad'
slice always to be red.

Setting the format worked OK until I had 7 goods and zero bads, then the
whole chart was red instead of green.

Any idea how I can fix this?

Howard



  #2   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 6,582
Default fixing pie chart colors depending upon value ?

The technique described in this blog post will work on any chart type that
uses a fill color:

http://peltiertech.com/WordPress/200...ategory-label/

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______


"Howard" wrote in message
...
This is really about using an excel chart inside an access report but
nobody in microsoft.access.reports seems to know the answer.

Using a grouped field in a database I end up with two values per record
showing the number of 'goods' and the number of 'bads' The pie chart plots
these two numbers. I want the 'good' slice always to be green and the
'bad' slice always to be red.

Setting the format worked OK until I had 7 goods and zero bads, then the
whole chart was red instead of green.

Any idea how I can fix this?

Howard





  #3   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 3
Default fixing pie chart colors depending upon value ?

Thanks, That didn't quite do it but it pointed me in the right direction. In
case anyone else wants to know how to do it this code finally worked.

Private Sub GroupHeader2_Format(Cancel As Integer, FormatCount As Integer)

Dim v As Variant

v = Me.chart1.SeriesCollection(1).Points.Item(1).DataL abel.Text
If UCase(Left(v, 1)) = "B" Then 'label starts with B - the bad slice, make
it red
Me.chart1.SeriesCollection(1).Points.Item(1).Inter ior.Color = RGB(255, 0,
0)
Else 'the good slice, make it green
Me.chart1.SeriesCollection(1).Points.Item(1).Inter ior.Color = RGB(0, 255,
0)
End If

End Sub


"Jon Peltier" wrote in message
...
The technique described in this blog post will work on any chart type that
uses a fill color:

http://peltiertech.com/WordPress/200...ategory-label/

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______


"Howard" wrote in message
...
This is really about using an excel chart inside an access report but
nobody in microsoft.access.reports seems to know the answer.

Using a grouped field in a database I end up with two values per record
showing the number of 'goods' and the number of 'bads' The pie chart
plots these two numbers. I want the 'good' slice always to be green and
the 'bad' slice always to be red.

Setting the format worked OK until I had 7 goods and zero bads, then the
whole chart was red instead of green.

Any idea how I can fix this?

Howard







Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Reset the colors in a chart JanHDon Charts and Charting in Excel 2 August 20th 08 05:38 PM
Create a chart depending on different criteria enna49 Charts and Charting in Excel 0 February 20th 08 10:47 PM
static colors in chart chart Johan Charts and Charting in Excel 1 September 22nd 05 01:01 PM
fixing a maximum chart value Cenk Ursavas via OfficeKB.com Charts and Charting in Excel 0 May 10th 05 06:06 PM
How to get excel cells to change colors depending on value KV Excel Worksheet Functions 2 November 25th 04 09:50 AM


All times are GMT +1. The time now is 02:52 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"