Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
I have a simple scatterplot setup with (x,y) values by a given "type" as created below in R Script:
ggplot(dataset,aes(x = xVal, y = yVal)) + geom_point(aes(color = type)
Everything runs just fine, however, the issue I am facing is while the plot dynamically changes to any slicers or selections, the color of the dots change from what they were originally assigned. For example, if the original legend had:
When I interact with my data whether through a table or slicer, focusing on a certain type, for example say applying a slicer to view Type 2, the R Script plot filters correctly but shows the dots as Red when unfiltered they were originally assigned Blue in the legend. Does anyone know how to disable this and have the points "hold" their original assigned color?
I believe I gave my line of code already. In any case this is not tied to any particular data case, in my experience it has been its general behavior.
Use this simple case:
For a data set:
TYPE | X | Y |
A | 1 | 1 |
B | 2 | 2 |
C | 3 | 3 |
Add a Table on Power Bi and add the fields to a R Visual.
library(ggplot2)
ggplot(dataset,aes(x = X, y = Y)) + geom_point(aes(color = TYPE))
The R Visual will assign colors for each "TYPE". However when you say click on a row on the table for TYPE B, it will show the dot for B on the R Visual as a different color from what it was originally assigned.
User | Count |
---|---|
128 | |
108 | |
100 | |
64 | |
62 |
User | Count |
---|---|
136 | |
113 | |
102 | |
71 | |
60 |