Print Page | Close Window

Stacked bar conundrum

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=6210
Printed Date: 05 May 2024 at 3:02am


Topic: Stacked bar conundrum
Posted By: zaroblan
Subject: Stacked bar conundrum
Date Posted: 29 Apr 2009 at 5:12am
Greetings,

I am trying to figure out how to use Crystal Reports 2008 to display a stacked bar where certain of the segments are to have the same colour to indicate a state.

For example on a machine being used for 24 hours:
00:00 - 06:00 Inactive
06:00 - 10:00 Active
10:00 - 10:15 Overuse
10:15 - 12:00 Active
12:00 - 13:00 Inactive
13:00 - 15:00 Active
15:00 - 16:00 Inactive
16:00 - 1700: Active
17:00 - 18:00 Overuse
18:00 - 00:00 Inactive

I would like to display a stacked bar where Inactive would be white, Active would be green and overuse would be red.

For a large numer of machines from a management viewpoint you could quite easily see what the usage of the machines was.

Please can you help?

Thanks,
Robert



Replies:
Posted By: DBlank
Date Posted: 29 Apr 2009 at 6:45am
I assume you want to stack this based on total time for each instance grouped on the 3 categories. I also assume your sample data above is 3 different fields, Start tiem, stop time and status.
First you will need to get your difference in time.
if your first two items are datetime fields you can use a datediff in a formula to get your total minutes. Called "Minutes" for this example:
datediff("n",{table.starttime},{table.enddtime})
I think for your chart you will need to select a stacked bar chart, on change of probably is Machine # and second the Active/Inactive field. Show value as the formula field mailto:%7b@Minutes - {@Minutes } set to summary as a SUM.
You might have to play around with this a bit depending on your overall design needs but hopefully this will get you on a good track.


Posted By: zaroblan
Date Posted: 29 Apr 2009 at 7:24am
Almost what I had in mind.
I want the ba to be stacked in chronological order.
That is first a white block, then a green, then a red, then a green again, then a white, then a green ... as per the timeline shown above.
I need the blocks to be stacked in order and not as totals.
Is this possible?


Posted By: DBlank
Date Posted: 29 Apr 2009 at 8:18am
Not sure about this one. Stacked bar charts generally are used to group like data together into another group. Perhaps you can group on a Computer # then unique line record with the SUM of the time and try to conditionally highlight the records for you Green, Red, White but I am not sure that the highlighter will work that way.


Posted By: Dan3D
Date Posted: 11 May 2009 at 8:57pm
If all elese fails, this kind of process control chart could be done with our CRChart add-in for Crystal Reports.
 
-Dan
 
disclaimer: I work for the company, threedgraphics.com, that makes this product. This product costs money.



Print Page | Close Window