RS-22447: Export grid line type to editable PPT chart settings - #90
Conversation
The MajorGridLine Style for both axes was hardcoded to "Solid" (or "None" when width is 0), so the Grid line type control (Solid/Dot/Dash) was not reflected in exported charts even after the on-screen fix. Derive the style from values.grid.dash / categories.grid.dash via the existing getLineStyle() helper, which already returns "None" for a zero-width line and falls back to "Solid" when no dash is supplied (so existing behaviour is unchanged when the control is absent). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Review note: omitted
|
| # emacs file | ||
| *~ No newline at end of file | ||
| *~ | ||
| .positai |
There was a problem hiding this comment.
Does this and the .Rbuildignore changes need to be added?
656f075 to
17e509d
Compare
Review follow-up. getPPTSettings() sees the raw user args before chart defaults are applied, so grid.width is NULL when a caller doesn't pass it (e.g. direct R/API callers of a chart with a default grid). Routing that through getLineStyle() flipped the exported MajorGridLine Style from "Solid" to "None" (grid vanished), and an NA width threw. Add getGridLineStyle(width, dash): only an explicit width of 0 hides the grid; a missing/NA width keeps the previous "Solid" default (NA-safe via isTRUE), while an explicit dash still maps to Dot/Dash. Add a test for the omitted-width case. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The regression escaped because every existing chart-settings test passed grid.width explicitly, leaving the default/omitted path uncovered. Add a direct unit test of getGridLineStyle spanning width 0/positive/NULL/NA x dash present/absent, locking in the NULL/NA-safe "Solid" default the reviewer flagged. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
RS-22447 — Grid line type in PowerPoint/Excel export
RS-22447
Companion to flipStandardCharts#130, which made the Grid line type control (Solid/Dot/Dash) work on-screen. This fixes the export path so exported (PPT/Excel) charts reflect it too.
Problem
getPPTSettings()hardcoded theMajorGridLineStylefor both axes to"Solid"(or"None"when the grid width is 0), ignoring the grid dash setting.Fix
Derive the style from
values.grid.dash/categories.grid.dashusing the existinggetLineStyle()helper. It already:"None"for a zero-width line, and"Solid"when nodashis supplied,so behaviour is unchanged when the control isn't present.
getPPTSettings()runs before the categories/values → x/y rename, soargs$values.grid.dash/args$categories.grid.dashare the correct names here (same as the existing zero-line-dash handling nearby).Tests
test-chartsettings.R— new case assertsDot/DashreachValueAxis/PrimaryAxisMajorGridLine$Style, that a zero-width grid stays"None", and that omitting the dash still yields"Solid". Full file: PASS 138 (with flipStandardCharts 1.32.12).🤖 Generated with Claude Code