Export Donut chart to PDF

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Pedro Bento
Newbie
Newbie
Posts: 1
Joined: Tue Apr 24, 2018 12:00 am

Export Donut chart to PDF

Post by Pedro Bento » Tue Apr 24, 2018 6:49 pm

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.
Attachments
Export_Preview_Result.png
Export_Preview_Result.png (48.35 KiB) Viewed 2880 times
Export_Preview.png
Export_Preview.png (12.29 KiB) Viewed 2878 times
Form_Chart.png
Form_Chart.png (12.71 KiB) Viewed 2878 times

Yeray
Site Admin
Site Admin
Posts: 8971
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Export Donut chart to PDF

Post by Yeray » Thu Apr 26, 2018 7:25 am

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 2863 times
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply