Repository navigation
Expand file tree
/
Copy pathsub bars
More file actions
100 lines (100 loc) · 1.99 KB
/
Copy pathsub bars
File metadata and controls
100 lines (100 loc) · 1.99 KB
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
{
"data": {
"name": "dataset"
},
"layer": [
{
"mark": {
"type": "bar"
},
"encoding": {
"y": {
"field": "Agent",
"type": "nominal"
},
"x": {
"field": "Calls not Answered",
"type": "quantitative",
"aggregate": "sum"
},
"color": {
"field": "Topic"
}
}
},
{
"transform": [
{
"joinaggregate": [{
"op": "sum",
"field": "Calls not Answered",
"as": "groupTotal"
}],
"groupby": ["Agent", "Topic"]
},
{
"window": [{
"op": "sum",
"field": "Calls not Answered",
"as": "cumulative"
}],
"groupby": ["Agent"],
"sort": [{"field": "Topic"}]
},
{
"calculate": "datum.cumulative - datum['Calls not Answered']/2",
"as": "midpoint"
}
],
"mark": {
"type": "text",
"align": "center",
"baseline": "middle"
},
"encoding": {
"y": {
"field": "Agent",
"type": "nominal"
},
"x": {
"field": "midpoint",
"type": "quantitative"
},
"color": {
"value": "white"
},
"text": {
"field": "Calls not Answered",
"type": "quantitative"
},
"detail": {
"field": "Topic",
"type": "nominal"
}
}
},
{
"mark": {
"type": "text",
"align": "right",
"dx": 5
},
"encoding": {
"y": {
"field": "Agent",
"type": "nominal"
},
"x": {
"field": "Calls not Answered",
"type": "quantitative",
"aggregate": "sum"
},
"text": {
"field": "Calls not Answered",
"type": "quantitative",
"aggregate": "sum"
}
}
}
]
}