diff --git a/components/fpspreadsheet/examples/other/chart/scatter_write_demo.lpr b/components/fpspreadsheet/examples/other/chart/scatter_write_demo.lpr index 11b6e806e..f1a82980e 100644 --- a/components/fpspreadsheet/examples/other/chart/scatter_write_demo.lpr +++ b/components/fpspreadsheet/examples/other/chart/scatter_write_demo.lpr @@ -111,7 +111,10 @@ begin ch.YAxis.Logarithmic := true; end; end; - ch.XAxis.Inverted := true; + + // For testing: + // ch.XAxis.Inverted := true; + ch.Interpolation := ciCubicSpline; // Add scatter series ser := TsScatterSeries.Create(ch); diff --git a/components/fpspreadsheet/source/common/xlsxooxmlchart.pas b/components/fpspreadsheet/source/common/xlsxooxmlchart.pas index 6a1ce2458..db0a2afac 100644 --- a/components/fpspreadsheet/source/common/xlsxooxmlchart.pas +++ b/components/fpspreadsheet/source/common/xlsxooxmlchart.pas @@ -3964,14 +3964,25 @@ procedure TsSpreadOOXMLChartWriter.WriteScatterSeries(AStream: TStream; var indent: String; chart: TsChart; + scatterStyleStr: String; begin indent := DupeString(' ', AIndent); chart := ASeries.Chart; + case chart.Interpolation of + ciLinear: + scatterStyleStr := 'lineMarker'; + ciCubicSpline, ciBSpline: + scatterStyleStr := 'smoothMarker'; + else + //ciStepStart, ciStepEnd, ciCenterX, ciCenterY + scatterStyleStr := 'lineMarker'; // better than nothing... + end; + AppendToStream(AStream, indent + '' + LE + indent + ' ' + LE + - indent + ' ' + LE + indent + ' ' + LE ); WriteChartSeriesNode(AStream, AIndent + 4, ASeries, ASeriesIndex);