diff --git a/components/fpspreadsheet/source/common/fpsutils.pas b/components/fpspreadsheet/source/common/fpsutils.pas index a9b5aa243..a0e8716f6 100644 --- a/components/fpspreadsheet/source/common/fpsutils.pas +++ b/components/fpspreadsheet/source/common/fpsutils.pas @@ -3259,52 +3259,7 @@ begin with TRGBA(Result) do HLStoRGB(round(H*255), round(L*255), round(S*255), R, G, B); end; -(* -{@@ ---------------------------------------------------------------------------- - Returns the input color with its luminance multiplied by the given factor. - @param AColor rgb color to be modified - @param AFactor Factor to be used for the operation - @returns Modified color --------------------------------------------------------------------------------} -function LumModColor(AColor: TsColor; AFactor: Double): TsColor; -var - H, L, S: Byte; -begin - with TRGBA(AColor) do - RGBToHLS(R,G,B, H,L,S); - L := EnsureRange(round(L*AFactor), 0, 255); - with TRGBA(Result) do - begin - HLSToRGB(H,L,S, R,G,B); - A := 0; - end; -end; - -{@@ ---------------------------------------------------------------------------- - Returns the input color with its luminance shifted, but with its hue and - saturation unchanged ([ISO/IEC29500-1:2016] section 20.1.2.3.21) - - @param AColor rgb color to be modified - @param AOffset Fraction of the maximum luminance to be added - @returns Modified color --------------------------------------------------------------------------------} -function LumOffsetColor(AColor: TsColor; AOffset: Double): TsColor; -const - HLSMAX = 255; -var - H, L, S: Byte; -begin - with TRGBA(AColor) do - RGBToHLS(R,G,B, H,L,S); - L := EnsureRange(round(L + HLSMAX * AOffset), 0, 255); - with TRGBA(Result) do - begin - HLSToRGB(H,L,S, R,G,B); - A := 0; - end; -end; - *) {@@ ---------------------------------------------------------------------------- Returns the color index for black or white depending on a color being "bright" or "dark". diff --git a/components/fpspreadsheet/source/common/xlsxooxmlchart.pas b/components/fpspreadsheet/source/common/xlsxooxmlchart.pas index 8f68e3f3a..40c126002 100644 --- a/components/fpspreadsheet/source/common/xlsxooxmlchart.pas +++ b/components/fpspreadsheet/source/common/xlsxooxmlchart.pas @@ -1511,6 +1511,8 @@ begin workNode := workNode.NextSibling; end; + AChart.PlotArea.Background.Color := ChartColor(scWhite); + AChart.PlotArea.Background.Style := cfsSolid; SetAxisDefaults(AChart.XAxis); SetAxisDefaults(AChart.YAxis); SetAxisDefaults(AChart.X2Axis); @@ -1568,6 +1570,8 @@ begin end; inc(valAxCounter); end; + 'c:spPr': + ReadChartFillAndLineProps(workNode.FirstChild, AChart, AChart.PlotArea.Background, AChart.PlotArea.Border); end; workNode := workNode.NextSibling; end; @@ -4210,32 +4214,13 @@ begin WriteChartAxisNode(AStream, AIndent, AChart.X2Axis, x2Axkind); end; end; - (* - // Wrie the - if (AChart.GetChartType = ctStock) then - begin - // Stock series has the y axis first, then the x axis. //// NOT CLEAR IF THIS IS REQUIRED... - WriteChartAxisNode(AStream, AIndent, AChart.XAxis, 'c:dateAx'); //'c:catAx'); - WriteChartAxisNode(AStream, AIndent, AChart.YAxis, 'c:valAx'); -// WriteChartAxisNode(AStream, AIndent, AChart.XAxis, 'c:dateAx'); //'c:catAx'); - if hasSecondaryAxis then - begin - WriteChartAxisNode(AStream, AIndent, AChart.Y2Axis, yAxKind); - WriteChartAxisNode(AStream, AIndent, AChart.X2Axis, x2AxKind); - end; - end else - if not (AChart.GetChartType in [ctPie, ctRing]) then - begin - yAxKind := 'c:valAx'; - WriteChartAxisNode(AStream, AIndent, AChart.XAxis, xAxKind); - WriteChartAxisNode(AStream, AIndent, AChart.YAxis, yAxKind); - if hasSecondaryAxis then - begin - WriteChartAxisNode(AStream, AIndent, AChart.Y2Axis, yAxKind); - WriteChartAxisNode(AStream, AIndent, AChart.X2Axis, x2AxKind); - end; - end; - *) + + // Write the plot area background + AppendToStream(AStream, + indent + ' ' + LE + + GetChartFillAndLineXML(AIndent + 4, AChart, AChart.PlotArea.Background, AChart.PlotArea.Border) + LE + + indent + ' ' + LE + ); AppendToStream(AStream, indent + '' + LE diff --git a/components/fpspreadsheet/source/visual/fpspreadsheetchart.pas b/components/fpspreadsheet/source/visual/fpspreadsheetchart.pas index 5cf097d15..a8a8aed3f 100644 --- a/components/fpspreadsheet/source/visual/fpspreadsheetchart.pas +++ b/components/fpspreadsheet/source/visual/fpspreadsheetchart.pas @@ -1489,6 +1489,13 @@ begin // Clear the footer FChart.Foot.Text.Clear; + + // Restore default background + FChart.BackColor := clWindow; + FChart.Frame.Color := clDefault; + FChart.Frame.Width := 1; + FChart.Frame.Style := psSolid; + FChart.Frame.Visible := true; end; { Approximates the empty hatch patterns by the built-in TBrush styles. }