Template:STV election graph

From English Wikipedia @ Freddythechick

<graph> {

  "legends":[
     {
        "properties":{
           "title":{
              "fill":{
                 "value":"#54595d"
              }
           },
           "labels":{
              "fill":{
                 "value":"#54595d"
              }
           }
        },
        "stroke":"color",
        "title":"Party",
        "fill":"color"
     }
  ],
  "scales":[
     {
        "type":"ordinal",
        "name":"x",
        "zero":false,
        "domain":{
           "data":"chart",
           "field":"x"
        },
        "range":"width",
        "nice":true
     },
     {
        "type":"linear",
        "name":"y",
        "domain":{
           "data":"stats",
           "field":"sum_y"
        },
        "zero":true,
        "range":"height",
        "nice":true
     },
     {
        "domain":{
           "data":"chart",
           "field":"series"
        },
        "type":"ordinal",
        "name":"color",
        "range":[
           ""
        ]
     }
  ],
  "version":2,
  "marks":[
     {
        "type":"group",
        "marks":[
           {
              "properties":{
                 "hover":{
                    "fill":{
                       "value":"#54595d"
                    }
                 },
                 "update":{
                    "fill":{
                       "scale":"color",
                       "field":"series"
                    }
                 },
                 "enter":{
                    "y":{
                       "scale":"y",
                       "field":"layout_start"
                    },
                    "x":{
                       "scale":"x",
                       "field":"x"
                    },
                    "y2":{
                       "scale":"y",
                       "field":"layout_end"
                    },
                    "width":{
                       "scale":"x",
                       "offset":-1,
                       "band":true
                    },
                    "fill":{
                       "scale":"color",
                       "field":"series"
                    }
                 }
              },
              "type":"rect"
           }
        ],
        "from":{
           "data":"chart",
           "transform":[
              {
                 "field":"y",
                 "type":"stack",
                 "sortby":[
                    "-_id"
                 ],
                 "groupby":[
                    "x"
                 ]
              },
              {
                 "groupby":[
                    "series"
                 ],
                 "type":"facet"
              }
           ]
        }
     }
  ],
  "height":300,
  "axes":[
     {
        "type":"x",
        "title":"Count",
        "scale":"x",
        "properties":{
           "title":{
              "fill":{
                 "value":"#54595d"
              }
           },
           "grid":{
              "stroke":{
                 "value":"#54595d"
              }
           },
           "ticks":{
              "stroke":{
                 "value":"#54595d"
              }
           },
           "axis":{
              "strokeWidth":{
                 "value":2
              },
              "stroke":{
                 "value":"#54595d"
              }
           },
           "labels":{
              "fill":{
                 "value":"#54595d"
              }
           }
        },
        "grid":false
     },
     {
        "type":"y",
        "title":"Votes",
        "scale":"y",
        "format":"d",
        "properties":{
           "title":{
              "fill":{
                 "value":"#54595d"
              }
           },
           "grid":{
              "stroke":{
                 "value":"#54595d"
              }
           },
           "ticks":{
              "stroke":{
                 "value":"#54595d"
              }
           },
           "axis":{
              "strokeWidth":{
                 "value":2
              },
              "stroke":{
                 "value":"#54595d"
              }
           },
           "labels":{
              "fill":{
                 "value":"#54595d"
              }
           }
        },
        "grid":false
     }
  ],
  "data":[
     {
        "format":{
           "parse":{
              "y":"integer",
              "x":"string"
           },
           "type":"json"
        },
        "name":"chart",
        "values":[
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
        ]
     },
     {
        "transform":[
           {
              "type":"aggregate",
              "summarize":{
                 "y":"sum"
              },
              "groupby":[
                 "x"
              ]
           }
        ],
        "name":"stats",
        "source":"chart"
     }
  ],
  "width":300

} </graph>