Template:NPVIC chart/doc

This template creates a "stacked" timeline chart for the article National Popular Vote Interstate Compact, showing the contributions over time of individual member states to the NPVIC electoral vote total. It allows annotations of key events.

Use
This template has several named parameters used to set up the chart, and uses unnamed parameters to pass data (in item frames) to the sub-template NPVIC chart/bar, which creates the contents of the chart.

Chart parameters

 * 1.The template currently supports up to 50 bar segments. If more are needed, the template must be edited to make additional calls to NPVIC chart/bar.
 * 2.Census events are automatically annotated and do not count towards the limit

Bar segment syntax
A bar segment represents a portion of the history of a particular state's participation in the compact, between two events at which the EV total changed: 'Most states will require multiple segments to span their history in the compact, if intervening events change the EV total. States which leave the compact must continue to be included, with an EV value of zero.'
 * The start event may be when the state joined the compact, when a previously-joined state left or rejoined the compact, or at a congressional reapportionment
 * The end event may be when the state left the compact, when a previously-joined state left or rejoined the compact, or at a congressional reapportionment

Each bar segment is created with a single unnamed argument, containing a call to the template item with the parameters outlined below.

Sample bar segment
(Note that the bar segment comprises a single argument to the parent template)

Date parameters
Bar segments require at least one of the three date parameters. If either the start date or end date is not given, the bar segment will start or end at the previous or the following reapportionment date, respectively. If neither date is specified, a census year must be specified instead, and the segment will span between subsequent reapportionments.

The start and end dates of the segment are set as follows:


 * 3.Reapportionment is considered to take place at the end of the census year.

Sub-templates
The following templates exist for use by this template, and should not be called outside this template.


 * NPVIC chart/bar – creates a bar segment for a given state within a specified date range
 * NPVIC chart/annotation – creates annotations of key events
 * NPVIC chart/stripe – creates gray bars on alternating years
 * NPVIC chart/x-axis – creates horizontal markers
 * NPVIC chart/y-axis – creates vertical markers
 * NPVIC chart/percent – utility template; calculates the horizontal position of a given date as a percentage of the graph's width