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
Adding A Virtical Line/Series
Hi Ted,
I'm able to generate a Chart with both series types using the following code :
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
Pep Jorge
http://support.steema.com
http://support.steema.com
I am still having a problem
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
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
Hi Ted,
I'm sorry, I mistake me, you can do something like :
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
Pep Jorge
http://support.steema.com
http://support.steema.com