TExportDrawing → TExportChart → [...] → TExportChartAreas
TExportChartAreas is the area chart class.
Please note that Excel has some problems reading ODS charts (it can read most features, but not all)! ODS charts are correctly displayed in Calc and XLSX charts are correctly displayed in Excel.
Name | Type | Description |
---|---|---|
Grouping | TExportChartGrouping | Grouping of the chart. |
Form | TCustomExportChartForm | Form of the chart (ecf2D, ecf3D). |
Please see TExportChart for inherited properties. |
This code generates a percentally stacked area chart:
procedure TForm1.BtnTestClick(Sender: TObject); var xExport: TOExport; I: Integer; begin xExport := TOExport.Create; try with xExport.AddWorkSheet('Area chart') do begin AddRow.AddCellString('Sales in €').SetFontSize(20); with AddRow do begin AddCellString('Products'); AddCellString('Bubble gums'); AddCellString('Doughnuts'); AddCellString('Soups'); AddCellString('Drinks'); AddCellString(''); AddCellString(''); with AddCellString('').AddChart(TExportChartAreas, 0, 0, 500, 300) do with TExportChartAreas(Drawing) do begin Title := 'Sales in €'; Fill.Color := clWhite; Border.Color := clBlue; Shadow.FillStyle := edfColor; Grouping := ecPercentStacked; Form := ecf3D;//TRY DIFFERENT SETTINGS Legend := eclLeft;//TRY DIFFERENT SETTINGS XTicsRange.SetRange(0, Rows.Count, 1, 3);//x-axis description for I := 1 to 4 do with AddData(I, Rows.Count, 1, 3) do begin//y-axis data DataTitle.SetRange(I, Rows.Count-1, 1, 1);//legend entry title ShowLabels := False; Border.FillStyle := edfNone; end; end; end; with AddRow do begin AddCellString('January'); AddCellNumber(15); AddCellNumber(30); AddCellNumber(10); AddCellNumber(50); end; with AddRow do begin AddCellString('February'); AddCellNumber(12); AddCellNumber(40); AddCellNumber(18); AddCellNumber(47); end; with AddRow do begin AddCellString('March'); AddCellNumber(8); AddCellNumber(25); AddCellNumber(12); AddCellNumber(61); end; end; xExport.SaveToFileWithDialog; finally xExport.Free; end; end;