Reply
avatar user
Anonymous
Not applicable
Partially syndicated - Outbound

How to create a line chart with range area in the background

Hello,

I am trying to create a Line chart with a range in the background (See pic below). The idea of the range is to show the normal range for the plot; anything outside of the range is considered abnormal. We want users to see whether the data point is within the range or outside the range. The screenshot shows how the graph looks like in R shiny, where the green area in the background represents the range, and the line represents the actual data points.   Is there a way that I can recreate this in PowerBI? I really appreciate any advice. Thanks

 

Jasleenm_0-1617722626134.png

 

2 ACCEPTED SOLUTIONS
avatar user
Anonymous
Not applicable

Syndicated - Outbound

Hi @Anonymous ,

 

After some research, I suggest that you can use R or Python visuals in Power BI Desktop. You can create the chart using the "Polygon()" function. Here is my test.

v-yuaj-msft_0-1618911201532.png

Result:

v-yuaj-msft_1-1618911236160.png

polygon() 

 

Hope that's what you were looking for.

Best Regards,

Yuna

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

avatar user
Anonymous
Not applicable

Syndicated - Outbound

@Anonymous thanks alot it worked.

View solution in original post

8 REPLIES 8
radhey_rec
Resolver II
Resolver II

Syndicated - Outbound

Hi @Anonymous,

 

If you can user custom visuals, you can try https://pbivizedit.com

I am able to create following chart:

radhey_rec_0-1640076091702.png

with the following data:

radhey_rec_1-1640076117692.png

 

Please note that, these visuals do not support (yet):

1. Native tooltips of Power BI.

2. selection of data points for further filtering.

 

Thanks,

-R

 

avatar user
Anonymous
Not applicable

Syndicated - Outbound

Hi @Anonymous ,

 

After some research, I suggest that you can use R or Python visuals in Power BI Desktop. You can create the chart using the "Polygon()" function. Here is my test.

v-yuaj-msft_0-1618911201532.png

Result:

v-yuaj-msft_1-1618911236160.png

polygon() 

 

Hope that's what you were looking for.

Best Regards,

Yuna

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Syndicated - Outbound

That looks like a great solution. I'll be grateful if you could post the R code that you used to produce that result. With no knowledge at all of R, I tried to figure it out myself from on-line documentation and didn't get very far.
Assuming it is R, of course.

avatar user
Anonymous
Not applicable

Syndicated - Outbound

@Anonymous thanks alot it worked.

avatar user
Anonymous
Not applicable

Syndicated - Outbound

Hi @Anonymous ,

 

Based on your description, it seems that there is no custom visual in Power BI that can fully meet your requirements. So I did a test to find something workaround. Is the following result what you want?

v-yuaj-msft_0-1617868916085.png

I just create a stacked chart visual and set the color of "minimum" as white. 

v-yuaj-msft_1-1617869054627.png

v-yuaj-msft_2-1617869079259.png

If you set the maximum and value columns to the same color, this may better meet your needs.

 

Hope that's what you were looking for.

Best Regards,

Yuna

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

amitchandak
Super User
Super User

Syndicated - Outbound

@Anonymous , I doubt you can do that with standard visual.

check some custom visual

https://appsource.microsoft.com/en-us/marketplace/apps?product=power-bi-visuals

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
avatar user
Anonymous
Not applicable

Syndicated - Outbound

@amitchandak Thanks for replying. I have been checking some custom visuals but I have not found any good fit so far. If you have any recommendations then please let me know. 

Syndicated - Outbound

@Anonymous , check if this one can help

https://blog.pragmaticworks.com/power-bi-custom-visuals-chartaccent-linechart

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
avatar user

Helpful resources

Announcements
March PBI video - carousel

Power BI Monthly Update - March 2025

Check out the March 2025 Power BI update to learn about new features.

March2025 Carousel

Fabric Community Update - March 2025

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

Top Solution Authors (Last Month)
Top Kudoed Authors (Last Month)