Label on custom axis?

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Jan Madsen
Newbie
Newbie
Posts: 21
Joined: Wed Jun 22, 2005 4:00 am

Label on custom axis?

Post by Jan Madsen » Thu Nov 09, 2006 10:45 am

Hi

When I create a new custom axis, I can't get the title to be shown just left of the axis. It was possible in the Active X version, but I can't figure out how to do it with .net.

I'm running the latest released version of TChart.

Is there anywhere I can upload a screendump showing the problem?


Regards
M

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

Post by Narcís » Thu Nov 09, 2006 11:31 am

Hi Michael,

Yes, please post your files at news://www.steema.net/steema.public.attachments newsgroup.

Thanks in advance.
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

Jan Madsen
Newbie
Newbie
Posts: 21
Joined: Wed Jun 22, 2005 4:00 am

Newsgroup?

Post by Jan Madsen » Mon Nov 13, 2006 9:18 am

Hi

I was trying to send the screendumps to news://www.steema.net/steema.public.attachments newsgroup, but I'm not sure that it succeeded. Can you please tell me if you got the screendumps.

/m

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

Post by Narcís » Mon Nov 13, 2006 10:48 am

Hi Michael,

I'm afraid your message is not in the newsgroups. You just need to set up www.steema.net as a newsgroups server with all default settings and subscribe to the attachments newsgroups. Would you be so kind to try sending it again?

Thanks in advance.
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

Jan Madsen
Newbie
Newbie
Posts: 21
Joined: Wed Jun 22, 2005 4:00 am

Can't post to newsgroup...

Post by Jan Madsen » Wed Nov 22, 2006 11:42 am

Hi, since I can't upload to newsgroup, I will try to post the following code instead:

Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim Line1 As New Steema.TeeChart.Styles.Line()
Dim Line2 As New Steema.TeeChart.Styles.Line()
Dim t As Integer

TChart1.Aspect.View3D = False
TChart1.Panel.Gradient.Visible = True
TChart1.Header.Text = "TeeChart Multiple Axes"
TChart1.Series.Add(Line1)
TChart1.Series.Add(Line2)
For t = 0 To 10
Line1.Add(t, 10 + t, Color.Red)
If (t > 1) Then
Line2.Add(t, t, Color.Green)
End If
Next

With TChart1.Axes.Left
.StartPosition = 0
.EndPosition = 100
.AxisPen.Color = Color.Red
.Title.Font.Color = Color.Red
.Title.Font.Bold = True
.Title.Text = "1st Left Axis"
End With

Dim Axis1 As New Steema.TeeChart.Axis(False, True, TChart1.Chart)
TChart1.Axes.Custom.Add(Axis1)
Line2.CustomVertAxis = Axis1
Axis1.StartPosition = 0
Axis1.EndPosition = 100
Axis1.AxisPen.Color = Color.Green
Axis1.Title.Font.Color = Color.Green
Axis1.Title.Font.Bold = True
Axis1.Title.Text = "Extra Axis 1"
Axis1.Title.Angle = 90
Axis1.RelativePosition = -5

Dim Axis2 As New Steema.TeeChart.Axis(False, True, TChart1.Chart)
TChart1.Axes.Custom.Add(Axis2)
Line2.CustomVertAxis = Axis2
Axis2.StartPosition = 0
Axis2.EndPosition = 100
Axis2.AxisPen.Color = Color.Green
Axis2.Title.Font.Color = Color.Green
Axis2.Title.Font.Bold = True
Axis2.Title.Text = "Extra Axis 2"
Axis2.Title.Angle = 90
Axis2.RelativePosition = -10

Dim Axis3 As New Steema.TeeChart.Axis(False, True, TChart1.Chart)
TChart1.Axes.Custom.Add(Axis3)
Line2.CustomVertAxis = Axis3
Axis3.StartPosition = 0
Axis3.EndPosition = 100
Axis3.AxisPen.Color = Color.Green
Axis3.Title.Font.Color = Color.Green
Axis3.Title.Font.Bold = True
Axis3.Title.Text = "Extra Axis 3"
Axis3.Title.Angle = 90
Axis3.RelativePosition = -10
End Sub
End Class


The problem is, that in the ActiveX version, it is possible to add extra axis with title standing next to it, which does not seem to be possible in the .net version. The title in the .net version (and code above) is placed correct for the last added axis, but not for the others.

best regards
M

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

Post by Narcís » Wed Nov 22, 2006 12:44 pm

Hi Michael,

This is because some of the custom axes don't have series associated as one series only can have one vertical and one horizontal custom axis associated.

To solve this problem you can add a couple of dummy series with no data to your chart and associate those axes to the dummy series:

Code: Select all

Public Class Form1

	Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
		Dim Line1 As New Steema.TeeChart.Styles.Line()
		Dim Line2 As New Steema.TeeChart.Styles.Line()
		Dim t As Integer

		TChart1.Aspect.View3D = False
		TChart1.Panel.Gradient.Visible = True
		TChart1.Header.Text = "TeeChart Multiple Axes"
		TChart1.Series.Add(Line1)
		TChart1.Series.Add(Line2)
		For t = 0 To 10
			Line1.Add(t, 10 + t, Color.Red)
			If (t > 1) Then
				Line2.Add(t, t, Color.Green)
			End If
		Next

		With TChart1.Axes.Left
			.StartPosition = 0
			.EndPosition = 100
			.AxisPen.Color = Color.Red
			.Title.Font.Color = Color.Red
			.Title.Font.Bold = True
			.Title.Text = "1st Left Axis"
		End With

		Dim DummyLine1 As New Steema.TeeChart.Styles.Line(TChart1.Chart)

		Dim Axis1 As New Steema.TeeChart.Axis(False, True, TChart1.Chart)
		TChart1.Axes.Custom.Add(Axis1)
		'Line2.CustomVertAxis = Axis1
		DummyLine1.CustomVertAxis = Axis1
		Axis1.StartPosition = 0
		Axis1.EndPosition = 100
		Axis1.AxisPen.Color = Color.Green
		Axis1.Title.Font.Color = Color.Green
		Axis1.Title.Font.Bold = True
		Axis1.Title.Text = "Extra Axis 1"
		Axis1.Title.Angle = 90
		Axis1.RelativePosition = -5

		Dim DummyLine2 As New Steema.TeeChart.Styles.Line(TChart1.Chart)

		Dim Axis2 As New Steema.TeeChart.Axis(False, True, TChart1.Chart)
		TChart1.Axes.Custom.Add(Axis2)
		'Line2.CustomVertAxis = Axis2
		DummyLine2.CustomVertAxis = Axis2
		Axis2.StartPosition = 0
		Axis2.EndPosition = 100
		Axis2.AxisPen.Color = Color.Green
		Axis2.Title.Font.Color = Color.Green
		Axis2.Title.Font.Bold = True
		Axis2.Title.Text = "Extra Axis 2"
		Axis2.Title.Angle = 90
		Axis2.RelativePosition = -10

		Dim Axis3 As New Steema.TeeChart.Axis(False, True, TChart1.Chart)
		TChart1.Axes.Custom.Add(Axis3)
		Line2.CustomVertAxis = Axis3
		Axis3.StartPosition = 0
		Axis3.EndPosition = 100
		Axis3.AxisPen.Color = Color.Green
		Axis3.Title.Font.Color = Color.Green
		Axis3.Title.Font.Bold = True
		Axis3.Title.Text = "Extra Axis 3"
		Axis3.Title.Angle = 90
		Axis3.RelativePosition = -10
	End Sub
End Class
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

Post Reply