Format: Ro: Diferență între versiuni

De la alegeri.md
Salt la: navigare, căutare
Linia 5.052: Linia 5.052:
 
         }
 
         }
 
       ]
 
       ]
 +
    }
 +
  ]
 +
}</graph>
 +
 +
 +
<graph>
 +
{
 +
  "width": 500,
 +
  "height": 200,
 +
  "padding": {"top": 10, "left": 30, "bottom": 30, "right": 10},
 +
  "data": [
 +
    {
 +
      "name": "table",
 +
      "values": [
 +
        {"x": 0, "y": 28, "c":0}, {"x": 0, "y": 55, "c":1},
 +
        {"x": 1, "y": 43, "c":0}, {"x": 1, "y": 91, "c":1},
 +
        {"x": 2, "y": 81, "c":0}, {"x": 2, "y": 53, "c":1},
 +
        {"x": 3, "y": 19, "c":0}, {"x": 3, "y": 87, "c":1},
 +
        {"x": 4, "y": 52, "c":0}, {"x": 4, "y": 48, "c":1},
 +
        {"x": 5, "y": 24, "c":0}, {"x": 5, "y": 49, "c":1},
 +
        {"x": 6, "y": 87, "c":0}, {"x": 6, "y": 66, "c":1},
 +
        {"x": 7, "y": 17, "c":0}, {"x": 7, "y": 27, "c":1},
 +
        {"x": 8, "y": 68, "c":0}, {"x": 8, "y": 16, "c":1},
 +
        {"x": 9, "y": 49, "c":0}, {"x": 9, "y": 15, "c":1}
 +
      ]
 +
    },
 +
    {
 +
      "name": "stats",
 +
      "source": "table",
 +
      "transform": [
 +
        {
 +
          "type": "aggregate",
 +
          "groupby": ["x"],
 +
          "summarize": [{"field": "y", "ops": ["sum"]}]
 +
        }
 +
      ]
 +
    }
 +
  ],
 +
  "scales": [
 +
    {
 +
      "name": "x",
 +
      "type": "ordinal",
 +
      "range": "width",
 +
      "domain": {"data": "table", "field": "x"}
 +
    },
 +
    {
 +
      "name": "y",
 +
      "type": "linear",
 +
      "range": "height",
 +
      "nice": true,
 +
      "domain": {"data": "stats", "field": "sum_y"}
 +
    },
 +
    {
 +
      "name": "color",
 +
      "type": "ordinal",
 +
      "range": "category10",
 +
      "domain": {"data": "table", "field": "c"}
 +
    }
 +
  ],
 +
  "axes": [
 +
    {"type": "x", "scale": "x"},
 +
    {"type": "y", "scale": "y"}
 +
  ],
 +
  "marks": [
 +
    {
 +
      "type": "rect",
 +
      "from": {
 +
        "data": "table",
 +
        "transform": [
 +
          {"type": "stack", "groupby": ["x"], "sortby": ["c"], "field": "y"}
 +
        ]
 +
      },
 +
      "properties": {
 +
        "enter": {
 +
          "x": {"scale": "x", "field": "x"},
 +
          "width": {"scale": "x", "band": true, "offset": -1},
 +
          "y": {"scale": "y", "field": "layout_start"},
 +
          "y2": {"scale": "y", "field": "layout_end"},
 +
          "fill": {"scale": "color", "field": "c"}
 +
        },
 +
        "update": {
 +
          "fillOpacity": {"value": 1}
 +
        },
 +
        "hover": {
 +
          "fillOpacity": {"value": 0.5}
 +
        }
 +
      }
 
     }
 
     }
 
   ]
 
   ]
 
}</graph>
 
}</graph>

Versiunea de la data 3 august 2020 21:14
















18293 / 201818793 / 2018147 / 2019