Canvas drawing not exporting
Posted: Thu Dec 04, 2008 3:27 pm
Hi,
After a few years of succesfully developing using your teechart activeX, I am now looking at some strange behavior that I do not understand.
I create a simple chart like this in Visual Foxpro using your ActiveX.
1)
I dropped an instance of the teechart activeX to my form and just create a simple bar serie in it with some sample values in the form's init.
ThisForm.oChart.AddSeries(1)
ThisForm.oChart.Series(0).FillSampleValues(10)
2)
In the OnAfterDraw event I add some custom drawings on top of the series to the canvas.
This.Canvas.Font.Name = "Verdana"
This.Canvas.Font.Size = 16
This.Canvas.Font.Color = 0
X = This.Series(0).CalcXPosValue(4)
Y = This.Series(0).CalcYPosValue(300)
This.Canvas.TextOut(X, Y, "What's wrong")
When I run my form It shows everything I expected.
3)
I want to export this chart, so I use the following command in a button.
ThisForm.oChart.Export.SaveToJPEGFile("c:\test.jpg",.F.,100,100,800, 600)
This command does not export my custom drawings added to the canvas.
I also tried a
ThisForm.ocHART.Repaint()
ThisForm.oChart.Environment.InternalRepaint()
Before my export call but this also does not work...
I'm very frustrated right now as I have a deadline by tomorrow and have no clue how I can fix this.
I already downloaded the latest version of Teechart 7 but no success.
I also tried it with the Teechart 8 evaluation, but no success either.
Could someone please tell me what I am doing wrong or maybe it's considered a Bug.
Am willing to upgrade my Teechart 7 license to version 8 if it's nescessary, but I have to be certain that this problem is fixed then.
Hope someone can help me.
Regards, Jacques
After a few years of succesfully developing using your teechart activeX, I am now looking at some strange behavior that I do not understand.
I create a simple chart like this in Visual Foxpro using your ActiveX.
1)
I dropped an instance of the teechart activeX to my form and just create a simple bar serie in it with some sample values in the form's init.
ThisForm.oChart.AddSeries(1)
ThisForm.oChart.Series(0).FillSampleValues(10)
2)
In the OnAfterDraw event I add some custom drawings on top of the series to the canvas.
This.Canvas.Font.Name = "Verdana"
This.Canvas.Font.Size = 16
This.Canvas.Font.Color = 0
X = This.Series(0).CalcXPosValue(4)
Y = This.Series(0).CalcYPosValue(300)
This.Canvas.TextOut(X, Y, "What's wrong")
When I run my form It shows everything I expected.
3)
I want to export this chart, so I use the following command in a button.
ThisForm.oChart.Export.SaveToJPEGFile("c:\test.jpg",.F.,100,100,800, 600)
This command does not export my custom drawings added to the canvas.
I also tried a
ThisForm.ocHART.Repaint()
ThisForm.oChart.Environment.InternalRepaint()
Before my export call but this also does not work...
I'm very frustrated right now as I have a deadline by tomorrow and have no clue how I can fix this.
I already downloaded the latest version of Teechart 7 but no success.
I also tried it with the Teechart 8 evaluation, but no success either.
Could someone please tell me what I am doing wrong or maybe it's considered a Bug.
Am willing to upgrade my Teechart 7 license to version 8 if it's nescessary, but I have to be certain that this problem is fixed then.
Hope someone can help me.
Regards, Jacques