Forum Discussion
Deneb: implicitly calculated columns messing up x axis positioning for labels
- 2 years ago
Thanks for the response. I discovered that my problem was unrelated to the use of a window function. The extra columns are created when the "stack" property is enabled. I had it turned on while experimenting to solve an unrelated issue. When I set "stack" to "false", the additional columns disappeared, and labels were positioned absolutely (instead of relative to the _start and _end columns that were created by the "stack" property). I have not tried the cumulative sum function - that could be an elegant way of achieving the desired positioning. I found another way to achieve the desired result.
Have you tried using sum instead of lag ?
"transform": [
{
"window": [
{
"op": "sum",
"field": "CU (s)",
"as": "cum_total"
}
],
"sort": [
{
"field": "CU (s)",
"order": "descending"
}
],
"frame": [null, 0]
},
{
"calculate": "datum.cum_total - datum['CU (s)'] + 2", "as": "bottomedge"
}]- sean_cochran2 years ago
Resolver I
Thanks for the response. I discovered that my problem was unrelated to the use of a window function. The extra columns are created when the "stack" property is enabled. I had it turned on while experimenting to solve an unrelated issue. When I set "stack" to "false", the additional columns disappeared, and labels were positioned absolutely (instead of relative to the _start and _end columns that were created by the "stack" property). I have not tried the cumulative sum function - that could be an elegant way of achieving the desired positioning. I found another way to achieve the desired result.