cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
t-raatha Frequent Visitor
Frequent Visitor

Legend Displaying differently on PowerBI Desktop and PowerBI Service

I was working on a custom visual using R and plotly to render a graph with multiple Y-Axes. I can see the legend as I expect to see it when I'm authoring a report on PowerBI Desktop. But I can't see the legend as I expect it in PowerBI Service when I try publishing it. I suspect it has something to do with this line of code in R, but I'm not sure:

 

paly1 = c("red","green")

p = plot_ly() %>%

      add_lines(x = Values$Time, y = Values$ActualValues, name = paste(Values$name, "(", names(Values$name)[1], ")", " "), colors =            ~paly1) 

 

In this scenario, Values is a dataRole that will definitely have a 'Time' column with various timestamps for the X-Axis,  an 'ActualValues' column to be plotted along the Y-Axis, and a 'name' column for the legend. The name is something the user can filter. 

 

So on Desktop this is how I see the legend (as expected):

 

Screen Shot 2019-08-28 at 8.06.13 PM.png

Value$name consists of all these rows.

 

But in PowerBI Service, I end up seeing:

 

Screen Shot 2019-08-28 at 8.07.56 PM.png

 

And the 5 lines that are supposed to be plotted also all look blue in color.

 

How could I fix this?

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
t-raatha Frequent Visitor
Frequent Visitor

Re: Legend Displaying differently on PowerBI Desktop and PowerBI Service

In case anyone runs into this issue as well, try manipulating the 'color' field in plotly instead of 'names'. 

View solution in original post

1 REPLY 1
t-raatha Frequent Visitor
Frequent Visitor

Re: Legend Displaying differently on PowerBI Desktop and PowerBI Service

In case anyone runs into this issue as well, try manipulating the 'color' field in plotly instead of 'names'. 

View solution in original post

Helpful resources

Announcements
October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Solution Badges

New Solution Badges

Two waves of brand new solution badges are coming! Read the article for more information on our new community badges.

Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

Analytics in Azure virtual event

Analytics in Azure virtual event

Experience a limitless analytics service built to ingest, prep, manage, and serve data for immediate use in Power BI.

Users Online
Currently online: 338 members 3,314 guests
Please welcome our newest community members: