• Home
  • Random
  • Recent changes
  • Special pages
  • Settings
  • About MOASSpedia
  • Disclaimers
MOASSpedia
  • 216.73.216.215
  • Talk
  • Watchlist
  • Contributions
  • Log in

Template:Articles by Importance Pie Graph

Template Discussion
  • Language
  • Watch
  • History
  • Edit
    • Page information
    • Permanent link
    • What links here


File:Test Template Info-Icon - Version (2).svg Template documentation[view] [edit] [history] [purge]
Shortcut
  • {{AbI Pie}}

Contents

  • 1 Usage
  • 2 Parameters
  • 3 Examples
    • 3.1 Basic
    • 3.2 Full Legend
    • 3.3 Different Colours
  • 4 Acknowledgement
  • 5 See also

Usage

This template will display a pie chart of your importance assessment data, that belong to a particular WikiProject. The syntax is as follows:

{{Articles by Importance Pie Graph
 |topic=
 |full=
 |Core=
 |Top=
 |High=
 |Mid=
 |Low=
 |bottom=
 |No=
 |NA=
 |Unknown=
}}

Parameters

  • |topic= (required) - set so that the quality categories are: "Foo-Class topic articles".
  • |full= (optional) - if set to yes it will show full legend. By default, only the categories with articles show in the legend.
  • |Core=, |Top=, |High=, |Mid=, |Low=, |Bottom=, |No=, |NA=, or |Unknown= (optional) - if set to a standard or HTML5 web color it will change the appropriate importance rating. By default, they are set to the standard importance rating colors.

Examples

Basic

{{Articles by Importance Pie Graph|topic=Cheeses}}

will result in:

<graph> {

 "version": 2,
 "axes": [],
 "data": [
   {
     "name": "table",
     "values": [
 









     ]
   }
 ],
 "height": 250,
 "legends": [
   {
     "fill": "color",
     "offset": 20,
     "properties": {},
     "title": "Article Importance"
   }
 ],
 "marks": [
   {
     "type": "arc",
     "from": {
       "data": "table",
       "transform": [{"type": "pie","field": "val"}]
     },
     "properties": {
       "enter": {
         "x": {"field": {"group": "width"},"mult": 0.5},
         "y": {"field": {"group": "height"},"mult": 0.5},
         "startAngle": {"field": "layout_start"},
         "endAngle": {"field": "layout_end"},
         "fill": {"field": "idx","scale": "color"},
         "innerRadius": {"value": 0},
         "outerRadius": {"value": 125},
         "stroke": {"value": "white"}
       }
     }
   }
 ],
 "padding": "auto",
 "scales": [
   {
     "domain": {"data": "table", "field": "idx"},
     "name": "color",
     "type": "ordinal",
     "range": [
                       
                       
                       
                       
                       
                       
                       
                       
                       
                   ]
   }
 ],
 "width": 300

} </graph>


Full Legend

By using the |full= with yes, you can show the entire legend - even if there are no articles in the categories.

{{Articles by Importance Pie Graph|topic=Cheeses|full=yes}}

will result in:

<graph> {

 "version": 2,
 "axes": [],
 "data": [
   {
     "name": "table",
     "values": [

{ "col": "data", "idx": "Core-importance: 0", "val": 0 },

{ "col": "data", "idx": "Top-importance: 0", "val": 0 },

{ "col": "data", "idx": "High-importance: 0", "val": 0 },

{ "col": "data", "idx": "Mid-importance: 0", "val": 0 },

{ "col": "data", "idx": "Low-importance: 0", "val": 0 },

{ "col": "data", "idx": "Bottom-importance: 0", "val": 0 },

{ "col": "data", "idx": "No-importance: 0", "val": 0 },

{ "col": "data", "idx": "NA-importance: 0", "val": 0 },

{ "col": "data", "idx": "Unknown-importance: 0", "val": 0 },

     ]
   }
 ],
 "height": 250,
 "legends": [
   {
     "fill": "color",
     "offset": 20,
     "properties": {},
     "title": "Article Importance"
   }
 ],
 "marks": [
   {
     "type": "arc",
     "from": {
       "data": "table",
       "transform": [{"type": "pie","field": "val"}]
     },
     "properties": {
       "enter": {
         "x": {"field": {"group": "width"},"mult": 0.5},
         "y": {"field": {"group": "height"},"mult": 0.5},
         "startAngle": {"field": "layout_start"},
         "endAngle": {"field": "layout_end"},
         "fill": {"field": "idx","scale": "color"},
         "innerRadius": {"value": 0},
         "outerRadius": {"value": 125},
         "stroke": {"value": "white"}
       }
     }
   }
 ],
 "padding": "auto",
 "scales": [
   {
     "domain": {"data": "table", "field": "idx"},
     "name": "color",
     "type": "ordinal",
     "range": [
                       "#ff00ff",
                       "#ff00ff",
                       "#ff88ff",
                       "#ffbbff",
                       "#ffddff",
                       "#ffeeff",
                       "#ffffff",
                       "#f5f5f5",
                       "#D3D3D3",
                   ]
   }
 ],
 "width": 300

} </graph>


Different Colours

By using the |Core=, |Top=, |High=, |Mid=, |Low=, |Bottom=, |No=, or |NA= with a web color, you can change the chart color.

{{Articles by Importance Pie Graph|topic=Cheeses|Top=black|High=#FFC0CB|Mid=#c5405b}}

will result in:

<graph> {

 "version": 2,
 "axes": [],
 "data": [
   {
     "name": "table",
     "values": [
 









     ]
   }
 ],
 "height": 250,
 "legends": [
   {
     "fill": "color",
     "offset": 20,
     "properties": {},
     "title": "Article Importance"
   }
 ],
 "marks": [
   {
     "type": "arc",
     "from": {
       "data": "table",
       "transform": [{"type": "pie","field": "val"}]
     },
     "properties": {
       "enter": {
         "x": {"field": {"group": "width"},"mult": 0.5},
         "y": {"field": {"group": "height"},"mult": 0.5},
         "startAngle": {"field": "layout_start"},
         "endAngle": {"field": "layout_end"},
         "fill": {"field": "idx","scale": "color"},
         "innerRadius": {"value": 0},
         "outerRadius": {"value": 125},
         "stroke": {"value": "white"}
       }
     }
   }
 ],
 "padding": "auto",
 "scales": [
   {
     "domain": {"data": "table", "field": "idx"},
     "name": "color",
     "type": "ordinal",
     "range": [
                       
                       
                       
                       
                       
                       
                       
                       
                       
                   ]
   }
 ],
 "width": 300

} </graph>


Acknowledgement

This template came from an idea first created by User:Kopiersperre on Version 1.0 Editorial Team's statistics page and was copied from {{Articles by Quality Pie Graph}}.

See also

Standard class types
Featured article FA  Featured list FL  Featured media FM  A-Class article A 
{{class|FA}} {{class|FL}} {{class|FM}} {{class|A}}
Good article GA  B-Class article B  C-Class article C  Start-Class article Start 
{{class|GA}} {{class|B}} {{class|C}} {{class|Start}}
Stub-Class article Stub  List-Class article List  Non-article page NA  Unrated ??? 
{{class|Stub}} {{class|List}} {{class|NA}} {{class|Unassessed}}
Non-standard class types
Current-Class article Current  Future-Class article Future  SIA-Class article SIA  Unrated Deferred 
{{class|Current}} {{class|Future}} {{class|SIA}} {{class|Deferred}}
A-Class list AL  B-Class list BL  C-Class list CL  Start-Class list SL 
{{class|AL}} {{class|BL}} {{class|CL}} {{class|SL}}
Category page Category  Disambiguation page Disambig  Draft page Draft  Media file page File 
{{class|Category}} {{class|Disambig}} {{class|Draft}} {{class|File}}
Unrated Merge  Unrated Needed  Portal page Portal  Project page Project 
{{class|Merge}} {{class|Needed}} {{class|Portal}} {{class|Project}}
Redirect page Redirect  Template page Template  Unrated User 
{{class|Redirect}} {{class|Template}} {{class|User}}
Importance types
 Top   High   Mid   Low 
{{importance|Top}} {{importance|High}} {{importance|Mid}} {{importance|Low}}
 Bottom   NA   ??? 
{{importance|Bottom}} {{importance|NA}} {{importance|Unknown}}
Class
  • {{Article classification}}
  • {{Grading scheme}}
  • {{Assessment Class Summary}}
  • {{Category class}}
  • {{Articles by Quality}}
  • {{Class}}
  • {{Class/colour}}
  • {{Class/icon}}
Importance
  • {{Article importance}}
  • {{Importance scheme}}
  • {{Assessment Importance Summary}}
  • {{Category importance}}
  • {{Articles by Importance}}
  • {{Importance}}
  • {{Importance/colour}}
  • {{Importance/icon}}
Hybrid
  • {{Articles by Quality and Importance}}
  • {{Article by Quality and Importance}}
Others
  • {{Articles by Quality Pie Graph}}
  • {{Articles by Importance Pie Graph}}
  • {{Progression rainbow}}
  • {{WikiProject assessment progression}}
Tool to add multiple templates to quality assessment pages
  • {{WPBannerMeta/templatepage/qualheader|project =|topic =}}
This box:
  • view
  • talk
  • edit
The above documentation is transcluded from Template:Articles by Importance Pie Graph/doc. (edit | history)
Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages.
Add categories to the /doc subpage. Subpages of this template.
Retrieved from "https://moasspedia.org/w/index.php?title=Template:Articles_by_Importance_Pie_Graph&oldid=5338"
Categories:
  • Pages with broken file links
  • Classification templates
Last edited on 27 June 2021, at 11:47

MOASSpedia

Content is available under Creative Commons Attribution-ShareAlike unless otherwise noted.
  • This page was last edited on 27 June 2021, at 11:47.
  • Content is available under Creative Commons Attribution-ShareAlike unless otherwise noted.
  • Privacy policy
  • About MOASSpedia
  • Disclaimers
  • Desktop