Forum Discussion
Beginner DENEB assistance
Hi all I am new to Deneb and am trying to create a heat map. The number of columns and rows are dependent on slicer selection.
I am trying to make the column and height a fixed size. Atm they dynamical change size. This is what I have tried so far.
Any help or pointers in the right direction would be greatly appreciated.
{
"data": {
"name": "dataset"
},
"encoding": {
"y": {
"field": "Course Name",
"type": "ordinal",
"axis": {
"labelAngle": 0
}
},
"x": {
"field": "Staff Name",
"type": "ordinal",
"axis": {
"orient": "top",
"labelAngle": -45
}
}
},
"layer": [
{
"mark": "rect",
"width": 500,
"height": 500,
"encoding": {
"color": {
"condition": [
{"test": "datum.Combined === 1", "value": "green"},
{"test": "datum.Combined === 2", "value": "orange"},
{"test": "datum.Combined === 3", "value": "red"},
{"test": "datum.Combined === 4", "value": "white"}
]
}
}
}
],
"config": {
"axis": {"grid": true, "tickBand": "extent", "gridWidth": 2.5}
}
}
Hi
Hi i found the answer in the custom sizing at the link below.
Thnaks for your help
{ "width": {"step": 40}, "height": {"step": 40}, "data": { "name": "dataset" },
4 Replies
- DekuSuper User
Does you mean it scales to fit the visual container?
There is are a few Vega lite example in the docs, that might help
https://vega.github.io/vega-lite/examples/rect_heatmap.html
https://vega.github.io/vega-lite/examples/selection_heatmap.html
- dfffddddddvddddFrequent Visitor
Hi
Hi i found the answer in the custom sizing at the link below.
Thnaks for your help
{ "width": {"step": 40}, "height": {"step": 40}, "data": { "name": "dataset" }, - v-tejramaCommunity Support
Hi dfffddddddvdddd ,
Thanks for reaching out to the Microsoft fabric community forum.
Try this :
{
"data": {
"name": "dataset"
},
"encoding": {
"y": {
"field": "Course Name",
"type": "ordinal",
"axis": {
"labelAngle": 0
}
},
"x": {
"field": "Staff Name",
"type": "ordinal",
"axis": {
"orient": "top",
"labelAngle": -45
}
}
},
"layer": [
{
"mark": {
"type": "rect",
"width": 50,
"height": 50
},
"encoding": {
"color": {
"field": "Combined",
"type": "quantitative",
"scale": {
"domain": [0, 10],
"range": ["white", "green"]
}
}
}
}
],
"config": {
"axis": {
"grid": true,
"tickBand": "extent",
"gridWidth": 2.5
}
}
}
Please find the attached pbix file for youe reference.If the response has addressed your query, please Accept it as a solution and give a 'Kudos' so other members can easily find it
Best Regards,
Tejaswi.
Community Support Team.- dfffddddddvddddFrequent Visitor
Hi thanks for the reply.
This fixes the size of the mark but the grid that the mark is in the column and row size is still dynamic.
Regards