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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
asimbilal
Regular Visitor

Change line chart background color

I want to make line chart report and I have attached the image what I am trying to achieve can you help me how can I do that. I want to change the background color if my y-axis value is 0 to 0.7 it will be green. If my y-axis value is 0.8 to 2.2 then it will be yellow and rest will be red.

 
Screen Shot 2016-03-29 at 4.05.20 pm.png
3 REPLIES 3
samKsam
New Member

Hi, I'm trying to create the same conditional background color. I was wondering if you could figure it out? 

Seth_C_Bauer
Community Champion
Community Champion

@asimbilal

I don't know of a way out of the box, but here are a few ideas you can pursue.

All ideas revolve around layering visuals. The line chart will be in the foreground, and these options in the background.

1) you could just add an image with these gradients and add it behind the line chart. The drawback is that if the y-axis changes, the colors may not match up...
2) You might be able to use a heat map custom visual to control the size and color which may change as your y-axis does. You could layer elements to hide descriptions on the heatmap, then put the line chart on top... Basically it would be something like, create the heat map, turn off all title, etc. Use a white box picture to cover the remaing text, then add your line chart.
3) A final option would be to use a visual and drop in a single value so nothing shows up. remove all titles, axis, etc. and add a color for the background. You will need 3 of these, and they could serve the same purpose as #1

All these ideas are just that, ideas. i haven't tested or brought them to completion to see how they may work.


Looking for more Power BI tips, tricks & tools? Check out PowerBI.tips the site I co-own with Mike Carlo. Also, if you are near SE WI? Join our PUG Milwaukee Brew City PUG
Anonymous
Not applicable

I was trying to achieve the same a few weeks ago, except that in my case even the target values for the background color were dynamic too coming from a measure in the same dataset. This case nothing hardcoded could work...

 

I came to the conclusion that I need to create a custom visual for this purpose, that would ideally inherit from the Line Chart visual. I would add new input fields for the target limits, and fill in the background in the visual myself - while leaving the rest of the line chart as is. It sounds simple, but I couldn't get through the inheritance yet.

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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.