Print Page | Close Window

Legend and bars of charts not consistent.

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=8225
Printed Date: 06 May 2024 at 9:25pm


Topic: Legend and bars of charts not consistent.
Posted By: mfrank
Subject: Legend and bars of charts not consistent.
Date Posted: 04 Nov 2009 at 8:01am

Using Crystal XI, I have a report that selects a top 10 categories in the report.  For each of the 10 categories, I have 4 stacked bar charts showing "dispatched" and "not dispatched".  I also have 1 subreport that charts two trend lines(one for "dispatched" and one for "not dispatched").

The problem is the color of bars/lines are not holding the same colors for "dispatched" and "not dispatched" from chart to chart.  I verified each chart is sorted in the same manner, but that doesn't seem to matter. 
 
I need "dispatched" to be the same color bar/line on all charts for each category and the same for "not dispatched". 
 
Does anyone have any idea as to why this might be happening or how I may be able to prevent this?
 
 
 
 


-------------
Me



Replies:
Posted By: DBlank
Date Posted: 04 Nov 2009 at 8:34am

In the chart expert under Data tab you have multiple values in the "Show Values(s)" box correct?

if so go chart by chart and change the order of the Data elements being summarized to be exactly the same for each.
First value =orange
second value=blue
third  value= green
 
(Version XI)
Does that do the trick?


Posted By: mfrank
Date Posted: 04 Nov 2009 at 8:37am
It will sometimes work, but if one of the top 10 categories is different at the next run time, it will randomly assign the color scheme.

-------------
Me


Posted By: DBlank
Date Posted: 04 Nov 2009 at 9:04am
I am not understanding your design here...
If from chart to chart your top N (10) changes due to it being calculated on different criteria then the colors will change. I am pretty sure it assigns color values in a constant sequence. Whatever vvalue fall sin that sequence gets that color. Sorry, I don't know a way around the top N color assignment.
 
Anyone else ... ?


Posted By: mfrank
Date Posted: 04 Nov 2009 at 10:37am

The report is reporting on the top 10 categories for a given week.  The top 10 can change from week to week.  Within each of those 10 categories there are the following:

  1. Stacked bar chart by symptom
  2. Stacked bar chart by cause
  3. Stacked bar chart by location
  4. Stacked bar chart by model/application
  5. A two line chart for total records in that categorization.

In each of these 5 charts, they are broken down by "dispatched" and "not dispatched".  I need the "dispatched" to be one color in all 5 of the charts and "not dispatched" to be one color in all 5 charts.  So there will be 50 different charts on the report.  I need all 50 charts to show the "dispatched" as one color and "not dispatched" as another color.

What is happening now, is chart 1 will have "dispatched" as blue and "not dispatched" as gold.  chart 2 will have "dispatched" as gold and "not dispatched" as blue. 
 
I have tried to control the colors by manually changing them in the preview.  I have tried to sort the data differently.  None of these have worked.
 
I am hoping this explains the design of the report more......


-------------
Me


Posted By: DBlank
Date Posted: 04 Nov 2009 at 10:53am
In the Chart Expert where is the 'dispatched' and 'not dispacthed' data element being added and how?
E.g. In the Chart Expert On the Data tab are you adding these as 'Show Value(s)' and a Count of a specific field(s)? if not where, how are they being added?


Posted By: mfrank
Date Posted: 04 Nov 2009 at 11:04am

In the chart expert on the Data tab, I have "On change of" symptom and @dispatched.  In the show values(s) I have "Sum of @Count Symptoms".    

@dispatched formula is
    If Not(IsNull({HPD_Help_Desk.Vendor_Name})) then
         "Dispatched"
    else
         "Not Dispatched"
 
this would be how the symptom chart is done.  The others are identical, but replace the symptom with their respected data.  So replace symptom with cause for the cause chart, replace symptom with location for the location chart etc....


-------------
Me


Posted By: DBlank
Date Posted: 04 Nov 2009 at 11:27am
Gotcha.
1. For each of the category grouping are these staying conisitent in all the charts and only flipping on category group change?
2. Is this happening...Per category if the first row has a NULL HPD_Help_Desk.Vendor_Name then "Not dispatched" = Orange but if the first row has NOT NULL HPD_Help_Desk.Vendor_Name then "Not dispatched"=Blue?


Posted By: mfrank
Date Posted: 04 Nov 2009 at 11:49am

The charts are not staying consisting within each category group.

It randomly happens reguardless of the category.  Sometimes the first category will have all the chart colors the same except one chart sometime two of the charts.

Sometimes the first category will show all the charts the same and the next category will have one not the same or more.   etc....
 
How would I know what the first row value has?


-------------
Me


Posted By: DBlank
Date Posted: 04 Nov 2009 at 11:58am

Here is an alternative to try.

I would add an extra section and just make copies of your existing charts and use those to test this out. Don't want to screw up your other ones if it is a dead end Thumbs%20Down
 
Make 2 formulas
@Dispatched
If IsNull({HPD_Help_Desk.Vendor_Name}) then 0 else 1
@Not Dispatched
If IsNull({HPD_Help_Desk.Vendor_Name}) then 1 else 0
In your stacked bar charts 
On change of = Symptom (or other value in next chart)
Show values as:
SUM of @Dispatched
SUM of @Not Dispatched
 
Repeat for a couple more charts but make sure you alwasy make the @dispatched the top value and @ Not dispatcehd the second value.

Does this work for you?
 


Posted By: mfrank
Date Posted: 04 Nov 2009 at 1:25pm
Yes.  This did work.  Thank you so much for the assistance.

-------------
Me


Posted By: mfrank
Date Posted: 04 Nov 2009 at 1:27pm
Thumbs%20Up  Thank you for your help!

-------------
Me



Print Page | Close Window