fpspreadsheet: More user-friendly chart background style.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8972 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2023-10-23 09:28:05 +00:00
parent 623d0bd4c5
commit ce4e36ca38
3 changed files with 122 additions and 36 deletions

View File

@ -1,5 +1,7 @@
program write_chart_demo;
{.$DEFINE DARK_MODE}
uses
SysUtils, fpspreadsheet, fpstypes, fpschart, xlsxooxml, fpsopendocument;
var
@ -8,8 +10,6 @@ var
ch: TsChart;
ser: TsChartSeries;
i: Integer;
bg: TsChartFill;
frm: TsChartLine;
begin
b := TsWorkbook.Create;
try
@ -28,18 +28,20 @@ begin
ser.SetLabelRange(1, 0, 7, 0);
ser.SetYRange(1, 1, 7, 1);
bg.FgColor := scYellow;
bg.Style := fsSolidFill;
ch.Background := bg;
{$IFDEF DARK_MODE}
ch.Background.FgColor := scBlack;
ch.Background.Style := fsSolidFill;
frm.color := scRed;
frm.Style := clsSolid;
ch.Border := frm;
ch.Border.Color := scWhite;
ch.Border.Style := clsSolid;
{$ENDIF}
ch.Title.Caption := 'HALLO';
ch.Title.Visible := true;
ch.SubTitle.Caption := 'hallo';
ch.SubTitle.Visible := true;
ch.YAxis.ShowMajorGridLines := true;
ch.YAxis.ShowMinorGridLines := true;