Skip to content

RS-19884: Export Price Sensitivity Meter as a chart when the default PowerPoint export format is Microsoft chart - #21

Open
JamieMorris1 wants to merge 1 commit into
masterfrom
RS-19884
Open

JamieMorris1 wants to merge 1 commit into
masterfrom
RS-19884

Conversation

@JamieMorris1

@JamieMorris1 JamieMorris1 commented Oct 1, 2026 •

Copy link
Copy Markdown

Reviewing AI-generated PRs from Context Engineering

TL;DR: In a document whose default PowerPoint export format is Microsoft Chart, a Price Sensitivity Meter left on "Default (Microsoft Chart)" exports as an image. With this change it exports as an editable chart, as it already does when "Microsoft Chart" is chosen explicitly.

Verified using test r server: r-rs19884-psm.test.displayr.com

Before, exports as image, when default is set to ms chart:
image

After, exports as chart, when default is set to ms chart:
image

Fixes RS-19884.

When an R output's format is Default and the document's default is Microsoft Chart, Displayr exports it as an editable chart only if the output has a ChartSettings attribute. Otherwise it falls back to an image without telling the user. Standard visualizations get that attribute from flipChart::CChart, but PriceSensitivityMeter draws its chart with flipStandardCharts::Line directly and only attached ChartData. Choosing "Microsoft Chart" explicitly skips the check, which is why that workaround works.

The fix attaches a minimal ChartSettings with data labels turned off for each series. The labels have to be turned off because once ChartSettings is present, Displayr shows data labels on every series by default. The exported chart is then the same as today's explicit "Microsoft Chart" export, and no Price Sensitivity Meter styling is carried over yet.

What CI can and can't show: the new test checks that the attribute is attached for all four "Show" outputs, but CI can't run Displayr's export. I checked that on nightly by wrapping PriceSensitivityMeter output in R calculations with this attribute. For all four outputs, Default exported the same chart XML as an explicit "Microsoft Chart", apart from hidden data-label blocks. A Playwright regression test in q (src/tests/replicator/RS-19884.spec.ts) will confirm it end to end once this version is on nightly's R server. On this PR, the GitHub nix build ran the full testthat suite against this branch and passed (292 passed, 0 failed). CircleCI's BuildAndCheckPackage fails at "Install R dependencies" (remove.packages("rlang") finds no such package) before any tests run, as it has on master since at least February.

What users will see change:

  • Every Price Sensitivity Meter left on Default, in a document whose default is Microsoft Chart, now exports as the same editable chart an explicit "Microsoft Chart" gives today. That includes its known gaps: six lines for "Likelihood to buy", "Revenue" and "Likelihood to buy and Revenue", where Displayr shows one or two, PowerPoint's default styling, and no intersection labels. These were previously hidden behind the image fallback. The fix applies to all four outputs so that Default always does what the document's setting says.
  • Displayr now treats a Price Sensitivity Meter as a chart, as it does every visualization built with flipChart::CChart. It can no longer be picked as a table input to another analysis, and Google Slides export should produce a native chart. I haven't checked the Google Slides export.

Follow-ups, deliberately left out: RS-23784 makes the editable chart match Displayr (the plotted lines only, the chart's own styling, intersection labels), and RS-23785 exports the two-axis output as an image with a warning.

AI involvement: the code change, the test and this description were written by Claude Code and checked by a separate review agent.

🤖 Drafted with /bug-fix in Claude Code.

…nt format is Default

Attach a ChartSettings attribute, with data labels off for each series, so
Displayr's Default export takes the same path as an explicit Microsoft Chart.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@JamieMorris1 JamieMorris1 changed the title RS-19884: Export Price Sensitivity Meter as a chart when the PowerPoint format is Default RS-19884: Export Price Sensitivity Meter as a chart when the default PowerPoint export format is Microsoft chart Oct 2, 2026
@JamieMorris1
JamieMorris1 marked this pull request as ready for review October 2, 2026 05:23
@JamieMorris1
JamieMorris1 requested a balanced review from Copilot October 2, 2026 05:24

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The focused implementation follows established chart metadata patterns and is adequately covered by tests.

Review effort: Balanced
Findings: None

What changed in this PR

Enables Price Sensitivity Meter outputs to export as editable Microsoft charts when configured as the document default.

Changes:

  • Adds ChartSettings with data labels disabled for every series.
  • Tests all four output modes.
  • Bumps the package version to 1.3.6.
File Description
R/​pricesensitivitymeter.R Adds Microsoft chart export settings.
tests/​testthat/​test-pricesensitivitymeter.R Verifies settings across output modes.
DESCRIPTION Updates the package version.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@chschan chschan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could do more with to make preserve the other chart settings (e.g. line color etc), but considering that there are already considerable changes, I guess its not worthwhile

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants