Page 1 of 1
Label on custom axis?
Posted: Thu Nov 09, 2006 10:45 am
by 9637394
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
Posted: Thu Nov 09, 2006 11:31 am
by narcis
Hi Michael,
Yes, please post your files at news://
www.steema.net/steema.public.attachments newsgroup.
Thanks in advance.
Newsgroup?
Posted: Mon Nov 13, 2006 9:18 am
by 9637394
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
Posted: Mon Nov 13, 2006 10:48 am
by narcis
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.
Can't post to newsgroup...
Posted: Wed Nov 22, 2006 11:42 am
by 9637394
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
Posted: Wed Nov 22, 2006 12:44 pm
by narcis
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