diff --git a/components/fpspreadsheet/examples/other/chart/stock_write_demo.lpi b/components/fpspreadsheet/examples/other/chart/stock_write_demo.lpi
new file mode 100644
index 000000000..63cb7d58d
--- /dev/null
+++ b/components/fpspreadsheet/examples/other/chart/stock_write_demo.lpi
@@ -0,0 +1,68 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+
+
+
diff --git a/components/fpspreadsheet/examples/other/chart/stock_write_demo.lpr b/components/fpspreadsheet/examples/other/chart/stock_write_demo.lpr
new file mode 100644
index 000000000..c4f77ce65
--- /dev/null
+++ b/components/fpspreadsheet/examples/other/chart/stock_write_demo.lpr
@@ -0,0 +1,104 @@
+program stock_write_demo;
+
+{$mode objfpc}{$H+}
+
+uses
+ SysUtils,
+ fpspreadsheet, fpstypes, fpsUtils, fpschart, xlsxooxml, fpsopendocument;
+
+const
+ FILE_NAME = 'stock';
+ CANDLE_STICK = false;
+
+var
+ book: TsWorkbook;
+ sheet: TsWorksheet;
+ ch: TsChart;
+ ser: TsStockSeries;
+ r: Integer;
+ d: TDate;
+ fn: String;
+
+ procedure WriteData(var ARow: Integer; var ADate: TDate; AOpen, AHigh, ALow, AClose: Double);
+ begin
+ sheet.WriteDateTime(ARow, 0, ADate, nfShortDate);
+ sheet.WriteNumber (ARow, 1, AOpen, nfFixed, 2);
+ sheet.WriteNumber (ARow, 2, AHigh, nfFixed, 2);
+ sheet.WriteNumber (ARow, 3, ALow, nfFixed, 2);
+ sheet.WriteNumber (ARow, 4, AClose,nfFixed, 2);
+ inc(ARow);
+ ADate := ADate + 1;
+ end;
+
+begin
+ book := TsWorkbook.Create;
+ try
+ // Worksheet
+ sheet := book.AddWorksheet('test');
+
+ // Enter data
+ sheet.WriteText (0, 0, 'My Company');
+ sheet.WriteFont (0, 0, '', 12, [fssBold], scBlack);
+ sheet.WriteText ( 2, 0, 'Date');
+ sheet.WriteText ( 2, 1, 'Open');
+ sheet.WriteText ( 2, 2, 'High');
+ sheet.WriteText ( 2, 3, 'Low');
+ sheet.WriteText ( 2, 4, 'Close');
+ d := EncodeDate(2023, 3, 6);
+ r := 3; // O H L C
+ WriteData(r, d, 100, 110, 95, 105);
+ WriteData(r, d, 107, 112, 101, 104);
+ WriteData(r, d, 108, 113, 100, 106);
+ WriteData(r, d, 109, 115, 99, 110);
+ WriteData(r, d, 110, 119, 103, 115);
+
+ // Create chart: left/top in cell D4, 150 mm x 100 mm
+ ch := book.AddChart(sheet, 2, 5, 150, 100);
+
+ // Chart properties
+ ch.Border.Style := clsNoLine;
+ ch.Legend.Border.Style := clsNoLine;
+ ch.XAxis.DateTime := true;
+ ch.XAxis.Title.Caption := 'Date';
+ ch.XAxis.MajorGridLines.Style := clsNoLine;
+ ch.XAxis.MinorGridLines.Style := clsNoLine;
+ ch.YAxis.Title.Caption := 'Stock price';
+ ch.YAxis.MajorGridLines.Style := clsSolid;
+ ch.YAxis.MinorGridLines.Style := clsNoLine;
+ ch.YAxis.AutomaticMin := false;
+ ch.YAxis.AutomaticMax := false;
+ ch.YAxis.Max := 120;
+ ch.YAxis.Min := 90;
+
+ // Add stock series
+ ser := TsStockSeries.Create(ch);
+
+ // Series properties
+ ser.CandleStick := CANDLE_STICK;
+ ser.CandleStickUpFill.Color := scGreen;
+ ser.CandlestickDownFill.Color := scRed;
+ ser.SetTitleAddr (0, 0);
+ if CANDLE_STICK then ser.SetOpenRange (3, 1, 7, 1);
+ ser.SetHighRange (3, 2, 7, 2);
+ ser.SetLowRange (3, 3, 7, 3);
+ ser.SetCloseRange(3, 4, 7, 4);
+ ser.SetXRange (3, 0, 7, 0);
+ ser.SetLabelRange(3, 0, 7, 0);
+
+ if CANDLE_STICK then
+ fn := FILE_NAME + '-candle'
+ else
+ fn := FILE_NAME + '-hlc';
+
+ {
+ book.WriteToFile(fn + '.xlsx', true); // Excel fails to open the file
+ WriteLn('Data saved with chart to ', fn, '.xlsx');
+ }
+
+ book.WriteToFile(fn + '.ods', true);
+ WriteLn('Data saved with chart to ', fn, '.ods');
+ finally
+ book.Free;
+ end;
+end.
+
diff --git a/components/fpspreadsheet/examples/other/chart/write_demos.lpg b/components/fpspreadsheet/examples/other/chart/write_demos.lpg
new file mode 100644
index 000000000..b7dcf5ee7
--- /dev/null
+++ b/components/fpspreadsheet/examples/other/chart/write_demos.lpg
@@ -0,0 +1,57 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/components/fpspreadsheet/examples/visual/fpschart/fpschartlink/main.lfm b/components/fpspreadsheet/examples/visual/fpschart/fpschartlink/main.lfm
index 6f1251e50..d31509a29 100644
--- a/components/fpspreadsheet/examples/visual/fpschart/fpschartlink/main.lfm
+++ b/components/fpspreadsheet/examples/visual/fpschart/fpschartlink/main.lfm
@@ -103,6 +103,8 @@ object Form1: TForm1
'../../../other/chart/scatter.ods'
'../../../other/chart/scatter_log.ods'
'../../../other/chart/scatter_loglog.ods'
+ '../../../other/chart/stock-candle.ods'
+ '../../../other/chart/stock-hlc.ods'
)
TabOrder = 0
OnCloseUp = ComboBox1CloseUp
diff --git a/components/fpspreadsheet/source/common/fpschart.pas b/components/fpspreadsheet/source/common/fpschart.pas
index e107a24f7..eb619f88e 100644
--- a/components/fpspreadsheet/source/common/fpschart.pas
+++ b/components/fpspreadsheet/source/common/fpschart.pas
@@ -267,6 +267,8 @@ type
constructor Create(AChart: TsChart);
destructor Destroy; override;
function OtherAxis: TsChartAxis;
+ procedure SetCategoryRange(ARow1, ACol1, ARow2, ACol2: Cardinal);
+ procedure SetCategoryRange(ASheet1: String; ARow1, ACol1: Cardinal; ASheet2: String; ARow2, ACol2: Cardinal);
property AutomaticMax: Boolean read FAutomaticMax write FAutomaticMax;
property AutomaticMin: Boolean read FAutomaticMin write FAutomaticMin;
property AutomaticMajorInterval: Boolean read FAutomaticMajorInterval write FAutomaticMajorInterval;
@@ -558,9 +560,13 @@ type
public
constructor Create(AChart: TsChart); override;
destructor Destroy; override;
+ procedure SetOpenRange(ARow1, ACol1, ARow2, ACol2: Cardinal);
procedure SetOpenRange(ASheet1: String; ARow1, ACol1: Cardinal; ASheet2: String; ARow2, ACol2: Cardinal);
+ procedure SetHighRange(ARow1, ACol1, ARow2, ACol2: Cardinal);
procedure SetHighRange(ASheet1: String; ARow1, ACol1: Cardinal; ASheet2: String; ARow2, ACol2: Cardinal);
+ procedure SetLowRange(ARow1, ACol1, ARow2, ACol2: Cardinal);
procedure SetLowRange (ASheet1: String; ARow1, ACol1: Cardinal; ASheet2: String; ARow2, ACol2: Cardinal);
+ procedure SetCloseRange(ARow1, ACol1, ARow2, ACol2: Cardinal);
procedure SetCloseRange(ASheet1: String; ARow1, ACol1: Cardinal; ASheet2: String; ARow2, ACol2: Cardinal);
property CandleStick: Boolean read FCandleStick write FCandleStick;
property CandleStickDownFill: TsChartFill read FCandleStickDownFill write FCandleStickDownFill;
@@ -1252,6 +1258,24 @@ begin
Result := Chart.YAxis;
end;
+procedure TsChartAxis.SetCategoryRange(ARow1, ACol1, ARow2, ACol2: Cardinal);
+begin
+ SetCategoryRange('', ARow1, ACol1, '', ARow2, ACol2);
+end;
+
+procedure TsChartAxis.SetCategoryRange(ASheet1: String; ARow1, ACol1: Cardinal;
+ ASheet2: String; ARow2, ACol2: Cardinal);
+begin
+ if (ARow1 <> ARow2) and (ACol1 <> ACol2) then
+ raise Exception.Create('Category values can only be located in a single column or row.');
+ FCategoryRange.Sheet1 := ASheet1;
+ FCategoryRange.Row1 := ARow1;
+ FCategoryRange.Col1 := ACol1;
+ FCategoryRange.Sheet2 := ASheet2;
+ FCategoryRange.Row2 := ARow2;
+ FCategoryRange.Col2 := ACol2;
+end;
+
{ TsChartLegend }
constructor TsChartLegend.Create(AChart: TsChart);
@@ -1818,6 +1842,11 @@ begin
inherited;
end;
+procedure TsStockSeries.SetOpenRange(ARow1, ACol1, ARow2, ACol2: Cardinal);
+begin
+ SetOpenRange('', ARow1, ACol1, '', ARow2, ACol2);
+end;
+
procedure TsStockSeries.SetOpenRange(ASheet1: String; ARow1, ACol1: Cardinal;
ASheet2: String; ARow2, ACol2: Cardinal);
begin
@@ -1831,6 +1860,10 @@ procedure TsStockSeries.SetOpenRange(ASheet1: String; ARow1, ACol1: Cardinal;
FOpenRange.Col2 := ACol2;
end;
+procedure TsStockSeries.SetHighRange(ARow1, ACol1, ARow2, ACol2: Cardinal);
+begin
+ SetHighRange('', ARow1, ACol1, '', ARow2, ACol2);
+end;
procedure TsStockSeries.SetHighRange(ASheet1: String; ARow1, ACol1: Cardinal;
ASheet2: String; ARow2, ACol2: Cardinal);
begin
@@ -1844,6 +1877,11 @@ begin
FHighRange.Col2 := ACol2;
end;
+procedure TsStockSeries.SetLowRange(ARow1, ACol1, ARow2, ACol2: Cardinal);
+begin
+ SetLowRange('', ARow1, ACol1, '', ARow2, ACol2);
+end;
+
procedure TsStockSeries.SetLowRange(ASheet1: String; ARow1, ACol1: Cardinal;
ASheet2: String; ARow2, ACol2: Cardinal);
begin
@@ -1857,6 +1895,11 @@ procedure TsStockSeries.SetLowRange(ASheet1: String; ARow1, ACol1: Cardinal;
FLowRange.Col2 := ACol2;
end;
+procedure TsStockSeries.SetCloseRange(ARow1, ACol1, ARow2, ACol2: Cardinal);
+begin
+ SetCloseRange('', ARow1, ACol1, '', ARow2, ACol2);
+end;
+
procedure TsStockSeries.SetCloseRange(ASheet1: String; ARow1, ACol1: Cardinal;
ASheet2: String; ARow2, ACol2: Cardinal);
begin
@@ -1974,10 +2017,19 @@ begin
end;
function TsChart.GetChartType: TsChartType;
+var
+ i: Integer;
begin
if FSeriesList.Count > 0 then
- Result := Series[0].ChartType
- else
+ begin
+ Result := Series[0].ChartType;
+ for i := 0 to FSeriesList.Count-1 do
+ if FSeriesList[i] is TsStockSeries then
+ begin
+ Result := ctStock;
+ exit;
+ end;
+ end else
Result := ctEmpty;
end;
diff --git a/components/fpspreadsheet/source/common/fpsopendocument.pas b/components/fpspreadsheet/source/common/fpsopendocument.pas
index 6467705d5..bd31ecaf6 100644
--- a/components/fpspreadsheet/source/common/fpsopendocument.pas
+++ b/components/fpspreadsheet/source/common/fpsopendocument.pas
@@ -5901,7 +5901,6 @@ end;
procedure TsSpreadOpenDocWriter.InternalWriteToStream(AStream: TStream);
var
FZip: TZipper;
- i: Integer;
begin
{ Analyze the workbook and collect all information needed }
ListAllNumFormats;
diff --git a/components/fpspreadsheet/source/common/fpsopendocumentchart.pas b/components/fpspreadsheet/source/common/fpsopendocumentchart.pas
index d2c890858..295b9eeab 100644
--- a/components/fpspreadsheet/source/common/fpsopendocumentchart.pas
+++ b/components/fpspreadsheet/source/common/fpsopendocumentchart.pas
@@ -91,13 +91,13 @@ type
ALine: TsChartLine; AIndent, AStyleID: Integer): String;
function GetChartLineStyleGraphicPropsAsXML(AChart: TsChart;
ALine: TsChartLine): String;
- function GetChartPlotAreaStyleAsXML(AChart: TsChart;
- AIndent, AStyleID: Integer): String;
+ function GetChartPlotAreaStyleAsXML(AChart: TsChart; AIndent, AStyleID: Integer): String;
function GetChartRegressionEquationStyleAsXML(AChart: TsChart;
AEquation: TsRegressionEquation; AIndent, AStyleID: Integer): String;
function GetChartRegressionStyleAsXML(AChart: TsChart; ASeriesIndex, AIndent, AStyleID: Integer): String;
function GetChartSeriesDataPointStyleAsXML(AChart: TsChart; ASeriesIndex, APointIndex, AIndent, AStyleID: Integer): String;
function GetChartSeriesStyleAsXML(AChart: TsChart; ASeriesIndex, AIndent, AStyleID: integer): String;
+ function GetChartStockSeriesStyleAsXML(AChart: TsChart; ASeries: TsStockSeries; AKind: Integer; AIndent, AStyleID: Integer): String;
procedure CheckAxis(AChart: TsChart; Axis: TsChartAxis);
function GetNumberFormatID(ANumFormat: String): String;
@@ -125,6 +125,9 @@ type
procedure WriteChartSeries(AChartStream, AStyleStream: TStream;
AChartIndent, AStyleIndent: Integer; AChart: TsChart; ASeriesIndex: Integer;
var AStyleID: Integer);
+ procedure WriteChartStockSeries(AChartStream, AStyleStream: TStream;
+ AChartIndent, AStyleIndent: Integer; AChart: TsChart; ASeriesIndex: Integer;
+ var AStyleID: Integer);
// procedure WriteChartTable(AStream: TStream; AChart: TsChart; AIndent: Integer);
procedure WriteChartTitle(AChartStream, AStyleStream: TStream;
AChartIndent, AStyleIndent: Integer; AChart: TsChart; IsSubtitle: Boolean;
@@ -2304,6 +2307,8 @@ var
stackModeStr: String = '';
rightAngledAxes: String = '';
startAngleStr: String = '';
+ candleStickStr: String = '';
+ i: Integer;
begin
indent := DupeString(' ', AIndent);
@@ -2332,6 +2337,13 @@ begin
if not (AChart.GetChartType in [ctRadar, ctPie]) then
rightAngledAxes := 'chart:right-angled-axes="true" ';
+ for i := 0 to AChart.Series.Count-1 do
+ if (AChart.Series[i] is TsStockSeries) and TsStockSeries(AChart.Series[i]).CandleStick then
+ begin
+ candleStickStr := 'chart:japanese-candle-stick="true" ';
+ break;
+ end;
+
Result := Format(
indent + ' ', [ AStyleID ]) + LE +
indent + ' '') or (lineStr <> '') then
+ begin
+ indent := DupeString(' ', AIndent);
+ Result := Format(
+ indent + '' + LE +
+ indent + ' ' + LE +
+ indent + '' + LE,
+ [ AStyleID ]
+ );
+ end else
+ Result := '';
+end;
+
function TsSpreadOpenDocChartWriter.GetNumberFormatID(ANumFormat: String): String;
var
idx: Integer;
@@ -2931,9 +2979,8 @@ begin
end;
procedure TsSpreadOpenDocChartWriter.WriteChartAxis(
- AChartStream, AStyleStream: TStream;
- AChartIndent, AStyleIndent: Integer; Axis: TsChartAxis;
- var AStyleID: Integer);
+ AChartStream, AStyleStream: TStream; AChartIndent, AStyleIndent: Integer;
+ Axis: TsChartAxis; var AStyleID: Integer);
var
indent: String;
captionKind: Integer;
@@ -2966,6 +3013,11 @@ begin
[ AStyleID, AXIS_ID[captionKind], AXIS_LEVEL[captionKind], AXIS_ID[captionKind] ]
));
+ if Axis.DateTime then
+ AppendToStream(AChartStream,
+ indent + ' ' + LE
+ );
+
if (Axis = chart.XAxis) and (not chart.IsScatterChart) and (chart.Series.Count > 0) then
begin
series := chart.Series[0];
@@ -3050,8 +3102,8 @@ end;
{ Writes the chart's background to the xml stream }
procedure TsSpreadOpenDocChartWriter.WriteChartBackground(
- AChartStream, AStyleStream: TStream;
- AChartIndent, AStyleIndent: Integer; AChart: TsChart; var AStyleID: Integer);
+ AChartStream, AStyleStream: TStream; AChartIndent, AStyleIndent: Integer;
+ AChart: TsChart; var AStyleID: Integer);
var
indent: String;
chartClass: String;
@@ -3064,7 +3116,7 @@ begin
AppendToStream(AChartStream, Format(
indent + '' + LE, [
+ indent + ' xlink:type="simple" xlink:href="..">' + LE, [
AStyleID,
chartClass,
AChart.Width, AChart.Height // Width, Height are in mm
@@ -3205,8 +3257,9 @@ begin
end;
{ Writes the chart's legend to the xml stream }
-procedure TsSpreadOpenDocChartWriter.WriteChartLegend(AChartStream, AStyleStream: TStream;
- AChartIndent, AStyleIndent: Integer; AChart: TsChart; var AStyleID: Integer);
+procedure TsSpreadOpenDocChartWriter.WriteChartLegend(
+ AChartStream, AStyleStream: TStream; AChartIndent, AStyleIndent: Integer;
+ AChart: TsChart; var AStyleID: Integer);
var
indent: String;
canOverlap: String = '';
@@ -3329,8 +3382,9 @@ begin
);
end;
-procedure TsSpreadOpenDocChartWriter.WriteChartPlotArea(AChartStream, AStyleStream: TStream;
- AChartIndent, AStyleIndent: Integer; AChart: TsChart; var AStyleID: Integer);
+procedure TsSpreadOpenDocChartWriter.WriteChartPlotArea(
+ AChartStream, AStyleStream: TStream; AChartIndent, AStyleIndent: Integer;
+ AChart: TsChart; var AStyleID: Integer);
var
indent: String;
i: Integer;
@@ -3393,7 +3447,10 @@ begin
// series
for i := 0 to AChart.Series.Count-1 do
- WriteChartSeries(AChartStream, AStyleStream, AChartIndent+2, AStyleIndent, AChart, i, AStyleID);
+ if AChart.GetChartType = ctStock then
+ WriteChartStockSeries(AChartStream, AStyleStream, AchartIndent+2, AStyleIndent, AChart, i, AStyleID)
+ else
+ WriteChartSeries(AChartStream, AStyleStream, AChartIndent+2, AStyleIndent, AChart, i, AStyleID);
// close xml node
AppendToStream(AChartStream,
@@ -3402,9 +3459,8 @@ begin
end;
procedure TsSpreadOpenDocChartWriter.WriteChartSeries(
- AChartStream, AStyleStream: TStream;
- AChartIndent, AStyleIndent: Integer; AChart: TsChart; ASeriesIndex: Integer;
- var AStyleID: Integer);
+ AChartStream, AStyleStream: TStream; AChartIndent, AStyleIndent: Integer;
+ AChart: TsChart; ASeriesIndex: Integer; var AStyleID: Integer);
var
indent: String;
series: TsChartSeries;
@@ -3513,7 +3569,6 @@ begin
else
chartClass := CHART_TYPE_NAMES[series.ChartType];
- // Store the series properties
AppendToStream(AChartStream, Format(
indent + '' + LE +
+ AIndent + ' ' + LE +
+ AIndent + '' + LE,
+ [ ACount ] ));
+ end;
+
+var
+ indent: String;
+ openRange: String = '';
+ highRange: String = '';
+ lowRange: String = '';
+ closeRange: String = '';
+ titleAddr: String = '';
+ seriesYAxis: String = '';
+ series: TsStockSeries;
+ count: Integer;
+begin
+ if not (AChart.Series[ASeriesIndex] is TsStockSeries) then
+ exit;
+ series := TsStockSeries(AChart.Series[ASeriesIndex]);
+ indent := DupeString(' ', AChartIndent);
+
+ // These are the open/high/low/close values of the OHLC series
+ if series.CandleStick and (not series.OpenRange.IsEmpty) then
+ openRange := Format('chart:values-cell-range-address="%s" ', [
+ GetSheetCellRangeString_ODS(
+ series.OpenRange.GetSheet1Name, series.OpenRange.GetSheet2Name,
+ series.OpenRange.Row1, series.OpenRange.Col1,
+ series.OpenRange.Row2, series.OpenRange.Col2,
+ rfAllRel, false)
+ ]);
+ if not series.HighRange.IsEmpty then
+ highRange := Format('chart:values-cell-range-address="%s" ', [
+ GetSheetCellRangeString_ODS(
+ series.HighRange.GetSheet1Name, series.HighRange.GetSheet2Name,
+ series.HighRange.Row1, series.HighRange.Col1,
+ series.HighRange.Row2, series.HighRange.Col2,
+ rfAllRel, false)
+ ]);
+ if not series.LowRange.IsEmpty then
+ lowRange := Format('chart:values-cell-range-address="%s" ', [
+ GetSheetCellRangeString_ODS(
+ series.LowRange.GetSheet1Name, series.LowRange.GetSheet2Name,
+ series.LowRange.Row1, series.LowRange.Col1,
+ series.LowRange.Row2, series.LowRange.Col2,
+ rfAllRel, false)
+ ]);
+ if not series.CloseRange.IsEmpty then
+ closeRange := Format('chart:values-cell-range-address="%s" ',[
+ GetSheetCellRangeString_ODS(
+ series.CloseRange.GetSheet1Name, series.CloseRange.GetSheet2Name,
+ series.CloseRange.Row1, series.CloseRange.Col1,
+ series.CloseRange.Row2, series.CloseRange.Col2,
+ rfAllRel, false)
+ ]);
+
+ // Title of the series for the legend
+ titleAddr := Format('chart:label-cell-address="%s" ', [
+ GetSheetCellRangeString_ODS(
+ series.TitleAddr.GetSheetName, series.TitleAddr.GetSheetName,
+ series.TitleAddr.Row, series.TitleAddr.Col,
+ series.TitleAddr.Row, series.TitleAddr.Col,
+ rfAllRel, false)
+ ]);
+
+ // Axis of the series
+ case series.YAxis of
+ alPrimary : seriesYAxis := 'chart:attached-axis="primary-y" ';
+ alSecondary: seriesYAxis := 'chart:attached-axis="secondary-y" ';
+ end;
+
+ // Number of data points
+ if series.YValuesInCol then
+ count := series.YRange.Row2 - series.YRange.Row1 + 1
+ else
+ count := series.YRange.Col2 - series.YRange.Col1 + 1;
+
+ // Store the series properties
+
+ // "Open" values, only for CandleStick mode
+ if series.CandleStick then
+ WriteRange(indent, openRange, '', seriesYAxis, count);
+ // "Low" values
+ WriteRange(indent, lowRange, '', seriesYAxis, count);
+ // "High" values
+ WriteRange(indent, highRange, '', seriesYAxis, count);
+ // "Close" values
+ WriteRange(indent, closeRange, titleAddr, seriesYAxis, count);
+
+ // Stock series styles
+ AppendToStream(AChartStream, Format(
+ indent + '' + LE +
+ indent + '' + LE +
+ indent + '' + LE,
+ [ AStyleID, AStyleID + 1, AStyleID + 2 ]));
+
+ AppendToStream(AStyleStream,
+ GetChartStockSeriesStyleAsXML(AChart, series, 0, AStyleIndent, AStyleID));
+ AppendToStream(AStyleStream,
+ GetChartStockSeriesStyleAsXML(AChart, series, 1, AStyleIndent, AStyleID + 1));
+ AppendToStream(AStyleStream,
+ GetChartStockSeriesStyleAsXML(AChart, series, 2, AStyleIndent, AStyleID + 2));
+
+ inc(AStyleID, 3);
+end;
+
procedure TsSpreadOpenDocChartWriter.WriteCharts;
var
i: Integer;
@@ -3816,9 +3984,9 @@ end;
*)
{ Writes the chart's title (or subtitle, depending on the value of IsSubTitle)
to the xml stream (chart stream) and the corresponding style to the stylestream. }
-procedure TsSpreadOpenDocChartWriter.WriteChartTitle(AChartStream, AStyleStream: TStream;
- AChartIndent, AStyleIndent: Integer; AChart: TsChart; IsSubtitle: Boolean;
- var AStyleID: Integer);
+procedure TsSpreadOpenDocChartWriter.WriteChartTitle(
+ AChartStream, AStyleStream: TStream; AChartIndent, AStyleIndent: Integer;
+ AChart: TsChart; IsSubtitle: Boolean; var AStyleID: Integer);
var
title: TsChartText;
captionKind: Integer;