Flot Examples

1990
1992
1994
1996
1998
2000
2002
2004
0
5
10
15
20
United States
Russia
United Kingdom
Germany
Denmark
Sweden
Norway

1000 kg. CO2 emissions per year per capita for various countries (source: Wikipedia).

Flot supports selections. You can enable rectangular selection or one-dimensional selection if the user should only be able to select on one axis. Try left-clicking and drag on the plot above where selection on the x axis is enabled.

You selected:

The plot command returns a Plot object you can use to control the selection. Try clicking the buttons below.

Selections are really useful for zooming. Just replot the chart with min and max values for the axes set to the values in the "plotselected" event triggered. Try enabling the checkbox below and select a region again.

Zoom to selection.