cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
hsavy
Frequent Visitor

Deneb - Independent Y-Axis Field on a facetted plot

Hello everyone, 

I need you help to make y-axis coherent to the facetted plot I am doing (Deneb). 

I facet a graph upon differents Products, with independant and differents Versions (y-axis) for each product. The issue is that Products are displayed according to versions of all product shown, and not only the one intended. Here he two screen of my deneb : 

hsavy_0-1674809583124.png           2   hsavy_1-1674809587173.png


When only one Product is filtered, version are shown correctly. But when I filter multiples products, each product is displayed according to the sum of versions of all products, which make it unreadable. 
Could you help me figure out how to make it work as I need ? 

Thanks everyone that's is going to help. 

@giammariam  @ppm1 @lbendlin, I ping you as you helped me at the beginning of the project, maybe you could also help here 😉 

1 ACCEPTED SOLUTION
giammariam
Impactful Individual
Impactful Individual

Thanks @hsavy, is this more of what you're after? I simply updated the resolve to set the scale as independent, as opposed to the axis. Let me know if you're trying to do something else.

"resolve": {"scale": {"y": "independent"}}



Vega Editor Gist 



Madison Giammaria
Super User In Training‌ 😄
LinkedIn

View solution in original post

13 REPLIES 13
giammariam
Impactful Individual
Impactful Individual

Hey @hsavy. I would look into resolve to get the scales to show as desired. If you could provide a santized .pbix file with some mock data and your deneb visual, it'd really help me to dive deeper into this. If that can't happen, could you provide your vega/vega-lite spec? Happy to help further. Also, thanks for the tag.



Madison Giammaria
Super User In Training‌ 😄
LinkedIn

.txt / .pbix files are not supported, how could i gave you access to my vega-lite spec ? 
I will also give you some anonimized data to work with. 

You can also share your data with your spec. Please see this video.

https://www.youtube.com/watch?v=SQt1qv24BKY

 

Pat

Microsoft Employee
hsavy
Frequent Visitor

Hoosier always here to help ahha 

Issue On VegaLite hsave (github.com)

Vega Editor

Here is a gist containing the data and code. 
As you can see, Product 1 and Product2 are shown according to all versions. 
I would like to display product1 according to his versions and product2 according to his versions. 

Thank you guys


giammariam
Impactful Individual
Impactful Individual

Thanks @hsavy, is this more of what you're after? I simply updated the resolve to set the scale as independent, as opposed to the axis. Let me know if you're trying to do something else.

"resolve": {"scale": {"y": "independent"}}



Vega Editor Gist 



Madison Giammaria
Super User In Training‌ 😄
LinkedIn

Thanks again. I also tried to change the height of each facet according to the number of version. Do you think it's possible ?

I've tried with a calculate and with "height" : calculated_height, but it said it had to constant 😕 

giammariam
Impactful Individual
Impactful Individual

@hsavy I believe so. Can you share the formula that you tried to implement for calculated_height? This may be doable by manipulating the y-scale output range values.

 

Or a better option is to probably use step for the height instead of a fixed value. See here and let me know.



Madison Giammaria
Super User In Training‌ 😄
LinkedIn

@giammariam I couldn't find exactly what I've tried but it was something like : 
"transform" : [

    {"calcultate" : length("List_of_version"), "as" calculated_height}

]
But it couldn't work correctly in this version, rising the error : height as to be constant. 

When I try to put a step height in my facet spec, the error raising is "missing child_height signal". 

I am currently looking for an other solution 

giammariam
Impactful Individual
Impactful Individual

@hsavy this was a tricky one. The layer inside the facet was throwing things off. The way the underlying Vega works, it wasn't recognizing the auto-generated signal called child_height. The solution was to create a param with the name, child_height. To avoid confusion, I didn't give the param a value. To update the vertical step, update the step value inside the spec for the facet.

A bit of a hack, but it works. Glad I was able to discover this in case I ever run into this down the road with any of my projects.

Here is the gist

giammariam_0-1675694664603.png

 



Madison Giammaria
Super User In Training‌ 😄
LinkedIn

What a solution :') 
Good job finding this one trick. Maybe you could post this as a bug on the vega-lite git. 
Thanks again, you're the goat 

Wow, that was that easy :') 
I may had some issue to different scale and axis as a non english speaker. 

Thanks for you help and quick answers. Really appreciate ! 

giammariam
Impactful Individual
Impactful Individual

@ppm1, thanks for sharing this. I've seen many of Hoosier BI's videos before, but not that one. That simple function will not only make getting help with Deneb easier, but will also make development with realistic data outside of deneb and in the vega editor, faster.



Madison Giammaria
Super User In Training‌ 😄
LinkedIn
giammariam
Impactful Individual
Impactful Individual

How to provide data/pbix: https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-...

 

you can also share your spec by using the code tag under formatting. The icon looks like this: </>



Madison Giammaria
Super User In Training‌ 😄
LinkedIn

Helpful resources

Announcements
PBI Sept Update Carousel

Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

Learn Live

Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

MPPC 2023 PBI Carousel

Power Platform Conference-Power BI and Fabric Sessions

Join us Oct 1 - 6 in Las Vegas for the Microsoft Power Platform Conference.

Top Kudoed Authors