All examples By author By category About

ndarville

Party Votes

(This chart is a part of the d3-charts collection available here.)


This chart is for displaying something as simple as the share of votes as per cent for political parties over time.

The example thumbnail.png shows the graph with the proper historical data for the Danish political parties according to the data by meningsmaalinger.dk, whereas the included data is arbitrary.

Usage

All parameters are in the top of the script under // Config. If we use the example script:

var dataset = "data.csv",
    parseDate = d3.time.format("%Y/%m").parse,
    yAxisTitle = "Votes (%)",
    dateValue = "Date",
    showDots = true,
    electionDate = "";  // "2014/11"

The other parameters should be self-explanatory.

The Data

The chart thumbnail.png is based on the data from the September data from at meningsmalinger.dk (translates to polls.dk, ND).

The voter data is not included in the source code out of respect for the work that went into gathering it; I merely transcribed it from the site for personal use and to gauge the usefulness of charts based on it. Instead, placeholder data has been included in this project.

Credits

Bugs