You've already forked lazarus-ccr
fpspreadsheet: Add missing fpspreadsheet_chart.inc
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8974 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -0,0 +1,45 @@
|
||||
{ Included by fpspreadsheet.pas }
|
||||
|
||||
{ Chart support }
|
||||
|
||||
{@@ ----------------------------------------------------------------------------
|
||||
Creates a chart object with its top/left corner in the specified row/colum and
|
||||
having the specified width (in workbook units).
|
||||
Inserts the chart in the FCharts list of the workbook and returns the chart
|
||||
instance.
|
||||
-------------------------------------------------------------------------------}
|
||||
function TsWorkbook.AddChart(ASheet: TsBasicWorksheet; ARow, ACol: Cardinal;
|
||||
AWidth, AHeight: Double; AOffsetX: Double = 0.0; AOffsetY: Double = 0.0): TsChart;
|
||||
begin
|
||||
Result := TsChart.Create;
|
||||
if (ASheet = nil) then
|
||||
raise Exception.Create('To do: Insert chart as new ChartSheet');
|
||||
Result.SheetIndex := GetWorksheetIndex(ASheet);
|
||||
Result.Row := ARow;
|
||||
Result.Col := ACol;
|
||||
Result.OffsetX := AOffsetX;
|
||||
Result.OffsetY := AOffsetY;
|
||||
Result.Width := AWidth;
|
||||
Result.Height := AHeight;
|
||||
Result.Index := FCharts.Add(Result);
|
||||
end;
|
||||
|
||||
{@@ ----------------------------------------------------------------------------
|
||||
Returns the chart having the given index in the worksheet's chart list
|
||||
-------------------------------------------------------------------------------}
|
||||
function TsWorkbook.GetChartByIndex(AIndex: Integer): TsChart;
|
||||
begin
|
||||
if (AIndex >= 0) and (AIndex < FCharts.Count) then
|
||||
Result := FCharts[AIndex]
|
||||
else
|
||||
Result := nil;
|
||||
end;
|
||||
|
||||
{@@ ----------------------------------------------------------------------------
|
||||
Returns the number of charts embedded on this sheet
|
||||
-------------------------------------------------------------------------------}
|
||||
function TsWorkbook.GetChartCount: Integer;
|
||||
begin
|
||||
Result := FCharts.Count;
|
||||
end;
|
||||
|
Reference in New Issue
Block a user