Apply data label font properties to scatter chart dLbls XML (#1348)#1459
Open
rupivbluegreen wants to merge 1 commit into
Open
Apply data label font properties to scatter chart dLbls XML (#1348)#1459rupivbluegreen wants to merge 1 commit into
rupivbluegreen wants to merge 1 commit into
Conversation
…gitbrent#1348) The scatter chart code emitted bare <a:defRPr/> elements in four places inside the data-label rich-text / txPr blocks: 1. main label paragraph (custom / customXY) 2. X-value field paragraph (customXY) 3. Y-value field paragraph (customXY) 4. XY-format dLbls txPr paragraph With the defRPr empty, PowerPoint ignored dataLabelFontSize / dataLabelFontFace / dataLabelColor / dataLabelFontBold / dataLabelFontItalic for scatter charts. Each defRPr now mirrors the populated form already used by line/bar/pie data labels elsewhere in this file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Change Summary
Fixes #1348. Scatter charts now respect
dataLabelFontSize/dataLabelFontFace/dataLabelColor/dataLabelFontBold/dataLabelFontItalicin PowerPoint by emitting populated<a:defRPr>blocks where the code previously emitted bare<a:defRPr/>.Change Type
Related Issue
Closes #1348 — Scatter plot data label font size not working
Motivation and Context
In
src/gen-charts.ts, the scatter chart's data-label section emits four<a:pPr>blocks containing bare<a:defRPr/>elements:dataLabelFormatScatter: 'custom' | 'customXY')customXY)customXY)'XY')With these
<a:defRPr/>empty, PowerPoint falls back to its own defaults for the scatter label rich text — ignoring the user-supplieddataLabel*chart options. Line/bar/pie data labels in the same file already emit a populateddefRPr(seegen-charts.ts:882-886,1003-1005,1303-1305, etc.); the scatter chart was the only remaining holdout.A user attached the same diff in a comment on the issue page.
Change Description
Each of the four bare
<a:defRPr/>emissions is replaced with the populated form already used elsewhere in this file:When the user doesn't specify these options, the result is identical to the previous behavior (font size =
DEF_FONT_SIZE, font face =Arial, color =DEF_FONT_COLOR, bold/italic = off, underline/strike = none) — no regression for callers that don't set the options.Verification
Generated a scatter chart with both
customXYandXYlabel formats, all fivedataLabel*font options set, and inspected the produced chart XML:On
master(without the fix) the bare<a:defRPr/>check fails — 16 empty defRPr instances remain across the two charts, matching the source of the bug.npx eslint src/gen-charts.tsreports the same one pre-existing warning (isMultiTypeChartunused), no new warnings introduced.Checklist
src/*.tsmodified — nodist/src/bldchanges