XLSX export drops the chart of a chart view without a finding

オープン
#360 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
38/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
javascript

調査の方向性

Start with packages/pivotkit-report/src/render.js and packages/pivotkit-core/src/xlsx.js, then read docs/use/export.md and the render_view description plus CLI help. Reproduce the display: "chart" XLSX export and inspect how findings are returned. Done means the agreed short term behavior reports the missing chart, or a chosen native chart implementation exports it with the documented format behavior.

索引モデルが issue の本文から書いたものです。

説明

area:core area:mcp area:report enhancement

When a view has display: "chart", an XLSX export holds only the table. The chart is dropped without a word: the result of render_view has no finding about it.

What happens

I rendered a view with "display": "chart", "chart": { "type": "line" } once as html and once as xlsx through the MCP server (render_view). The HTML report shows the line chart above the table. The workbook has the table only, and findings is empty.

  • packages/pivotkit-report/src/render.js: the xlsx branch calls toXlsx(grid, ...) with the grid only. Only svg and html call chartOf(), and only the html branch reports chartUnavailable.
  • packages/pivotkit-core/src/xlsx.js: toXlsx writes a single sheet with no drawing or chart part.
  • docs/use/export.md lists what the workbook holds, and a chart is not in that list. So this matches the docs. The tool description of render_view ("xlsx (Excel, the default) ... svg for the chart") does not say so, though, and an agent or user who asks for "the same as Excel" expects the chart.

Not affected: html and svg, as well as the React export menu, where the chart is downloaded as its own PNG/SVG next to the workbook.

Proposal

  1. Short term: when display is "chart" and format is "xlsx", add a finding (e.g. chartNotInXlsx, "The workbook holds the table; the chart is in html or svg"). Mention it in the render_view description, the CLI help and docs/use/export.md.
  2. Feature: write the chart as a native Excel chart (DrawingML xl/charts/chart1.xml plus a drawing on the sheet) that refers to the table's cell ranges, so it stays live in Excel. Bar, line, area and pie map directly; donut and heatmap need a decision (doughnut chart; heatmap stays the table's colour scale). This adds size to pivotkit-core, so it may belong in pivotkit-report or as an option.

How to reproduce

render_view with format: "xlsx" and this view, then open the file: no chart, findings: [].

{
  "version": 2,
  "rows": ["Monat"],
  "cols": ["Region"],
  "derived": [{ "name": "Monat", "field": "Month", "by": "yearMonth" }],
  "values": [{ "field": "Revenue", "agg": "sum" }],
  "display": "chart",
  "chart": { "type": "line" }
}

I checked this through the MCP server only. The CLI goes through the same render() and should behave the same way, but I have not run it.

主要言語
JavaScript
スター
1
フォーク
1
平均マージ
3時間 34分
マージ済み PR(30日)
213

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

eizedev/pivotkit のほかの issue

eizedev/pivotkit の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。