cancel
Showing results for 
Search instead for 
Did you mean: 

Suppress or hide particular series in bar chart

Former Member
0 Kudos

Hi,

I am using crystal reports 2011 to display report having bar chart. Chart has only one series which is used to diaply names.

My requirement: If name contains string "abc" then change the bar color to red.

Color highlight helps to change the color conditionally. But I am not able to check if String contains sub string with. i.e. "pqrabc hds" contains "abc".

As a solution I decided to use another field "color code" with original field "name". So that I can conditionally change the color using field "color code".

To have "color code" in value of section in color highlight, you need to use it as data input of chart. After doing that my bar chart displays 1 bar for name and 1 bar for color code.

Can I hide all bars related to "color code"? As I am using it just to conditionally change the color, I don't need them while displaying the chart. Neither I want blank spaces instead of bars.

Any other Ideas or suggestions to change the bar colors as per my requirements?

Thanks You.

Accepted Solutions (0)

Answers (2)

Answers (2)

abhilash_kumar
Active Contributor
0 Kudos

HI Rutvi,

Crystal Reports does not let you use a 'formula' to conditionally color a Bar Chart.

If you add multiple fields to the 'Show Value' section, you will see two bars for each name. There's also no way to get rid of one of the bar (other than removing it).

-Abhilash

former_member477249
Participant
0 Kudos

Hi Rutvi,

Is there any metric(number) being displayed on the chart in the 'show value' box of the 'chart expert'.

generally, charts are used to show numbers w.r.t a changing attribute like a month,year,region,country etc.

The color highlight would only work for a metric series , for e.g 1-to-100 show green, 101-to-200 show red etc. It will not work for a string field.

It is not very clear why a string content needs to be shown as a 'red' or 'green' on a bar chart.

-Prathamesh