having a different color for each bar in a cfchart

Posted on 2005-04-26
Last Modified: 2013-12-24
We are in the process of upgrading to MX from 4.5.  In 4.5 our bar graphs consisted of different colors for each bar on each graph. How can I make this happen in MX using cfchart and cfchartseries?
Question by:parikaa
    LVL 35

    Expert Comment

    By default it will do so.

    <cfchartseries type="bar" paintstyle="shade" serieslabel="#MyDate#">

    If you want to specify WHICH colors are used for each series then use:


    such as:

    <cfchartseries type="bar" paintstyle="shade" serieslabel="#MyDate#" seriescolor="003399">

    LVL 5

    Author Comment

    thanks for your reply....and now using the example above where every bar in the series would be #003399 lets change that only the first bar of the series is that color, and the rest ummmmmm #993300. how can I make this possible?
    LVL 35

    Accepted Solution

    I am not sure exactly what you are asking, but here is an example of a chart I did where I rotated through a set of defined colors:

    <cfset Colors = "003399,9966CC,009999,CC00CC,FF6633,33CC33,FFCC66">
    <cfset colorindex = 1>
          yaxistitle="Order Count"
          <cfoutput query="MyQuery" group="PickupDate">
                <cfchartseries type="bar" paintstyle="shade" serieslabel="#PickupDate#" seriescolor="#ListGetAt(Colors, colorindex)#">
                            <cfchartdata item="#PickupTime#" value="#Quantity#">
                <cfset colorindex = colorindex + 1>
    LVL 5

    Author Comment

    I thought that this was the solution until I acutally tried it. This is close to what I need, but not exactly.
    An example of a graph that I want is the following:
    The count of hits on a homepage by month.
    I want the graph to display the # of hits and months.
    It should be a bar graph.
    ****The most important part is that all the bars should be different colors.****

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Suggested Solutions

    Have you ever sent email via ColdFusion and thought of tracking this mail to capture the exact date and time when the message was opened ?  If yes, then this article is for you ! First we need a table user_email with columns user_id , email , sub…
    When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
    how to add IIS SMTP to handle application/Scanner relays into office 365.
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now