Template:Standardgraph

From LinuxReviews
Jump to navigationJump to search

{

 "version": 2, "width": 400, "height": {{{2}}},
 "padding": {"top": 10, "left": 150, "bottom": 50, "right": 10},
 "data": [
   {
     "name": "table",

{{{1}}}

   }
 ],
 "scales": [
   {
     "name": "x",
     "range": "width",
     "domain": {"data": "table", "field": "v"}
   },
   {
     "name": "y",
     "range": "height",
     "type": "ordinal",
     "domain": {"data": "table", "field": "t"}
   }
 ],
 "axes": [
   { "type": "x", "scale": "x",
     "grid": true,
       "properties": {
           "labels": { 
               "align": {"value": "top"}, "angle": {"value": "60" }
       } 
     },
   },
   {"type": "y", "scale": "y"}
 ],
 "marks": [
   {
     "type": "rect",
     "from": {"data": "table"},
     "properties": {
       "enter": {
         "y": {"scale": "y", "field": "t"},
         "height": {"scale": "y", "band": true, "offset": -1},
         "x": {"scale": "x", "value": 0},
         "x2": {"scale": "x", "field": "v"}
       },
       "update": {
         "fill": {"value": "steelblue"}
       },
       "hover": {
         "fill": {"value": "green"}
       }
     }
   }
 ]

}