Deneb (advanced visual)

Hello community!

I have - with great help of Claude 3.5 LLM - designed a quite advanced Deneb visual to showcase how some shopfloor equipment are expected to perform over a series of years and versions.

I’m very close to being finished with my visual but I have hit a wall, and thus seeking guidance/assistance finalising the visual.

I’m seeking help to figure out the following:

  1. I have a tooltip where I get a false error, despite the label on the visual being able to actually calculate this properly. I don’t understand why it cannot show the value in the tooltip itself - remark for other years, it seems to be working just thing, it’s in the outer years.

  2. How can I add auto adjust my y-axis to add a little extra so that all my stacked bar layers are able to be displayed without exceeding the y-axis borders?

  3. I cannot figure out how to auto hide/show data labels if they are too large to be displayed within the stacked bars; some bars are so small that it does not make sense to use label space (and it clutters the visual overall). This is something that works out of the box in standard PBI visuals, but not something I have managed to fix here.

  4. My visual is in general very fixed in height / width - but a big bonus would be if I can somehow make this more dynamic pending on how I size my visual container. I am looking for something similar to what is being done behind the scenes of out of the box standard visuals in Power BI.

Attached is an example of my PBIX file:

Deneb sample.pbix (2.7 MB)

Dataset (if needed again):

deneb_sample_data_shared.csv (120.8 KB)

Appreciate all the help and support!

Best Regards,
Casper

Hi @CasperSeve.

I’ll reserve comment about the utility of the visual created by the LLM; on first look, I wouldn’t call it advanced at all as it seems very complicated and insights (for me, at least) are difficult to find. Also, 10 years of data into the future seems much too optimistic.

Nonetheless, here’s my comments on your 4 issues:
Q1: Why is there a false error in the tooltip, despite the label on the visual being able to actually calculate this properly? [I don’t understand why it cannot show the value in the tooltip itself - remark for other years, it seems to be working just thing, it’s in the outer years.]

A1: The title differs from the field name; remove [or comment-out] the title to restore correct display; e.g.,

          "tooltip": [
            {"field": "Year", "type": "nominal", "title": "Year"},
            {"field": "Supply Version", "type": "nominal", "title": "Supply Version"},
            {"field": "Capacity_type", "type": "nominal", "title": "Capacity Type"},
            {"field": "AggregatedCapacity", "type": "quantitative",
            //, "title": "Production Output"
            "format": ",.0f"}            
          ]

Q2: How can the Y axis be adjusted to add a little extra so that all the stacked bar layers are displayed without exceeding the y-axis borders?

A2: Add a y/scale/domain to the shared encoding block; e.g.,
"y": { "scale": { "domain": [0,4200] } }

Q3: How can the data labels be hidden automatically when they are too large to be displayed within the stacked bars? [some bars are so small that it does not make sense to use label space (and it clutters the visual overall)]

A3: An expression can be used to determine the desired font size for the text mark; here’s an example:

          "fontSize": {
            "expr": "datum['ProductionOutputNumber'] < 100 ? 12 : datum['ProductionOutputNumber'] < 200 ? 10 : 6"
          }

Q4: How can I make the visual size dynamic depending on how the visual container is sized? [avoid scrollbars]

A4: AFAIK, Vega-Lite doesn’t support expressions for the “width” property; instead, adjust the visual size in Power BI as desired, then set the “width” property to a desired number; e.g.,

  "spec": {
    "width": 150,
    "height": 600,

Hope it helps.
Greg
eDNA Forum - Faceted Stacked Column Chart Issues.pbix (2.7 MB)

2 Likes

A1: the false is a bug in 1.7.0. This is fixed in 1.7.1 (currently passed certification and pending deployment)

2 Likes