Hi,
I am using TeeChart Pro 5.0.
I need to draw one horizontal dotted lines in my line graph from the point 0 in Y- axis. I have attached one image.
Can you tell me how can I do this.
Horizontal dotted lines from 0 point of Y-axis .
Horizontal dotted lines from 0 point of Y-axis .
- Attachments
-
- Dotted horizontal line from point 0 in Y- axis
- LineGraph-HorizontalDottedLine.JPG (6.23 KiB) Viewed 5074 times
Re: Horizontal dotted lines from 0 point of Y-axis .
Hi CS,
With TeeChart v8 you can use ColorLine to do that but in Teechart v5 I think that this tool wasn't still available. If not, you still could draw the desired line drawing it directly to the canvas at OnAfterDraw event.
With TeeChart v8 you can use ColorLine to do that but in Teechart v5 I think that this tool wasn't still available. If not, you still could draw the desired line drawing it directly to the canvas at OnAfterDraw event.
Code: Select all
Private Sub Form_Load()
TChart1.Aspect.View3D = False
TChart1.AddSeries scFastLine
TChart1.Series(0).Add -50, "", clTeeColor
TChart1.Series(0).Add 0, "", clTeeColor
TChart1.Series(0).Add 75, "", clTeeColor
TChart1.Series(0).Add 50, "", clTeeColor
TChart1.Series(0).Add 50, "", clTeeColor
TChart1.Axis.Left.SetMinMax -100, 300
TChart1.Tools.Add tcColorLine
TChart1.Tools.Items(0).asColorLine.Axis = TChart1.Axis.Left
TChart1.Tools.Items(0).asColorLine.Value = 0
TChart1.Tools.Items(0).asColorLine.Pen.Color = vbMagenta
TChart1.Tools.Items(0).asColorLine.Pen.Style = psDash
End Sub
'Private Sub TChart1_OnAfterDraw()
' With TChart1.Canvas
' .Pen.Color = vbMagenta
' .Pen.Style = psDash
' .Line TChart1.Axis.Bottom.IStartPos, TChart1.Axis.Left.CalcYPosValue(0), TChart1.Axis.Bottom.IEndPos, TChart1.Axis.Left.CalcYPosValue(0)
' End With
'End Sub
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Horizontal dotted lines from 0 point of Y-axis .
Thanks Yeray. It worked.