How to use spreadsheets to generate .svg charts.

Simple instructions provided within the spreadsheets should bring you to success. The following explanations help you understand the process and fine-tune your final result.

Background: spreadsheet structure and content[edit]

The user pastes data and selects format choices in yellow cells. The spreadsheet automatically assembles XML code in the blue column, which the user copies and pastes into the .svg file.

1. Generally, users should be concerned with the leftmost columns, which contain yellow cells in which user data is pasted or entered, and in which chart parameters are adjusted.

  • Such parameters include chart width and height, margins, font sizes, titles, labels, etc.
  • My "default" parameters are reasonably chosen, and hopefully don't require much fiddling.

2. Immediately to the right of the leftmost columns is a blue-shaded column that you copy and paste into a text file that you will save as myfilename.svg. Do not change the blue-shaded column itself.
3. To the right of the blue-shaded column are the calculation columns having often-complex formulas. The formulas catenate (assemble) characters of the XML code that constitutes the text you see in the blue-shaded column. Messing with those formulas can instantly mess up your final result!

Detailed how to: copying, pasting, and saving the svg code[edit]

Stepwise instructions (after you've entered your data and parameters into the yellow-shaded cells):

  1. Click on the header of the blue-shaded column, so that the entire column is highlighted (selected)
  2. Copy (Command-c on Mac, Control-c on Windows)
  3. Switch to your text editor
  4. Paste the content (Command-v on Mac, Control-v on Windows)
  5. File, Save as, (enter myfilename.svg), Save. (Be sure to use the ".svg" suffix.)
  6. Open the .svg file in your browser to view the graphic

Optionally:

(a) manually in the .svg file itself (see "Fine-tuning", below) or
(b) in the original spreadsheet (then repeat the copy-paste-save steps above).
After you've established your .svg file, you can check your changes simply by refreshing your browser.

Tips:

Fine-tuning the code after it's pasted in the .svg file[edit]

After you've pasted the code into the .svg file, you can fine-tune the .svg file itself using an ordinary text editor. Since the code is minimal (not complex and cluttered like in Inkscape), it's relatively easy to change even if you don't have much prior training in XML or SVG.
Such edits are usually for minor adjustments, for example:

Useful strategy:

Why not just use Excel's "Chart" feature, or Inkscape?[edit]

What are disadvantages of these spreadsheets?[edit]

What if a raster image (PNG etc.) is needed, rather than SVG?[edit]

Your browser should render SVGs directly, and SVGs can be embedded in html; but sadly, most programs and social media websites can't handle SVGs directly.

However, there are options:

Tell me on my talk page if you know of other workable methods.

Contact[edit]

Please don't edit this page. Place comments or questions at User talk:RCraig09 instead.

Disclaimer: I've done a reasonable amount of testing, but I don't guarantee the spreadsheets will function as you hope, for your particular purpose or with your particular data.

See also