[Solved] Series lines are black regardless of color set

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
MattHolmes
Newbie
Newbie
Posts: 5
Joined: Fri Jul 27, 2007 12:00 am

[Solved] Series lines are black regardless of color set

Post by MattHolmes » Wed Sep 19, 2007 5:29 pm

I am setting a series line color as such:

line.LinePen.Width = 2;
line.LinePen.Color = color;
line.Pointer.Brush.Color = color;
line.Pointer.Pen.Color = color;
line.Color = color;

line is a Styles.Line instance. The issue is that the lines are drawn in black on the chart. They show up in the correct color in the legend, but they are always black on the chart itself. The points show up in the correct color, only the lines themselves are black. Am I not setting a color property somewhere? Have I missed something?
Last edited by MattHolmes on Thu Sep 20, 2007 8:42 pm, edited 1 time in total.

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 Sep 20, 2007 9:13 am

Hi MattHolmes,

Could you please send us a simple example project we can run "as-is" to reproduce the problem here and let us know which exact TeeChart version are you using?

You can 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

MattHolmes
Newbie
Newbie
Posts: 5
Joined: Fri Jul 27, 2007 12:00 am

Post by MattHolmes » Thu Sep 20, 2007 3:38 pm

I can try. Pulling this code out of my project is going to be a real pain, but I'll see what I can do.

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 Sep 20, 2007 3:51 pm

Hi MattHolmes,

Thanks for trying. As you can understand it's pretty difficult for us guessing what the problem can be without being able to reproduce it here. The only think I can think of is that you have a black pen for the lines and display it in 2D but this seems most unlikely as you assing the same color to LinePen. Pointer.Brush and Pointer.Pen. Another thing you can try is setting line.Brush.Color.
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

MattHolmes
Newbie
Newbie
Posts: 5
Joined: Fri Jul 27, 2007 12:00 am

Post by MattHolmes » Thu Sep 20, 2007 4:00 pm

I found something odd. I added a BeforeDrawValues event to each of my line series and inspected the values in the LinePen and Brush properties of the line.

When using the color {0, 170, 109}, the Brush.Color and Brush.ForegroundColor inspect correctly, but LinePen.Color has somehow been divided by two, meaning it's color property during the BeforeDrawValues is {0, 85, 54}. Something lowered the intensity of the color. This still doesn't explain why it's drawing as all black, but it is sort of odd and makes me wonder if anything is modifying the colors elsewhere.

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 Sep 20, 2007 4:11 pm

Hi MattHolmes,

By default and for cosmetic reasons, series's pen colors are set to a color a little bit darker than the specified series color. You'll be able to appreciate that if you have a look at the features demo available at TeeChart's program group. This may be the reason of your colors being "divided by two".
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

MattHolmes
Newbie
Newbie
Posts: 5
Joined: Fri Jul 27, 2007 12:00 am

Post by MattHolmes » Thu Sep 20, 2007 4:13 pm

Alright. Well, all the other color values of my lines series are fine during the BeforeDrawValues event. I will try and break out a couple of these series (their points anyway) and put you together a quick app to look at. I am wondering if I am just missing setting elsewhere, like the chart itself.

MattHolmes
Newbie
Newbie
Posts: 5
Joined: Fri Jul 27, 2007 12:00 am

Post by MattHolmes » Thu Sep 20, 2007 8:42 pm

In the process of creating that small sample, I figured out the issue. Because I am porting legacy C++ code to C#, I was adding points to the series using the Add(double, double, Color) method, because that's how it was done in the old VCL version of this piece of software. The color that was always being used was extremely dark, almost black (black to the naked eye). I changed that to use the Add(PointF) method and the issue went away. Changing the line brush and line pen colors now correctly draws the line in the chart.

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

Post by Narcís » Fri Sep 21, 2007 7:33 am

Hi MattHolmes,

I'm glad to hear you solved the problem.
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

Post Reply