Adding A Virtical Line/Series

TeeChart for ActiveX, COM and ASP
Post Reply
TedK
Newbie
Newbie
Posts: 6
Joined: Tue Oct 09, 2001 4:00 am

Adding A Virtical Line/Series

Post by TedK » Mon Feb 16, 2004 6:31 pm

I am trying to build two series on a chart. Series(0) is a line series and I don't have a problem generating this. The second series however need to be a vertical line and this is where I have the problem. I have tried using the HorizontalLine series which keeps generating a horizontal line vs vertical line and I have tried to draw a line using 'Canvas' this also didn't work.

Now I am trying to use the ColorLine tool and this renders a horizontal line vs a vertical line. Please look at the code below

With staticTtt

'With TChart1
.Tools.Add tcColorLine
With .Tools.Items(0)
.Active = True
With .asColorLine
.AllowDrag = False
.Axis = atBottom
.Pen.Color = vbRed
.Value = EntTTT 'This is a variable set at some point above
End with
' End With
End With
End With

Please help.....

We are on TChart 5 and we are using ASP.


Thanks,
Ted

Pep
Site Admin
Site Admin
Posts: 3303
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Tue Feb 17, 2004 11:33 am

Hi Ted,
I'm able to generate a Chart with both series types using the following code :

Code: Select all

Private Sub Form_Load()
With TChart1
    .Aspect.View3D = f
    .AddSeries scLine
    .Series(0).AddXY 0, 10, "", clTeeColor
    .Series(0).AddXY 1, 15, "", clTeeColor
    .Series(0).AddXY 2, 5, "", clTeeColor
    .Series(0).AddXY 3, 12, "", clTeeColor
    .AddSeries scHorizLine
    .Series(1).AddXY 0, 4, "", clTeeColor
    .Series(1).AddXY 1, 10, "", clTeeColor
    .Series(1).AddXY 2, 6, "", clTeeColor
    .Series(1).AddXY 3, 12, "", clTeeColor
    .Series(1).VerticalAxis = aRightAxis
End With
End Sub

TedK
Newbie
Newbie
Posts: 6
Joined: Tue Oct 09, 2001 4:00 am

I am still having a problem

Post by TedK » Tue Feb 17, 2004 3:59 pm

Pep,

I copyed and pasted the code you posted and generated the chart and I am still getting two horizontal lines vs horizontal and vertical lines. What am I missing?

Set staticTtt = Server.CreateObject("TeeChart.TChart")
With staticTtt
.Aspect.View3D = f
.AddSeries scLine
.Series(0).AddXY 0, 10, "", clTeeColor
.Series(0).AddXY 1, 15, "", clTeeColor
.Series(0).AddXY 2, 5, "", clTeeColor
.Series(0).AddXY 3, 12, "", clTeeColor
.AddSeries scHorizLine
.Series(1).AddXY 0, 4, "", clTeeColor
.Series(1).AddXY 1, 10, "", clTeeColor
.Series(1).AddXY 2, 6, "", clTeeColor
.Series(1).AddXY 3, 12, "", clTeeColor
.Series(1).VerticalAxis = aRightAxis
End With

Thanks,

Ted

Pep
Site Admin
Site Admin
Posts: 3303
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Tue Feb 17, 2004 4:16 pm

Hi Ted,

I'm sorry, I mistake me, you can do something like :

Code: Select all

Private Sub Form_Load()
With TChart1
    .Aspect.View3D = False
    .AddSeries scLine
    .Series(0).AddXY 0, 10, "", clTeeColor
    .Series(0).AddXY 1, 15, "", clTeeColor
    .Series(0).AddXY 2, 5, "", clTeeColor
    .Series(0).AddXY 3, 12, "", clTeeColor
    .AddSeries scHorizLine
    .Series(1).AddXY 4, 0, "", clTeeColor
    .Series(1).AddXY 10, 1, "", clTeeColor
    .Series(1).AddXY 6, 2, "", clTeeColor
    .Series(1).AddXY 12, 3, "", clTeeColor
    .Series(1).VerticalAxis = aRightAxis
End With
End Sub

TedK
Newbie
Newbie
Posts: 6
Joined: Tue Oct 09, 2001 4:00 am

Post by TedK » Tue Feb 17, 2004 6:04 pm

Thanks - It works.

Ted

Post Reply