Talk:Mean minimum political distance

From electowiki

Tried to make a graph of the example but it's out of order. I don't know why:

<graph>{"legends":[],"scales":[{"type":"ordinal","name":"x","zero":false,"domain":{"data":"chart","field":"x"},"padding":0.2,"range":"width","nice":true},{"type":"linear","name":"y","domain":{"data":"chart","field":"y"},"zero":true,"range":"height","nice":true},{"domain":{"data":"chart","field":"series"},"type":"ordinal","name":"color","range":"category10"}],"version":2,"marks":[{"type":"rect","properties":{"hover":{"fill":{"value":"red"}},"update":{"fill":{"scale":"color","field":"series"}},"enter":{"y":{"scale":"y","field":"y"},"x":{"scale":"x","field":"x"},"y2":{"scale":"y","value":0},"width":{"scale":"x","offset":-1,"band":true},"fill":{"scale":"color","field":"series"}}},"from":{"data":"chart"}},{"type":"text","properties":{"enter":{"baseline":{"value":"middle"},"align":{"value":"right"},"text":{"template":"{{datum.y|number:'.0%'}}"},"y":{"scale":"y","offset":4,"field":"y"},"dy":{"scale":"x","mult":0.5,"band":true},"x":{"scale":"x","field":"x"},"angle":{"value":-90},"fontSize":{"value":11},"fill":{"value":"white"}}},"from":{"data":"chart"}}],"height":100,"axes":[{"scale":"x","type":"x","title":""},{"scale":"y","type":"y","title":"","format":"%"}],"data":[{"format":{"parse":{"y":"number","x":"number"},"type":"json"},"name":"chart","values":[{"y":0.15,"series":"y","x":0},{"y":0.2,"series":"y","x":0.25},{"y":0.3,"series":"y","x":0.5},{"y":0.2,"series":"y","x":0.75},{"y":0.15,"series":"y","x":1}]}],"width":400}</graph>

Psephomancy (talk) 01:28, 2 September 2018 (UTC)

xType=string works:

<graph>{"legends":[],"scales":[{"type":"ordinal","name":"x","zero":false,"domain":{"data":"chart","field":"x"},"padding":0.2,"range":"width","nice":true},{"type":"linear","name":"y","domain":{"data":"chart","field":"y"},"zero":true,"range":"height","nice":true},{"domain":{"data":"chart","field":"series"},"type":"ordinal","name":"color","range":"category10"}],"version":2,"marks":[{"type":"rect","properties":{"hover":{"fill":{"value":"red"}},"update":{"fill":{"scale":"color","field":"series"}},"enter":{"y":{"scale":"y","field":"y"},"x":{"scale":"x","field":"x"},"y2":{"scale":"y","value":0},"width":{"scale":"x","offset":-1,"band":true},"fill":{"scale":"color","field":"series"}}},"from":{"data":"chart"}},{"type":"text","properties":{"enter":{"baseline":{"value":"middle"},"align":{"value":"right"},"text":{"template":"{{datum.y|number:'.0%'}}"},"y":{"scale":"y","offset":4,"field":"y"},"dy":{"scale":"x","mult":0.5,"band":true},"x":{"scale":"x","field":"x"},"angle":{"value":-90},"fontSize":{"value":11},"fill":{"value":"white"}}},"from":{"data":"chart"}}],"height":100,"axes":[{"scale":"x","type":"x","title":""},{"scale":"y","type":"y","title":"","format":"%"}],"data":[{"format":{"parse":{"y":"number","x":"string"},"type":"json"},"name":"chart","values":[{"y":0.15,"series":"y","x":"0.0"},{"y":0.2,"series":"y","x":"0.25"},{"y":0.3,"series":"y","x":"0.5"},{"y":0.2,"series":"y","x":"0.75"},{"y":0.15,"series":"y","x":"1.0"}]}],"width":400}</graph>