Tip: How to conditionally change the color of a Chart in Crystal Reports?

Before I say any thing, I have to admit, Crystal Reports is the suckiest (I'd to find a unique word) product in my list of sucky products I have ever used. I do not have any words to describe the SUCKER LEVEL for this product. BTW I am using version CR 10.

Any way, in this article let's see how to change the color of a Chart bars based on certain conditions. For example, if the value of the chart is > 100, the color would be green otherwise it would be red.

Let's talk about changing the color of the chart.

  1. Right-click on the chart and select Chart Expert

  2. Click on the Options tab. Guess what, if you have default Automatically set chart options selected, you will not see Options tab. So first, clear Automatically set chart options as following:

    images2.gif
  3. Verify that the Color radio button is selected in the Chart Color group. See following figure:

    image1.gif

  4. Click the Format button in the Chart Color group

  5. The Chart Color Format Expert appears. For each bar that you want to color:

    a. Click New to add a new item to the Item List

    ChartColorImg3.gif

    b. From the Item Editor select the field that you want to check (from the first dropdown list), the condition (from the second dropdown list) and the value to check against (from the third dropdown list).

    c. Select the custom color to apply if the conditions set. When you have entered all of the custom colors, click OK

  6. Preview the report.

     Also do not forget the following :

  1. Right-click on the chart and select Chart Options >> General
  2. Click the Look tab
  3. Set the Color Mode drop down list to Color by Groups and click OK.

Up Next
    Ebook Download
    View all
    Learn
    View all