Steema Issues Database

Note: This database is for bugs and wishes only. For technical support help, if you are a customer please visit our online forums;
otherwise you can use StackOverflow.
Before using this bug-tracker we recommend a look at this document, Steema Bug Fixing Policy.



Bug 2621 - Add an event to modify properties when saving the chart to Stream/File
Summary: Add an event to modify properties when saving the chart to Stream/File
Status: RESOLVED WONTFIX
Alias: None
Product: VCL TeeChart
Classification: Unclassified
Component: Export (show other bugs)
Version: unspecified
Hardware: PC Windows
: --- enhancement
Target Milestone: ---
Assignee: Steema Issue Manager
URL: https://www.steema.com/support/viewto...
Keywords:
Depends on:
Blocks:
 
Reported: 2023-07-13 12:12 EDT by yeray alonso
Modified: 2023-07-14 02:44 EDT (History)
1 user (show)

See Also:
Chart Series: ---
Delphi / C++ Builder RAD IDE Version:


Attachments
test example (1.80 KB, application/x-zip-compressed)
2023-07-13 12:12 EDT, yeray alonso
Details

Note You need to log in before you can comment on or make changes to this bug.
Description yeray alonso 2023-07-13 12:12:18 EDT
Created attachment 1050 [details]
test example

It could be sometimes useful to allow modifying the properties that are being saved to a Stream, as the customer in the forums suggests.

I've added the customers test project with the event - under development - commented out.
Comment 1 yeray alonso 2023-07-14 02:44:52 EDT
The latest version (v2023.38) adds SaveChartToString/LoadChartFromString which could do the job without having to add a new event into the Chart. Here the example:

procedure TForm1.BSaveClick(Sender: TObject);
var lStringList:TStringList;

  procedure DeleteIfExists(prop: string);
  var idx: Integer;
  begin
    idx:=lStringList.IndexOf(prop);
    if idx>=0 then
       lStringList.Delete(idx);
  end;

begin
  lStringList:=TStringList.Create;
  lStringList.Text:=SaveChartToString(Chart1);

  DeleteIfExists('Marks.OnTop');

  MemoXML.Lines:=lStringList;
end;

procedure TForm1.BLoadClick(Sender: TObject);
begin
  LoadChartFromString(Chart1, MemoXML.Lines.Text);
end;