One pixel drawing issue with bar pen

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
pcc_user
Newbie
Newbie
Posts: 5
Joined: Tue Dec 20, 2011 12:00 am

One pixel drawing issue with bar pen

Post by pcc_user » Wed Dec 21, 2011 2:21 pm

Hello,

I noticed a pixel error in the way the bar pen is drawn. The following picture shows the case where I have two bars, one white and one gray. The white is behind the gray one, and it has a 1px black pen, whereas the gray doesn't have a pen.
bar pen pixel issue.png
bar pen pixel issue.png (7.5 KiB) Viewed 4215 times
As you can see, the line is drawn inside the bar on the left-hand side, and outside on the right. It is only a single pixel that is affected by this, if you set the pen width to 10 px, there will still be a single pixle error on the right hand side.

Is there a way to specify that the pen should be drawn outside the bar?

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: One pixel drawing issue with bar pen

Post by Sandra » Thu Dec 22, 2011 11:32 am

Hello

I think a solution for you would be set the Pen color of your Series Gray as same color of Brush of your Series Gray, you can do something as next:

Code: Select all

        Steema.TeeChart.Silverlight.Styles.Bar bar1,bar2;
        private void InitializeChart()
        {
            tChart1.Aspect.View3D = false;
            bar1 = new Steema.TeeChart.Silverlight.Styles.Bar(tChart1.Chart);
            bar2 = new Steema.TeeChart.Silverlight.Styles.Bar(tChart1.Chart);
            bar1.FillSampleValues();
            bar2.FillSampleValues();
            bar1.Color = Colors.White;
            bar2.Color = Colors.LightGray;
            bar1.Pen.Color = Colors.Black;
            bar2.Pen.Color = Colors.LightGray;
            bar1.MultiBar = Steema.TeeChart.Silverlight.Styles.MultiBars.None;

        }
Can you tell us if previous code works as you want?

Thanks,
Best Regards,
Sandra Pazos / 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

pcc_user
Newbie
Newbie
Posts: 5
Joined: Tue Dec 20, 2011 12:00 am

Re: One pixel drawing issue with bar pen

Post by pcc_user » Thu Dec 22, 2011 11:52 am

Thanks, I didn't think of that. I'd still argue that the right line is one pixel too far to the right, but at least now it is not noticable :)

Post Reply