When i want to use labels and colors parameters with addLegend() function inside a shinyAppthe legend is displayed in sta
One of the reason it may happen is when the web-page is zoomed in i.e. the zoom level is more than 100%.
Make sure you are not zoomed in. Press Control + 0 from your keyboard to reset zoom to 100%. Also, try using another web-browser if problem persists.
I had the same silly problem since my browser was zoomed in (>100%).