Page 1 of 2 12 LastLast
Results 1 to 15 of 17
  1. #1
    Gab Franken is offline Novice
    Windows XP Access 2003
    Join Date
    May 2013
    Posts
    9

    Question determine color in graph in Access report

    Hi you all, thanx all of you in advance for your time helping me out.



    I made an Access database for monitoring the projets running in my department. For your info, I am using Access 2003 (sorry, that's what the boss supplies).

    For representing status of the progress of these projects to management, I made a report with two graphs: one piechart and one with columns, both representing same figures: status of projects.

    That all went well, but unfortunately one of the staff-members is color-blind and therefore has some demands on the colors used. Normally I would adjust the colors in Visual Basic using the RGB color-coding, but when invoking the wizard for making of adjusting a graph the top-menu is replaced by the interface of MS Graph.

    Therefore, can anybody help me out:
    • How can I invole VBA when defining a graph
    • And how can I then in VBA set the color of the pies in the piechart.


    Kind regards,

    Gab Franken

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Why can't you just manually preset the colors for the data series with the Graph properties?

    Review http://www.developerbarn.com/communi...30/#post-28257
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Gab Franken is offline Novice
    Windows XP Access 2003
    Join Date
    May 2013
    Posts
    9
    Thank you for you quick reply!

    Indeed setting the color with the Graph Properties would be the easiest way, but I need distinct colors, which are not included in the pre-programmed color scheme. I got the RGB-colorscheme for the exact colors our management can read, which I would like to put into VBA.

    I tried your suggestion following your link. For the pie-chart it worked out well, although I could not understand the programming with the switch-command: what is "OL", or "GP-GM(S)" etc. I just made a few more lines, each line for each color : colors change, but a strange thing happened.
    In the report underneath the graphs I put a table, each project is decribed in text and getting a colormark indicating its status (green-orange-red , in total 5 colors), and the same colorcoding I used in my pie-chart. The strange thing I mentioned is, that the color in the table differ quite a bit from the colors in the pie-chart. Even though I used exactly the same RGB-coding. The color of the table disappearing in the report is the right color; the color in the pie-chart is completely off-color for some reason.

    Next to the piechart I have a graph with columns, the method mentioned wouldn't work at all: I get an error message. Solved that bit by leaving out the command 'point()' and increased the number in the command SeriesCollection by one each time. As a result, the same colors apear in the pie-chart and the bar-chart; but both differ from the colors in the table.

    Any suggestions as on how to get the right colors in both the graphs??

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    "OL" and "GP-GM(S)" are values in my data (soils classifications).

    That is the extent of my experimentation with programmatically color coding graphs and I have abandoned it.

    If you want to provide db for analysis, follow instructions at bottom of my post.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    Gab Franken is offline Novice
    Windows XP Access 2003
    Join Date
    May 2013
    Posts
    9

    Red face color coding graphs - database for analysis

    Quote Originally Posted by June7 View Post
    "OL" and "GP-GM(S)" are values in my data (soils classifications).

    That is the extent of my experimentation with programmatically color coding graphs and I have abandoned it.

    If you want to provide db for analysis, follow instructions at bottom of my post.
    Thank you for your kind offer, I attached de database. Removed all confidential data and removed tables, queries, forms and reports that are not important to this matter
    Attached Files Attached Files

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    On the graphs, I think what you call oranje I would call yellow and rood looks like red brick to me.

    I see two different RGB codes for color groen. From the color picker 71 255 100 is the same as shown in the textbox. I don't know why the graph shows the dark green. Must be the MSGraph engine doesn't handle the RGB codes and substitutes whatever color seems close.

    Regardless, I get the same color discrepancy for groen and oranje (blauw, rood, white look okay).

    The constant vbGreen is the same in graph and textbox. Maybe management will have to adapt to new colors.

    I am surprised the code for coloring the textbox actually works. Think I've tried this before and didn't work, interesting.

    The report renders very fast if the graph colors are manually set in graph properties instead of with code. Conditional Formatting could color the textbox.
    Last edited by June7; 06-07-2013 at 09:40 AM.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  7. #7
    Gab Franken is offline Novice
    Windows XP Access 2003
    Join Date
    May 2013
    Posts
    9

    Talking Thank you for your quick reply

    Quote Originally Posted by June7 View Post
    On the graphs, I think what you call oranje I would call yellow and rood looks like red brick to me.

    I see two different RGB codes for color groen. From the color picker 71 255 100 is the same as shown in the textbox. I don't know why the graph shows the dark green. Must be the MSGraph engine doesn't handle the RGB codes and substitutes whatever color seems close.

    Regardless, I get the same color discrepancy for groen and oranje (blauw, rood, white look okay).

    The constant vbGreen is the same in graph and textbox. Maybe management will have to adapt to new colors.

    I am surprised the code for coloring the textbox actually works. Think I've tried this before and didn't work, interesting.

    The report renders very fast if the graph colors are manually set in graph properties instead of with code. Conditional Formatting could color the textbox.
    Hi June7,

    Thank you for your quick reply. You are right that the colors of graph and table differ: I used different colorcoding espacially for green. The reason is, as you also state, that MS Graph engine doens't handle the RGB codes well. And using the same color-coding gives me an awfull green in the graphs. Pitty you also don't have a clue on how to overcome this problem.

    For your info; I have to use colorcoding in code in stead of using the method of graph properties, as my customer is color blind, and I have to use colors that he is able to distuinguish.

    And yes, colorcoding works, thanx again for your good advise!

    Greetz, Gab Franken

  8. #8
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    You got the color coding to give acceptable colors? I think you should be able to set acceptable colors manually in the chart properties and textbox Conditional Formatting.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  9. #9
    Gab Franken is offline Novice
    Windows XP Access 2003
    Join Date
    May 2013
    Posts
    9

    Question colors in chart properties

    Quote Originally Posted by June7 View Post
    You got the color coding to give acceptable colors? I think you should be able to set acceptable colors manually in the chart properties and textbox Conditional Formatting.
    Hi Jun7,

    mmm, that indeed is the very best idea, but being just an amateur, I really don't have a clue on how to set these colors manually in the chart properties and textbox. Would you please be so kind as to help me out?

    Greetz, Gab

  10. #10
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Do you know what textbox Conditional Formatting is?

    Manually setting properties of graph can be tricky, involves lots of clicking. With report in design view, double click on graph (or right click > Chart Object > Open). Click on one data series (pie segment or bar) to select then double click to open property sheet, set color, texture, pattern, fill effects.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  11. #11
    Gab Franken is offline Novice
    Windows XP Access 2003
    Join Date
    May 2013
    Posts
    9

    colorcoding

    Quote Originally Posted by June7 View Post
    Do you know what textbox Conditional Formatting is?

    Manually setting properties of graph can be tricky, involves lots of clicking. With report in design view, double click on graph (or right click > Chart Object > Open). Click on one data series (pie segment or bar) to select then double click to open property sheet, set color, texture, pattern, fill effects.
    Thank you for your ever quick reactions!

    Yes, this bit I know, I thought you meant, that it is possible to define the colors that appear in the overview whenn adjusting the color of the graph or when adjusting the color in the conditional formatting of a textbox. For reasons mentioned earlier I just can't use the colors that standardly appear in Access. It does not sound strange to me that it would be possible to define somewhere in access what colors appear in the overview. If you happen to know how this can be done i would so gratefull.

  12. #12
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Remind me again, what is 'overview' - the graphs?

    If the graphs aren't going to accept those codes then you are probably stuck with the color palette. Unfortunately, textbox Conditional Formatting doesn't have pattern, texture, gradient.

    However, I am confused. You said in post 3 that the colors in textboxes are correct and the pie chart is wrong. The colors in textbox are from the color palette.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  13. #13
    Gab Franken is offline Novice
    Windows XP Access 2003
    Join Date
    May 2013
    Posts
    9

    Talking coding colorpallet

    Quote Originally Posted by June7 View Post
    Remind me again, what is 'overview' - the graphs?

    If the graphs aren't going to accept those codes then you are probably stuck with the color palette. Unfortunately, textbox Conditional Formatting doesn't have pattern, texture, gradient.

    However, I am confused. You said in post 3 that the colors in textboxes are correct and the pie chart is wrong. The colors in textbox are from the color palette.
    Forgive me for my English, it is not my first language. Some confusing can be led back to that circumstance. In Overview I meant as you indeed suggested, the colorpallet.

    In Post 3 I indeed mentioned, the colors in the textbox are right, but also there I didn't use conditional formatting, but coding in VBA with -if- and -elseif- commands:
    If [VoortgangKleur] = 1 Then
    Me.[VoortgangKleur].BackColor = RGB(71, 255, 181) 'groen
    Me.[VoortgangKleur].ForeColor = RGB(71, 255, 181) 'groen
    ElseIf [VoortgangKleur] = 3 Then
    Me.[VoortgangKleur].BackColor = RGB(232, 230, 72) 'oranje
    Me.[VoortgangKleur].ForeColor = RGB(232, 230, 72) 'oranje
    ElseIf [VoortgangKleur] = 5 Then
    Me.[VoortgangKleur].BackColor = RGB(255, 102, 0) 'rood
    Me.[VoortgangKleur].ForeColor = RGB(255, 102, 0) 'rood
    ElseIf [VoortgangKleur] = 100 Then
    Me.[VoortgangKleur].BackColor = vbWhite
    Me.[VoortgangKleur].ForeColor = vbWhite
    Else: Me.[VoortgangKleur].BackColor = RGB(72, 147, 255) 'blauw
    Me.[VoortgangKleur].ForeColor = RGB(72, 147, 255) 'blauw
    End If

    Using the same colorcoding for my graphs in the method described by you, strangly MS Graph doesn't show the same colors, which strikes me as odd. So possibly you can help me out again with some ideas as on how to change the colors in the colorpallet. Possibly that will lead to optimum colors in both textboxes and graph.

  14. #14
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    I already described in post 10 how to manually set colors in textbox and graph by selecting from the color palette.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  15. #15
    Gab Franken is offline Novice
    Windows XP Access 2003
    Join Date
    May 2013
    Posts
    9

    colorplallet

    Quote Originally Posted by June7 View Post
    I already described in post 10 how to manually set colors in textbox and graph by selecting from the color palette.
    Yeah, I know, but I want te determine what colors appear in the colorpallet, so to say, change the default colors in this pallet by user-defined colors based on RGB coding. Is that possible?

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 3
    Last Post: 05-30-2013, 08:03 AM
  2. Graph (Chart) - Set Color of Data Point with VBA
    By June7 in forum Programming
    Replies: 6
    Last Post: 10-18-2012, 03:14 PM
  3. Graph Formatting in Access 2010 Report
    By RayMilhon in forum Reports
    Replies: 13
    Last Post: 03-16-2012, 05:23 PM
  4. Replies: 2
    Last Post: 05-26-2011, 12:15 PM
  5. Graph Report in Access
    By Alaska1 in forum Access
    Replies: 0
    Last Post: 03-07-2011, 08:32 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums