Horizontal maxumum line not drawn

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Elric
Newbie
Newbie
Posts: 21
Joined: Fri Nov 15, 2002 12:00 am

Horizontal maxumum line not drawn

Post by Elric » Tue Apr 19, 2005 10:47 am

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

Marjan
Site Admin
Site Admin
Posts: 745
Joined: Fri Nov 07, 2003 5:00 am
Location: Slovenia
Contact:

Post by Marjan » Tue Apr 19, 2005 11:50 am

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
Marjan Slatinek,
http://www.steema.com

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Tue Apr 19, 2005 12:01 pm

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
Best Regards,
Narcís Calvet / 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

Elric
Newbie
Newbie
Posts: 21
Joined: Fri Nov 15, 2002 12:00 am

Post by Elric » Thu Apr 21, 2005 7:58 am

Hello Marjan, Hello Narcis

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

Greetings
Elric

Post Reply