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

Aberta
#360 0 comentários 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
4/5
Tempo estimado
3-5 dias
Facilidade para iniciantes
38/100
Tipo de issue
Funcionalidade
Clareza
Razoavelmente clara
Status de atividade
Ativa
Stack de tecnologia
javascript

Direção de pesquisa

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.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

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.

Linguagem predominante
JavaScript
Estrelas
1
Forks
1
Merge médio
3h 34min
PRs com merge (30d)
213

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de eizedev/pivotkit

Todas as issues de eizedev/pivotkit

Issues semelhantes

Mais issues de JavaScript

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.