Page 1 of 1

What TChart.Canvas class is being used?

Posted: Fri Aug 08, 2014 2:07 pm
by 10546565
For a long time, I had the following code:

Code: Select all

  Assert(aChart.Canvas is TGDIPlusCanvas, 'Chart canvas class should be TGDIPlusCanvas but is ' + aChart.Canvas.ClassName);
  aChart.Canvas := TTeeCanvas3D.Create;
  try
  ...
  finally
    aChart.Canvas := TGDIPlusCanvas.Create;
  end;
This code gets called a lot (used to create an image of a chart for reporting). But a few days ago the Assert fired.

How can I know what class is used by default for the TChart.Canvas object?

Ed Dressel

Re: What TChart.Canvas class is being used?

Posted: Fri Aug 08, 2014 3:03 pm
by yeray
Hi Ed,

The default Canvas is the one you have selected in the "Render" combobox at the "New Chart" tab at the design time options. Note this option is saved at the registry entry:

Code: Select all

HKEY_CURRENT_USER\Software\Steema Software\TeeChart Pro\Editor\DefaultCanvas
- a blank string '' is the value set for the GDI canvas.
- 'TGDIPlusCanvas' is the value set for GDI+.