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.
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.
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
Solved! Go to Solution.
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.
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.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.