Page 1 of 1

Adding A Virtical Line/Series

Posted: Mon Feb 16, 2004 6:31 pm
by 6920687
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

Posted: Tue Feb 17, 2004 11:33 am
by Pep
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

I am still having a problem

Posted: Tue Feb 17, 2004 3:59 pm
by 6920687
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

Posted: Tue Feb 17, 2004 4:16 pm
by Pep
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

Posted: Tue Feb 17, 2004 6:04 pm
by 6920687
Thanks - It works.

Ted