Forum Discussion

dfffddddddvdddd's avatar
dfffddddddvdddd
Frequent Visitor
1 year ago
Solved

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}
  
  }
}

 

4 Replies

  • Hi 

     

    Hi i found the answer in the custom sizing at the link below.

     

    Thnaks for your help

     

    Customizing Size | Vega-Lite

     

    {
      "width": {"step": 40},
      "height": {"step": 40},
      "data": {
        "name": "dataset"
      },

     

  • v-tejrama's avatar
    v-tejrama
    Community 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.

    • dfffddddddvdddd's avatar
      dfffddddddvdddd
      Frequent 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