heatmap
2 TopicsDeneb heatmap color tweak
Apologies but workplace security policies and practices prevent me from uploading a pbix, etc. I have a Deneb spec that I am reusing that, thanks to earlier contributions from giammariam , is almost exactly what I need: Until it's filtered (using a slicer) and an extreme outlier (in dark blue) dominates the color scale: Stakeholders are asking whether each row --across the fiscal years--can be colored independently. In other words, every row would have its own "blueorange" scale (in reverse). I have tried many approaches that have not worked. Here is my spec. Thanks for any help offered. { "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": 35}, "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": "nominal" }, { "field": "Metric", "type": "quantitative", "format": ".1%" } ], "color": { "aggregate": "max", "field": "Metric", "type": "quantitative", "title": "Metric", "scale": { "reverse": true, "scheme": "blueorange" }, "legend": { "title": "", "titleAnchor": "middle", "titleBaseline": "top", "direction": "horizontal", "format": "%", "orient": "bottom-right", "offset": 14 } } } }, "data": {"name": "dataset"} }3.7KViews0likes13CommentsHelp coloring Deneb heatmap
I’m new to Deneb and haven’t been able to figure out how to color this heatmap so that it is colored by row, or category, rather than as a whole: I want the rows to be color independently of one another, like this: This is my first forum post and I don't see a way to post a .pbix. Here is the Deneb specification using Vega Lite: { "data": {"name": "dataset"}, "mark": { "type": "rect", "stroke": "white", "tooltip": true }, "encoding": { "y": { "field": "Category", "type": "nominal", "title": "", "axis": { "domain": false, "ticks": false, "labels": true, "labelAngle": 0, "labelPadding": 5 } }, "x": { "field": "Date", "type": "ordinal", "title": "", "timeUnit": "yearmonth", "axis": { "domain": false, "ticks": false, "labels": true, "labelAngle": -90, "orient": "top" } }, "tooltip": [ { "field": "Category", "type": "nominal" }, { "field": "Date", "type": "ordinal" }, { "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": { "scheme": "pbiColorDivergent" }, "legend": { "direction": "vertical", "gradientLength": 120, "format": ".1%" } } } } Any help is greatly appreciated. Thanks.Solved6.8KViews0likes24Comments