வார்ப்புரு:Graph:Lines
&lt;includeonly&gt;{{safesubst:#tag:templatestyles||src=&quot;Graph:Chart/styles.css&quot;}}{{#tag:graph|
 {
   //
   // ATTENTION: This code is maintained at https://www.mediawiki.org/wiki/Template:Graph:Lines
   //            Please do not modify it anywhere else, as it may get copied and override your changes.
   //            Suggestions can be made at https://www.mediawiki.org/wiki/Template_talk:Graph:Lines
   //
   // Template translation is in https://commons.wikimedia.org/wiki/Data:Original/Template:Graphs.tab
   //
 
   &quot;version&quot;: 2,
   &quot;width&quot;: {{{width|400}}},
   &quot;height&quot;: {{{height|300}}},
   &quot;padding&quot;: &quot;strict&quot;,
 
   &quot;signals&quot;: [{&quot;name&quot;: &quot;rightwidth&quot;, &quot;expr&quot;: &quot;width + padding.right&quot;}],
   &quot;data&quot;: [{
     &quot;name&quot;: &quot;chart&quot;,
 
 {{#switch: {{{tabletype|tab}}}
 |tab=    &quot;url&quot;: &quot;tabular:///{{{table}}}&quot;,
 |query=  &quot;url&quot;: &quot;wikidatasparql:///?query={{urlencode:{{{table}}}|PATH}}&quot;,
 }}
     &quot;format&quot;: {&quot;type&quot;: &quot;json&quot;
 {{#ifeq:{{{tabletype|tab}}}|tab|
       , &quot;property&quot;: &quot;data&quot;
 }}
 {{#ifeq:{{{type|}}}|time|
       , &quot;parse&quot;: {&quot;{{{xField}}}&quot;: &quot;date&quot;}
 }}
     },
     &quot;transform&quot;: [
       // Convert xField parameter into a field &quot;_xfield&quot;
       {&quot;type&quot;: &quot;formula&quot;, &quot;field&quot;: &quot;_xfield&quot;, &quot;expr&quot;:
 {{#switch: {{{type|year}}}
 | year= &quot;datetime(datum.{{{xField|}}}, 0, 1)&quot;
 | &quot;datum.{{{xField}}}&quot;
 }}
       }
       , {&quot;type&quot;: &quot;sort&quot;, &quot;by&quot;: [&quot;_xfield&quot;]}
 {{#if:{{{series|}}}
 |     , {&quot;type&quot;: &quot;fold&quot;, &quot;fields&quot;: [{{{series}}}]}
 }}
 {{#if:{{{replaceZerosWith|}}}
 |   , {&quot;type&quot;: &quot;formula&quot;, &quot;field&quot;: &quot;_yfield&quot;, &quot;expr&quot;: &quot;max(datum.{{#if:{{{series|}}}|value|{{{value|value}}}}}, {{{replaceZerosWith}}})&quot; }
 |   , {&quot;type&quot;: &quot;formula&quot;, &quot;field&quot;: &quot;_yfield&quot;, &quot;expr&quot;: &quot;datum.{{#if:{{{series|}}}|value|{{{value|value}}}}}&quot; }
 }}
 {{#ifeq:{{{yScale|}}}|log
 |   , {&quot;type&quot;: &quot;filter&quot;, &quot;test&quot;: &quot;datum._yfield != 0&quot;}
 }}
     ]
   },
 {{#if:{{{series|}}}|{{#ifeq: {{{tabletype|tab}}} | tab |
   {
     &quot;name&quot;: &quot;labels&quot;,
     &quot;url&quot;: &quot;tabular:///{{{table}}}&quot;,
     &quot;format&quot;: {&quot;type&quot;: &quot;json&quot;, &quot;property&quot;: &quot;fields&quot;}
   }
 }}}}
   ],
   &quot;scales&quot;: [
     {
       &quot;name&quot;: &quot;x&quot;,
       &quot;type&quot;: {{#switch: {{{type|year}}}
 | year= &quot;time&quot;
 | &quot;{{{type}}}&quot;
 }},
       &quot;domain&quot;: {&quot;data&quot;: &quot;chart&quot;, &quot;field&quot;: &quot;_xfield&quot;},
       &quot;range&quot;: &quot;width&quot;,
 {{#if:{{{xZero|}}}|&quot;zero&quot;: {{{xZero}}},}}
 {{#if:{{{xMin|}}}|&quot;domainMin&quot;: {{{xMin}}},}}
 {{#if:{{{xMax|}}}|&quot;domainMax&quot;: {{{xMax}}},}}
     },
     {
       &quot;name&quot;: &quot;y&quot;,
       &quot;type&quot;: &quot;{{{yScale|linear}}}&quot;,
       &quot;range&quot;: &quot;height&quot;,
       &quot;domain&quot;: {&quot;data&quot;: &quot;chart&quot;, &quot;field&quot;: &quot;_yfield&quot;},
 {{#if:{{{yZero|}}}|&quot;zero&quot;: {{{yZero}}},}}
 {{#if:{{{yMin|}}}|&quot;domainMin&quot;: {{{yMin}}},}}
 {{#if:{{{yMax|}}}|&quot;domainMax&quot;: {{{yMax}}},}}
     },
     {
       &quot;name&quot;: &quot;color&quot;,
       &quot;type&quot;: &quot;ordinal&quot;,
       &quot;domain&quot;: {&quot;data&quot;: &quot;chart&quot;, &quot;field&quot;: &quot;{{{group|key}}}&quot;},
       &quot;range&quot;: &quot;category10&quot;
     },
 {{#if:{{{series|}}}|
     {
       &quot;name&quot;: &quot;labels&quot;,
       &quot;type&quot;: &quot;ordinal&quot;,
 {{#ifeq: {{{tabletype|tab}}} | tab
 |     &quot;domain&quot;: {&quot;data&quot;: &quot;labels&quot;, &quot;field&quot;: &quot;name&quot;},
       &quot;range&quot;: {&quot;data&quot;: &quot;labels&quot;, &quot;field&quot;: &quot;title&quot;},
 |     &quot;domain&quot;: [{{{series|}}}],
       &quot;range&quot;: [{{{series|}}}],
 }}
     }
 }}
   ],
 {{#if:{{{legend|}}}|
   &quot;legends&quot;: [{
     &quot;fill&quot;: &quot;color&quot;,
     &quot;stroke&quot;: &quot;color&quot;,
 {{#ifeq: {{{legend|}}}|-|| &quot;title&quot;: &quot;{{{legend|}}}&quot;, }}
 {{#if:{{{series|}}}
 |   &quot;properties&quot;: { &quot;labels&quot;: { &quot;text&quot;: {&quot;scale&quot;: &quot;labels&quot;, &quot;field&quot;: &quot;data&quot;} } }
 }}
   }],
 }}
   &quot;axes&quot;: [
     {&quot;scale&quot;: &quot;x&quot;, &quot;type&quot;: &quot;x&quot;, &quot;tickSizeEnd&quot;: 0
 {{#ifeq:{{{xTicks|7}}}|-||, &quot;ticks&quot;: {{{xTicks|7}}}}}
 {{#if:{{{xAxis|}}}|, &quot;title&quot;: &quot;{{{xAxis}}}&quot;}}
 {{#if:{{{xGrid|}}}|, &quot;grid&quot;: true}}
 },
     {&quot;scale&quot;: &quot;y&quot;, &quot;type&quot;: &quot;y&quot;, &quot;tickSizeEnd&quot;: 0
 {{#ifeq:{{{yTicks|-}}}|-||, &quot;ticks&quot;: {{{yTicks}}}}}
 {{#if:{{{yAxis|}}}|, &quot;title&quot;: &quot;{{{yAxis}}}&quot;}}
 {{#if:{{{yGrid|}}}|, &quot;grid&quot;: true}}
 }
   ],
 
   &quot;marks&quot;: [
     // Group data by the group parameter or &quot;key&quot;, and draw lines, one line per group
     {
       &quot;type&quot;: &quot;group&quot;,
       &quot;from&quot;: {
         &quot;data&quot;: &quot;chart&quot;,
         &quot;transform&quot;: [{&quot;type&quot;: &quot;facet&quot;, &quot;groupby&quot;: [&quot;{{{group|key}}}&quot;]}]
       },
       &quot;marks&quot;: [
         {
           &quot;type&quot;: &quot;line&quot;,
           &quot;properties&quot;: {
             &quot;enter&quot;: {
               &quot;y&quot;: {&quot;scale&quot;: &quot;y&quot;, &quot;field&quot;: &quot;_yfield&quot;},
               &quot;x&quot;: {&quot;scale&quot;: &quot;x&quot;, &quot;field&quot;: &quot;_xfield&quot;},
               &quot;stroke&quot;: {&quot;scale&quot;: &quot;color&quot;, &quot;field&quot;: &quot;{{{group|key}}}&quot;},
               &quot;interpolate&quot;: {&quot;value&quot;: &quot;monotone&quot;},
               &quot;strokeWidth&quot;: {&quot;value&quot;: 2.5}
             }
           }
         }
       ],
     }
 
 {{#if:{{{title|}}}|
     // Draw title at the top of the graph
 ,   {
       &quot;type&quot;: &quot;text&quot;,
       &quot;properties&quot;: {
         &quot;enter&quot;: {
           &quot;x&quot;: {&quot;signal&quot;: &quot;rightwidth&quot;, &quot;mult&quot;: 0.5},
           &quot;y&quot;: {&quot;value&quot;: -15},
           &quot;text&quot;: {&quot;value&quot;: &quot;{{{title}}}&quot;},
           &quot;fontWeight&quot;: {&quot;value&quot;: &quot;bold&quot;},
           &quot;align&quot;: {&quot;value&quot;: &quot;center&quot;},
           &quot;baseline&quot;: {&quot;value&quot;: &quot;bottom&quot;},
           &quot;fill&quot;: {&quot;value&quot;: &quot;#000&quot;}
         }
       }
     }
 }}
   ]
 }
 }}
 &lt;small&gt;{{#switch: {{{tabletype|tab}}}
 |tab= {{#invoke:TNT|msg|I18n/Template:Graphs.tab|source_table|{{#invoke:TNT|link|{{{table}}}}}}}.
 |query= {{#invoke:TNT|msg|I18n/Template:Graphs.tab|source_wdqs|https://query.wikidata.org/embed.html#{{urlencode:{{{table}}}|PATH}}}}.
 }}&lt;/small&gt;