Change series color for bars does not work

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
cic
Newbie
Newbie
Posts: 7
Joined: Thu Mar 08, 2007 12:00 am

Change series color for bars does not work

Post by cic » Fri Sep 21, 2007 8:48 am

Hi,

I'm using Version 7 in a CBuilder 5.

I have a bar chart in which the user can change bar colors programmatically. The color of the legend changes OK but the corresponding color in the bar chart remains as it was before the change. Line series change OK.

To set and change the color I use the SeriesColor property of TBarSeries. I have used the Series and Chart Repaint method to force repainting but no result.

Thanks in advance.

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 25, 2007 12:04 pm

Hi cic,

We haven't been able to reproduce the problem here. Could you please send us a simple example project we can run "as-is" to reproduce the problem here and let us know which TeeChart version are you using?

You can either post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.

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
Image Image Image Image Image Image
Instructions - How to post in this forum

cic
Newbie
Newbie
Posts: 7
Joined: Thu Mar 08, 2007 12:00 am

Post by cic » Sat Sep 29, 2007 11:02 am

Hi Narcís ,

I've uploaded the project you asked me. It is a CBuilder5 project using TeeChart version 7.07. Click "Open Chart" and try to change the colors of one of the bars.

cic

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 Oct 01, 2007 10:09 am

Hi cic,

Thanks for the example project but I'm not able to run it here because I ghet this error message:
[Pascal Error] TeeMIFCanvas.pas(61): Declaration of 'Arc' differs from previous declaration
Could you please let us know how we should solve this?

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
Image Image Image Image Image Image
Instructions - How to post in this forum

cic
Newbie
Newbie
Posts: 7
Joined: Thu Mar 08, 2007 12:00 am

Post by cic » Mon Oct 01, 2007 10:34 am

Hi Narcis,

You could try to comment out the line

//USEUNIT("TeeMIFCanvas.pas");


Thanks in advance,

cic

cic
Newbie
Newbie
Posts: 7
Joined: Thu Mar 08, 2007 12:00 am

Post by cic » Mon Oct 01, 2007 10:35 am

You'll find the line in the tchart.cpp

Yeray
Site Admin
Site Admin
Posts: 9602
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Post by Yeray » Tue Oct 02, 2007 8:39 am

Hi cic,

We've done what you said and now we have another error message:
[C++ Error] main.cpp(6): E2209 Unable to open include file 'iode.hpp'
Would you be so kind to send us a simple example project we can run "as-is" to reproduce the problem here?

Thanks in advance.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

cic
Newbie
Newbie
Posts: 7
Joined: Thu Mar 08, 2007 12:00 am

Post by cic » Tue Oct 02, 2007 9:06 am

The tchart.exe included in the zip file I uploaded reproduces the problem.

Click "Open Chart" and try to change the colors of one of the bars using
your editor. Line colors change, only the legend bar color changes.

Sorry for the problems and thanks in advance.

cic

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 Oct 02, 2007 11:36 am

Hi cic,

Thank you very much for the information but it would be really helpful if we could debug the project here to find where the problem is. So we would really appreciate if you could arrange a simple example project we can run "as-is" to reproduce the problem here.

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
Image Image Image Image Image Image
Instructions - How to post in this forum

cic
Newbie
Newbie
Posts: 7
Joined: Thu Mar 08, 2007 12:00 am

Post by cic » Tue Oct 02, 2007 12:01 pm

Hi Narcís ,

I've uploaded the project again. I've included iode.hpp and hope it compiles now.

cic

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

Post by Narcís » Thu Oct 11, 2007 8:18 am

Hi cic,

Sorry for the delayed reply but your project wasn't a simple one and took us some time debugging it.

The problem was that you tried to assign a color to the series when you had already assigned a color for each point in the AddXY method and therefore TeeChart didn't take into account the color of the series. To achieve what you request you should modify the code below at ChrtAdd:

Code: Select all

    for(i = 0; i < nobs; i++)  {
	    if(SCR_ISAN(vals[i*2+1]))
            {
	        Series->AddXY(vals[i*2], vals[i*2+1], """", clTeeColor); // Color
                Series->SeriesColor=Color;
            }
	    else
            {
	        if(type != 'B') Series->AddNullXY(vals[i*2], oval, "");
            }
    }
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

cic
Newbie
Newbie
Posts: 7
Joined: Thu Mar 08, 2007 12:00 am

Post by cic » Thu Oct 11, 2007 8:31 am

Hi Narcís,


I tried it and it works like I wanted it to.
Thanks.

Best Regards,
cic

Post Reply