Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
DW868990
Helper IV
Helper IV

Deneb - Vega Lite Color Gradient Per Category

Hi,

 

Just wondering if and how it is possible to set the color gradient for category within a visual rather than across the full visual.

 

The below example shows the gradient based all all categories but is is possible for the color gradient to be applied on each individual category.

DW868990_0-1674126013938.png


{ "data": {"url": "data/cars.json"},

"mark": "rect",

"encoding": { "y": {"field": "Origin", "type": "nominal"},

"x": {"field": "Cylinders", "type": "ordinal"},

"color": {"aggregate": "mean", "field": "Horsepower"} },

"config": { "axis": {"grid": true, "tickBand": "extent"}

} }

Thanks in advance

1 ACCEPTED SOLUTION
giammariam
Solution Sage
Solution Sage

Providing the solution here in case anyone comes across this question down the road.

https://community.powerbi.com/t5/Custom-Visuals-Development/Deneb-Vega-Lite-Color-Gradient-Per-Categ...



Madison Giammaria
Proud to be a Super User 😄
LinkedIn

Do you frequently use Deneb to provide insights to your stakeholders? Have you considered sponsoring this free and open source custom visual? More info here!

View solution in original post

1 REPLY 1
giammariam
Solution Sage
Solution Sage

Providing the solution here in case anyone comes across this question down the road.

https://community.powerbi.com/t5/Custom-Visuals-Development/Deneb-Vega-Lite-Color-Gradient-Per-Categ...



Madison Giammaria
Proud to be a Super User 😄
LinkedIn

Do you frequently use Deneb to provide insights to your stakeholders? Have you considered sponsoring this free and open source custom visual? More info here!

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.