It is possible to have more than one line style for a serie or it is necessary to create a serie for each style.
For instance:
I need to show an horitzonal line and every time that the Y values are <0 the line will be dashed and when Y values >=0 the line will be dotted.
It is possible to do this using the same serie?
Thanks.
More than one line style for serie?
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi PocJoc,
Yes, this is possible doing something like:
Yes, this is possible doing something like:
Code: Select all
Private Sub Form_Load()
With TChart1
.AutoRepaint = False
.Series(0).Add 100, "", clTeeColor
.Series(0).Add 50, "", clTeeColor
.Series(0).Add 40, "", clTeeColor
.Series(0).Add 44, "", clTeeColor
.Series(0).Add 33, "", clTeeColor
.Series(0).Add 13, "", clTeeColor
.Series(0).Add 10, "", clTeeColor
.Series(0).Add -10, "", clTeeColor
.Series(0).Add -11, "", clTeeColor
.Series(0).Add -19, "", clTeeColor
.Series(0).Add -22, "", clTeeColor
.Series(0).Add -30, "", clTeeColor
.Series(0).Add -50, "", clTeeColor
.Series(0).Add -45, "", clTeeColor
.Series(0).Add -42, "", clTeeColor
.Series(0).asLine.LinePen.Style = psDot
.Series(0).asLine.Pointer.Visible = True
.Series(0).asLine.Pointer.Brush.Style = bsClear
.Series(0).asLine.Pointer.Pen.Visible = False
End With
End Sub
Private Sub TChart1_OnGetSeriesPointerStyle(ByVal SeriesIndex As Long, ByVal ValueIndex As Long, AStyle As TeeChart.EPointerStyle)
If TChart1.Series(0).YValues.Value(ValueIndex) < 0 Then
TChart1.Series(0).asLine.LinePen.Style = psDash
Else
TChart1.Series(0).asLine.LinePen.Style = psDot
End If
End Sub
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |