Forum Discussion
AlexandreCoutoB
3 years agoFrequent Visitor
Deneb - How to add measures on another dataset
Hi, I want to replicate the sunburst example from Vega on my PBI here: https://vega.github.io/vega/examples/sunburst/ But, my values are not in a table, they are measures. So, I need to combi...
- 3 years ago
A couple things:
- You're missing the parent column. I created one based on the numbering of your IDs, although if you are going to stick with this type of hierarchy and eventually add more nodes, I'd consider handling the parent column separately. If you don't need this parent-child relationship visualized, feel free to delete the formula transform that I added to create the parent column.
- I moved all encodings to the update channel and that seemed to get the colors and tooltips working. Unless I want encodings to change in a particular way due to data binding changes, I'll usually always have everything in update.
giammariam
3 years agoSolution Sage
A couple things:
- You're missing the parent column. I created one based on the numbering of your IDs, although if you are going to stick with this type of hierarchy and eventually add more nodes, I'd consider handling the parent column separately. If you don't need this parent-child relationship visualized, feel free to delete the formula transform that I added to create the parent column.
- I moved all encodings to the update channel and that seemed to get the colors and tooltips working. Unless I want encodings to change in a particular way due to data binding changes, I'll usually always have everything in update.
AlexandreCoutoB
3 years agoFrequent Visitor
Hi giammariam ,
It worked now! Sorry for the silly mistake of the missing column, and the encoding approach works for me.
Just an additional quick question, do you know how I can configure a custom linear gradient with the following config? I want to ensure that the color #FF1414 is for calc=0, not the lowest value of calc.
if calc = 0.0, then color = #FF1414
if calc = 0.5, then color = #FFDF4B
if calc = 1.0, then color = #00FFCD
Solution:
- AlexandreCoutoB3 years agoFrequent Visitor
with the tooltip:
- giammariam3 years agoSolution Sage
Try a threshold scale. Something like:
{ "name": "color", "type": "threshold", "domain": [0.0, 1.0], "range": ["#FF1414", "#FFDF48", "#00FFCD"] }You may need to play with the domain values.
I'm assuming you want your quantiles to be:
- 0.0-0.49
- 0.5-0.99
- 1-