Dynamic Curves

Hi,

I want to set about creating a dynamic xy curve. What I want to achieve is described by the picture I attached.

Basically I want a drawn curve on an xy plot with a little dragger.

When some one drags the dragger the curve redraws itself .

Could somebody give me a few pointers on where to start, what I need to learn etc?

Thanks,

dub