bars colors are not changing

TeeChart for ActiveX, COM and ASP
Post Reply
Oblicore
Newbie
Newbie
Posts: 79
Joined: Fri May 27, 2005 4:00 am

bars colors are not changing

Post by Oblicore » Tue Sep 02, 2008 8:05 am

Hello,

We have a problem changing series colors using the teechart properties pop up.

we use teechart 7 activex

I have uploaded a file (problem.zip) with a small project that display the problem.
To recreate the problem:
1. run the project
2. press on "select tee" and select the tee file that is also in the uploaded zip file.
3. press on the properties icon to open the properties pop up.
4. press on the color squere near the Violation and complient series and change thier colors.

you can see that the color on the legend is changed but the color on the chart stays the same.

Is this a know issue? Is there a solution?

Thanks
Zoe.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Tue Sep 02, 2008 8:28 am

Hi Zoe,

This is because all bars in "Violation" series have a value of zero. You'll notice that if you go to the "Data" tab in the editor and press the "X" icon on the bottom right. At the editor, if you change bar values you'll see they are visible in the color you selected.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Oblicore
Newbie
Newbie
Posts: 79
Joined: Fri May 27, 2005 4:00 am

Post by Oblicore » Tue Sep 02, 2008 8:34 am

Hello Narcis,

thanks for your quick reply.

This is right for just one series. the other series (the blue one) is not all 0 and still color is not changed. It is true that if i change the 0 values to another value but what about the values that are not 0?

Zoe.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Mon Sep 08, 2008 10:26 am

Hi Zoe,

With your *.tee file we can not see how did you generated the chart so we image that the problem could be that you are a assigning a color to each point when adding data to the series. Therefore you can not change series color if each point has been assigned a color individually.

So that it works as you request you should use clTeeColor constant as the color in the Add method when populating your series. Then you could set series color using like TChart1.Series(0).Color=clRed. Proceeding like this would also let you change series's colors in the editor.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Oblicore
Newbie
Newbie
Posts: 79
Joined: Fri May 27, 2005 4:00 am

Post by Oblicore » Tue Sep 09, 2008 7:07 am

Hi Narcis,

Actually, the "color each" propertie is set to false.

We create the actual serie using this code (only part of the code is displayed here):
chart->AddSeries(TeeChart::scBar);
TeeChart::ISeriesPtr series;
series = chart->aSeries[seriesNum];
series->ColorEachPoint = FALSE;
series->Color = color;

and we fill the series using this code (again only part of it):
chart->aSeries[seriesNum]->Add(dValue, label.c_str(), color);

as you can see, we do pass the color parameter but this is becase we did not manage to find any Add method that does not ask for color. Does this affect the chart even though coloreachpoint is set to false? Is there an add method that we do not need to pass color to?

thanks
Zoe

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Tue Sep 09, 2008 9:04 am

Hi Zoe,

No, instead of passing "color" try passing "clTeeColor".
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Oblicore
Newbie
Newbie
Posts: 79
Joined: Fri May 27, 2005 4:00 am

Post by Oblicore » Tue Sep 09, 2008 9:31 am

Thank you very much.

This has solved the problem.

Zoe

Post Reply