Format: Ro/2: Diferență între versiuni

De la alegeri.md
Salt la: navigare, căutare
Linia 1: Linia 1:
 +
<graph>{
 +
"version": 2,
 +
"description": "Всплывающие данные",
 +
"height": 200,
 +
"width": 910,
 +
// "viewport": [945,230],
 +
// "padding": 5,
 +
"padding": {"top": 15, "left": 33, "bottom": 25, "right": 1},
 +
//
 +
"data": [
 +
{
 +
"name": "table",
 +
"values": [
 +
{"x": "7 mar", "y": 109},
 +
{"x": "B", "y": 55},
 +
{"x": "C", "y": 9},
 +
{"x": "D", "y": 91},
 +
{"x": "31 iul", "y": 81},
 +
]
 +
}
 +
],
 +
//
 +
  "signals": [
 +
    {
 +
      "name": "tooltip",
 +
      "init": {},
 +
      "streams": [
 +
        {"type": "rect:mouseover", "expr": "datum"},
 +
        {"type": "rect:mouseout", "expr": "{}"}
 +
      ]
 +
    }
 +
  ],
 +
//
 +
  "predicates": [
 +
    {
 +
      "name": "tooltip", "type": "==",
 +
      "operands": [{"signal": "tooltip._id"}, {"arg": "id"}]
 +
    }
 +
  ],
 +
//
 +
"scales": [
 +
{
 +
"name": "x",
 +
"type": "ordinal",
 +
"range": "width",
 +
"padding": 0.8,
 +
// "round": true,
 +
"domain": {"data": "table", "field": "x"}
 +
},
 +
{
 +
"name": "y",
 +
"type": "linear",
 +
"range": "height",
 +
"nice": true,
 +
"domain": {"data": "table", "field": "y"}
 +
}
 +
],
 +
//
 +
"axes": [
 +
{
 +
"type": "x",
 +
"scale": "x",
 +
// "grid": true,
 +
"values": ["7 mar", "31 iul"],
 +
"properties":
 +
{
 +
"ticks": {"stroke": {"value": "#aaa"}},
 +
"labels": {"fill": {"value": "#666"}, "fontSize": {"value": 12}},
 +
"axis": {"stroke": {"value": "#efefef"}}
 +
}
 +
},
 +
{
 +
"type": "y",
 +
"scale": "y",
 +
// "offset": 5, // отступ от графика
 +
"ticks": 5, // кол-во значений на оси y
 +
// "tickSize": 2,
 +
// "tickSizeEnd": 10,
 +
"grid": true,
 +
// "values": [10, 30, 50, 70, 110],
 +
"properties":
 +
{
 +
"ticks": {"stroke": {"value": "#d9d9d9"}},
 +
"labels": {"fill": {"value": "#666"}, "fontSize": {"value": 12}},
 +
"axis": {"stroke": {"value": "#ccc"}}
 +
}
 +
}
 +
],
 +
//
 +
"marks": [
 +
{
 +
"type": "rule",
 +
"properties":
 +
{
 +
"enter":
 +
{
 +
"x": {"field": {"group": "x"}},
 +
"x2": {"field": {"group": "width"}},
 +
"y": {"scale": "y", "value": 55}, "stroke": {"value": "#999"},
 +
"strokeWidth": {"value": 0.5}, "strokeDash": {"value": [5]}
 +
}
 +
}
 +
},
 +
{
 +
"type": "rect",
 +
"from": {"data": "table"},
 +
"properties": {
 +
"enter": {
 +
"x": {"scale": "x", "field": "x"},
 +
"width": {"scale": "x", "band": 1, "offset": 0},
 +
"y": {"scale": "y", "field": "y"},
 +
"y2": {"scale": "y", "value": 0}
 +
},
 +
"update": {"fill": {"value": "#ff8a88"}},
 +
"hover": {"fill": {"value": "#c33"}},
 +
}
 +
},
 +
{
 +
"type": "text",
 +
"properties": {
 +
"enter": {
 +
"align": {"value": "center"},
 +
"fill": {"value": "#666"},
 +
},
 +
"update": {
 +
"x": {"scale": "x", "signal": "tooltip.x"},
 +
"dx": {"scale": "x", "mult": 0.5, "band": true},
 +
"y": {"scale": "y", "offset": -4, "signal": "tooltip.y"},
 +
"text": {"signal": "tooltip.y"},
 +
"fontSize": {"value": 12},
 +
"fillOpacity": {
 +
"rule": [
 +
{
 +
"predicate": {"name": "tooltip", "id": {"value": null}},
 +
"value": 0
 +
},
 +
{"value": 1}
 +
]
 +
}
 +
}
 +
}
 +
}
 +
]
 +
}</graph>
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
 
<graph>{
 
<graph>{
 
"version": 2,
 
"version": 2,

Versiunea de la data 2 august 2020 16:41














text