Skip to content

feat(chart): add area charts (chartType "area") - #653

Merged
ShotaroKataoka merged 3 commits into
aws-samples:mainfrom
kushaldave002:feat/chart-area
Nov 19, 2026
Merged

ShotaroKataoka merged 3 commits into
aws-samples:mainfrom
kushaldave002:feat/chart-area

Conversation

@kushaldave002

Copy link
Copy Markdown
Contributor

Closes #620

Summary

Adds native chartType: "area" support for both unstacked (XL_CHART_TYPE.AREA) and stacked (stacked: true, XL_CHART_TYPE.AREA_STACKED) area charts.

Changes

  • Builder (sdpm/sdpm/engine/builder/elements/chart.py): mapped ("area", False, False) → XL_CHART_TYPE.AREA and ("area", True, False) → XL_CHART_TYPE.AREA_STACKED. Series fill colors, axes, gridlines, legend, and data labels follow the existing bar/area fill path.
  • Converter (sdpm/sdpm/engine/converter/chart.py): mapped XL_CHART_TYPE.AREA and XL_CHART_TYPE.AREA_STACKED to "area" (with stacked when stacked) and extracted series fill color for "area", making area charts rebuildable from JSON (AREA_STACKED_100 remains non-rebuildable).
  • Schema lint (sdpm/sdpm/engine/schema/lint.py): added "area" to _CHART_TYPES, updated the missing-chartType diagnostic, and allowed stacked: true on "area".
  • Docs & Changelog: added sdpm/references/guides/chart-area.md, registered it in slide-json-media.md, slide-json-spec.md, and composer.md, and added an [Unreleased] Added entry to CHANGELOG.md.
  • Tests: added round-trip, color, and edited-rebuild tests in tests/test_chart_roundtrip.py (updating TestChartsTheJsonCannotDescribe to use stacked100) and lint tests in tests/test_lint.py.

Verification

  • make lint: passed
  • uv run pytest tests/test_chart_roundtrip.py tests/test_lint.py -q: 148 passed
  • uv run pytest tests/ -k "guide or doc or chart or lint" -q: 278 passed, 1 xfailed

@ShotaroKataoka

Copy link
Copy Markdown
Contributor

🤖 KiroCrew automated comment

✅ PASS (verdict pending CI): area and stacked-area charts build, read back and rebuild as described

CI has not run on b375e6c yet (fork workflows await maintainer approval), so this verdict is provisional. Locally, ruff check sdpm/ is clean and tests/test_chart_roundtrip.py + tests/test_lint.py pass (148 passed). The diff has no workflow, script or dependency changes.

What I checked

  • The builder maps area / area+stacked to AREA / AREA_STACKED (sdpm/sdpm/engine/builder/elements/chart.py:68-69). Series styling falls through to the existing fill path, which is the right one for an area.
  • The converter maps both back to area (with stacked) and reads the fill color (sdpm/sdpm/engine/converter/chart.py:29-30, 103). AREA_STACKED_100 stays non-rebuildable and keeps _chartXml, as the description says.
  • Lint accepts stacked on area (sdpm/sdpm/engine/schema/lint.py:304).
  • The description matches the diff.

Merge note (no change needed here)
This PR and #654 (scatter charts) edit the same lines in type_map, _CHART_TYPES, the lint message, the guide lists (slide-json-media.md, slide-json-spec.md, composer.md), CHANGELOG.md and both test files. Whichever merges second needs a rebase. When it does, the lint message should list both types (... radar, area, or scatter).

@ShotaroKataoka ShotaroKataoka added the blog:skip ブログ対象外 label Nov 19, 2026

@ShotaroKataoka ShotaroKataoka 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.

Thanks — builder, converter, lint, guide and tests are all covered, and the guide follows the same structure as chart-radar. v0.19.0 was released after you opened this, so I merged main into your branch (including #649, which touches the same file) and moved the CHANGELOG entry under [Unreleased]. If you keep working on this branch, pull first.

@ShotaroKataoka
ShotaroKataoka merged commit 8a90670 into aws-samples:main Nov 19, 2026
23 checks passed
ShotaroKataoka added a commit that referenced this pull request Nov 30, 2026
Resolve the chart.py conflict with #649: the relocated value-axis
line "none" block now inserts c:spPr in schema order via
_insert_in_order. The axis styling comment names area charts (#653).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

blog:skip ブログ対象外

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Charts: add area charts (chartType "area")

2 participants