Use ajax to fetch data and flot to plot a graph.