| Theaccessibility of this help page is in question. The specific issue is:Text is way too small and distorted to be legible at default size. Relevant discussion may be found on thetalk page. |
This help page is ahow-to guide. It explains concepts or processes used by the Wikipedia community. It is not one ofWikipedia's policies or guidelines, and may reflect varying levels ofconsensus. |
TheEasyTimeline feature produces an embeddedimage from wikitext. The image can be a one-dimensional diagram (horizontally or vertically), or a two-dimensional one. The name "EasyTimeline" refers to the possibility to apply the feature with a time scale horizontally or vertically, possibly with another parameter in the other direction, but there are also various other possibilities.
See alsoWikipedia:Timeline,mw:Extension:EasyTimeline,mw:Extension:EasyTimeline/syntax,EasyTimeline activation on other MediaWiki installations
Graphical timelines can be produced by providing a script between special tags:
<timeline>script</timeline>
EasyTimeline will then be invoked to render a PNG image and (optionally) a clickable map.
Disclaimer: Even though EasyTimeline is designed for ease of use, a complicated graphical timeline is a non-trivial affair.A simple timeline may take half an hour to compose (or even less, when a suitable example is taken as a basis). Large timelines may take a few hours for composition and fine-tuning. However, adding to or correcting a timeline, no matter how complex, should be a relatively straightforward affair,even for contributors who have no expert knowledge of the syntax described here.
Feel free to ask theauthor of EasyTimeline for advice.
The script commands define:
The following commands are mandatory:ImageSize,PlotArea,Period andTimeAxis. At least one of the following commands is required:PlotData and/orTextData. Either or both can occur multiple times. All other commands are optional.
Case: Commands and their attributes can be specified in lower, upper or mixed case. Please try to be consistent in applying case as this will further readability, e.g. use mixed case for all commands and lowercase for all attributes.
A script can contain commands and comments. Each command is followed by one or more attributes.
Commands should start on the first position of a line.Some commands can be followed by multiple lines of data and/or options.These extra lines should start with at least one space or be completely empty(the latter is useful for visually grouping related data lines).
Commands have one of the following forms, depending on the type ofcommand:
Command = attribute(s) | DateFormat = dd/mm/yyyy |
Command name = attribute(s) | Color Jp = value:red legend:Japan |
Command =attribute(s)attribute(s)etc. | PlotData = fontsize:XS width:20 bar:Japan from:start till:19/02/1945 color:JT bar:Japan from:19/02/1945 till:14/03/1945 color:AI |
Single and multi line comments can be specified:
Examples:
Dateformat = dd/mm/yyyy # European date formatPeriod = from:01/09/1939 till:02/09/1945 #> this chart will show the complete duration of World War II <#
When several attributes can be specified for a certain command, they arenotated as 'name:value' pairs. When several values can be specified forone attribute they have to be enclosed between parentheses.
Examples:
AlignBars = justifyColor SB = value:rgb(0.8,0,0.7) legend:Sea_Battles
Most commands only accept attributes that are specified on the same line.
Data blocks: some commands, likeBarData,PlotData,TextData,Colors expect adata block consisting of one or moredata lines. Data lines should start with one or more spaces. A data block is considered complete when a linestarting with a non-space is encountered, unless that non-space is the comment character #.Since empty lines are ignored, they may be used to group related data lines within a block.
Attributes in a data block can conceptually be divided intoparameters anddata items. Data blocks can contain parameters and data items intermingled.
Data items: in data lines attributestext,from,till andat always apply only to the line in which they occur.
Parameters: in data lines attributes likecolor andfontsize have different implications depending on the context. If these parameters occur on a line without data items, they set new defaults for the data lines that follow. If they appear on a line mixed with data items they apply only to that line, thus overruling a default that was previously set.
Example:
# In this example two sets of bars are drawn, in red and blue respectively,# but in each set one bar (marking war periods) will be drawn in green.PlotData = color:red fontsize:S # set defaults bar:USSR from:1919 till:1922 text:Lenin # red bar bar:USSR from:1922 till:1953 text:Stalin # red bar bar:USSR from:1939 till:1945 text:WWII color:green # green bar bar:USSR from:1953 till:1964 text:Krushchev # red bar color:blue # change default color bar:US from:1913 till:1921 text:Wilson # blue bar bar:US from:1917 till:1918 text:WWI color:green # green bar bar:US from:1921 till:1923 text:Harding # blue bar#> this multiline comment does not end command PlotData, even when the previous line does not start with a space<# bar:US from:1923 till:1929 text:Coolidge # blue barTextData = # now PlotData is considered complete tabs:...etc
For each command the valid attributes are listed. Some commands and/orattributes are optional (O).
For some commands certain attributes are mutually exclusive (will beexplained where applicable).
Bars will always be drawn at equal distances.This command specifies whether the bars should be spaced as much apart as possible, or some whitespace should be reserved between the left/top side of the chart and thefirst bar or between the last bar and the right/bottom side of the chart.
Examples:
| TimeAxis = orientation:horizontal | TimeAxis = orientation:vertical | |||||
Alignbars = | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
This command allows the specification of background colors for various parts of the chart.Any colorids specified should be defined first usingColors.
Examples:
BackgroundColors = bars:darkgreyBackgroundColors = canvas:lightgrey bars:darkgreyBackgroundColors = canvas:lightgrey
This is an optional command which if present determines which bars will be drawn on the chart and in which order.If it is omitted then bars will be drawn in order of their appearance in commandPlotData.
For complex timelines with many bars, usage of this command is recommended:
Notes
Examples:
BarData = bar:Japan bar:US text:"United States" # refer in PlotData to bar "US" but show "United States" bar:China text:[[China]] # label China will be shown as blue clickable link to the English Wikipedia article about China
The following lines produce the same output (only reference inPlotData changes):
bar:US text:[[United_States]]bar:US text:"United States" link:http://www.wikipedia.org/wiki/United_Statesbar:United_States link:http://www.wikipedia.org/wiki/United_States
This command allows colors to be defined and coupled to an id (identification tag).Other commands will refer to colors with the id specified here.This command expects one or more color definitions, each on a separate indented line.
Example:
Colors = id:war value:red legend:War Period id:peace value:blue legend:Peace Time id:treaty value:rgb(0.6,0,0.6) id:lightgrey value:gray(0.9) id:darkgrey value:gray(0.1)
This command defines how dates, specified in other commands, should beinterpreted.
Valid dateformats are:
Example:
DateFormat = mm/dd/yyyy
This command allows definition of text constants, i.e. shorthands forpieces of script code that occur multiple times.Text constants should always start with a$ (dollar sign).
Example:
Define $broad = width:30Define $narrow = width:10Define $bardefaults = $broad fontsize:S
This command defines the overall size of the final image.Specify values inabsolute measurements.
For maximum flexibility you can let the script calculate the height or width of the image, based on the number of bars and the amount in pixels to add per bar. Specifyheight:auto (for horizontal time axis) orwidth:auto (for vertical time axis).
This is especially helpful when the number of bars in a timeline is likely to change over time again and again. Or to ensure equal distances between bars in images with many narrow bars where differences in amount of white space would soon be noticed (see for a real exampleTemplate:Vocal and instrumental pitch ranges). Or to make sure several related timelines always use the same distance between bars, no matter how many bars each contains (see for a real exampleList of popes (graphical)). In short it is a good idea most of the time.
Examples:
ImageSize = width:800 height:600ImageSize = width:800 height:auto barincrement:30
A legend will only be shown when this command is present.There are several ways to define the appearance and position of the legend. Some attributes are mutually exclusive (see below).
Tip: you may consider omitting the following parameters at first, and only add them when defaults settings are not satisfactory.
Examples:
Legend = orientation:vertical position:bottom columns:3 columnwidth:140Legend = orientation:horizontal position:bottomLegend = left:100 top:120 columns:3
Some timelines extend over several clearly distinct periods.A line demarcating these periods may serve as a visual aid.
Only in rare cases the following extra attributes may be needed for full flexibility:
Advanced positioning options
You can draw lines in any direction. The following options are available:
at:datefrompos:positiontillpos:positionfrom:datetill:dateatpos:positionpoints:(x1,y1)(x2,y2)Attributesat,from andtill expect a date or year, in compliance with the specifiedDateFormat.
Attributesfrompos,tillpos,atpos expect coordinates (e.g. pixels values)
Example:

LineData= layer:front# all lines in front of bars unless stated otherwise at:1 color:yellow# perpendicular to time axis full length at:2 color:orange layer:back# perpendicular to time axis full length but behind bars at:4 frompos:50 tillpos:105 color:green# perpendicular to time axis, with specified start and stop points from:5 till:8 atpos:50 color:red# parallel to time axis points:(100,20)(170,105) color:blue width:3# from one arbitrary absolute position to another, extra thick
ImageSize = width:200 height:120andPlotArea = left:20 right:10 top:10 bottom:20.Defines the time period that will be displayed in the chart. Both parameters are mandatory. Specify dates in compliance with specifiedDateFormat.
Example:
Period = from:01/09/1939 till:02/09/1945
width/height attributes
These attributes are only retained for downward compatibility. Earlier a plot area could only be defined by its totalwidth andheight, andleft andbottom margins. Now you can specify all four margins, and are advised to do so, and not usewidth andheight attributes anymore. The advantage is added flexibility: when you change the overall image size, you do not need to adjust the plotarea definition as well. This is even more important when the image size is calculated automatically (seeImageSize).
Example:
# e.g. extra space to the left and below the plot area for axis labels and legendPlotArea = left:40 bottom:60 top:10 right:10
Used to define bars (symbolizing a time period), and add text next to these bars on a specific position.
For texts which are not related to a certain period or date/year or which require extensive formatting use commandTextData.
Attributes text, at, from and till always apply only to the line on which they occur. All other attributes, when not combined with one these four,act as default for the remainder of the command block or until a new default is specified, and may be overruled for a single line. See Parameters vs Data Items for more info and an example.
PlotData accepts a lot of attributes, some of which are mutuallyexclusive. These attributes can be grouped as follows:
Examples:
DateFormat = dd/mm/yyyyPeriod = from:01/01/1939 till:02/09/1945PlotData= width:15 bar:Japan from:01/09/1939 till:27/09/1940 color:green bar:Japan from:27/09/1940 till:19/02/1945 color:yellow bar:Japan from:19/02/1945 till:14/03/1945 color:blue bar:Japan from:02/09/1945 till:end color:red at:07/12/1941 shift:(0,-2) text:"<-- Attack on Pearl Harbor"

Example:
BarData= bar:US text:United States bar:SB text:Sea BattlesColors= id:US value:blue legend:United_States id:SB value:rgb(0.8,0,0.7) legend:Sea_BattlesPlotData= width:0.3 # see note 1 bar:SB from:07/08/1942 till:09/02/1943 text:Guadalcanal color:SB # see note 2 bar:US from:start till:end color:US # see note 3 bar:Midway from:start till:end color:US # see note 4 bar:US at:07/12/1941 text:7/12 Pearl Harbour # see note 5
Notes:
at", or implicitly with attributes "from" and "till".Notes
Example:
PlotData= bar:US at:07/12/1941 align:left textcolor:black fontsize:XS text:7/12 [[Pearl Harbour]]
produces the same result as:
PlotData= bar:US at:07/12/1941 align:left textcolor:black fontsize:XS text:"7/12 Pearl Harbour" link:http://www.wikipedia.org/wiki/Pearl_Harbour
Example:
PlotData= bar:test width:15 color:red from:1900 till:2000 at:1990 mark:(line,white)
will be shown as:

This command divides the timeline into smaller periods, either
Note: the orientation of the lines and/or placement of the stubs dependson the orientation of theTimeAxis.
Examples:
ScaleMajor = gridcolor:red start:1940ScaleMajor = gridcolor:red unit:month increment:3 start:01/09/1939
This command defines a further subdivision of the timescale. See ScaleMajor for syntax .
Example:
ScaleMajor = grid:red unit:year increment:1 start:01/01/1940ScaleMinor = grid:blue unit:month increment:3 start:01/10/1939
Used to define a text block that can be positioned anywhere on the chart.
Notes:
Example:
TextData = pos:(20,67) textcolor:black fontsize:S tabs:(10-right,14-left,50-left,90-left,230-left) text:Germany,Italy and Japan sign[[Tripartite Pact]] text:^10^1944^1-22/7^Bretton Woods 44 nations establish text:^^^^^IMF and World Bank
will be shown as:

Defines the orientation of the time axis, and textual representation of stubs along that axis.
Example:
TimeAxis = orientation:horizontal format:yyyy
Presets are a shorthand for often used settings. They save a few code lines and promote standardisation, but may be confusing, as the timeline script become less self documenting.
At the moment two presets are available:
PlotArea = left:45 right:10 top:10 bottom:10TimeAxis = orientation:vertical format:yyyyDateFormat = yyyy ;AlignBars = earlyScaleMajor = unit:yearScaleMinor = unit:yearPlotData =mark:(line,white) align:left fontsize:S width:20 shift:(20,0)
ImageSize = height:auto barincrement:20PlotArea = left:25 right:25 top:15 bottom:30TimeAxis = orientation:horizontal format:yyyyColors =id:canvas value:gray(0.7)id:grid1 value:gray(0.4)id:grid2 value:gray(0.2)BackgroundColors = canvas:canvasDateFormat = yyyy ;AlignBars = justifyScaleMajor = unit:year grid:grid1ScaleMinor = unit:yearLegend = orientation:vertical left:35 top:130PlotData =align:left anchor:from fontsize:M width:15 shift:(4,-6) textcolor:black
Absolute measures may be used for specifying sizes, positions and position shifts, measured in pixels.
Example:
PlotArea = width:800 height:600 left:50 bottom:50
Relative measures may be used for specifying sizes and positions. Specify a number between 0 and 100, immediately followed by a %(percentage) sign. For horizontal measurements the percentage is related to image width, for vertical measurements to image height.
The first coordinate is horizontal from left to right, the second is vertically upward.
Example:
PlotArea = width:80% height:80% left:10% bottom:5%
Text input is subject to a few rules:
Example: (the following are all equivalent)
BarData = text:Japanese_mandate_since_1914 bar:MarshallsBarData = text:"Japanese mandate since 1914" bar:MarshallsBarData = bar:Marshalls text:Japanese mandate since 1914
Example showing tabs:
TextData = tabs:(4-right,12-right,14-left,34-left) text:^1^1940^27/9^Berlin Ger,It,Jap sign Tripartite Pact text:^10^1944^1-22/7^Bretton Woods 44 nations establish text:^^^^^IMF and World Bank# will be shown as:## 1 27/9 Berlin Ger,It,Jap sign Tripartite Pact# 10 1-22/7 Bretton Woods 44 nations establish# IMF and World Bank
Both output formats available in MediaWiki, i.e. PNG and SVG, can contain clickable links. Texts shown in blue, and bars, may then be clicked, to surf to another web page.
Links can be specified with commandsBarData,PlotData andTextData,either with attributelink, or as embedded links, via attributetext.
You can specify one link per text segment.
Embedded links are links that are (part of a) displayable text, specifiedwith attributetext. Their counterpart are explicit links (URL only)which are defined with attributelink.
Both type of links can be specified with commandsBarData,PlotData andTextData and are used forclickable maps.
In embedded links, internal link style is as usual, interwiki link style does not work, external link style is as usual with single brackets, but here with a pipe instead of a space.
Examples:
text:example [[Help:Link]] internal link
will be shown as:

text:[[Help:Link|Link]]
will be shown as:

text:[http://en.wikipedia.org/wiki/Rembrandt|Rembrandt van Rijn] paints Night Watch
will be shown as:

Attempt to use interwiki link style:
text:[[Main_Page]]
and similar with nl: and m: give:



The third one to Meta-Wikipedia works properly, except from Meta itself, the other links work likeMain Page (internal page, the prefix is ignored) or e.g. //en.wikipedia.org/w/Main_Page (gives File not found), depending on the URL of the referring page (e.g. different for a preview page and a diff page).
Special characters:
Blank spaces and underscores in the url should be written as %20.
The tilde character (~) is normally interpreted as line break. When a tilde is part of an url write it as is two tildes.
For example, link towww.site.com/~mysite as:
text:[www.site.com/~~mysite|My site]
The number sign (#) is normally interpreted as start of comment. When a number sign is part of an url make sure the text is embedded in double quotes as follows:
text:"More at [www.site.com/~~mysite#section2|My site]"
Actually it may be a good idea to always put texts between double quotes.
Timeline has somewhat limited Unicode support. It uses FreeSans.ttf font, which supports a subset of all the possible glyphs (it supportsCyrillic alphabet, east-Europe diactrics and kana for instance, but lackskanji). You can also specify|font=freesanswmf or|font=unifont to specify a different font, or do the rendering in a completely different way with|method=svg2png.
Example:
ImageSize=width:180height:90PlotArea=width:180height:90left:0bottom:0TimeAxis=orientation:vertical #dummyColors=id:grayvalue:gray(0.95)Backgroundcolors=canvas:grayPeriod=from:1till:2 # dummyTextData=pos:(10,90)fontsize:Ltext:"维基百科"pos:(10,70)fontsize:Ltext:"Zażółć gęślą jaźń"pos:(10,50)fontsize:Ltext:"ウィキペディア"
will be shown as:

As a legacy of bitmap font usage, only five font tags are predefined. They will render at slightly different sizes in PNG and SVG images to produce optimal readability for both platforms.It is advised to use these tags instead of numbers whenever possible.They are: XS=eXtra Small, S=Small (default), M=Medium, L=Large, XL=eXtra large

This documentation is originally a wikified version of theoriginal EasyTimeline documentation.
To render template parameters you must use{{#tag: syntax. As an example:
{{#tag:timeline|ImageSize = width:280 height:25PlotArea = width:280 height:25 left:0 bottom:0TimeAxis = orientation:vertical # dummy, requiredPeriod = from:0 till:1 # dummy, requiredColors = id:canvas value:rgb(1,1,0.85)BackgroundColors = canvas:canvasTextData = pos:(10,10) fontsize:XL text:"a"}}renders as

Example a political timeline
{{#tag:timeline|ImageSize = width:1010 height:auto barincrement:25PlotArea = top:30 bottom:90 right:130 left:3AlignBars = lateDefine $today = {{#time:d/m/Y}}DateFormat = dd/mm/yyyyPeriod = from:01/01/1865 till:31/12/{{#time:Y|+1 year}}TimeAxis = orientation:horizontalColors = id:Liberal value:rgb(0.92,0.43,0.42) legend: Liberal_Party_of_Canada id:OldConservative value:rgb(0.6,0.6,1) legend: Conservative_Party_→_Progressive_Conservative_Party id:Conservative value:rgb(0.39,0.58,0.93) legend: Conservative_Party_of_Canada id:gray1 value:gray(0.8) id:gray2 value:gray(0.9) id:grid value:gray(0.5)ScaleMajor = gridcolor:gray1 unit:year increment:10 start:1870ScaleMinor = gridcolor:gray2 unit:year increment:2 start:1868Legend = columns:1 left:150 top:60 columnwidth:230TextData = pos:(20,65) textcolor:black fontsize:M text:"Political parties:"BarData = bar:Macdonald bar:Mackenzie bar:Abbott bar:JSDT bar:Bowell bar:Tupper bar:Laurier bar:Borden bar:Meighen bar:WLMK bar:Bennett bar:St.Laurent bar:Diefenbaker bar:Pearson bar:PTrudeau bar:Clark bar:Turner bar:Mulroney bar:Campbell bar:Chretien bar:Martin bar:Harper bar:JTrudeau bar:CarneyPlotData= width:7 align:left fontsize:S shift:(5,-4) anchor:till bar:Macdonald from: 01/07/1867 till: 05/11/1873 color:OldConservative from: 17/10/1878 till: 06/06/1891 color:OldConservative text:"[[John A. Macdonald]]" fontsize:10 bar:Mackenzie from: 07/11/1873 till: 08/10/1878 color:Liberal text:"[[Alexander Mackenzie (politician)|Alexander Mackenzie]]" fontsize:10 bar:Abbott from: 16/06/1891 till: 24/11/1892 color:OldConservative text:"[[John Abbott]]" fontsize:10 bar:JSDT from: 05/12/1892 till: 12/12/1894 color:OldConservative text:"[[John Sparrow David Thompson]]" fontsize:10 bar:Bowell from: 21/12/1894 till: 27/04/1896 color:OldConservative text:"[[Mackenzie Bowell]]" fontsize:10 bar:Tupper from: 01/05/1896 till: 08/07/1896 color:OldConservative text:"[[Charles Tupper]]" fontsize:10 bar:Laurier from: 11/07/1896 till: 06/10/1911 color:Liberal text:"[[Wilfrid Laurier]]" fontsize:10 bar:Borden from: 10/10/1911 till: 10/07/1920 color:OldConservative text:"[[Robert Borden]]" fontsize:10 bar:Meighen from: 10/07/1920 till: 29/12/1921 color:OldConservative from: 28/06/1926 till: 29/06/1926 color:OldConservative text:"[[Arthur Meighen]]" fontsize:10 bar:WLMK from: 29/12/1921 till: 28/06/1926 color:Liberal from: 25/09/1926 till: 07/08/1930 color:Liberal from: 23/10/1935 till: 15/11/1948 color:Liberal text:"[[William Lyon Mackenzie King]]" fontsize:10 bar:Bennett from: 07/08/1930 till: 23/10/1935 color:OldConservative text:"[[R. B. Bennett]]" fontsize:10 bar:St.Laurent from: 15/11/1948 till: 21/06/1957 color:Liberal text:"[[Louis St. Laurent]]" fontsize:10 bar:Diefenbaker from: 21/06/1957 till: 22/04/1963 color:OldConservative text:"[[John Diefenbaker]]" fontsize:10 bar:Pearson from: 22/04/1963 till: 20/04/1968 color:Liberal text:"[[Lester B. Pearson]]" fontsize:10 bar:PTrudeau from: 20/04/1968 till: 04/06/1979 color:Liberal from: 03/03/1980 till: 30/06/1984 color:Liberal text:"[[Pierre Trudeau]]" fontsize:10 bar:Clark from: 04/06/1979 till: 03/03/1980 color:OldConservative text:"[[Joe Clark]]" fontsize:10 bar:Turner from: 30/06/1984 till: 17/09/1984 color:Liberal text:"[[John Turner]]" fontsize:10 bar:Mulroney from: 17/09/1984 till: 25/06/1993 color:OldConservative text:"[[Brian Mulroney]]" fontsize:10 bar:Campbell from: 25/06/1993 till: 04/11/1993 color:OldConservative text:"[[Kim Campbell]]" fontsize:10 bar:Chretien from: 04/11/1993 till: 12/12/2003 color:Liberal text:"[[Jean Chrétien]]" fontsize:10 bar:Martin from: 12/12/2003 till: 06/02/2006 color:Liberal text:"[[Paul Martin]]" fontsize:10 bar:Harper from: 06/02/2006 till: 04/11/2015 color:Conservative text:"[[Stephen Harper]]" fontsize:10 bar:JTrudeau from: 04/11/2015 till: 14/03/2025 color:Liberal text:"[[Justin Trudeau]]" fontsize:10 bar:Carney from: 14/03/2025 till: $today color:Liberal text:"[[Mark Carney]]" fontsize:10}}renders as
