2023-11-21 22:03:20 +00:00
|
|
|
unit main;
|
|
|
|
|
|
|
|
{$mode objfpc}{$H+}
|
|
|
|
|
|
|
|
interface
|
|
|
|
|
|
|
|
uses
|
|
|
|
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ExtCtrls,
|
|
|
|
TAGraph,
|
|
|
|
fpSpreadsheet, fpsTypes, fpsOpenDocument,
|
|
|
|
fpSpreadsheetCtrls, fpSpreadsheetGrid, fpSpreadsheetChart;
|
|
|
|
|
|
|
|
type
|
|
|
|
|
|
|
|
{ TForm1 }
|
|
|
|
|
|
|
|
TForm1 = class(TForm)
|
|
|
|
Chart1: TChart;
|
|
|
|
Splitter1: TSplitter;
|
|
|
|
sWorkbookSource1: TsWorkbookSource;
|
|
|
|
sWorksheetGrid1: TsWorksheetGrid;
|
|
|
|
procedure FormCreate(Sender: TObject);
|
|
|
|
private
|
|
|
|
sChartLink: TsWorkbookChartLink;
|
|
|
|
|
|
|
|
public
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
var
|
|
|
|
Form1: TForm1;
|
|
|
|
|
|
|
|
implementation
|
|
|
|
|
|
|
|
{$R *.lfm}
|
|
|
|
|
|
|
|
const
|
2023-11-22 22:08:47 +00:00
|
|
|
// FILE_NAME = '../../../other/chart/bars.ods';
|
|
|
|
// FILE_NAME = '../../../other/chart/area.ods';
|
2023-11-23 18:49:41 +00:00
|
|
|
FILE_NAME = '../../../other/chart/area-sameImg.ods';
|
2023-11-23 00:08:33 +00:00
|
|
|
// FILE_NAME = '../../../other/chart/pie.ods';
|
|
|
|
// FILE_NAME = '../../../other/chart/scatter.ods';
|
2023-11-23 18:49:41 +00:00
|
|
|
// FILE_NAME = '../../../other/chart/regression.ods';
|
2023-11-21 22:03:20 +00:00
|
|
|
|
|
|
|
{ TForm1 }
|
|
|
|
|
|
|
|
procedure TForm1.FormCreate(Sender: TObject);
|
|
|
|
var
|
|
|
|
fn: String;
|
|
|
|
begin
|
|
|
|
fn := ExpandFileName(FILE_NAME);
|
|
|
|
|
|
|
|
sWorkbookSource1.FileFormat := sfOpenDocument;
|
|
|
|
if FileExists(fn) then
|
|
|
|
sWorkbookSource1.Filename := fn;
|
|
|
|
|
|
|
|
sChartLink := TsWorkbookChartLink.Create(self);
|
|
|
|
sChartLink.Chart := Chart1;
|
|
|
|
sChartLink.WorkbookSource := sWorkbookSource1;
|
|
|
|
sChartLink.WorkbookChartIndex := 0;
|
|
|
|
end;
|
|
|
|
|
|
|
|
end.
|
|
|
|
|