-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathone_week-data_consumo_diario_liquidos.html
85 lines (80 loc) · 2.61 KB
/
one_week-data_consumo_diario_liquidos.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
<!DOCTYPE html>
<html>
<head>
<title>One week data - consumo diario de liquidos</title>
</head>
<body>
<h1>One week data - consumo diario de liquidos</h1>
<div id="vis"></div>
<br>
<a href="https://docs.google.com/spreadsheets/d/1Qo4Jk0S2ZHWaEnJDVHmcv6uRRg3SnE4-LvN1VOXyHBg/edit?usp=sharing" target="_blank">Dataset</a>
<br><br>
<a href="https://colab.research.google.com/drive/1TfgQMiHA-YAwtpfIWFwEZ_Pjts5iTKqB?usp=sharing" target="_blank">Versión Colab</a>
<br><br>
<a href="https://observablehq.com/@facundososalopez/one-week-data-consumo-diario-de-liquidos" target="_blank">Version ObservableHq</a>
<script src="https://cdn.jsdelivr.net/npm/[email protected]"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]"></script>
<script type="text/javascript">
var vlSpec = {
"$schema": "https://vega.github.io/schema/vega-lite/v4.json",
"data": {"url": "https://docs.google.com/spreadsheets/d/1Qo4Jk0S2ZHWaEnJDVHmcv6uRRg3SnE4-LvN1VOXyHBg/gviz/tq?tqx=out:csv", "format": { "type": "csv"}},
"width": 600,
"height": 400,
"layer": [
{
"mark": { "type": "bar", "tooltip": true },
"encoding": {
"x": {
"timeUnit": "monthdate",
"field": "fecha_hora",
"type": "ordinal",
"title": "Fecha"
},
"y": {
"aggregate": "sum",
"field": "cantidad",
"type": "quantitative",
"stack": true,
"title": "Cantidad (cc)"
},
"color": {
"field": "tipo_liquido",
"type": "nominal",
"scale": {
"domain": ["C","M","A","J","Al"],
"range": ["#6f4e37", "#919f6b", "#aec7e8", "#ffa500", "#9467bd"]
},
"title": "Tipo de Líquido"
}
}
},
{
"mark": { "type": "circle", "tooltip": true },
"encoding": {
"x": {
"timeUnit": "monthdate",
"field": "fecha_hora",
"type": "ordinal"
},
"y": {
"aggregate": "sum",
"field": "cantidad",
"type": "quantitative",
"title": "Cantidad (cc)"
}
}
},
{
"mark": { "type": "arc", "align": "right", "xOffset": 410, "yOffset": 50, "radius": 100 },
"encoding": {
"theta": { "aggregate": "sum", "field": "cantidad", "type": "quantitative" },
"color": { "field": "tipo_liquido", "type": "nominal" }
}
}
]
};
vegaEmbed('#vis', vlSpec);
</script>
</body>
</html>