InfoVis SS 2025

Exercise 1: Create a Simple Chart in SVG

This exercise involves hand-coding a chart in SVG 1.1. There is widespread browser support for SVG 1.1.

There has been a Candidate Recommendation for SVG 2 since 2018, but browser support is still very patchy.

Note:

1 Preparation

  1. Read the (free) Pocket Guide to Writing SVG:
    https://svgpocketguide.com/

  2. Look at this guide to hand-coding SVGs:
    https://webdesign.tutsplus.com/tutorials/how-to-hand-code-svg--cms-30368

  3. Refer to the SVG 1.1 Specification for any details:
    https://w3.org/TR/SVG11/

    Note: It is also possible to style SVG elements using CSS, either from an external file (style sheet) or embedded in a <style> element.

  4. The best book on SVG for the web is:
    Using SVG with CSS3 and HTML5: Vector Graphics for Web Design Amelia Bellamy-Royds, Kurt Cagle, and Dudley Storey; O'Reilly, Nov 2017, ISBN 1491921978.
    https://learning.oreilly.com/library/view/using-svg-with/9781491921968/

  5. Check out this article on Making Charts with SVG:
    https://css-tricks.com/how-to-make-charts-with-svg/

  6. Download the sample SVG files and data files from:
    ../exercises/materials/svg-chart/

    Right-click, Save Link As...

    There are examples of charts by previous students Peter Oberrauner, Ridvan Aydin, and Philipp Drescher.

    The example charts are provided under the terms of a CC BY 4.0 licence.

    Do not simply replicate the look of the examples, come up with your own style!

2 Dataset and Chart Type Assignments

There are two datasets (each with seven records):

  1. Graz Population:

    Population of the city of Graz, on 01 Jan of each year, from 2018 to 2024:
    graz-population-2018-2024.txt

    Source: Land Steiermark; Bevölkerungsstand zu Jahresbeginn seit 2002 (Gebietsstand 2020);
    https://landesentwicklung.steiermark.at/cms/beitrag/12651292/141979459/

  2. Austrian General Election 2024:

    Percentage of vote for top seven parties:
    election-austria-2024.txt

    Source: Österreich, Endgültiges Endergebnis;
    https://bundeswahlen.gv.at/2024/nr/

There are two chart topics:

  1. Line chart with population dataset (population-line).
  2. Bar chart with election dataset (election-bar).

See TeachCenter to see which topic you have been assigned.

3 Plan the Chart on Graph Paper

  1. Draw the chart on graph paper (kariertes Papier) to figure out the coordinates.

  2. Keep the final sketch to document your process and hand in.

    Make a copy or a scan first if you want to keep it, you will hand in the original.

4 Hand Code the Chart in SVG 1.1

Using a text editor, hand code your assigned chart as SVG 1.1:

  1. Name your SVG file as follows: surname-task.svg, where surname is your (main) surname in lower case and task is one of population-line or election-bar, depending on your assignment. For example, andrews-population-line.svg or andrews-election-bar.svg

  2. Include the following visual elements in your chart:

    • the chart itself
    • title
    • x axis with tick marks and labels
    • x axis title
    • y axis with tick marks and labels
    • y axis title
    • a narrow uniform margin around the chart (no visible frame).
  3. The sample SVG files contain a comment with copyright and CC BY 4.0 licence statement:

    • Change the name in the copyright statement to your own and the year to this year.
    • Or, alternatively, leave out the licence statement, if you do not wish to place your work under that licence.

Bear in mind:

5 Hand In Your Work

  1. Email your SVG file to me at kandrews@iicm.edu by Tue 11 Mar 2025 18:00.

  2. I will collect your sketches in class on Wed 12 Mar 2025.