Visualisation Legend Scrollable or alternative solution?

The data visualisations that I am working with could have up to 20 categories in the legend, which presents a problem. This is due to visuals been inside a card with a fixed height.

As a result I am trying to think of a solution for handling the categories.....one option is to have a scrollable legend. I was wondering if someone from community has a better solution?

Cheers,

Chris