Page 1 of 1

Horizontal maxumum line not drawn

Posted: Tue Apr 19, 2005 10:47 am
by 6929966
Hello

I found the following problem: If the highest value in a series is horizontal line (not a single point), then this line will not be drawn. You can reproduce it by adding a TChart to a form and put the following code into Form_Load

Code: Select all

		Me.TChart1.Walls.Visible = False
		Me.TChart1.Aspect.View3D = False
		Dim s1 As New Steema.TeeChart.Styles.Line(TChart1.Chart)
		s1.Add(1, 0)
		s1.Add(2, 100)
		s1.Add(3, 100)
		s1.Add(4, 0)
So the line between Point 2 and 3 cannot be seen.

Is this a bug or have I forgotten to set the correct property?
(I know, I can work around this, when I set Automatic = False and increase the Axis.Maximum a little bit, but that´s not how it should be).

Greetings
Elric

Posted: Tue Apr 19, 2005 11:50 am
by Marjan
Hi.

Actually, the line is drawn, but it's drawn right on the axis border so it's clipped. To solve this problem, you can add extra offset to vertical axis. Something along these lines (C#, the same approach can be used with VB as well):

Code: Select all

s1.Add(1,0);
s1.Add(3,100);
s1.Add(2,100);
s1.Add(4,0);
s1.GetVertAxis.MaximumOffset = 5; // 5px offset
s1.GetVertAxis.MinimumOffset = 5; // 5px offset

Posted: Tue Apr 19, 2005 12:01 pm
by narcis
Hello Elric,

This is a pixel rounding problem we are aware of. However there's an easy solution for this that's setting a pixel offset for the axis doing:
Me.TChart1.Walls.Visible = False
Me.TChart1.Aspect.View3D = False
Dim s1 As New Steema.TeeChart.Styles.Line(TChart1.Chart)
s1.Add(1, 0)
s1.Add(2, 100)
s1.Add(3, 100)
s1.Add(4, 0)
s1.Add(5, 0)

Me.TChart1.Axes.Left.MaximumOffset = 5
Me.TChart1.Axes.Left.MinimumOffset = 5

Posted: Thu Apr 21, 2005 7:58 am
by 6929966
Hello Marjan, Hello Narcis

Thanks for your answers. It works fine. This is a solution I am completely contented with. :D

Greetings
Elric