Page 1 of 1

Chart export on iOS

Posted: Wed Nov 20, 2013 8:49 am
by 16266934
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

Re: Chart export on iOS

Posted: Wed Nov 20, 2013 11:39 am
by narcis
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;

Re: Chart export on iOS

Posted: Wed Nov 20, 2013 1:03 pm
by 16266934
Perfect. Thank you!

Re: Chart export on iOS

Posted: Wed Nov 20, 2013 2:00 pm
by narcis
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.