Bands (like confidence intervals or error bands) can be added to line charts through the "bands" option of the line renderer. The band data can be automatically computed or manually assigned. If assigned manually, the simpliest approach is to set the "rendererOptions: { bandData: [] }" array on the series. Note that band data is taken into account when axes scale themselves so bands will not get clipped.

Band data can be supplied as arrays of [x,y] values. One array for the upper band line and one for the lower band line.

The number of points in the band data arrays does not have to correspond to the number of points in the data series. Also, band data will be drawn as smoothed lines if the data series is smoothed.

In this example, band data is supplied as an array of arrays of y values for the low and hi bands. X values for the bands are taken from the x values of the series. The band data is of the form: [ [y low 1, y hi 1], [y low 2, y hi 2], ... ] and there must be a corresponding array of low/hi y values for each x value in the data series.

The band data can also be supplied as an array of [low y values], [hi y values]. In this case there must also be an equal number of low y values and hi y values as there are data points in the series. X values for the low and hi bands will be taken from the series data. Additionally, the order of low/hi values does not matter as long as they are consistent. jqPlot will figure out which is the low values and which are the high values.

Band data does not have to be provided. By default, jqPlot will compute +/- 3% band intervals if the "rendererOptions: { bands: { show: true } }" option is set. The band intervals can be customized as well through the "rendererOptions: { bands: { interval: [number|string|arry] } }" option. Valid intervals are:

  • '1.7' - will add bands at y +/- 1.7 above and below the line.
  • '10%' - will compute +/- 10% interval bands.
  • [3, '-10%'] - will add bands at y + 3 and y - 10% above and below the line.

Examples of such interval specifications are shown below:




You can also customize the fill color of the bands and turn on/off band lines. By default, bands respond to the mouse over event, but they can be set to respond to mouse down as well.

Note, the plots on this page all extend the following pre-defined theme: