Forum Discussion

javaroni's avatar
javaroni
Regular Visitor
1 year ago
Solved

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.

 

I don't know how to fix this. Another thing I want to fix is that the labels occasionally overlap each other."
 
Thanks



  • lbendlin's avatar
    lbendlin
    1 year ago

    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

  • javaroni's avatar
    javaroni
    Regular Visitor

    I figured out how to fix this.
    Just select "Shows items with no data" then the measure will work lol

  • 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?

    • javaroni's avatar
      javaroni
      Regular Visitor
      Here is the code: https://codeshare.io/WLpR1M
      When a use the measure the stack column turn into null values.

      Here is data sample:
      DATEsourcedestinationvaluecategorystacksortlabelsAnovalue no signal
      Q2 2023Gross Revenue with intercompanyIntercompany889.000,00   left2023889000
      Q2 2023Gross Revenue with intercompanyGross Revenue without intercompany0,00   left20230
      Q2 2023Groos ProfitOperations Expenses-827.881,35   left2023827881,35
      Q2 2023Groos ProfitOperating Profit (Before Tax) EBIT-980.986,03   left2023980986,03
      Q2 2023   Gross Revenue with intercompany12left2023 
      Q2 2023   Gross Revenue with intercompany11left2023 
      Q2 2023   Groos Profit41left2023 
      Q2 2023   Groos Profit41left2023 
      • lbendlin's avatar
        lbendlin
        Super 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.

    • lbendlin's avatar
      lbendlin
      Super 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.

      • javaroni's avatar
        javaroni
        Regular Visitor

        That´s Great
        Thank you for the help

  • Anonymous's avatar
    Anonymous
    Not 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