Forum Discussion
Help coloring Deneb heatmap
- 2 years ago
Doug7983, I see the issue. I had a rogue closed bracket in the data object that I missed. I deleted it and updated the above spec. Try it now.
"data": { "name": "dataset" ] //<-- Should not be there } - 2 years ago
Another great catch Doug7983. That's what I get for trying to rush through it 😆
gist{ "transform": [ {"calculate": "(month(datum['Date'])+1)", "as": "monthNum"}, { "calculate": "datum['monthNum'] + (datum['monthNum'] < 7 ? 6 : -6)", "as": "monthSort" }, { "calculate": "'FY ' + toString(year(datum['Date']) + (datum['monthSort'] <= 6 ? +1 : 0))", "as": "FY" } ], "facet": { "column": {"field": "FY", "title": null, "header": {"labelFontSize": 13}} }, "resolve": {"scale": {"x": "independent"}}, "spacing": {"column": 5}, "spec": { "width": {"step": 30}, "mark": {"type": "rect", "stroke": "white", "tooltip": true}, "encoding": { "x": { "field": "Date", "type": "ordinal", "title": null, "timeUnit": "month", "axis": { "domain": false, "ticks": false, "labels": true, "labelOpacity": 0.65, "orient": "top" }, "sort": {"field": "monthSort"} }, "y": { "field": "Category", "type": "nominal", "title": "", "axis": { "domain": false, "ticks": false, "labels": true, "labelOpacity": 0.65, "labelAngle": 0, "labelPadding": 5 } }, "tooltip": [ {"field": "Category", "type": "nominal"}, {"field": "Date", "type": "temporal"}, {"field": "Growth (MoYaM)", "type": "quantitative", "format": ".1%"}, {"field": "Growth (WDC)", "type": "quantitative", "format": ".1%"} ], "color": { "aggregate": "max", "field": "Growth (WDC)", "type": "quantitative", "title": "Growth (WDC)", "scale": {"domainMid": 0, "reverse": true, "scheme": "blueorange"}, "legend": { "titleBaseline": "bottom", "direction": "vertical", "format": ".1%", "orient": "right" } } } }, "data": { "name": "dataset" } }
Hey Doug7983. Welcome to the forums! That's awesome that you're diving into Deneb. Thank you for providing your spec and screenshots. Here's how to provide a .pbix, which would be very helpful. Alternatively, if you're able to provide a sanitized dataset that matches your schema, that will also work.
Happy to try to help once I have either the dataset or .pbix.
Thanks for the reply, giammariam. Security policies prevent me from uploading a .pbix as described in your linked instructions, and character limitations prevent pasting the full file here. I'm attempting to paste in a partial data set.
| Date | Category | Growth (WDC) | Growth (MoYaM) |
| 11/1/21 | Category 01 | 23.2% | 29.7% |
| 12/1/21 | Category 01 | 11.9% | 11.9% |
| 1/1/22 | Category 01 | 12.9% | 18.9% |
| 2/1/22 | Category 01 | 9.1% | 9.1% |
| 3/1/22 | Category 01 | 20.8% | 20.8% |
| 4/1/22 | Category 01 | 29.3% | 23.5% |
| 5/1/22 | Category 01 | 35.6% | 42.7% |
| 6/1/22 | Category 01 | 27.6% | 27.6% |
| 7/1/22 | Category 01 | 42.4% | 13.9% |
| 8/1/22 | Category 01 | 27.7% | 33.5% |
| 9/1/22 | Category 01 | 17.7% | 23.6% |
| 10/1/22 | Category 01 | 18.7% | 18.7% |
| 11/1/22 | Category 01 | 9.0% | 9.0% |
| 12/1/22 | Category 01 | 14.4% | 14.4% |
| 1/1/23 | Category 01 | 10.1% | 10.1% |
| 2/1/23 | Category 01 | 8.5% | 8.5% |
| 3/1/23 | Category 01 | 13.0% | 13.0% |
| 4/1/23 | Category 01 | 6.0% | 0.9% |
| 5/1/23 | Category 01 | 3.0% | 13.3% |
| 6/1/23 | Category 01 | 6.9% | 6.9% |
| 7/1/23 | Category 01 | 11.8% | 11.8% |
| 8/1/23 | Category 01 | 13.8% | 13.8% |
| 9/1/23 | Category 01 | 17.6% | 12.0% |
| 10/1/23 | Category 01 | 14.5% | -61.8% |
| 11/1/21 | Category 03 | 15.2% | 21.3% |
| 12/1/21 | Category 03 | 10.6% | 10.6% |
| 1/1/22 | Category 03 | 14.2% | 20.2% |
| 2/1/22 | Category 03 | 12.4% | 12.4% |
| 3/1/22 | Category 03 | 12.2% | 12.2% |
| 4/1/22 | Category 03 | 13.5% | 8.3% |
| 5/1/22 | Category 03 | 15.5% | 21.5% |
| 6/1/22 | Category 03 | 6.5% | 6.5% |
| 7/1/22 | Category 03 | 17.9% | -5.7% |
| 8/1/22 | Category 03 | 7.7% | 12.6% |
| 9/1/22 | Category 03 | -1.7% | 3.2% |
| 10/1/22 | Category 03 | 8.0% | 8.0% |
| 11/1/22 | Category 03 | 12.3% | 12.3% |
| 12/1/22 | Category 03 | 6.7% | 6.7% |
| 1/1/23 | Category 03 | 4.0% | 4.0% |
| 2/1/23 | Category 03 | 8.4% | 8.4% |
| 3/1/23 | Category 03 | 18.8% | 18.8% |
| 4/1/23 | Category 03 | 14.0% | 8.6% |
| 5/1/23 | Category 03 | 5.2% | 15.7% |
| 6/1/23 | Category 03 | 12.7% | 12.7% |
| 7/1/23 | Category 03 | 8.7% | 8.7% |
| 8/1/23 | Category 03 | 10.5% | 10.5% |
| 9/1/23 | Category 03 | 5.8% | 0.8% |
| 10/1/23 | Category 03 | 1.7% | -66.1% |
| 11/1/21 | Category 10 | 24.0% | 30.5% |
| 12/1/21 | Category 10 | 15.8% | 15.8% |
| 1/1/22 | Category 10 | 11.8% | 17.7% |
| 2/1/22 | Category 10 | 11.3% | 11.3% |
| 3/1/22 | Category 10 | 18.3% | 18.3% |
| 4/1/22 | Category 10 | 21.6% | 16.1% |
| 5/1/22 | Category 10 | 14.6% | 20.6% |
| 6/1/22 | Category 10 | 12.5% | 12.5% |
| 7/1/22 | Category 10 | 25.4% | 0.3% |
| 8/1/22 | Category 10 | 8.7% | 13.6% |
| 9/1/22 | Category 10 | 9.0% | 14.4% |
| 10/1/22 | Category 10 | 12.6% | 12.6% |
| 11/1/22 | Category 10 | 2.6% | 2.6% |
| 12/1/22 | Category 10 | 0.5% | 0.5% |
| 1/1/23 | Category 10 | 3.9% | 3.9% |
| 2/1/23 | Category 10 | 0.1% | 0.1% |
| 3/1/23 | Category 10 | -8.4% | -8.4% |
| 4/1/23 | Category 10 | -7.7% | -12.1% |
| 5/1/23 | Category 10 | -5.0% | 4.5% |
| 6/1/23 | Category 10 | -6.0% | -6.0% |
| 7/1/23 | Category 10 | -3.0% | -3.0% |
| 8/1/23 | Category 10 | -0.1% | -0.1% |
| 9/1/23 | Category 10 | -1.6% | -6.3% |
| 10/1/23 | Category 10 | -7.2% | -69.1% |