Hi,
I am currently using TeeChart Pro V 7.0 with Report Builder 7.0.4. I am creating a report of bar graphs. However, I need the ability to set the individual color of each bar for each graph to be based on the data label. Is there any way of doing this? If so, can you provide a sample on how this is done?
how to set individual color for each bar based on data label
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Wayne,
Can you please be more specific on what kind of information will be in the labels and how would you like to colors to be?
Thanks in advance.
Can you please be more specific on what kind of information will be in the labels and how would you like to colors to be?
Thanks in advance.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
how to set individual color for each bar based on data label
Hi Narcis,
What I am trying do is this. I have a database of a survey that people took. I need to generate a bar graph report using report builder 7.0.4 of the data summary for each question answered. I would like to have the colors of the answers to be consistent. For example say 10 people took this survey:
The presentation was informative:
Strongly Agree (5) Blue
Agree (2) Yellow
Disagree (1) Green
Strongly Disagree(3) Red
The presenter was very knowledgeable:
Strongly Agree (3) White
Agree (3) Blue
No Opinion (2) Yellow
Disagree (1) Green
Strongly Disagree (1) red
I need to be able to assign colors based on what the label is such as "Agree" above needs to be assigned to specific color say "Blue" no matter what order it is in for each bar for each graph created in the report. Please keep in mine that each graph is created with only one serie. Any idea?
thanks!
--Wayne
What I am trying do is this. I have a database of a survey that people took. I need to generate a bar graph report using report builder 7.0.4 of the data summary for each question answered. I would like to have the colors of the answers to be consistent. For example say 10 people took this survey:
The presentation was informative:
Strongly Agree (5) Blue
Agree (2) Yellow
Disagree (1) Green
Strongly Disagree(3) Red
The presenter was very knowledgeable:
Strongly Agree (3) White
Agree (3) Blue
No Opinion (2) Yellow
Disagree (1) Green
Strongly Disagree (1) red
I need to be able to assign colors based on what the label is such as "Agree" above needs to be assigned to specific color say "Blue" no matter what order it is in for each bar for each graph created in the report. Please keep in mine that each graph is created with only one serie. Any idea?
thanks!
--Wayne
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Wayne,
You could do something like this:
You could do something like this:
Code: Select all
procedure TForm1.FormCreate(Sender: TObject);
var i: Integer;
begin
With Series1 do
begin
ColorEachPoint:=true;
Add(5,'Strongly Agree');
Add(2,'Agree');
Add(1,'Disagree');
Add(3,'Strongly Disagree');
for i:=0 to Count-1 do
begin
if Labels[i]='Strongly Agree' then ValueColor[i]:=clBlue
else if Labels[i]='Agree' then ValueColor[i]:=clYellow
else if Labels[i]='Disagree' then ValueColor[i]:=clGreen
else ValueColor[i]:=clRed;
end;
end;
end;
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Hi Narcis,
I see where you are getting at with your example. However, the problem I am having with now is how to do this within ReportBuilder. The only event I access to is the OnPrint event for the Chart embedded inside the report. The other events I tried playing with was under report builder's detail band events which are AfterGenerate, AfterPrint, BeforeGenerate, and BeforePrint. The sample you provided is for the manual creation of the serie which is perfectly fine in a static scenario. However, the charts I am generating is using reportbuilder's DBpipeline to automatically populate the data for the serie. Any more ideas?
I see where you are getting at with your example. However, the problem I am having with now is how to do this within ReportBuilder. The only event I access to is the OnPrint event for the Chart embedded inside the report. The other events I tried playing with was under report builder's detail band events which are AfterGenerate, AfterPrint, BeforeGenerate, and BeforePrint. The sample you provided is for the manual creation of the serie which is perfectly fine in a static scenario. However, the charts I am generating is using reportbuilder's DBpipeline to automatically populate the data for the serie. Any more ideas?
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Wayne,
No problem, I'm glad you found a solution to your needs.
No problem, I'm glad you found a solution to your needs.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |