mirror of
https://github.com/storytold/gridcraft.git
synced 2026-11-30 10:13:56 +01:00
A PivotChart series stayed live whenever its reference had as many cells as the cache had points. With one row item, every formula pointing at the PivotTable's corner cell passed that test, so the chart plotted the header text. Multi-level category references never passed it (width × height cells for N points), so a correct reference was replaced by a leaf-only literal and its outer level was lost on save. The check now compares values, once every sheet is read (read_chart returns each PivotChart series' cache; plot_pivot_caches runs after the sheets load): a series plots its cache unless the referenced cells hold the cached points, numbers within rounding and text as is. For a multiLvlStrRef, the innermost level's column (or row) is compared, so a reference that matches stays live and is saved as a reference. Literals read before this branch keep their points again: a missing, unreadable or too small ptCount gives way to the points present, and points without an idx go in document order. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>