Jump to content

User:BaseBot/EAHC/MMXVI/General, per country and per language statistics/Params template

From Meta, a Wikimedia project coordination wiki


<graph>

{
  "version": 2, "width": 600, "height": 400,
  "padding": {"top": 10, "left": 120, "bottom": 50, "right": 10},
  "data": [
    {
      "name": "table",
      "values": 
        [{"param":"Sweden","value":63},{"param":"Denmark","value":61},{"param":"France","value":51},{"param":"Norway","value":42},{"param":"Latvia","value":33},{"param":"Spain","value":32},{"param":"Netherlands","value":32},{"param":"Belgium","value":31},{"param":"Austria","value":31},{"param":"Italy","value":30},{"param":"Luxembourg","value":29},{"param":"England","value":28},{"param":"Germany","value":27},{"param":"Wales","value":26},{"param":"Czech Republic","value":26},{"param":"Greece","value":25},{"param":"Finland","value":23},{"param":"Poland","value":22},{"param":"Bulgaria","value":22},{"param":"Portugal","value":21},{"param":"Lithuania","value":21},{"param":"Estonia","value":20},{"param":"Slovakia","value":20},{"param":"Romania","value":19},{"param":"Hungary","value":17},{"param":"Croatia","value":16},{"param":"Malta","value":16},{"param":"Slovenia","value":12},{"param":"Cyprus","value":10},{"param":"Ireland","value":10}]
    }
  ],
  "scales": [
    {
      "name": "x",
      "range": "width",
      "domain": {"data": "table", "field": "value"}
    },
    {
      "name": "y",
      "range": "height",
      "type": "ordinal",
      "domain": {"data": "table", "field": "param"}
    }
  ],
  "axes": [
    {"type": "x", "scale": "x", "subdivide" : 4, "title": "articles"},
    {"type": "y", "scale": "y", "title" : "country names"}
  ],
  "marks": [
    {
      "type": "rect",
      "name": "bars",
      "from": {"data": "table"},
      "properties": {
        "enter": {
          "y": {"scale": "y", "field": "param"},
          "height": {"scale": "y", "band": true, "offset": -1},
          "x": {"scale": "x", "value": 0},
          "x2": {"scale": "x", "field": "value"}
        },
        "update": {
          "fill": {"value": "darkkhaki"}
        },
        "hover": {
          "fill": {"value": "red"}
        }
      }
    },
    {
    "type": "text",
    "from": {"mark": "bars"},
    "properties": {
        "enter": {
              "x": {"field": "x2", "offset": -5},
              "y": {"field": "y"},
              "dy": {"field": "height", "mult": 0.5},              
              "fill": {"value": "white"},
              "align": {"value": "right"},
              "baseline": {"value": "middle"},
              "text": {"field": "datum.value"}
        }
      }
    }
  ]
}

</graph>