Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: How to Create a Stacked Bar Chart in Crystal Repor Post Reply Post New Topic
Author Message
computerguy
Newbie
Newbie


Joined: 15 Dec 2008
Online Status: Offline
Posts: 3
Quote computerguy Replybullet Topic: How to Create a Stacked Bar Chart in Crystal Repor
     Posted: 15 Dec 2008 at 9:07am
Hey. I am working on a report that needs to have a few stacked bar charts. I can't get them to display properly. I am using a .Net class as the data source. The class is listed below.

When the report is produced I just get a regular bar chart. Could someone point out if this class I am using is sufficient to create the stacked bar chart? Also what are the correct options I used in Crystal Reports when designing the chart. What do I have to set under the data tab?

Thanks for any help.

1     public class ChartDataObject  
2     {  
3         private string label = String.Empty;  
4         private double value = 0;  
5  
6         public string Label  
7         {  
8             get { return this.label; }  
9         }  
10  
11         public double Value  
12         {  
13             get { return this.value; }  
14         }  
15  
16         public ChartDataObject(string label, double value)  
17         {  
18             this.label = label;  
19             this.value = value;  
20         }  
21     }
IP IP Logged
computerguy
Newbie
Newbie


Joined: 15 Dec 2008
Online Status: Offline
Posts: 3
Quote computerguy Replybullet Posted: 19 Dec 2008 at 11:39am
I figured out the issue. My data class didn't have the proper fields. For each part of the stack I needed to have a value. So for a 5 stack chart I would need something like:

public class ChartDataObject
{
public string label = String.Empty;
public double value1 = 0;
public double value2 = 0;
public double value3 = 0;
public double value4 = 0;
public double value5 = 0;
}
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum