Fill area up to moveable line

I am trying to create an interactive chart where the use can move a vertical line left or right, and the area under a given curve and left of the vertical line is one color, and the area under the curve and to the right is another color.

I’m sure this should be a simple exercise, but I’m not sure where to start.