Chart export on iOS

TeeChart FireMonkey (Windows,OSX,iOS & Android) for Embarcadero RAD Studio, Delphi and C++ Builder (XE5+)
Post Reply
OceaBen
Newbie
Newbie
Posts: 4
Joined: Tue Sep 03, 2013 12:00 am

Chart export on iOS

Post by OceaBen » Wed Nov 20, 2013 8:49 am

Hi,

I'm using the last version of TeeChart 2013 (posted yesterday) on Delphi XE5 for iOS application.

TChart.SaveToBitmapFile doesn't seem to be working. This function returns false:

Code: Select all

  Chart1.SaveToBitmapFile(GetHomePath + PathDelim + 'Documents' + PathDelim + 'test.BMP');

  Result := FileExists(GetHomePath + PathDelim + 'Documents' + PathDelim + 'test.BMP');
Is there anyway to export Chart in bmp ?

Or in other format (jpeg, pdf,....)

Thanks in advance.

Ben

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: Chart export on iOS

Post by Narcís » Wed Nov 20, 2013 11:39 am

Hi Ben,

The problem is the .bmp extension as explained at StackOverflow. Changing the filename to .jpg solves the problem:

Code: Select all

  FileName:=GetHomePath + PathDelim + 'Documents' + PathDelim + 'test.jpg';
  Chart1.SaveToBitmapFile(FileName);
For a PDF export you can do this:

Code: Select all

uses
  FMXTee.Canvas.PDF;

procedure TForm1.Button1Click(Sender: TObject);
var
  FileName  : String;
  Extension : String;
begin
  Extension:='pdf';
  FileName:=GetHomePath + PathDelim + 'Documents' + PathDelim + 'test.' + Extension;
  //Chart1.SaveToBitmapFile(FileName); //use .jpg http://stackoverflow.com/questions/19482829/firemonkey-taking-and-saving-pictures
  TeeSaveToPDFFile(Chart1, FileName, Round(Chart1.Width), Round(Chart1.Height));
end;
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

OceaBen
Newbie
Newbie
Posts: 4
Joined: Tue Sep 03, 2013 12:00 am

Re: Chart export on iOS

Post by OceaBen » Wed Nov 20, 2013 1:03 pm

Perfect. Thank you!

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: Chart export on iOS

Post by Narcís » Wed Nov 20, 2013 2:00 pm

Hi OceaBen,

As an update, we have added this to the bug list [ID118] to be improved for future releases. If you sign up at our bugzilla system I can add you to the CC List to be updated about the issue's evolution.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply