Place the color legend in the sidebar below the color dropdown. Give it a certain amount of vertical space, and let it grow beyond that by showing scrollbars when needed.
Benefits:
You can have a large number of categories without breaking the plot.
The legend can be hidden when, in the future, we have a sliding sidebar; this gives the full screen to the plot itself
Issues:
Won't print together with the main plot (but the user can always print it separately, or we can add it to the plot when printing).
Place the color legend in the sidebar below the color dropdown. Give it a certain amount of vertical space, and let it grow beyond that by showing scrollbars when needed.
Benefits:
Issues: