Page 1 of 1

One pixel drawing issue with bar pen

Posted: Wed Dec 21, 2011 2:21 pm
by 15661118
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 4204 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?

Re: One pixel drawing issue with bar pen

Posted: Thu Dec 22, 2011 11:32 am
by 10050769
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,

Re: One pixel drawing issue with bar pen

Posted: Thu Dec 22, 2011 11:52 am
by 15661118
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 :)