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?
[Solved] Series lines are black regardless of color set
-
- Newbie
- Posts: 5
- Joined: Fri Jul 27, 2007 12:00 am
[Solved] Series lines are black regardless of color set
Last edited by MattHolmes on Thu Sep 20, 2007 8:42 pm, edited 1 time in total.
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
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.
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 |
Instructions - How to post in this forum |
-
- Newbie
- Posts: 5
- Joined: Fri Jul 27, 2007 12:00 am
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
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.
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 |
Instructions - How to post in this forum |
-
- Newbie
- Posts: 5
- Joined: Fri Jul 27, 2007 12:00 am
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.
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.
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
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".
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 |
Instructions - How to post in this forum |
-
- Newbie
- Posts: 5
- Joined: Fri Jul 27, 2007 12:00 am
-
- Newbie
- Posts: 5
- Joined: Fri Jul 27, 2007 12:00 am
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.
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi MattHolmes,
I'm glad to hear you solved the problem.
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 |
Instructions - How to post in this forum |