hi
can i draw a freedom shape
and can i fill it by a color
thanks
can i draw freedom shape
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Jameh2020,
What do you exactly mean with "a freedom shape"?
Thanks in advance.
What do you exactly mean with "a freedom shape"?
Thanks in advance.
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 |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Jameh2020,
Following up to your question, you may be interested on drawing polygons in TeeChart's canvas as shown here:
Following up to your question, you may be interested on drawing polygons in TeeChart's canvas as shown here:
Code: Select all
Private Sub TChart1_OnAfterDraw()
With TChart1.Canvas
.Pen.Color = vbBlue
.Brush.Color = vbRed
a = Array(100, 100, 150, 50, 170, 100, 250, 100, 200, 200)
.Polygon 5, a
End With
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 |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Jameh2020,
This is because those are absolute pixel positions. In that case you should use pixel positions relative to some chart elements (series points, axes, etc.), for example:
This is because those are absolute pixel positions. In that case you should use pixel positions relative to some chart elements (series points, axes, etc.), for example:
Code: Select all
Private Sub Form_Load()
TChart1.Series(0).FillSampleValues 10
End Sub
Private Sub TChart1_OnAfterDraw()
With TChart1.Canvas
.Pen.Color = vbBlue
.Brush.Color = vbRed
a = Array(TChart1.Axis.Left.Position, TChart1.Axis.Top.Position, _
TChart1.Axis.Left.Position, TChart1.Axis.Bottom.Position, _
TChart1.Series(0).CalcXPos(5), TChart1.Series(0).CalcYPos(5))
.Polygon 3, a
End With
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 |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Jameh2020,
Ok, in that case you can use OnBeforeDrawChart event and some code like this:
Please don't forget the InternalRepaint method calls to have the custom painting properly done.
Ok, in that case you can use OnBeforeDrawChart event and some code like this:
Code: Select all
Private Sub Form_Load()
TChart1.Series(0).FillSampleValues 10
TChart1.Environment.InternalRepaint
End Sub
Private Sub TChart1_OnBeforeDrawChart()
With TChart1
p1x = .Series(0).CalcXPos(2)
p1y = .Axis.Left.CalcYPosValue(.Series(0).asCandle.HighValues.Value(2))
p2x = .Series(0).CalcXPos(4)
p2y = .Axis.Left.CalcYPosValue(.Series(0).asCandle.HighValues.Value(4))
p3x = p2x
p3y = .Axis.Left.CalcYPosValue(.Series(0).asCandle.LowValues.Value(4))
p4x = p1x
p4y = .Axis.Left.CalcYPosValue(.Series(0).asCandle.LowValues.Value(2))
End With
With TChart1.Canvas
.Pen.Color = vbBlue
.Brush.Color = vbRed
a = Array(p1x, p1y, p2x, p2y, p3x, p3y, p4x, p4y)
.Polygon 4, a
End With
End Sub
Private Sub TChart1_OnScroll()
TChart1.Environment.InternalRepaint
End Sub
Private Sub TChart1_OnUndoZoom()
TChart1.Environment.InternalRepaint
End Sub
Private Sub TChart1_OnZoom()
TChart1.Environment.InternalRepaint
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 |