Forum Discussion
Sankey Chart - Deneb - Measure Problem
Hi,
i´m using Deneb to create a sankey chart.
Everything is working until i starting to use a measure as value.
When i use a column as value, it´s works
But when a using a sum measure and not the column, the chart turned very messy.
That's a weird input format 🙂 Have to see how this can be converted.
As for the texts overlapping - there's not much you can do apart from mimicking the stacking logic that is used for the boxes. you would need to probe the frame boundaries for the rendered text, see if any x values overlap, and then push the y origin up for an amount that clears the conflict. But this may cascade when you have lots of small boxes with long text.
8 Replies
- javaroniRegular Visitor
I figured out how to fix this.
Just select "Shows items with no data" then the measure will work lol - lbendlinSuper User
Can you show your Vega/Vega Lite code and some sample data?
Deneb doesn't know the difference between a DAX measure and a DAX column. Are you adding calculations in Deneb?
- javaroniRegular VisitorHere is the code: https://codeshare.io/WLpR1MWhen a use the measure the stack column turn into null values.
Here is data sample:DATE source destination value category stack sort labels Ano value no signal Q2 2023 Gross Revenue with intercompany Intercompany 889.000,00 left 2023 889000 Q2 2023 Gross Revenue with intercompany Gross Revenue without intercompany 0,00 left 2023 0 Q2 2023 Groos Profit Operations Expenses -827.881,35 left 2023 827881,35 Q2 2023 Groos Profit Operating Profit (Before Tax) EBIT -980.986,03 left 2023 980986,03 Q2 2023 Gross Revenue with intercompany 1 2 left 2023 Q2 2023 Gross Revenue with intercompany 1 1 left 2023 Q2 2023 Groos Profit 4 1 left 2023 Q2 2023 Groos Profit 4 1 left 2023 - lbendlinSuper User
That's a weird input format 🙂 Have to see how this can be converted.
As for the texts overlapping - there's not much you can do apart from mimicking the stacking logic that is used for the boxes. you would need to probe the frame boundaries for the rendered text, see if any x values overlap, and then push the y origin up for an amount that clears the conflict. But this may cascade when you have lots of small boxes with long text.
- lbendlinSuper User
Here's something I did recently (sorry for the blurring)
I used a sorted window for the stacking.
{ "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" }"bottomedge" is the derived y value for each bar's rendering box.
- javaroniRegular Visitor
That´s Great
Thank you for the help
- AnonymousNot applicable
Hi javaroni ,
If you have solved the problem, please accept lbendlin reply and your reply as the solution to help the other members find it more quickly.
Best Regards,
Wisdom Wu