Page 1 of 1

Bar series pen

Posted: Thu Feb 05, 2009 9:27 pm
by 13049011
Hello,

I'll put together a small example, but I've got a bar chart where I draw a line horizontally at 0 across the chart. When I set series.Pen.Visible = false; the bar is slightly above the line. What I really want to do is set the pen color to the same as the bar. Right now it's slightly darker shade of the color being used in the bar. Can that be done?

Thanks,
Nick

Posted: Fri Feb 06, 2009 4:10 pm
by narcis
Hi Nick,
I've got a bar chart where I draw a line horizontally at 0 across the chart. When I set series.Pen.Visible = false; the bar is slightly above the line.


With the code snippet below it also happens with the bottom axis. So I think this is a bug. I've added it to the defect list (TF02013846) to be enhanced for future releases.

Code: Select all

		public Form1()
		{
			InitializeComponent();
			InitializeChart();
		}

		private void InitializeChart()
		{
			tChart1.Aspect.View3D = false;

			Steema.TeeChart.Styles.Bar bar1 = new Steema.TeeChart.Styles.Bar(tChart1.Chart);
			bar1.FillSampleValues();

			bar1.Pen.Visible = false;
		}
What I really want to do is set the pen color to the same as the bar. Right now it's slightly darker shade of the color being used in the bar. Can that be done?
Yes, by default pen colors are a little bit shaded for aesthetic purposes. However you can achieve what you request using this:

Code: Select all

			bar1.Pen.Color = bar1.Color;