The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
I am plotting athlete reaction time (y-axis) on different days (x-axis). I have 5 athletes and I want each to have their own line, as seen in the example, but I only want four line colors because two of the athletes are taking the same amount of vitamins (80mg). right now the legend is a combination of dose (mg) and ID#, but I really only want four in the legend with just dose. However, if I change my legend to dose, the chart summarizes the pink and yellow lines & only displays one line. Please help, how can I get 5 lines with only 4 in legend. [i realize i could manually change the yellow to pink, but I have about 20 of these charts and I do not want that manual work for each report, also do not want the 5 dots at top (only four).] Thank you!
Solved! Go to Solution.
Thank you so much for looking into this. As a note for other readers, I found that it might be possible with the ggplot2 package from R, but I have not yet tested. Again thank you, and we can close this question.
Hi @MaggiB,
In your scenario, there is no automatic way to change the line color, you have to manually change the yellow to pink. And unless you change the legend to does, you will have 5 dots at top.
Thanks,
Lydia Zhang
Is there a way to do it with R-programming?
Hi @MaggiB,
Based on my reserach, it is not possible to use R to create multiple lines that associate with only one legend.
Thanks,
Lydia Zhang
Thank you so much for looking into this. As a note for other readers, I found that it might be possible with the ggplot2 package from R, but I have not yet tested. Again thank you, and we can close this question.