Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
DW868990
Helper IV
Helper IV

Deneb Vega Lite Table - Need to show values of zero

Hi,

 

I have created the below table in Deneb using vega lite, i need it to show all of the bin values that are the x axis, including ones where the value is zero, at present it only shows bin sizes that have a value in.

 

DW868990_0-1674042608281.png

 

My current code is below:
{
"data": {"name": "dataset"},

"encoding":{
"y": {
"field": "Category",
"title": null,
"sort": "descending"
},
"x": {
"field": "Bin Name",
"type": "nominal",
"sort": {"field": "Min"},
"axis": {
"orient": "bottom",
"title": null
}
},
"tooltip": [
{"field": "Category"},
{"field": "Bin Name"},
{"field": "Metric"}
]
},

"layer": [
{
"mark": {"type": "rect"},
"encoding": {
"color": {
"field": "Metric",
"scale":{
"scheme": "lightgreyteal"
},
"legend": null
}
}
}
]
}

Any advice appreciated.

Regards,

JJ

1 ACCEPTED SOLUTION
giammariam
Super User
Super User

Hi @DW868990. It's hard to tell without seeing a sample of your dataset, but it looks like the bins are created outside of Deneb and then passed in to be used as the x-axis. A different approach would be to pass the raw values in and then perform the binning in vega-lite. Then you could explicitly set the scale domain values. 

If this is enough info to get you closer to what you are after, then please consider marking this as the solution. However, if you are willing to provide a representive mock dataset, I'd be happy to try to provide a more thorough answer and a vega-lite spec. 



Madison Giammaria
Proud to be a Super User 😄
LinkedIn

Do you frequently use Deneb to provide insights to your stakeholders? Have you considered sponsoring this free and open source custom visual? More info here!

View solution in original post

1 REPLY 1
giammariam
Super User
Super User

Hi @DW868990. It's hard to tell without seeing a sample of your dataset, but it looks like the bins are created outside of Deneb and then passed in to be used as the x-axis. A different approach would be to pass the raw values in and then perform the binning in vega-lite. Then you could explicitly set the scale domain values. 

If this is enough info to get you closer to what you are after, then please consider marking this as the solution. However, if you are willing to provide a representive mock dataset, I'd be happy to try to provide a more thorough answer and a vega-lite spec. 



Madison Giammaria
Proud to be a Super User 😄
LinkedIn

Do you frequently use Deneb to provide insights to your stakeholders? Have you considered sponsoring this free and open source custom visual? More info here!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors