/jqplot_threshold_lines_renderer

A plugin for jqPlot which allows rendering any number of threshold lines in a chart

Primary LanguageJavaScript

jpPlot Threshold Lines Renderer Plugin

This plugin enhances jqPlot to draw 1..n vertical and horizontal lines at specifiable x/y values.

Config instructions

After downloading the project copy the file jqplot.canvasThresholdLinesRenderer.js to your JavaScript folder.
In the seriesDefaults part of your jqPlot config add the following part to enable and draw threshold lines:

seriesDefaults: {
       thresholdLines: {
          lineColor: '#8f8f8f',
          labelColor: '#454545',
          xValues: [33.0, 78.0, 105.0, 155.0],
          yValues: [25.0, 50.0, 75.0, 5.0],
          showLabel: true,     -> [true|false]
          labelLocation: 'nw'  -> ['nw'|'ne'|'sw'|'se']
       }
}
  • lineColor defines the lines color
  • labelColor defines the labels color
  • xValues defines 1..n vertical lines you want to draw
  • yValues defines 1..n horizontal lines you want to draw
  • showLabel enables or disables the drawing of the line’s x or y value
  • labelLocation allows you to define the position of a label relative to the line

Useful links