Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2005
    Location
    Florida
    Posts
    3

    How do you change the column colors in an Access graph?


    I have a bar graph in Access with 6 different values on the x-axis (Unfortunately, it shows them in groups of 4-4-4 and labels them North, South, East and West while in design view). But while in print preview, it shows them as the labels corresponding with those in the database, which is correct. The problem is that I can figure out how to change the colors in design view, but when I go to print preview, it designates all of the x-axis values the same color that I adjusted the first bar to. For instance, upon its creation, it designated all of the bars as blue. So I changed them to various colors, the first value being yellow, then it made all bars yellow. How can I color them different colors?

    Also, is there any way anyone knows of how to apply a number value in or around each bar to tell exactly what that value is? (I have the y-axis values set in intervals of "5's", but I would like the bars to note their exact value somewhere around them.) But I need that number to be updated with proper changes to the database.

  2. #2
    Join Date
    Dec 2005
    Location
    Wilmington, DE - USA
    Posts
    275
    I just created a quickie report that has a chart in the page header and nothing in the detail. The chart shows six values.

    In Design view, I edited the first data series to show labels. (Doubleclick the chart in Design to get into MS Chart. Select the first data series and rightclick, selecting Format Data Series from the popup menu. On the Data Labels tab, check the box for Value.)

    To get different colors for each data point, I used this code:

    Code:
    Private Sub PageHeaderSection_Format(Cancel As Integer, FormatCount As Integer)
    
        Dim Counter As Long
        Dim NumPoints As Long
        
        With Me.Graph1.SeriesCollection(1)
            NumPoints = .Points.Count
            For Counter = 1 To NumPoints
                .Points(Counter).Interior.ColorIndex = Counter
            Next
        End With
            
    End Sub
    I used a simple loop to assign the colors. You could use a fancier construct like an If or a Select Case structure to assign colors based on meaningful rules.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. split a column into two seperate columns
    By nybanshee in forum Access
    Replies: 2
    Last Post: 08-14-2008, 04:52 PM
  2. Replies: 2
    Last Post: 01-14-2008, 12:15 PM
  3. inserting values in column based another column
    By wasim_sono in forum Database Design
    Replies: 1
    Last Post: 06-27-2006, 05:23 AM
  4. 2 different fields into 1 column by query?
    By rainxking in forum Queries
    Replies: 1
    Last Post: 06-04-2006, 09:37 AM
  5. Added items in a column.
    By Wrangler in forum Forms
    Replies: 3
    Last Post: 03-25-2006, 07:56 PM

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