Binding to click Events for time series graph

Hello I found this sample here:

The plot part Looks so:

But I dont know how to customized it for time series graph?

        Plotly.newPlot(self.ctx.div, self.ctx.plotData,
            layout, {
                displaylogo: false
three reasons why you should buy plotly pro: support open source, get great support, host your plots and dashboards online