Changes
→Migration from familytree
{{Lua|Module:Tree chart}}
{{distinguish|Template:Graph:Chart}}
<noinclude>{{documentation subpage}}</noinclude>
<!--PLEASE ADD METADATA TO THE <includeonly> SECTION AT THE BOTTOM OF THIS PAGE
EDIT TEMPLATE DOCUMENTATION BELOW THIS LINE-->
==Usage==
This template produces one row in a "family tree"-like chart consisting of boxes and connecting lines based loosely on an [[ASCII art]]-like syntax. It is meant to be used in conjunction with {{tl|Tree chart/start}} and {{tl|Tree chart/end}}. The chart is displayed as [[HTML]] tables using [[Cascading Style Sheets|CSS]] attributes, and may contain arbitrary [[wiki markup]] within the boxes. This implementation was based on the now-deprecated {{tl|family tree}} template.
==Basic example==
This code:
<pre><nowiki>
{{Tree chart/start|align=center|summary=An example family tree}}
{{Tree chart| | | |GrMa |~|y|~| GRP | |GrMa=Grandma|GRP=Grandpa}}
{{Tree chart| | | | | | | |)|-|-|-|.| }}
{{Tree chart| | | MOM |y| DAD | |DAISY|MOM=Mom|DAD=Dad|DAISY=[[Aunt Daisy]]}}
{{Tree chart| |,|-|-|-|+|-|-|-|.| | | }}
{{Tree chart| JOE | | ME | | SIS | | |JOE=My brother Joe|ME='''Me!'''|SIS=My little sister}}
{{Tree chart/end}}
</nowiki></pre>
produces this:
{{Tree chart/start|align=center|summary=An example family tree}}
{{Tree chart| | | |GrMa |~|y|~| GRP | |GrMa=Grandma|GRP=Grandpa}}
{{Tree chart| | | | | | | |)|-|-|-|.| }}
{{Tree chart| | | MOM |y| DAD | |DAISY|MOM=Mom|DAD=Dad|DAISY=[[Aunt Daisy]]}}
{{Tree chart| |,|-|-|-|+|-|-|-|.| | | }}
{{Tree chart| JOE | | ME | | SIS | | |JOE=My brother Joe|ME='''Me!'''|SIS=My little sister}}
{{Tree chart/end}}
This chart visually displays the information that I have a brother Joe and a little sister; my mom married my dad;
and my dad's parents were Grandma and Grandpa; and my dad's parents had another child, Aunt Daisy. The code above produces a table of size 9 rows x 10 columns as shown below.
[[File:Chart template table structure.png|center|The table structure created using the example above]]
==Collapsible basic example==
This code uses {{tl|chart top}}:
<pre><nowiki>
{{chart top|An example family tree}}
{{Tree chart/start|align=center}}
{{Tree chart| | | |GrMa |~|y|~| GRP | |GrMa=Grandma|GRP=Grandpa}}
{{Tree chart| | | | | | | |)|-|-|-|.| }}
{{Tree chart| | | MOM |y| DAD | |DAISY|MOM=Mom|DAD=Dad|DAISY=[[Aunt Daisy]]}}
{{Tree chart| |,|-|-|-|+|-|-|-|.| | | }}
{{Tree chart| JOE | | ME | | SIS | | |JOE=My brother Joe|ME='''Me!'''|SIS=My little sister}}
{{Tree chart/end}}
{{chart bottom}}
</nowiki></pre>
produces this:
{{chart top|An example family tree}}
{{Tree chart/start|align=center}}
{{Tree chart| | | |GrMa |~|y|~| GRP | |GrMa=Grandma|GRP=Grandpa}}
{{Tree chart| | | | | | | |)|-|-|-|.| }}
{{Tree chart| | | MOM |y| DAD | |DAISY|MOM=Mom|DAD=Dad|DAISY=[[Aunt Daisy]]}}
{{Tree chart| |,|-|-|-|+|-|-|-|.| | | }}
{{Tree chart| JOE | | ME | | SIS | | |JOE=My brother Joe|ME='''Me!'''|SIS=My little sister}}
{{Tree chart/end}}
{{chart bottom}}
This chart visually displays the information that I have a brother Joe and a little sister; my mom married my dad;
and my dad's parents were Grandma and Grandpa; and my dad's parents had another child, Aunt Daisy.
==Parameters==
The template accepts any number of unnamed parameters with each parameter specifying a '''tile''' or a '''box'''.
* '''Boxes''' can contain arbitrary [[wiki markup]]. The content of each box is specified using additional named parameters appended to the template call. Each box is '''three tiles wide''' and normally has a black border two pixels wide. Boxes can have any name that is a valid template parameter name, subject to a minimum of two alphabetical characters.
* '''Tiles''' are line drawing symbols used to connect the boxes. They consist of various styles of horizontal and vertical lines along with corners and crossings as needed. Tiles are specified using their one- or two-character name: for the most common tiles, that character is more or less approximate to the tile's appearance. A special case of a tile is the '''empty tile''', specified by a single space character. A table of available tiles is given below.
{| style="float: left; margin-left: 1em;"
|+ '''Solid lines:'''
|-
| {{big|<code>!</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|!}}{{Tree chart/end}} ||
| {{big|<code>,</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|,}}{{Tree chart/end}} ||
| {{big|<code>v</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|v}}{{Tree chart/end}} ||
| {{big|<code>.</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|.}}{{Tree chart/end}} ||
|-
| {{big|<code>-</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|-}}{{Tree chart/end}} ||
| {{big|<code>)</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|)}}{{Tree chart/end}} ||
| {{big|<code>+</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|+}}{{Tree chart/end}} ||
| {{big|<code>(</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|(}}{{Tree chart/end}} ||
|-
| || ||
| {{big|<code>`</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|`}}{{Tree chart/end}} ||
| {{big|<code>^</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|^}}{{Tree chart/end}} ||
| {{big|<code>'</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|'}}{{Tree chart/end}} ||
|}
{| style="float: left; margin-left: 1em;"
|+ '''Dashed lines:'''
|-
| {{big|<code>:</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|:}}{{Tree chart/end}} ||
| {{big|<code>F</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|F}}{{Tree chart/end}} ||
| {{big|<code>V</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|V}}{{Tree chart/end}} ||
| {{big|<code>7</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|7}}{{Tree chart/end}} ||
|-
| {{big|<code>~</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|~}}{{Tree chart/end}} ||
| {{big|<code>D</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|D}}{{Tree chart/end}} ||
| {{big|<code>%</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|%}}{{Tree chart/end}} ||
| {{big|<code>C</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|C}}{{Tree chart/end}} ||
|-
| || ||
| {{big|<code>L</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|L}}{{Tree chart/end}} ||
| {{big|<code>A</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|A}}{{Tree chart/end}} ||
| {{big|<code>J</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|J}}{{Tree chart/end}} ||
|}
{| style="float: left; margin-left: 1em;"
|+ '''Dotted lines:'''
|-
| {{big|<code>Q</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|Q}}{{Tree chart/end}} ||
| {{big|<code>S</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|S}}{{Tree chart/end}} ||
| {{big|<code>M</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|M}}{{Tree chart/end}} ||
| {{big|<code>T</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|T}}{{Tree chart/end}} ||
|-
| {{big|<code>P</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|P}}{{Tree chart/end}} ||
| {{big|<code>H</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|H}}{{Tree chart/end}} ||
| {{big|<code>R</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|R}}{{Tree chart/end}} ||
| {{big|<code>G</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|G}}{{Tree chart/end}} ||
|-
| || ||
| {{big|<code>Y</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|Y}}{{Tree chart/end}} ||
| {{big|<code>W</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|W}}{{Tree chart/end}} ||
| {{big|<code>Z</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|Z}}{{Tree chart/end}} ||
|}
{| style="float: left; margin-left: 1em;"
|+'''Dashes hrzntl solid vrtcl:'''
| {{big|<code>fy</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|fy}}{{Tree chart/end}}
| {{big|<code>y</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|y}}{{Tree chart/end}}
| {{big|<code>ye</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|ye}}{{Tree chart/end}}
|-
| {{big|<code>f</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|f}}{{Tree chart/end}}
| {{big|<code>t</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|t}}{{Tree chart/end}}
| {{big|<code>e</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|e}}{{Tree chart/end}}
|-
| {{big|<code>fh</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|fh}}{{Tree chart/end}}
| {{big|<code>h</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|h}}{{Tree chart/end}}
| {{big|<code>he</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|he}}{{Tree chart/end}}
|}
{| style="float: left; margin-left: 1em;"
|+ '''Solid hrzntl dashes vrtcl:'''
| {{big|<code>dj</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|dj}}{{Tree chart/end}}
| {{big|<code>j</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|j}}{{Tree chart/end}}
| {{big|<code>jc</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|jc}}{{Tree chart/end}}
|-
| {{big|<code>d</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|d}}{{Tree chart/end}}
| {{big|<code>*</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|*}}{{Tree chart/end}}
| {{big|<code>c</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|c}}{{Tree chart/end}}
|-
| {{big|<code>di</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|di}}{{Tree chart/end}}
| {{big|<code>i</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|i}}{{Tree chart/end}}
| {{big|<code>ic</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|ic}}{{Tree chart/end}}
|}
{| style="float: left; margin-left: 1em;"
|+'''Solid hrzntl dot vrtcl:'''
| {{big|<code>kr</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|kr}}{{Tree chart/end}}
| {{big|<code>r</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|r}}{{Tree chart/end}}
| {{big|<code>rl</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|rl}}{{Tree chart/end}}
|-
| {{big|<code>k</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|k}}{{Tree chart/end}}
| {{big|<code>a</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|a}}{{Tree chart/end}}
| {{big|<code>l</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|l}}{{Tree chart/end}}
|-
| {{big|<code>kq</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|kq}}{{Tree chart/end}}
| {{big|<code>q</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|q}}{{Tree chart/end}}
| {{big|<code>ql</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|ql}}{{Tree chart/end}}
|}
{| style="float: left; margin-left: 1em;"
|+ '''Dashed hrzntl dot vrtcl:'''
| {{big|<code>kr2</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|kr2}}{{Tree chart/end}}
| {{big|<code>r2</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|r2}}{{Tree chart/end}}
| {{big|<code>rl2</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|rl2}}{{Tree chart/end}}
|-
| {{big|<code>k2</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|k2}}{{Tree chart/end}}
| {{big|<code>a2</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|a2}}{{Tree chart/end}}
| {{big|<code>l2</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|l2}}{{Tree chart/end}}
|-
|{{big|<code>kq2</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|kq2}}{{Tree chart/end}}
| {{big|<code>q2</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|q2}}{{Tree chart/end}}
| {{big|<code>ql2</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|ql2}}{{Tree chart/end}}
|}
{| style="float: left; margin-left: 1em;"
|+ '''Dots hrzntl solid vrtcl:'''
| {{big|<code>om</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|om}}{{Tree chart/end}}
| {{big|<code>m</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|m}}{{Tree chart/end}}
| {{big|<code>mp</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|mp}}{{Tree chart/end}}
|-
| {{big|<code>o</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|o}}{{Tree chart/end}}
| {{big|<code>b</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|b}}{{Tree chart/end}}
| {{big|<code>p</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|p}}{{Tree chart/end}}
|-
| {{big|<code>on</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|on}}{{Tree chart/end}}
| {{big|<code>n</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|n}}{{Tree chart/end}}
| {{big|<code>np</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|np}}{{Tree chart/end}}
|}
{| style="float: left; margin-left: 1em;"
|+ '''Dots hrzntl dashes vrtcl:'''
| {{big|<code>om2</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|om2}}{{Tree chart/end}}
| {{big|<code>m2</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|m2}}{{Tree chart/end}}
| {{big|<code>mp2</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|mp2}}{{Tree chart/end}}
|-
| {{big|<code>o2</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|o2}}{{Tree chart/end}}
| {{big|<code>b2</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|b2}}{{Tree chart/end}}
| {{big|<code>p2</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|p2}}{{Tree chart/end}}
|-
| {{big|<code>on2</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|on2}}{{Tree chart/end}}
| {{big|<code>n2</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|n2}}{{Tree chart/end}}
| {{big|<code>np2</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|np2}}{{Tree chart/end}}
|}
{{clear}}
{|
|+ '''Miscellaneous:'''<!-- This subset is an insufficient set or questionable, but maps onto tiles that exist in {{familytree}}: -->
|-
| ||
| {{big|<code>T2</code>}} ||style="border:1px solid gray"| {{Tree chart/start}}{{Tree chart|T2}}{{Tree chart/end}}
|-
| {{big|<code>G2</code>}} ||style="border:1px solid gray"| {{Tree chart/start}}{{Tree chart|G2}}{{Tree chart/end}}
| {{big|<code>X</code>}} ||style="border:1px solid gray"| {{Tree chart/start}}{{Tree chart|X}}{{Tree chart/end}}
| {{big|<code>K</code>}} ||style="border:1px solid gray"| {{Tree chart/start}}{{Tree chart|K}}{{Tree chart/end}}
| {{big|<code>l4</code>}} ||style="border:1px solid gray"| {{Tree chart/start}}{{Tree chart|l4}}{{Tree chart/end}}
|-
| ||
| {{big|<code>U</code>}} ||style="border:1px solid gray"| {{Tree chart/start}}{{Tree chart|U}}{{Tree chart/end}}
|}
==Style attributes==
The appearance of the boxes in a row may be controlled by the following optional template parameters:
* ''border'' specifies the width of the box border in pixels,
* ''boxstyle'' can be used to append arbitrary [[Cascading Style Sheets|CSS]] declarations directly to the box style attributes. For example, the following code:
<pre><nowiki>
{{Tree chart/start}}
{{Tree chart|border=1|boxstyle=color:white; background:green; | | FOO |y| BAR | |FOO=Box 1|BAR=Box 2}}
{{Tree chart| | |,|-|^|-|.| | }}
{{Tree chart|border=3|boxstyle=background:yellow; | | FOO | | BAR | |FOO=Box 3|BAR=Box 4}}
{{Tree chart/end}}
</nowiki></pre>
produces this chart:
{{Tree chart/start}}
{{Tree chart|border=1|boxstyle=color:white; background:green; | | FOO |y| BAR | |FOO=Box 1|BAR=Box 2}}
{{Tree chart| | |,|-|^|-|.| | }}
{{Tree chart|border=3|boxstyle=background:yellow; | | FOO | | BAR | |FOO=Box 3|BAR=Box 4}}
{{Tree chart/end}}
Style attributes can even be set for individual boxes within each row, as in the example below:
<pre><nowiki>
{{Tree chart/start}}
{{Tree chart| | | | |CLEAR| | | | |CLEAR=Clear box}}
{{Tree chart| |,|-|-|'|!|`|-|-|.| }}
{{Tree chart|RED |~|GREEN|~|BLUE |RED=Red box|GREEN=Green box|BLUE=Blue box
|boxstyle_RED =color:white; background-color: red;
|boxstyle_GREEN=color:yellow; background-color: green;
|boxstyle_BLUE =color:white; background-color: blue;
}}
{{Tree chart/end}}
</nowiki></pre>
which produces this:
{{Tree chart/start}}
{{Tree chart| | | | |CLEAR| | | | |CLEAR=Clear box}}
{{Tree chart| |,|-|-|'|!|`|-|-|.| }}
{{Tree chart|RED |~|GREEN|~|BLUE |RED=Red box|GREEN=Green box|BLUE=Blue box
|boxstyle_RED =color:white; background-color: red;
|boxstyle_GREEN=color:yellow; background-color: green;
|boxstyle_BLUE =color:white; background-color: blue;
}}
{{Tree chart/end}}
{{Warnsign|'''Note:'''}} When specifying style attributes for individual named boxes, make sure the box names are aligned to the '''left''' side of the area reserved for them in the template call (as in "<code>|RED |</code>" instead of "<code>| RED |</code>" in the example above), otherwise the template will end up looking for a style parameter with spaces in its name.
The {{tl|Tree chart/start}} template also accepts an optional {{para|style}} parameter that can be used to set CSS styles for the entire diagram, and an optional {{para|align}} parameter to set the chart alignment.
==Migration from familytree==
The {{tl|tree chart}} template is largely compatible with the earlier {{tl|family tree}} template. However, to use the additional functionality offered with this template, diagrams must be updated to use {{tl|tree chart}} instead. Many {{tl|family tree}} diagrams can be altered to use {{tl|tree chart}} simply by replacing the wikitext <code>familytree</code> with <code>tree chart</code>. A few of the "mixed" tiles had to be renamed, and {{tl|family tree}} diagrams using these tiles will have to make a few changes. Additionally, three "miscellaneous" tiles have been included in this list that have not changed <code>K,U,X.</code>
{| class="wikitable" style="text-align:center; float: left; margin-left: 1em;"
|+Mixed tiles that have changed
!Tile!!{{tl|family tree}}!!{{tl|chart}}||Notes on parameters
|-
|{{Tree chart/start}}{{Tree chart|c}}{{Tree chart/end}}||<code>{</code>||<code>c</code>||Change
|-
|{{Tree chart/start}}{{Tree chart|d}}{{Tree chart/end}}||<code>}</code>||<code>d</code>||Change
|-
|{{Tree chart/start}}{{Tree chart|t}}{{Tree chart/end}}||<code>#</code>||<code>t</code>||Change
|-
|{{Tree chart/start}}{{Tree chart|e}}{{Tree chart/end}}||<code>[</code>||<code>e</code>||Change
|-
|{{Tree chart/start}}{{Tree chart|f}}{{Tree chart/end}}||<code>]</code>||<code>f</code>||Change
|-
|{{Tree chart/start}}{{Tree chart|di}}{{Tree chart/end}}||<code>b</code>||<code>di</code>||Change
|-
|{{Tree chart/start}}{{Tree chart|fh}}{{Tree chart/end}}||<code>c</code>||<code>fh</code>||Change
|-
|{{Tree chart/start}}{{Tree chart|ic}}{{Tree chart/end}}||<code>d</code>||<code>ic</code>||Change
|-
|{{Tree chart/start}}{{Tree chart|he}}{{Tree chart/end}}||<code>j</code>||<code>he</code>||Change
|-
|{{Tree chart/start}}{{Tree chart|ye}}{{Tree chart/end}}||<code>n</code>||<code>ye</code>||Change
|-
|{{Tree chart/start}}{{Tree chart|om2}}{{Tree chart/end}}||<code>p</code>||<code>om2</code>||Change
|-
|{{Tree chart/start}}{{Tree chart|mp2}}{{Tree chart/end}}||<code>q</code>||<code>mp2</code>||Change
|-
|{{Tree chart/start}}{{Tree chart|kr2}}{{Tree chart/end}}||<code>r</code>||<code>kr2</code>||Change
|}
{| class="wikitable" style="text-align:center; float: left; margin-left: 1em;"
|+Miscellaneous tiles
!Tile!!{{tl|family tree}}!!{{tl|tree chart}}||Notes on parameters
|-
|{{Tree chart/start}}{{Tree chart|G2}}{{Tree chart/end}}||<code>G</code>||<code>G2</code>||Change
|-
||{{Tree chart/start}}{{Tree chart|K}}{{Tree chart/end}}||<code>K</code>||<code>K</code>||Same
|-
|{{Tree chart/start}}{{Tree chart|T2}}{{Tree chart/end}}||<code>T</code>||<code>T2</code>||Change
|-
||{{Tree chart/start}}{{Tree chart|U}}{{Tree chart/end}}||<code>U</code>||<code>U</code>||Same
|-
||{{Tree chart/start}}{{Tree chart|X}}{{Tree chart/end}}||<code>X</code>||<code>X</code>||Same
|-
|{{Tree chart/start}}{{Tree chart|l4}}{{Tree chart/end}}||<code>k</code>||<code>l4</code>||Change
|}
{{clear}}
When converting from {{tl|familytree}} to {{tl|tree chart}} care must be taken with all the glyph mentioned in this section to generate tiles with {{tl|familytree}} are altered so that the tiles are not silently replaced with inappropriate tiles from {{tl|tree chart}}.
{|
|-
|For example: the glyph "[[k]]" generates the tile
|style="border:1px solid gray"|{{familytree/start}}{{familytree|k}}{{familytree/end}}
| with {{tl|Familytree}}
|but
|style="border:1px solid gray"|{{Tree chart/start}}{{Tree chart|k}}{{Tree chart/end}}
| with {{tl|tree chart}}
|(instead use "l4" to generate
|style="border:1px solid gray"|{{Tree chart/start}}{{Tree chart|l4}}{{Tree chart/end}}
|with {{tl|tree chart}}).
|}
Lastly, if any uses of the {{tl|family tree}} template end with <code>|}}</code>, that vertical bar should be removed, leaving the last cell in that row containing either some text or a space.
The familytree.js tool below can be used to convert between syntaxes. Just change the start tag when in edit view, then click "Art → Templates" to toggle back to wikitext view. The other templates will be updated to match.
== See also ==
* [[Wikipedia:Family trees]] for other methods.
* [[User:GregU/familytree.js|familytree.js]], a tool for the easy creation or updating of diagrams using these templates.
* [[:Category:Family tree templates]]
* [[Template:Nerva–Antonine family tree]], a large example.
* [[Template:Tree list]]
* [[Template:Ahnentafel]]
{{Template:Graph, chart and plot templates}}
<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox |
| {{When on user page | |
<!-- Categories below this line, please:-->
[[Category:Chart formatting templates| ]]
[[Category:Graph, chart and plot templates]]
[[Category:Genealogy formatting templates]]
}} }}</includeonly>
{{distinguish|Template:Graph:Chart}}
<noinclude>{{documentation subpage}}</noinclude>
<!--PLEASE ADD METADATA TO THE <includeonly> SECTION AT THE BOTTOM OF THIS PAGE
EDIT TEMPLATE DOCUMENTATION BELOW THIS LINE-->
==Usage==
This template produces one row in a "family tree"-like chart consisting of boxes and connecting lines based loosely on an [[ASCII art]]-like syntax. It is meant to be used in conjunction with {{tl|Tree chart/start}} and {{tl|Tree chart/end}}. The chart is displayed as [[HTML]] tables using [[Cascading Style Sheets|CSS]] attributes, and may contain arbitrary [[wiki markup]] within the boxes. This implementation was based on the now-deprecated {{tl|family tree}} template.
==Basic example==
This code:
<pre><nowiki>
{{Tree chart/start|align=center|summary=An example family tree}}
{{Tree chart| | | |GrMa |~|y|~| GRP | |GrMa=Grandma|GRP=Grandpa}}
{{Tree chart| | | | | | | |)|-|-|-|.| }}
{{Tree chart| | | MOM |y| DAD | |DAISY|MOM=Mom|DAD=Dad|DAISY=[[Aunt Daisy]]}}
{{Tree chart| |,|-|-|-|+|-|-|-|.| | | }}
{{Tree chart| JOE | | ME | | SIS | | |JOE=My brother Joe|ME='''Me!'''|SIS=My little sister}}
{{Tree chart/end}}
</nowiki></pre>
produces this:
{{Tree chart/start|align=center|summary=An example family tree}}
{{Tree chart| | | |GrMa |~|y|~| GRP | |GrMa=Grandma|GRP=Grandpa}}
{{Tree chart| | | | | | | |)|-|-|-|.| }}
{{Tree chart| | | MOM |y| DAD | |DAISY|MOM=Mom|DAD=Dad|DAISY=[[Aunt Daisy]]}}
{{Tree chart| |,|-|-|-|+|-|-|-|.| | | }}
{{Tree chart| JOE | | ME | | SIS | | |JOE=My brother Joe|ME='''Me!'''|SIS=My little sister}}
{{Tree chart/end}}
This chart visually displays the information that I have a brother Joe and a little sister; my mom married my dad;
and my dad's parents were Grandma and Grandpa; and my dad's parents had another child, Aunt Daisy. The code above produces a table of size 9 rows x 10 columns as shown below.
[[File:Chart template table structure.png|center|The table structure created using the example above]]
==Collapsible basic example==
This code uses {{tl|chart top}}:
<pre><nowiki>
{{chart top|An example family tree}}
{{Tree chart/start|align=center}}
{{Tree chart| | | |GrMa |~|y|~| GRP | |GrMa=Grandma|GRP=Grandpa}}
{{Tree chart| | | | | | | |)|-|-|-|.| }}
{{Tree chart| | | MOM |y| DAD | |DAISY|MOM=Mom|DAD=Dad|DAISY=[[Aunt Daisy]]}}
{{Tree chart| |,|-|-|-|+|-|-|-|.| | | }}
{{Tree chart| JOE | | ME | | SIS | | |JOE=My brother Joe|ME='''Me!'''|SIS=My little sister}}
{{Tree chart/end}}
{{chart bottom}}
</nowiki></pre>
produces this:
{{chart top|An example family tree}}
{{Tree chart/start|align=center}}
{{Tree chart| | | |GrMa |~|y|~| GRP | |GrMa=Grandma|GRP=Grandpa}}
{{Tree chart| | | | | | | |)|-|-|-|.| }}
{{Tree chart| | | MOM |y| DAD | |DAISY|MOM=Mom|DAD=Dad|DAISY=[[Aunt Daisy]]}}
{{Tree chart| |,|-|-|-|+|-|-|-|.| | | }}
{{Tree chart| JOE | | ME | | SIS | | |JOE=My brother Joe|ME='''Me!'''|SIS=My little sister}}
{{Tree chart/end}}
{{chart bottom}}
This chart visually displays the information that I have a brother Joe and a little sister; my mom married my dad;
and my dad's parents were Grandma and Grandpa; and my dad's parents had another child, Aunt Daisy.
==Parameters==
The template accepts any number of unnamed parameters with each parameter specifying a '''tile''' or a '''box'''.
* '''Boxes''' can contain arbitrary [[wiki markup]]. The content of each box is specified using additional named parameters appended to the template call. Each box is '''three tiles wide''' and normally has a black border two pixels wide. Boxes can have any name that is a valid template parameter name, subject to a minimum of two alphabetical characters.
* '''Tiles''' are line drawing symbols used to connect the boxes. They consist of various styles of horizontal and vertical lines along with corners and crossings as needed. Tiles are specified using their one- or two-character name: for the most common tiles, that character is more or less approximate to the tile's appearance. A special case of a tile is the '''empty tile''', specified by a single space character. A table of available tiles is given below.
{| style="float: left; margin-left: 1em;"
|+ '''Solid lines:'''
|-
| {{big|<code>!</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|!}}{{Tree chart/end}} ||
| {{big|<code>,</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|,}}{{Tree chart/end}} ||
| {{big|<code>v</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|v}}{{Tree chart/end}} ||
| {{big|<code>.</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|.}}{{Tree chart/end}} ||
|-
| {{big|<code>-</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|-}}{{Tree chart/end}} ||
| {{big|<code>)</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|)}}{{Tree chart/end}} ||
| {{big|<code>+</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|+}}{{Tree chart/end}} ||
| {{big|<code>(</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|(}}{{Tree chart/end}} ||
|-
| || ||
| {{big|<code>`</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|`}}{{Tree chart/end}} ||
| {{big|<code>^</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|^}}{{Tree chart/end}} ||
| {{big|<code>'</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|'}}{{Tree chart/end}} ||
|}
{| style="float: left; margin-left: 1em;"
|+ '''Dashed lines:'''
|-
| {{big|<code>:</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|:}}{{Tree chart/end}} ||
| {{big|<code>F</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|F}}{{Tree chart/end}} ||
| {{big|<code>V</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|V}}{{Tree chart/end}} ||
| {{big|<code>7</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|7}}{{Tree chart/end}} ||
|-
| {{big|<code>~</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|~}}{{Tree chart/end}} ||
| {{big|<code>D</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|D}}{{Tree chart/end}} ||
| {{big|<code>%</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|%}}{{Tree chart/end}} ||
| {{big|<code>C</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|C}}{{Tree chart/end}} ||
|-
| || ||
| {{big|<code>L</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|L}}{{Tree chart/end}} ||
| {{big|<code>A</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|A}}{{Tree chart/end}} ||
| {{big|<code>J</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|J}}{{Tree chart/end}} ||
|}
{| style="float: left; margin-left: 1em;"
|+ '''Dotted lines:'''
|-
| {{big|<code>Q</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|Q}}{{Tree chart/end}} ||
| {{big|<code>S</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|S}}{{Tree chart/end}} ||
| {{big|<code>M</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|M}}{{Tree chart/end}} ||
| {{big|<code>T</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|T}}{{Tree chart/end}} ||
|-
| {{big|<code>P</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|P}}{{Tree chart/end}} ||
| {{big|<code>H</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|H}}{{Tree chart/end}} ||
| {{big|<code>R</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|R}}{{Tree chart/end}} ||
| {{big|<code>G</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|G}}{{Tree chart/end}} ||
|-
| || ||
| {{big|<code>Y</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|Y}}{{Tree chart/end}} ||
| {{big|<code>W</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|W}}{{Tree chart/end}} ||
| {{big|<code>Z</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|Z}}{{Tree chart/end}} ||
|}
{| style="float: left; margin-left: 1em;"
|+'''Dashes hrzntl solid vrtcl:'''
| {{big|<code>fy</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|fy}}{{Tree chart/end}}
| {{big|<code>y</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|y}}{{Tree chart/end}}
| {{big|<code>ye</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|ye}}{{Tree chart/end}}
|-
| {{big|<code>f</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|f}}{{Tree chart/end}}
| {{big|<code>t</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|t}}{{Tree chart/end}}
| {{big|<code>e</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|e}}{{Tree chart/end}}
|-
| {{big|<code>fh</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|fh}}{{Tree chart/end}}
| {{big|<code>h</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|h}}{{Tree chart/end}}
| {{big|<code>he</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|he}}{{Tree chart/end}}
|}
{| style="float: left; margin-left: 1em;"
|+ '''Solid hrzntl dashes vrtcl:'''
| {{big|<code>dj</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|dj}}{{Tree chart/end}}
| {{big|<code>j</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|j}}{{Tree chart/end}}
| {{big|<code>jc</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|jc}}{{Tree chart/end}}
|-
| {{big|<code>d</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|d}}{{Tree chart/end}}
| {{big|<code>*</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|*}}{{Tree chart/end}}
| {{big|<code>c</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|c}}{{Tree chart/end}}
|-
| {{big|<code>di</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|di}}{{Tree chart/end}}
| {{big|<code>i</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|i}}{{Tree chart/end}}
| {{big|<code>ic</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|ic}}{{Tree chart/end}}
|}
{| style="float: left; margin-left: 1em;"
|+'''Solid hrzntl dot vrtcl:'''
| {{big|<code>kr</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|kr}}{{Tree chart/end}}
| {{big|<code>r</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|r}}{{Tree chart/end}}
| {{big|<code>rl</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|rl}}{{Tree chart/end}}
|-
| {{big|<code>k</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|k}}{{Tree chart/end}}
| {{big|<code>a</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|a}}{{Tree chart/end}}
| {{big|<code>l</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|l}}{{Tree chart/end}}
|-
| {{big|<code>kq</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|kq}}{{Tree chart/end}}
| {{big|<code>q</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|q}}{{Tree chart/end}}
| {{big|<code>ql</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|ql}}{{Tree chart/end}}
|}
{| style="float: left; margin-left: 1em;"
|+ '''Dashed hrzntl dot vrtcl:'''
| {{big|<code>kr2</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|kr2}}{{Tree chart/end}}
| {{big|<code>r2</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|r2}}{{Tree chart/end}}
| {{big|<code>rl2</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|rl2}}{{Tree chart/end}}
|-
| {{big|<code>k2</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|k2}}{{Tree chart/end}}
| {{big|<code>a2</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|a2}}{{Tree chart/end}}
| {{big|<code>l2</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|l2}}{{Tree chart/end}}
|-
|{{big|<code>kq2</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|kq2}}{{Tree chart/end}}
| {{big|<code>q2</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|q2}}{{Tree chart/end}}
| {{big|<code>ql2</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|ql2}}{{Tree chart/end}}
|}
{| style="float: left; margin-left: 1em;"
|+ '''Dots hrzntl solid vrtcl:'''
| {{big|<code>om</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|om}}{{Tree chart/end}}
| {{big|<code>m</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|m}}{{Tree chart/end}}
| {{big|<code>mp</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|mp}}{{Tree chart/end}}
|-
| {{big|<code>o</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|o}}{{Tree chart/end}}
| {{big|<code>b</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|b}}{{Tree chart/end}}
| {{big|<code>p</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|p}}{{Tree chart/end}}
|-
| {{big|<code>on</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|on}}{{Tree chart/end}}
| {{big|<code>n</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|n}}{{Tree chart/end}}
| {{big|<code>np</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|np}}{{Tree chart/end}}
|}
{| style="float: left; margin-left: 1em;"
|+ '''Dots hrzntl dashes vrtcl:'''
| {{big|<code>om2</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|om2}}{{Tree chart/end}}
| {{big|<code>m2</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|m2}}{{Tree chart/end}}
| {{big|<code>mp2</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|mp2}}{{Tree chart/end}}
|-
| {{big|<code>o2</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|o2}}{{Tree chart/end}}
| {{big|<code>b2</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|b2}}{{Tree chart/end}}
| {{big|<code>p2</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|p2}}{{Tree chart/end}}
|-
| {{big|<code>on2</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|on2}}{{Tree chart/end}}
| {{big|<code>n2</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|n2}}{{Tree chart/end}}
| {{big|<code>np2</code>}} || style="border: 1px solid gray;" | {{Tree chart/start}}{{Tree chart|np2}}{{Tree chart/end}}
|}
{{clear}}
{|
|+ '''Miscellaneous:'''<!-- This subset is an insufficient set or questionable, but maps onto tiles that exist in {{familytree}}: -->
|-
| ||
| {{big|<code>T2</code>}} ||style="border:1px solid gray"| {{Tree chart/start}}{{Tree chart|T2}}{{Tree chart/end}}
|-
| {{big|<code>G2</code>}} ||style="border:1px solid gray"| {{Tree chart/start}}{{Tree chart|G2}}{{Tree chart/end}}
| {{big|<code>X</code>}} ||style="border:1px solid gray"| {{Tree chart/start}}{{Tree chart|X}}{{Tree chart/end}}
| {{big|<code>K</code>}} ||style="border:1px solid gray"| {{Tree chart/start}}{{Tree chart|K}}{{Tree chart/end}}
| {{big|<code>l4</code>}} ||style="border:1px solid gray"| {{Tree chart/start}}{{Tree chart|l4}}{{Tree chart/end}}
|-
| ||
| {{big|<code>U</code>}} ||style="border:1px solid gray"| {{Tree chart/start}}{{Tree chart|U}}{{Tree chart/end}}
|}
==Style attributes==
The appearance of the boxes in a row may be controlled by the following optional template parameters:
* ''border'' specifies the width of the box border in pixels,
* ''boxstyle'' can be used to append arbitrary [[Cascading Style Sheets|CSS]] declarations directly to the box style attributes. For example, the following code:
<pre><nowiki>
{{Tree chart/start}}
{{Tree chart|border=1|boxstyle=color:white; background:green; | | FOO |y| BAR | |FOO=Box 1|BAR=Box 2}}
{{Tree chart| | |,|-|^|-|.| | }}
{{Tree chart|border=3|boxstyle=background:yellow; | | FOO | | BAR | |FOO=Box 3|BAR=Box 4}}
{{Tree chart/end}}
</nowiki></pre>
produces this chart:
{{Tree chart/start}}
{{Tree chart|border=1|boxstyle=color:white; background:green; | | FOO |y| BAR | |FOO=Box 1|BAR=Box 2}}
{{Tree chart| | |,|-|^|-|.| | }}
{{Tree chart|border=3|boxstyle=background:yellow; | | FOO | | BAR | |FOO=Box 3|BAR=Box 4}}
{{Tree chart/end}}
Style attributes can even be set for individual boxes within each row, as in the example below:
<pre><nowiki>
{{Tree chart/start}}
{{Tree chart| | | | |CLEAR| | | | |CLEAR=Clear box}}
{{Tree chart| |,|-|-|'|!|`|-|-|.| }}
{{Tree chart|RED |~|GREEN|~|BLUE |RED=Red box|GREEN=Green box|BLUE=Blue box
|boxstyle_RED =color:white; background-color: red;
|boxstyle_GREEN=color:yellow; background-color: green;
|boxstyle_BLUE =color:white; background-color: blue;
}}
{{Tree chart/end}}
</nowiki></pre>
which produces this:
{{Tree chart/start}}
{{Tree chart| | | | |CLEAR| | | | |CLEAR=Clear box}}
{{Tree chart| |,|-|-|'|!|`|-|-|.| }}
{{Tree chart|RED |~|GREEN|~|BLUE |RED=Red box|GREEN=Green box|BLUE=Blue box
|boxstyle_RED =color:white; background-color: red;
|boxstyle_GREEN=color:yellow; background-color: green;
|boxstyle_BLUE =color:white; background-color: blue;
}}
{{Tree chart/end}}
{{Warnsign|'''Note:'''}} When specifying style attributes for individual named boxes, make sure the box names are aligned to the '''left''' side of the area reserved for them in the template call (as in "<code>|RED |</code>" instead of "<code>| RED |</code>" in the example above), otherwise the template will end up looking for a style parameter with spaces in its name.
The {{tl|Tree chart/start}} template also accepts an optional {{para|style}} parameter that can be used to set CSS styles for the entire diagram, and an optional {{para|align}} parameter to set the chart alignment.
==Migration from familytree==
The {{tl|tree chart}} template is largely compatible with the earlier {{tl|family tree}} template. However, to use the additional functionality offered with this template, diagrams must be updated to use {{tl|tree chart}} instead. Many {{tl|family tree}} diagrams can be altered to use {{tl|tree chart}} simply by replacing the wikitext <code>familytree</code> with <code>tree chart</code>. A few of the "mixed" tiles had to be renamed, and {{tl|family tree}} diagrams using these tiles will have to make a few changes. Additionally, three "miscellaneous" tiles have been included in this list that have not changed <code>K,U,X.</code>
{| class="wikitable" style="text-align:center; float: left; margin-left: 1em;"
|+Mixed tiles that have changed
!Tile!!{{tl|family tree}}!!{{tl|chart}}||Notes on parameters
|-
|{{Tree chart/start}}{{Tree chart|c}}{{Tree chart/end}}||<code>{</code>||<code>c</code>||Change
|-
|{{Tree chart/start}}{{Tree chart|d}}{{Tree chart/end}}||<code>}</code>||<code>d</code>||Change
|-
|{{Tree chart/start}}{{Tree chart|t}}{{Tree chart/end}}||<code>#</code>||<code>t</code>||Change
|-
|{{Tree chart/start}}{{Tree chart|e}}{{Tree chart/end}}||<code>[</code>||<code>e</code>||Change
|-
|{{Tree chart/start}}{{Tree chart|f}}{{Tree chart/end}}||<code>]</code>||<code>f</code>||Change
|-
|{{Tree chart/start}}{{Tree chart|di}}{{Tree chart/end}}||<code>b</code>||<code>di</code>||Change
|-
|{{Tree chart/start}}{{Tree chart|fh}}{{Tree chart/end}}||<code>c</code>||<code>fh</code>||Change
|-
|{{Tree chart/start}}{{Tree chart|ic}}{{Tree chart/end}}||<code>d</code>||<code>ic</code>||Change
|-
|{{Tree chart/start}}{{Tree chart|he}}{{Tree chart/end}}||<code>j</code>||<code>he</code>||Change
|-
|{{Tree chart/start}}{{Tree chart|ye}}{{Tree chart/end}}||<code>n</code>||<code>ye</code>||Change
|-
|{{Tree chart/start}}{{Tree chart|om2}}{{Tree chart/end}}||<code>p</code>||<code>om2</code>||Change
|-
|{{Tree chart/start}}{{Tree chart|mp2}}{{Tree chart/end}}||<code>q</code>||<code>mp2</code>||Change
|-
|{{Tree chart/start}}{{Tree chart|kr2}}{{Tree chart/end}}||<code>r</code>||<code>kr2</code>||Change
|}
{| class="wikitable" style="text-align:center; float: left; margin-left: 1em;"
|+Miscellaneous tiles
!Tile!!{{tl|family tree}}!!{{tl|tree chart}}||Notes on parameters
|-
|{{Tree chart/start}}{{Tree chart|G2}}{{Tree chart/end}}||<code>G</code>||<code>G2</code>||Change
|-
||{{Tree chart/start}}{{Tree chart|K}}{{Tree chart/end}}||<code>K</code>||<code>K</code>||Same
|-
|{{Tree chart/start}}{{Tree chart|T2}}{{Tree chart/end}}||<code>T</code>||<code>T2</code>||Change
|-
||{{Tree chart/start}}{{Tree chart|U}}{{Tree chart/end}}||<code>U</code>||<code>U</code>||Same
|-
||{{Tree chart/start}}{{Tree chart|X}}{{Tree chart/end}}||<code>X</code>||<code>X</code>||Same
|-
|{{Tree chart/start}}{{Tree chart|l4}}{{Tree chart/end}}||<code>k</code>||<code>l4</code>||Change
|}
{{clear}}
When converting from {{tl|familytree}} to {{tl|tree chart}} care must be taken with all the glyph mentioned in this section to generate tiles with {{tl|familytree}} are altered so that the tiles are not silently replaced with inappropriate tiles from {{tl|tree chart}}.
{|
|-
|For example: the glyph "[[k]]" generates the tile
|style="border:1px solid gray"|{{familytree/start}}{{familytree|k}}{{familytree/end}}
| with {{tl|Familytree}}
|but
|style="border:1px solid gray"|{{Tree chart/start}}{{Tree chart|k}}{{Tree chart/end}}
| with {{tl|tree chart}}
|(instead use "l4" to generate
|style="border:1px solid gray"|{{Tree chart/start}}{{Tree chart|l4}}{{Tree chart/end}}
|with {{tl|tree chart}}).
|}
Lastly, if any uses of the {{tl|family tree}} template end with <code>|}}</code>, that vertical bar should be removed, leaving the last cell in that row containing either some text or a space.
The familytree.js tool below can be used to convert between syntaxes. Just change the start tag when in edit view, then click "Art → Templates" to toggle back to wikitext view. The other templates will be updated to match.
== See also ==
* [[Wikipedia:Family trees]] for other methods.
* [[User:GregU/familytree.js|familytree.js]], a tool for the easy creation or updating of diagrams using these templates.
* [[:Category:Family tree templates]]
* [[Template:Nerva–Antonine family tree]], a large example.
* [[Template:Tree list]]
* [[Template:Ahnentafel]]
{{Template:Graph, chart and plot templates}}
<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox |
| {{When on user page | |
<!-- Categories below this line, please:-->
[[Category:Chart formatting templates| ]]
[[Category:Graph, chart and plot templates]]
[[Category:Genealogy formatting templates]]
}} }}</includeonly>