fpspreadsheet: Make chart skip blank cells in xlsx (instead of drawing them as zero).

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@9776 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz 2025-06-10 14:24:20 +00:00
parent 4ab22d4638
commit cfcb832434
2 changed files with 10 additions and 2 deletions

View File

@ -4573,7 +4573,8 @@ end;
{ Is called when a formula is moved from the ASrcCell to ADestCell. Must
adjust cell references which originally were relative to ASrcCell such that
they are relative to ADestCell afterwards. }
they are relative to ADestCell afterwards.
No need to move the worksheet because it is always an absolute reference. }
procedure TsCellExprNode.MoveCells(ASourceCell, ADestCell: PCell);
var
delta: Int64;
@ -4589,6 +4590,7 @@ begin
delta := Int64(ADestCell^.Col) - Int64(ASourceCell^.Col);
FCol := Int64(FCol) + delta;
end;
end;
function TsCellExprNode.NodeType: TsResultType;

View File

@ -2808,6 +2808,8 @@ var
chart: TsChart;
indent: String;
savedRotatedAxes: Boolean;
plotVisOnly: String;
dispBlanksAs: String;
begin
indent := DupeString(' ', AIndent);
chart := TsWorkbook(Writer.Workbook).GetChartByIndex(AChartIndex);
@ -2828,8 +2830,12 @@ begin
WriteChartPlotAreaNode(AStream, AIndent + 2, chart);
WriteChartLegendNode(AStream, AIndent + 2, chart.Legend);
plotVisOnly := indent + ' <c:plotVisOnly val="1" />' + LE;
dispBlanksAs := indent + ' <c:dispBlanksAs val="gap" />' + LE; // empty cells are not plotted
AppendToStream(AStream,
indent + ' <c:plotVisOnly val="1" />' + LE +
plotVisOnly +
dispBlanksAs +
indent + '</c:chart>' + LE
);