I am getting a "canvas does not allow drawing" exception from TCanvas.RequiredState procedure in graphics.pas in the VCL...
it is occuring while i am running a realtime plot with 1000+ points...
the points are being drawn onto the Chart.Canvas in a similar fashion to TFastLineSeries (overriding NotifyNewValue procedure) through a separate thread to the main application thread...
the exception seems to get raised randomly during a run... though it also seems more frequent when the mouse is moving (main app thread maybe interfering with the drawing of the chart...)
any suggestions greatly appreciated....
Canvas does not allow drawing..
I have the same problem
I have the same problem, and I use Teechart 5.03 with Delphi7. Is this your case?
I'd like to know if this problem have a solucion in another version of TeeChart.
I'd like to know if this problem have a solucion in another version of TeeChart.
it's TeeChart 5.02 with Delphi 6...
On delphi faq's it is said that this is unsafe code as accessing the one canvas from different threads will cause problems - i.e. potentially the canvas will attempt to be drawn by both threads simultaneously
it is suggested to use TCanvas.Lock and TCanvas.Unlock while drawing ...
and this might solve the problem..
But TChart doesn't seem to allow you lock the chart for drawing.... as the Chart.Canvas is a TCanvas3D and doesn't directly inherit from the VCL TCanvas, and i don't know how i could prevent a thread from accessing the canvas ... (maybe i'm barking up the wrong tree here..)
etc.etc..
On delphi faq's it is said that this is unsafe code as accessing the one canvas from different threads will cause problems - i.e. potentially the canvas will attempt to be drawn by both threads simultaneously
it is suggested to use TCanvas.Lock and TCanvas.Unlock while drawing ...
and this might solve the problem..
But TChart doesn't seem to allow you lock the chart for drawing.... as the Chart.Canvas is a TCanvas3D and doesn't directly inherit from the VCL TCanvas, and i don't know how i could prevent a thread from accessing the canvas ... (maybe i'm barking up the wrong tree here..)
etc.etc..
Hi.
One thing that might work would be to disable the chart drawing while you're modifying series data points. In short, set chart AutoRepaint property to false before you start modifying series values and then at the end (when you need a redraw), set the AutoRepaint back to true and refresh the chart by calling the TChart.Repaint method. I've discussed some of the problems with real-time plotting in one of my articles. Check the following article
One thing that might work would be to disable the chart drawing while you're modifying series data points. In short, set chart AutoRepaint property to false before you start modifying series values and then at the end (when you need a redraw), set the AutoRepaint back to true and refresh the chart by calling the TChart.Repaint method. I've discussed some of the problems with real-time plotting in one of my articles. Check the following article
Marjan Slatinek,
http://www.steema.com
http://www.steema.com
With T7 I don't have problem
Well, I don't get a solution using AutoRepaint = False .....
but I've tested the T6 and T7 and with T6 the problem still happend
with T7 the problem disappeared!
p.s: The problem is not the number of points ploted, but the number of charts that I try to plot in the screen.
but I've tested the T6 and T7 and with T6 the problem still happend
with T7 the problem disappeared!
p.s: The problem is not the number of points ploted, but the number of charts that I try to plot in the screen.