Jump to content

Template:Annual readership/doc

From Meta, a Wikimedia project coordination wiki

This template reports the daily page views for an article over a period of time (default: the last year), placing them in a suitable frame with a heading. It is typically placed on an article's talk page.

Usage

[edit]

Basic syntax (annual data):
{{Annual readership}}

Template syntax with optional parameters:
{{Annual readership | days= | expanded= | target= | color= | scale=}}

Optional parameters

[edit]
  • |days= (default: 365) can be used to change the number of pageview days depicted in the graph.
  • |expanded= can be used to override the default auto-collapsing of the message box. To prevent the graph from being collapsed on page load, use |expanded=true.
  • |target= (default: {{SUBJECTPAGENAME}}) can be used to simultaneously specify the page in the graph title and the page for which page traffic is displayed.
  • |color= (default: #00f) can be used to change the graph color; accepted inputs include HTML color names (e.g., red) and hex codes
  • |scale= (default: linear) can be used to change the scale of the y axis; accepted inputs: linear, log, pow, sqrt, quantile, quantize, and threshold
  • This template contains additional parameters for modifying the height and width of the graph; in order to avoid {{tmbox}} rendering issues, consult the talk page for assistance with modifying these values when transcluding this template.


If further variations are desired, use {{Graph:PageViews}} instead.

Note about the graph title

[edit]

If |target= is not specified, the graph title varies depending on the namespace of the page where this template is used.

  • Title if placed on an article talk page:
    Daily article pageviews
  • Title if placed on a page in any other talk namespace (e.g., "User talk:", "Template talk:", "Wikipedia talk:", etc.):
    Daily pageviews of {{SUBJECTPAGENAME}}
  • Title if placed on any subject page (i.e., pages in namespaces like "User:", "Template:", "Wikipedia:", etc.):
    Daily pageviews of this page


If |target= is specified, the graph title is set as "Daily pageviews of target page", with the target page linked.

  • E.g., inputting |target=XYZ would set the graph title as:
    Daily pageviews of XYZ

Examples

[edit]
Template defaults (collapsed)

{{Annual readership}} produces:

Template defaults (uncollapsed)

{{Annual readership|expanded=true}} produces:

Template with a specified target page, logarithmic scale, and green coloring (collapsed)

{{Annual readership|days=150|target=Pancake|scale=log|color=green}} produces:

For comparison, here's the same template as above except with a linear scale:


Template with a specified target page, linear scale, and red coloring (uncollapsed)

{{Annual readership|days=30|expanded=true|target=Rubber duck|scale=linear|color=red}} produces: