Anonymous
Not logged in
Talk
Contributions
Create account
Log in
Search
Editing
Template:Line chart/doc
From MEpedia, a crowd-sourced encyclopedia of ME and CFS science and history
Namespaces
Template
Discussion
More
More
Page actions
Read
Edit source
History
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Documentation subpage}} '''Note: [[:Template:Graph:Chart]] is an alternative template that may produce higher-quality charts.''' This template allows the creation of [[line chart]]s with the following limitations: * <u>Maximum number of data series</u>: 10 * <u>Maximum number of x-values</u>: 25 It is based on the extension [[mw:Extension:EasyTimeline|EasyTimeline]] and has been copied from [https://en.wikipedia.org/wiki/fr:Modèle:Graphique_polygonal French Wikipedia]. == Syntax == <pre> {{Line chart | padding_top = | padding_bottom = | padding_right = | padding_left = | width = | height = | number_of_x-values = | y_max = | y_min = | number_of_series = | color_background = | scale = | color_primary_scale = | color_secondary_scale = | interval_primary_scale = | interval_secondary_scale = | color_series_1 = | ... | color_series_10 = | label_x1 = | ... | label_x25 = | S01V01 = | ... | S01V25 = | S02V01 = | ... | S02V25 = | ... | S10V01 = | ... | S10V25 = }} </pre> == Parameters == === Layout parameters === The following parameters are optional: * <code>width</code>: width in pixels of the chart (default: 500) * <code>height</code>: height in pixels of the chart (default: 350) * <code>padding_top</code>: margin in pixels between the top of the image and the top of the drawing area (default: 10) * <code>padding_bottom</code>: margin in pixels between the bottom of the image and the bottom of the drawing area (default: 20) * <code>padding_right</code>: margin in pixels between the right of the image and the right of the drawing area (default: 10) * <code>padding_left</code>: margin in pixels between the left of the image and the left of the drawing area (default: 30) === Form and color parameters === The following parameters are optional: * <code>color_background</code>: Background color (default: white). * <code>color_primary_scale</code>: Color of the primary lines of the ordinate scale (default: dark gray). * <code>color_secondary_scale</code>: Color of the secondary lines of the ordinate scale (default: light gray). * <code>color_series_1</code> to <code>color_series_10</code>: Color of each line of data series (default: red, blue, green, yelloworange, purple, magenta, orange, lavender, powderblue, brightgreen). * <code>thickness_series1</code> to <code>thickness_series10</code> : Thickness of each line of data series, from 0.1 (very thin) to 10 (very thick). Default: 0.8 Color can be described with one of the keywords listed in the [[mw:Extension:EasyTimeline/syntax#Predefined_colors|EasyTimeline documentation]], or in the format <code>rgb(red,green,blue)</code>, where red, green and blue are values from 0 to 1. Refer to the [[mw:Extension:EasyTimeline/syntax#Colors|documentation]] to convert [[web colors]] into this format. === Data series parameters === * <code>SaaVxx</code>: Value ''xx'' (from 01 to 25) of the series ''aa'' (from 01 to 10). The subsequent value must be between 0 and the parameter <code>y_max</code> (see below). ** '''Example''': ''<code>S05V01 = 25 </code>'' means: "The first value (at x-axis position 01) of the fifth series (05) is 25". **Note: X-axis values may be omitted. For example, if values for S01V01 and S01V03 are provided, but not for S01V02, a direct line between the x-axis value at 1 and at 3 is drawn. * <code>points</code>: Determines whether points symbolizing the x-axis value of the data are to be added to the graph. <code>points = yes</code> means that such points are added for all data series. All other values of the parameter are ignored. === Axis parameters === * <code>interval_primary_scale</code>: Interval between each principal subdivision of the y-axis. ''Mandatory''. * <code>interval_secondary_scale</code>: Interval between each secondary subdivision of the y-axis (if the parameter <code>scale</code> is given a value of <code>yes</code>). * <code>number_of_x-values</code> : number of values on the x-axis. ''Mandatory''. * <code>label_x1</code> to <code>label_x25</code>: the labels (text) of the x-axis values. The number of these parameters that is set must be equal to the value <code>number_of_x-values</code>. Default value: a number between 1 and 25. * <code>y_max</code> : Maximum value on the y-axis. ''Mandatory''. * <code>y_min</code> : Minimum value on the y-axis. Default is zero. == Example == The following code: <pre> {{Line chart | color_background = white | width = 500 | height = 350 | padding_left = 40 | padding_right = 15 | padding_top = 10 | padding_bottom = 20 | number_of_series = 3 | number_of_x-values = 10 | label_x1 = Val. 1 | label_x2 = Val. 2 | label_x3 = Val. 3 | label_x4 = Val. 4 | label_x5 = Val. 5 | label_x6 = Val. 6 | label_x7 = Val. 7 | label_x8 = Val. 8 | label_x9 = Val. 9 | label_x10 = Val. 10 | y_max = 3000 | y_min = 1000 | scale = yes | interval_primary_scale = 1000 | interval_secondary_scale = 100 | S01V02 = 2200 | S01V03 = 2400 | S01V04 = 2500 | S01V05 = 2600 | S01V06 = 2500 | S02V01 = 1400 | S02V02 = 2000 | S02V03 = 1600 | S02V04 = 1800 | S02V05 = 2400 | S02V06 = 2400 | S02V07 = 2500 | S02V08 = 2000 | S02V09 = 1600 | S02V10 = 1800 | S03V01 = 1800 | S03V04 = 2000 | S03V05 = 1600 | S03V06 = 1800 | S03V07 = 2400 | S03V09 = 2400 | points = yes }} {{legend|red|Series 1}} {{legend|blue|Series 2}} {{legend|green|series 3}} </pre> renders: <br> {{Line chart | color_background = white | width = 500 | height = 350 | padding_left = 40 | padding_right = 15 | padding_top = 10 | padding_bottom = 20 | number_of_series = 3 | number_of_x-values = 10 | label_x1 = Val. 1 | label_x2 = Val. 2 | label_x3 = Val. 3 | label_x4 = Val. 4 | label_x5 = Val. 5 | label_x6 = Val. 6 | label_x7 = Val. 7 | label_x8 = Val. 8 | label_x9 = Val. 9 | label_x10 = Val. 10 | y_max = 3000 | y_min = 1000 | scale = yes | interval_primary_scale = 1000 | interval_secondary_scale = 100 | S01V02 = 2200 | S01V03 = 2400 | S01V04 = 2500 | S01V05 = 2600 | S01V06 = 2500 | S02V01 = 1400 | S02V02 = 2000 | S02V03 = 1600 | S02V04 = 1800 | S02V05 = 2400 | S02V06 = 2400 | S02V07 = 2500 | S02V08 = 2000 | S02V09 = 1600 | S02V10 = 1800 | S03V01 = 1800 | S03V04 = 2000 | S03V05 = 1600 | S03V06 = 1800 | S03V07 = 2400 | S03V09 = 2400 | points = yes }} {{legend|red|Series 1}} {{legend|blue|Series 2}} {{legend|green|Series 3}} == Limitations == * The magic word ''formatnum'' cannot be used to format the x-axis values. * There is no alternate text for accessibility purposes. == See also == * [[mw:Extension:EasyTimeline|EasyTimeline]] * [[Module:Chart]] * {{tl|Graph:Chart}} {{Template:Graph, chart and plot templates}} <includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox | | <!-- Categories below this line, please: --> [[Category:Graph, chart and plot templates]] }}</includeonly>
Summary:
Please make sure your edits are consistent with
MEpedia's guidelines
.
By saving changes, you agree to the
Terms of use
, and you irrevocably agree to release your contribution under the
CC BY-SA 3.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)
Templates used on this page:
Template:Category other
(
edit
)
Template:Dir
(
edit
)
Template:Documentation subpage
(
edit
)
Template:Graph, chart and plot templates
(
edit
)
Template:Legend
(
edit
)
Template:Line chart
(
edit
)
Template:Line chart/Polygon
(
edit
)
Template:Line chart/Scale
(
edit
)
Template:Line chart/X-axis
(
edit
)
Template:Mbox
(
edit
)
Template:Navbox
(
edit
)
Template:Strong
(
edit
)
Template:Terminate sentence
(
edit
)
Template:Tl
(
edit
)
Module:Arguments
(
edit
)
Module:Message box
(
edit
)
Module:Message box/configuration
(
edit
)
Module:Navbar
(
edit
)
Module:Navbox
(
edit
)
Module:No globals
(
edit
)
Module:Text
(
edit
)
Module:Yesno
(
edit
)
Navigation
Navigation
Skip to content
Main page
Browse
Become an editor
Random page
Popular pages
Abbreviations
Glossary
About MEpedia
Links for editors
Contents
Guidelines
Recent changes
Pages in need
Search
Help
Wiki tools
Wiki tools
Special pages
Page tools
Page tools
User page tools
More
What links here
Related changes
Page information
Page logs