diff --git a/components/fpspreadsheet/examples/other/chart/scatter_write_demo.lpr b/components/fpspreadsheet/examples/other/chart/scatter_write_demo.lpr index b0910ceab..11b6e806e 100644 --- a/components/fpspreadsheet/examples/other/chart/scatter_write_demo.lpr +++ b/components/fpspreadsheet/examples/other/chart/scatter_write_demo.lpr @@ -111,6 +111,7 @@ begin ch.YAxis.Logarithmic := true; end; end; + ch.XAxis.Inverted := true; // Add scatter series ser := TsScatterSeries.Create(ch); diff --git a/components/fpspreadsheet/source/common/xlsxooxmlchart.pas b/components/fpspreadsheet/source/common/xlsxooxmlchart.pas index f316a601b..1617235a1 100644 --- a/components/fpspreadsheet/source/common/xlsxooxmlchart.pas +++ b/components/fpspreadsheet/source/common/xlsxooxmlchart.pas @@ -3620,12 +3620,15 @@ end; procedure TsSpreadOOXMLChartWriter.WriteChartAxisScaling(AStream: TStream; AIndent: Integer; Axis: TsChartAxis); +const + INVERTED: array[boolean] of String = ('minMax', 'maxMin'); var indent: String; intv: Double; logStr: String = ''; maxStr: String = ''; minStr: String = ''; + orientationStr: String; begin indent := DupeString(' ', AIndent); @@ -3638,12 +3641,14 @@ begin if Axis.Logarithmic then logStr := indent + Format(' ', [Axis.LogBase], FPointSeparatorSettings) + LE; + orientationStr := indent + Format(' ', [ INVERTED[Axis.Inverted] ]) + LE; + AppendToStream(AStream, indent + '' + LE + maxStr + minStr + logStr + - indent + ' ' + LE + + orientationStr + indent + '' + LE );