Try ~
Do your graph as normal, then highlight your headers, click the filter icon in the data menu and then filter by colour on which ever column has the colours.
When filtered by the colour, your graph will change to reflect the values that are visible.