Hi,
I can open the chart editor during runtime and export a chart as e.g. a bmp picture.
The editor window shows a picture size automatically derived from chart.width and chart.height
In the according edit fields it is possible to manually edit the width and heigth data.
How to fill these parameters by the application program? To set the chart dimension in the OnShow event of the chart editor does not help as it also changes the chart size on the screen.
Thanks for any advice
Uli
How to define picture size in chart editor for export?
Re: How to define picture size in chart editor for export?
Hi Uli,
You could change the chart's width and height before opening the editor and not allowing the chart to be redrawn with autorepaint=false:
You could change the chart's width and height before opening the editor and not allowing the chart to be redrawn with autorepaint=false:
Code: Select all
uses Series, TeeEdit;
procedure TForm1.FormCreate(Sender: TObject);
begin
Chart1.Width:=300;
Chart1.Height:=200;
with Chart1.AddSeries(TBarSeries.Create(self)) do FillSampleValues();
end;
procedure TForm1.Button1Click(Sender: TObject);
var oldWidth, oldHeight: Integer;
begin
Chart1.AutoRepaint:=false;
oldWidth:=Chart1.Width;
oldHeight:=Chart1.Height;
Chart1.Width:=600;
Chart1.Height:=400;
with TChartEditor.Create(self) do
begin
Chart:=Chart1;
Execute;
end;
Chart1.AutoRepaint:=true;
Chart1.Width:=oldWidth;
Chart1.Height:=oldHeight;
end;
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |