Page 1 of 1

Export Donut chart to PDF

Posted: Tue Apr 24, 2018 6:49 pm
by 16483571
Good afternoon,

Delphi version: Delphi XE
TeeChart version: Teechart Pro v2018.24.180321 32bit VCL

I'm unable to correctly export a Donut chart to PDF.
In the attached files I show the chart in a TForm, the export options I select (I don't change any settings) and the PDF export result.
I simply place a new TChart on the screen, add a new Donut series and using the sample data I export the chart to PDF.

This happens when I export a Donut chart from a TForm.
It gets worse when I try to export a Donut chart in a report. I'm using Digital Metaphors Report Builder, version 14.07 Build 326.
Nothing but the legend is exported to PDF.
Any ideas on how this can be fixed? Is this a known issue?

Best regards,

Pedro Bento
Codeware, S.A.

Re: Export Donut chart to PDF

Posted: Thu Apr 26, 2018 7:25 am
by yeray
Hello,

Indeed the export to pdf seems to be broken for the TDonutSeries in 2D. I've added it to the public tracker:
http://bugs.teechart.net/show_bug.cgi?id=2031

In the meanwhile, it seems you can draw it in 3D and simulate a 2D setting Chart3DPercent to 0 and Elevation to 360:

Code: Select all

uses TeePDFCanvas, TeeDonut;

procedure TForm1.FormCreate(Sender: TObject);
begin
  Chart1.Title.Caption:='Donut';

  with Chart1.AddSeries(TDonutSeries) as TDonutSeries do
  begin
    FillSampleValues(4);
    Shadow.Hide;
    Marks.Hide;
  end;

  Chart1.Chart3DPercent:=0;
  Chart1.Aspect.Elevation:=360;

  TeeSaveToPDFFile(Chart1, 'C:\tmp\Chart1.pdf');
end;
Here a screenshot of the resultant pdf:
donut_pdf.png
donut_pdf.png (13.28 KiB) Viewed 6343 times