question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Charts in file breaks roundtrip

See original GitHub issue

Roundtrip test program

    var xlsx = require('xlsx');
    var book = xlsx.readFile('test/reports/Book1.xlsx',{cellStyles:true,bookDeps:true});
    xlsx.writeFile(book, 'test/reports/Book1-out.xlsx');

Roundtrip works with no chart

  • Create a brand new spreadsheet.
  • In Sheet1!A1 type “Sheet 1”
  • In Sheet2!A1 type “Sheet 2”
  • In Sheet3!A1 type “Sheet 3”
  • Save as Book1.xlsx.
  • Output from roundtrip shows appropriate entries in cells.

Roundtrip fails with chart present

  • On Sheet1, select cell A1, and insert some kind of chart (e.g. Column chart).
  • Right click on chart and “Move Chart…” to New Sheet Chart1 (which appears to left of Sheet1)
  • Run roundtrip
  • Resulting output has three sheets (and no chart).
    • Sheet1 is blank
    • Sheet2 has ‘Sheet1’ in cell A1
    • Sheet3 has ‘Sheet2’ in cell A1
  • During parsing, book.Sheets.Sheet1['!ref]===undefined

It seems that the presence of the Chart is confusing the parser when it determines the names of the sheets.

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Reactions:3
  • Comments:19 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
SheetJSDevcommented, Sep 16, 2021

For roundtripping, we offer a special Pro Edit build which, instead of trying to read and write the charts properly, surgically edits the underlying data blocks to enable preservation.

Based on our experience offering a component to read and write the basic chart types, a proper roundtrip is certainly possible. Unfortunately Excel is adding new chart types with each major release (new charts were added in Excel 2016 and Excel 2019), and keeping up with the changes is beyond the scope of what a small number of unpaid volunteers can support.

1reaction
jacobqcommented, Dec 21, 2018

We are working out the logistics of actually saving chartsheets as chartsheets

@SheetJSDev Is there a place where we can check the progress of this work? (It’s been 18+ months, and the lack of ability to preserve existing “special content” like charts is the only limitation blocking use of this library in my application.)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Fixing Broken Graphs and Charts in PowerPoint & Word
Step-by-step tutorial for converting PowerPoint or Word graphs and charts with linked data to embedded data and fixing broken or missing ...
Read more >
RRDtool tutorial, graphs and examples @ Calomel.org
The graph shows both the round trip time (rtt) and packet loss (pl). ... in the file are one command, but we have...
Read more >
The Best Time to Buy Flights: Annual Domestic Airfare Study
Find the best time to buy flights with the CheapAir.com annual airfare study. This domestic flight report analyzes when is the best time...
Read more >
IO tools (text, CSV, HDF5, …) — pandas 1.5.2 documentation
Character to break file into lines. ... and the round-trip converter (which is guaranteed to round-trip values after writing to a file). For...
Read more >
How-to Add Clean Breaks or Cliff Edges to an Excel Area Chart
View the Step-by-Step tutorial here: https://www.exceldashboardtemplates.com/AddCleanBreaksOrCliffEdgesToAnExcelAreaChartStacked area charts ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found