In either case draw the target curve (using a javascript library like flot, see http://www.flotcharts.org), compute the 5 most similar time series, and return and display them using AJAX($.ajax) with their metadata (you can use a IN query on the ids of the time series).
In either case draw the target curve (using a javascript library like flot, see http://www.flotcharts.org), compute the 5 most similar time series, and return and display them using AJAX($.ajax) with their metadata (you can use a IN query on the ids of the time series).