Line chart with horizontal rainbow under


I am trying to implement a chart similar to the one that is used with spectrometers.
A set of values and corresponding colours of the light spectrum - from 400-700nm.
I know the RGB values, but I don’t know how to generate that “rainbow” horizontally.

What MCU/Processor/Board and compiler are you using?

What have you tried so far?

I have tried editing a widget example - Faded area line chart with custom division lines. I want that exact effect but instead of faded colour, I need a spectrum of light.

Is there a way to do it? I guess I could place a picture on the chart, but I would prefer to avoid it.