Content deleted Content added
TRANSWIKI: Copied from Meta:Help:EasyTimeline syntax. |
|||
(90 intermediate revisions by 55 users not shown) | |||
Line 1:
{{Accessibility dispute|reason=Text is way too small and distorted to be legible at default size}}{{Wikipedia how-to|H:ET}}
The [[Wikipedia:EasyTimeline|EasyTimeline]] feature produces an embedded [[Help:Images and other uploaded files|image]] 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 also [[Wikipedia:Timeline]], [[mw:Extension:EasyTimeline]], <!--[http://stats.wikimedia.org/EN/TimelinesIndex.htm Gallery of graphical timelines], -->[[mw:Extension:EasyTimeline/syntax]], [[mw:Extension:EasyTimeline/installation|EasyTimeline activation on other MediaWiki installations]]
== Introduction ==
Graphical timelines can be produced by providing a script between special tags:
<nowiki><timeline></nowiki>
''script''
<nowiki></timeline></nowiki>
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 the [[m:User:Erik Zachte|author of EasyTimeline]] for advice.
== Available commands ==
The script commands define:
*Overall layout: [[#
*Interpretation and presentation of dates and periods: [[#DateFormat|DateFormat]], [[#
*Events, periods and descriptive texts: [[#PlotData|PlotData]], [[#TextData|TextData]]
*How to order, divide, and name groups of events and periods: [[#BarData|BarData]], [[#Legend|Legend]], [[#LineData|LineData]]
*Shorthands for pieces of script code that occur multiple times: [[#Define|Define]]
The following commands are mandatory: [[#
'''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.
----
== General syntax rules ==
A script can contain commands and comments. Each command is followed by one or more attributes.
=== Commands ===
Commands should start on the first position of a line.
Some commands can be followed by multiple lines of data and/or options.
Line 44 ⟶ 42:
Commands have one of the following forms, depending on the type of
command:
{|
|
'''''Command = attribute(s)'''''
|<pre>
DateFormat = dd/mm/yyyy
</pre>
|-
|
'''''Command name = attribute(s)'''''
|<pre>
Color Jp = value:red legend:Japan
</pre>
|-
|
'''''Command ='''''
'''''attribute(s)'''''
'''''attribute(s)'''''
'''''etc.'''''
|<pre>
PlotData =
fontsize:XS width:20
Line 62 ⟶ 66:
bar:Japan from:19/02/1945 till:14/03/1945 color:AI
</pre>
|}
=== Comments ===
Single and multi line comments can be specified:
* Text following the hash sign '''#''' will be regarded as a comment
Line 77 ⟶ 80:
</pre>
=== Attributes ===
When several attributes can be specified for a certain command, they are
notated as 'name:value' pairs. When several values can be specified for
Line 88 ⟶ 91:
</pre>
==== Parameters vs data items ====
Most commands only accept attributes that are specified on the same line.
'''Data blocks:''' some commands, like [[#BarData|BarData]], [[#PlotData|PlotData]], [[#TextData|TextData]], [[#Colors|Colors]] expect a ''data block'' consisting of one or more ''data lines''. Data lines should start with one or more spaces. A data block is considered complete when a line
starting with a non-space is encountered,
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 into ''parameters'' and ''data items''. Data blocks can contain parameters and data items intermingled.
Line 102 ⟶ 105:
<small>Example:</small>
<!-- all data start with space here to keep source formatting
Line 131 ⟶ 133:
</pre>
=== Special characters ===
*'''#''', '''#>''', '''<#''' (hash, hash+"greater than", "less than"+hash): see [[#Comments|Comments]]
*'''~''' (tilde) in texts means: line break
Line 139 ⟶ 141:
----
== Command
For each command the valid attributes are listed. Some commands and/or
attributes are optional (O).
Line 146 ⟶ 148:
explained where applicable).
=== AlignBars ===
Bars will always be drawn at equal distances.
This command specifies whether the bars should be spaced as much apart as possible, or some white
Line 299 ⟶ 301:
</td>
</tr></table>
----
=== BackgroundColors ===
This command allows the
Any color ''id''s specified should be defined first using [[#Colors|Colors]].
;canvas (O) : Specify a background color for the whole image.
;bars (O) : Specify a background color for all bars.
Line 319 ⟶ 321:
----
=== BarData ===
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 command [[#PlotData|PlotData]].
Line 327 ⟶ 329:
*Bar names specified in [[#PlotData|PlotData]] can be validated against this list, thus preventing typing errors.
;bar : defines the bar id. Other commands (notably [[#PlotData|PlotData]]) will expect this id for reference. This will also be the label to be shown along the axis, unless attribute ''text'' is present. The bar id should not contain any spaces: use underscores instead, these will be converted to spaces, as
;text (O) : When specified this specifies the text to be presented along the axis, instead of the bar id. See also rules for [[#Text
;link (O) : Specify a web link (see '''Note 1''') (URL). The label along the axis will be shown as a blue clickable link.
Line 351 ⟶ 353:
</pre>
----
=== Colors ===
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.
Line 360 ⟶ 363:
;* predefined color constant, for which 32 predefined color names are recognized (see the [http://ploticus.sourceforge.net/doc/color.html Ploticus color page] where all these constants are defined).
;* rgb (red,green,blue): specify 3 numbers between 0 (minimal) and 1 (maximal)
;* gray (value): specify a number between 0 (black) and 1 (white)
;legend (O) : Specifies the text that should be displayed in the legend for this color. If this attribute is omitted no entry will appear in the legend at all. See [[#Text
<small>Example:</small>
Line 375 ⟶ 377:
----
=== DateFormat ===
This command defines how dates, specified in other commands, should be
interpreted.
Line 386 ⟶ 387:
;mm/dd/yyyy : Dates are interpreted as month/day/year
: '''Note''': this format is only allowed for dates starting from 01/01/1800
;yyyy : this deals with [[
<small>Example:</small>
<pre>
DateFormat = mm/dd/
</pre>
----
=== Define ===
This command allows definition of text constants, i.e. shorthands for
pieces of script code that occur multiple times.
Line 410:
----
=== ImageSize (mandatory) ===
This command defines the overall size of the final image.
Specify values in [[#Measurements|absolute measurements]].
Line 416:
;height : Height of final image: maximum is 1200 pixels, minimum is 25
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. Specify '''height:auto''' (for horizontal time axis) or '''width: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 example [[
;barincrement : Amount in pixels that should be added to the image size for each bar specified (mandatory and only allowed in combination with width:auto or height:auto).
<small>Examples:</small>
Line 431:
----
=== Legend ===
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).
Line 441:
;'''columns''' (O) : Specify 1, 2, 3 or 4. When this attribute is omitted the number of columns is determined as follows:
*'''orientation horizontal''' : Attribute columns does not apply here. All entries will be on the same line.
*'''orientation vertical''' :
**'''position right''' : All entries will be in one column
**'''position top''' or '''bottom''' : The number of columns depends on the number of entries to be shown:<br/>1-5 entries: 1 column, 6-10 entries: 2 columns, 11 or more entries: 3 columns.
Line 463:
----
=== LineData ===
Some timelines extend over several clearly distinct periods.
A line demarcating these periods may serve as a visual aid.
;at : Draws a line perpendicular to the time axis (default at maximal length, see also below).<br />Specify the date/year where the line should be drawn, in compliance with the specified [[#DateFormat|DateFormat]].
;color : Specify the color in which the line should drawn.
:'''Note''': The color id specified should be defined first with command [[#Colors|Colors]].
Line 478:
You can draw lines in any direction. The following options are available:
*'''Perpendicular to the time axis''' with arbitrary start and stop points: <code>'''at''':''date'' '''frompos''':''position'' '''tillpos''':''position''
*'''Parallel to the time axis''' with arbitrary start and stop points <code>'''from''':''date'' '''till''':''date'' '''atpos''':''position''
*'''In any direction''' with arbitrary start and stop points: <code>'''points''':(x1,y1)(x2,y2)</code>
Attributes '''at''', '''from''' and '''till''' expect a date or year, in compliance with the specified [[#DateFormat|DateFormat]].<br />
Attributes '''frompos''', '''tillpos''', '''atpos''' expect coordinates (e.g. pixels values)
<small>Example:</small>
Line 516:
points:(100,20)(170,105) color:blue width:3
</timeline>
<syntaxhighlight lang="unixconfig" line style="font-size:90%">
LineData =
layer:front # all lines in front of bars unless stated otherwise
Line 524:
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
</syntaxhighlight>
::: <small>''Note that in the above example those "absolute positions" are plotted in the context of'' <code>ImageSize = width:200 height:120</code> ''and'' <code>PlotArea = left:20 right:10 top:10 bottom:20</code>.</small>
----
=== Period (mandatory) ===
Defines the time period that will be displayed in the chart. Both parameters are mandatory. Specify dates in compliance with specified [[#DateFormat|DateFormat]].
;from : Timeline starts here. The specified value can be referenced as start in commands like [[#PlotData|PlotData]] and [[#TextData|TextData]].
Line 540 ⟶ 541:
----
=== PlotArea (mandatory) ===
;width : Specify value in absolute or relative [[#Measurements|measurements]]. ('''do not use anymore''', see below)
;height : Specify value in absolute or relative measurements. ('''do not use anymore''', see below)
Line 548 ⟶ 549:
;bottom : Margin between bottom of image and bottom of plot area. Specify value in absolute or relative measurements.
'''width/height attributes'''
These attributes are only retained for downward compatibility. Earlier a plot area could only be defined by its total ''width'' and ''height'', and ''left'' and ''bottom'' margins. Now you can specify all four margins, and are advised to do so, and not use ''width'' and ''height'' 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 (see [[#ImageSize (mandatory)|ImageSize]]).
<small>Example:</small>
<pre>
PlotArea = left:40 bottom:60 top:10 right:10
</pre>
----
=== PlotData ===
Used to define bars (symbolizing a time period), and add text next to these bars on a specific position.
Line 575 ⟶ 577:
*Marker attribute
==== Positional attributes ====
;at : Specifies at which date/year a text should be positioned. Depending on attribute '''align''' the text either starts, ends or is centered at this position. Use date/year format as specified in [[#DateFormat|DateFormat]] or specify ''start'' or ''end'' which refers to time frame defined by command [[#Period|Period]].
:'''NB''': This attribute
;from : Specifies at which date/year a bar should start. Use date/year format as specified in [[#DateFormat|DateFormat]] or specify ''start'' which refers to time frame defined by command Period.
:'''NB''': This attribute should be used in combination with attribute '''till''' and
;till : Specifies at which date/year a bar should end. Use date/year format as specified in DateFormat or specify ''end'' which refers to time frame defined by command Period.
:'''NB''': This attribute should be used in combination with attribute '''from''' and
;shift : Specifies a horizontal and vertical displacement in absolute [[#Measurements|measurements]] for a text. This allows:
:*Texts to be shifted to avoid overlaps
Line 588 ⟶ 590:
<small>Examples:</small>
<pre>
DateFormat = dd/mm/yyyy
Period = from:01/01/1939 till:02/09/1945
PlotData=
width:15
bar:Japan from:
bar:Japan from:
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,-
</pre>
<timeline>
ImageSize = width:500 height:50
PlotArea = left:20 right:10 top:10 bottom:20
TimeAxis = orientation:horizontal
AlignBars = justify
DateFormat = dd/mm/yyyy
Period = from:01/01/1939 till:02/09/1945
ScaleMajor = grid:red unit:year increment:1 start:01/01/1939
ScaleMinor = grid:blue unit:month increment:1 start:01/01/1939
PlotData=
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"
</timeline>
==== Bar related attributes ====
;bar : Specifies to which bar all other attributes apply.
:When command [[#BarData|BarData]] has not been used, bars will be drawn in the order in which they occur in any [[#PlotData|PlotData]] data block. The id specified here will also be the text presented along the axis, next to the bar.
:When command BarData has been used, bars will presented in the order specified there, also the bar id specified here will be validated against that list. Also the text presented along the axis will depend on the definition in [[#BarData|BarData]].
;barset : Restarts the bar display "from the top", allowing multiple bars on the same line. Syntax: <samp>barset:name</samp><br />Blank lines may be added to skip over lines that you do not wish to add to with declarations such as <samp>at:1234</samp> with no further attributes.
;color : Specifies the color is which the bar should be drawn.
:The color id specified should be defined first with command [[#Colors|Colors]].
Line 607 ⟶ 634:
<pre>
BarData=
Colors=
Line 628 ⟶ 655:
#the last line will not result in a bar being plotted, it merely specifies on which bar the text should be placed
==== Text attributes ====
;text : Defines a text that should be plotted on or near a bar. The anchor position can be defined either explicitly with attribute "<code>at</code>", or implicitly with attributes "<code>from</code>" and "<code>till</code>".
:In the latter case the text will be positioned in the middle of the defined bar segment. See also [[#Text :The text may include embedded links (see '''Notes 1 & 2''') for use in clickable maps.
;textcolor (O) : Defines the color of the text. The color id specified should be defined first with command [[#Colors|Colors]]. When not specified color black will be assumed.
;fontsize (O) : Specify a point size between 6 and 30, or (preferably) one of tags XS, S (default), M, L or XL. See [[#Font
;align (O) : Specify center (default), left or right.
;link (O) : Specify a web link (see '''Note 1''') (URL) for use in clickable maps. The text will be shown as a blue clickable link.
Line 653 ⟶ 681:
</pre>
==== Marker attribute ====
;mark : Places a marker in a bar at the specified position. Specify as mark:(symbol, color). The only value for ''symbol'' supported to date is ''line''. The ''color'' id specified should be defined first with command [[#Colors|Colors]]. When not specified color black will be assumed.
Line 684 ⟶ 712:
----
=== ScaleMajor ===
This command divides the timeline into smaller periods, either
* Graphically, through thin vertical or horizontal lines in the chart
Line 708 ⟶ 736:
----
=== ScaleMinor ===
This command defines a further subdivision of the timescale. See ScaleMajor for syntax .
Line 718 ⟶ 746:
----
=== TextData ===
Used to define a text block that can be positioned anywhere on the chart.
;text : The actual text. See also [[#Text
;pos : Defines the top-left corner of the text block in absolute or relative [[#
;link (O) : Specify a web link (see '''Note 1''') (URL) for use in clickable maps. The label along the axis will be shown as a blue clickable link.
;textcolor (O) : Defines the color of the text. The color id specified should be defined first using [[#Colors|Colors]]. When not specified, the color is black.
;fontsize (O) : Specify a point size between 6 and 30, or (preferably) one of tags '''XS''', '''S''' (default), '''M''', '''L''' or '''XL''' (see [[#Font
;tabs (O) : Defines position and alignment for tab character: '''^''' (caret). Specify multiple tab settings as tabs: (''x<sup>1</sup>-a<sup>1</sup>,x<sup>2</sup>-a<sup>2</sup>,x<sup>3</sup>-a<sup>3</sup>'', etc..) where
:*''x<sup>n</sup>'' is the horizontal displacement in absolute measurements from the left side of the text
Line 734 ⟶ 762:
<small>Example:</small>
<syntaxhighlight lang="moin">
TextData =
pos:(20,67) textcolor:black fontsize:S
tabs:(10-right,14-left,50-left,90-left,230-left)
text:
text:^10^1944^1-22/7^Bretton Woods 44 nations establish
text:^^^^^IMF and World Bank
</syntaxhighlight>
will be shown as:
<timeline font="unifont">
ImageSize = width:400 height:70
PlotArea = width:400 height:70 left:0 bottom:0
Line 754 ⟶ 782:
pos:(20,67) textcolor:black fontsize:S
tabs:(10-right,14-left,50-left,90-left,230-left)
text:
text:^10^1944^1-22/7^Bretton Woods 44 nations establish
text:^^^^^IMF and World Bank
Line 761 ⟶ 789:
----
=== TimeAxis ===
Defines the orientation of the time axis, and textual representation of stubs along that axis.
;format (O) : Specify in which format dates should be presented along the time axis.
:Currently only format yyyy (default) is supported. More formats may follow.
;orientation (O) : Specify hor[izontal] (default) or ver[tical].
<small>Example:</small>
<pre>
Line 774 ⟶ 801:
----
== Presets ==
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:
*'''Preset = TimeVertical_OneBar_UnitYear''', which expands to
PlotArea = left:45 right:10 top:10 bottom:10
TimeAxis = orientation:vertical format:yyyy
DateFormat = yyyy ;
AlignBars = early
ScaleMajor = unit:year
ScaleMinor = unit:year
PlotData =
mark:(line,white) align:left fontsize:S width:20 shift:(20,0)
*'''Preset = TimeHorizontal_AutoPlaceBars_UnitYear''', which expands to
ImageSize = height:auto barincrement:20
PlotArea = left:25 right:25 top:15 bottom:30
TimeAxis = orientation:horizontal format:yyyy
Colors =
id:canvas value:gray(0.7)
id:grid1 value:gray(0.4)
id:grid2 value:gray(0.2)
BackgroundColors = canvas:canvas
DateFormat = yyyy ;
AlignBars = justify
ScaleMajor = unit:year grid:grid1
ScaleMinor = unit:year
Legend = orientation:vertical left:35 top:130
PlotData =
align:left anchor:from fontsize:M width:15 shift:(4,-6) textcolor:black
== Input rules ==
{{anchor|Measurements}}
=== Scales for size and position ===
'''Absolute measures''' may be used for specifying sizes, positions and position shifts, measured in pixels.
Line 795 ⟶ 844:
(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.
<small>Example:</small>
Line 802 ⟶ 851:
</pre>
=== Text
Text input is subject to a few rules:
:1). Only a subset of
:2). When text should contain spaces, either specify these by using underscores or place the text between double quotes.
:Exception: when the text attribute is the last attribute on a line, spaces are allowed (no confusion will arise where the text stops and the next attribute starts, that
<small>Example: (the following are all equivalent)</small>
Line 823 ⟶ 872:
</pre>
:3). In data lines following command [[#TextData|TextData]]
:'''^''' (caret) means ''tab''
<small>Example showing tabs:</small>
<syntaxhighlight lang="moin">
TextData =
tabs:(4-right,12-right,14-left,34-left)
Line 851 ⟶ 888:
# 10 1-22/7 Bretton Woods 44 nations establish
# IMF and World Bank
</syntaxhighlight>
----
== Clickable maps ==
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.
Line 864 ⟶ 900:
You can specify one link per text segment.
=== Embedded links ===
Embedded links are links that are (part of a) displayable text, specified
with attribute ''text''. Their counterpart are explicit links (URL only)
which are defined with attribute ''link''.
Both type of links can be specified with commands [[#BarData|BarData]], [[#PlotData|PlotData]] and [[#TextData|TextData]] and are used for [[#
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:
<pre>
<nowiki>text:example [[Help:Link]] internal link</nowiki>
</pre>
will be shown as:
<timeline font="unifont">
ImageSize = width:380 height:25
PlotArea = width:380 height:25 left:0 bottom:0
Line 894 ⟶ 929:
</pre>
will be shown as:
<timeline font="unifont">
ImageSize = width:380 height:25
PlotArea = width:380 height:25 left:0 bottom:0
Line 910 ⟶ 945:
</pre>
will be shown as:
<timeline font="unifont">
ImageSize = width:380 height:25
PlotArea = width:380 height:25 left:0 bottom:0
Line 925 ⟶ 960:
<pre>
<nowiki>text:[[
</pre>
and similar with nl: and m: give:
<timeline font="unifont">
ImageSize = width:380 height:25
PlotArea = width:380 height:25 left:0 bottom:0
Line 937 ⟶ 972:
BackgroundColors = canvas:canvas
TextData =
pos:(10,10) fontsize:XL text:"[[
</timeline>
<timeline font="unifont">
ImageSize = width:380 height:25
PlotArea = width:380 height:25 left:0 bottom:0
Line 949 ⟶ 984:
BackgroundColors = canvas:canvas
TextData =
pos:(10,10) fontsize:XL text:"
</timeline>
<timeline font="unifont">
ImageSize = width:380 height:25
PlotArea = width:380 height:25 left:0 bottom:0
Line 964 ⟶ 999:
</timeline>
The third one to Meta-Wikipedia works properly, except from Meta itself, the other links work like [[
'''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.<br />
For example, link to ''www.site.com/~mysite'' as:
<pre>
<nowiki>text:[www.site.com/~~mysite|My site]</nowiki>
</pre>
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:
<pre>
<nowiki>text:"More at [www.site.com/~~mysite#section2|My site]"</nowiki>
</pre>
Actually it may be a good idea to always put texts between double quotes.
----
== Font
Timeline has somewhat limited
<small>Example:</small>
<syntaxhighlight lang="tf">
ImageSize = width:180 height:90
PlotArea = width:180 height:90 left:0 bottom:0
TimeAxis = orientation:vertical #dummy
Colors =
id:gray value:gray(0.95)
Backgroundcolors = canvas:gray
Period = from:1 till:2 # dummy
TextData=
pos:(10,90) fontsize:L text:"维基百科"
pos:(10,70) fontsize:L text:"Zażółć gęślą jaźń"
pos:(10,50) fontsize:L text:"ウィキペディア"
</syntaxhighlight>
will be shown as:
<timeline>
ImageSize = width:180 height:90
Line 996 ⟶ 1,046:
Period = from:1 till:2 # dummy
TextData=
pos:(10,
pos:(10,
pos:(10,
</timeline>
Line 1,021 ⟶ 1,071:
</timeline>
This documentation is originally a wikified version of the [http://
== EasyTimeline code with
To render template parameters you must use <code><nowiki>{{#tag:</nowiki></code> syntax. As an example:
<pre>
{{#tag:timeline|
ImageSize = width:280 height:25
PlotArea = width:280 height:25 left:0 bottom:0
TimeAxis = orientation:vertical # dummy, required
Period = from:0 till:1 # dummy, required
Colors =
id:canvas value:rgb(1,1,0.85)
BackgroundColors = canvas:canvas
TextData =
pos:(10,10) fontsize:XL text:"a"
}}
</pre>
renders as
{{#tag:timeline|
ImageSize = width:280 height:25
PlotArea = width:280 height:25 left:0 bottom:0
TimeAxis = orientation:vertical # dummy, required
Period = from:0 till:1 # dummy, required
Colors =
id:canvas value:rgb(1,1,0.85)
BackgroundColors = canvas:canvas
TextData =
pos:(10,10) fontsize:XL text:"a"
}}
Example a political timeline
<pre>
{{#tag:timeline|
ImageSize = width:1010 height:auto barincrement:25
PlotArea = top:30 bottom:90 right:130 left:3
AlignBars = late
Define $today = {{#time:d/m/Y}}
DateFormat = dd/mm/yyyy
Period = from:01/01/1865 till:31/12/{{#time:Y|+1 year}}
TimeAxis = orientation:horizontal
Colors =
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:1870
ScaleMinor = gridcolor:gray2 unit:year increment:2 start:1868
Legend = columns:1 left:150 top:60 columnwidth:230
TextData =
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:Carney
PlotData=
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
}}
</pre>
renders as
{{#tag:timeline|
ImageSize = width:1010 height:auto barincrement:25
PlotArea = top:30 bottom:90 right:130 left:3
AlignBars = late
Define $today = {{#time:d/m/Y}}
DateFormat = dd/mm/yyyy
Period = from:01/01/1865 till:31/12/{{#time:Y|+1 year}}
TimeAxis = orientation:horizontal
Colors =
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:1870
ScaleMinor = gridcolor:gray2 unit:year increment:2 start:1868
Legend = columns:1 left:150 top:60 columnwidth:230
TextData =
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:Carney
PlotData=
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
}}
{{Wikipedia technical help|collapsed}}
[[Category:Wikipedia image help]]
|