Using dropdown Menu to show graphs


I already found some examples but no one of them solve my problem.

First I want to create ramdom numbers to plot a 3 curves.

curve “red” containts the dataset [x1, y1; x2, y2; x3, y3]
blue dataset [x4, y4; x5, y5, x6, y6]

how can I program this curves based on datasets?

Second question:
how can I add a dropdown or a autofill textfield to select specific curves red one or blue one?

I am very new at programmiing javascript with plotly.js.

Thanks in advance,