Deneb text labels not positioned correctly

Hi,

I am working through Deneb and trying it out on some work examples. I can’t seem to position the text label correctly. I would like to position the text label at the top of the bar (see yellow below)

I have used the deneb practice file to replicate my problem which I have attached.
Demo - Deneb - Practice.pbix (1.7 MB)

Hi @KimC:

The labels in your example were being displayed at the zero Y coordinate as there was no Y encoding for the text mark. Once the “y” block was added to the encoding block (and the “dy” [aka “yOffset”] adjusted), the label positions were improved.

Here’s the code snippet:

	...
	{
      "description": "Total Text Label",
      "mark": {
        "type": "text",
        "baseline": "top",
        "dy": -12
      },
      "encoding": {
        "text": {
          "field": "Chart E+W+D",
          "format": "#,##0,.",
          "formatType": "pbiFormat"
        },
        "y": {"field": "Chart E+W+D"}
      }
    }
	...

Hope this helps.
Greg
eDNA Forum - Deneb Text Label Position.pbix (1.7 MB)

3 Likes

Thanks for your help @Greg, it works perfectly now :slight_smile: