|
|
| (6 révisions intermédiaires par le même utilisateur non affichées) |
| Ligne 4 : |
Ligne 4 : |
| | { | | { |
| | "version": 2, | | "version": 2, |
| − | "width": 1000, | + | "width": 800, |
| | "height": 200, | | "height": 200, |
| | "padding": {"top": 10, "left": 65, "bottom": 20, "right": 10}, | | "padding": {"top": 10, "left": 65, "bottom": 20, "right": 10}, |
| Ligne 12 : |
Ligne 12 : |
| | "name": "table", | | "name": "table", |
| | "values": [ | | "values": [ |
| − | {"date": "2014-07", "amount": 722 }, | + | {"date": "14-07", "amount": 722 }, |
| − | {"date": "2014-08", "amount": 6330 }, | + | {"date": "14-08", "amount": 6330 }, |
| − | {"date": "2014-09", "amount": 6418 }, | + | {"date": "14-09", "amount": 6418 }, |
| − | {"date": "2014-10", "amount": 4719 }, | + | {"date": "14-10", "amount": 4719 }, |
| − | {"date": "2014-11", "amount": 9035 }, | + | {"date": "14-11", "amount": 9035 }, |
| − | {"date": "2014-12", "amount": 7638 }, | + | {"date": "14-12", "amount": 7638 }, |
| − | {"date": "2015-01", "amount": 6721 }, | + | {"date": "15-01", "amount": 6721 }, |
| − | {"date": "2015-02", "amount": 6157 }, | + | {"date": "15-02", "amount": 6157 }, |
| − | {"date": "2015-03", "amount": 4074 }, | + | {"date": "15-03", "amount": 4074 }, |
| − | {"date": "2015-04", "amount": 5025 }, | + | {"date": "15-04", "amount": 5025 }, |
| − | {"date": "2015-05", "amount": 5603 }, | + | {"date": "15-05", "amount": 5603 }, |
| − | {"date": "2015-06", "amount": 3395 }, | + | {"date": "15-06", "amount": 3395 }, |
| − | {"date": "2015-07", "amount": 6191 }, | + | {"date": "15-07", "amount": 6191 }, |
| − | {"date": "2015-08", "amount": 4299 }, | + | {"date": "15-08", "amount": 4299 }, |
| − | {"date": "2015-09", "amount": 2793 }, | + | {"date": "15-09", "amount": 2793 }, |
| − | {"date": "2015-10", "amount": 3025 }, | + | {"date": "15-10", "amount": 3025 }, |
| − | {"date": "2015-11", "amount": 4299 }, | + | {"date": "15-11", "amount": 4299 }, |
| − | {"date": "2015-12", "amount": 3748 }, | + | {"date": "15-12", "amount": 3748 }, |
| − | {"date": "2016-01", "amount": 3363 },
| |
| − | {"date": "2016-02", "amount": 6853 },
| |
| − | {"date": "2016-03", "amount": 9197 },
| |
| − | {"date": "2016-04", "amount": 4934 },
| |
| − | {"date": "2016-05", "amount": 3687 },
| |
| − | {"date": "2016-06", "amount": 4950 },
| |
| − | {"date": "2016-07", "amount": 4254 },
| |
| − | {"date": "2016-08", "amount": 5046 },
| |
| − | {"date": "2016-09", "amount": 5896 },
| |
| − | {"date": "2016-10", "amount": 3220 },
| |
| − | {"date": "2016-11", "amount": 3552 },
| |
| − | {"date": "2016-12", "amount": 5629 },
| |
| − | {"date": "2017-01", "amount": 5099 },
| |
| − | {"date": "2017-02", "amount": 5494 },
| |
| − | {"date": "2017-03", "amount": 6280 },
| |
| − | {"date": "2017-04", "amount": 5519 },
| |
| − | {"date": "2017-05", "amount": 4304 },
| |
| − | {"date": "2017-06", "amount": 2620 },
| |
| − | {"date": "2017-07", "amount": 2884 },
| |
| − | {"date": "2017-08", "amount": 3537 },
| |
| − | {"date": "2017-09", "amount": 3627 },
| |
| − | {"date": "2017-10", "amount": 5206 },
| |
| − | {"date": "2017-11", "amount": 6184 },
| |
| − | {"date": "2017-12", "amount": 6839 },
| |
| − | {"date": "2018-01", "amount": 4828 },
| |
| − | {"date": "2018-02", "amount": 4131 },
| |
| − | {"date": "2018-03", "amount": 4311 },
| |
| − | {"date": "2018-04", "amount": 4365 },
| |
| − | {"date": "2018-05", "amount": 4879 },
| |
| − | {"date": "2018-06", "amount": 5214 },
| |
| − | {"date": "2018-07", "amount": 2840 },
| |
| − | | |
| | ] | | ] |
| | } | | } |
| Ligne 138 : |
Ligne 106 : |
| | } | | } |
| | | mode=interactive }} | | | mode=interactive }} |
| − |
| |
| − | <graph>
| |
| − | {
| |
| − | //
| |
| − | // ATTENTION: This code is maintained at https://www.mediawiki.org/wiki/Template:Graph:PageViews
| |
| − | // 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:PageViews
| |
| − | // The graph uses PageViews API https://wikitech.wikimedia.org/wiki/Analytics/PageviewAPI
| |
| − | //
| |
| − |
| |
| − | "version": 2,
| |
| − | "width": 400,
| |
| − | "height": 200,
| |
| − |
| |
| − | // The data for this graph comes from the PageView API. The request is made for N days back up to now.
| |
| − | "data": [
| |
| − | {
| |
| − | "name": "pageviews",
| |
| − | "url": "wikirest://wikimedia.org/api/rest_v1/metrics/pageviews/per-article/fr.wikipedia.org/all-access/user/Mod%C3%A8le%3AGraph%3APageViews/daily/2018121600/2019011500",
| |
| − | "format": {
| |
| − | "type": "json",
| |
| − | "property": "items"
| |
| − | },
| |
| − |
| |
| − | // The response is parsed here, converting date strings of form "20160223" into date 2016-02-23
| |
| − | "transform": [
| |
| − | { "type": "formula", "field": "year", "expr": "parseInt(substring(datum.timestamp,0,4))" },
| |
| − | { "type": "formula", "field": "month", "expr": "parseInt(substring(datum.timestamp,4,6))" },
| |
| − | { "type": "formula", "field": "day", "expr": "parseInt(substring(datum.timestamp,6,8))" },
| |
| − | { "type": "formula", "field": "date", "expr": "datetime(datum.year,datum.month-1,datum.day)" }
| |
| − | ]
| |
| − | }
| |
| − | ],
| |
| − |
| |
| − | "scales": [
| |
| − | // The dates are scaled to the "x" axis - the width of the graph
| |
| − | {
| |
| − | "name": "x",
| |
| − | "type": "time",
| |
| − | "range": "width",
| |
| − | "domain": {"data": "pageviews","field": "date"}
| |
| − | },
| |
| − | // The pageviews are scaled to the "y" axis - the height of the graph
| |
| − | // Optional scale parameter can change "linear" to other scales like log
| |
| − | // Optional max parameter can fix the upper bound of the graph
| |
| − | {
| |
| − | "name": "y",
| |
| − | "type": "linear",
| |
| − | "range": "height",
| |
| − | "domain": {"data": "pageviews","field": "views"},
| |
| − | "clamp": true,
| |
| − |
| |
| − | "nice": true
| |
| − | }
| |
| − | ],
| |
| − |
| |
| − | // Simple axis with horizontal grid lines
| |
| − | "axes": [
| |
| − | {"type": "x", "scale": "x", "ticks": 5},
| |
| − | {"type": "y", "scale": "y", "ticks": 5, "grid": true}
| |
| − | ],
| |
| − |
| |
| − | // The graph is drawn with two elements a thick line at the top, and a semi-transparent area below
| |
| − | "marks": [
| |
| − | {
| |
| − | "type": "line",
| |
| − | "from": {"data": "pageviews"},
| |
| − | "properties": {
| |
| − | "enter": {
| |
| − | "x": {"scale": "x","field": "date"},
| |
| − | "y": {"scale": "y","field": "views"},
| |
| − | "stroke": {"value": "#00f"},
| |
| − | "strokeWidth": {"value": 3},
| |
| − | "interpolate": {"value": "monotone"}
| |
| − | }
| |
| − | }
| |
| − | },
| |
| − | {
| |
| − | "type": "area",
| |
| − | "from": {"data": "pageviews"},
| |
| − | "properties": {
| |
| − | "enter": {
| |
| − | "x": {"scale": "x","field": "date"},
| |
| − | "y": {"scale": "y","value": 0},
| |
| − | "y2": {"scale": "y","field": "views"},
| |
| − | "fill": {"value": "#00f"},
| |
| − | "fillOpacity": {"value": 0.35},
| |
| − | "interpolate": {"value": "monotone"}
| |
| − | }
| |
| − | }
| |
| − | }
| |
| − | ]
| |
| − | }
| |
| − | </graph>
| |