jqplot.pointLabels.js

Summary
jqplot.pointLabels.js
$.jqplot.PointLabelsPlugin for putting labels at the data points.
Properties
showshow the labels or not.
locationcompass location where to position the label around the point.
labelsFromSeriestrue to use labels within data point arrays.
seriesLabelIndexarray index for location of labels within data point arrays.
labelsarray of arrays of labels, one array for each series.
stackedValuetrue to display value as stacked in a stacked plot.
ypaddingvertical padding in pixels between point and label
xpaddinghorizontal padding in pixels between point and label
escapeHTMLtrue to escape html entities in the labels.
edgeToleranceNumber of pixels that the label must be away from an axis boundary in order to be drawn.
formatterA class of a formatter for the tick text.
formatStringstring passed to the formatter.
hideZerostrue to not show a label for a value which is 0.

$.jqplot.PointLabels

Plugin for putting labels at the data points.

To use this plugin, include the js file in your source:

<script type="text/javascript" src="plugins/jqplot.pointLabels.js"></script>

By default, the last value in the data ponit array in the data series is used for the label.  For most series renderers, extra data can be added to the data point arrays and the last value will be used as the label.

For instance, this series:

[[1,4], [3,5], [7,2]]

Would, by default, use the y values in the labels.  Extra data can be added to the series like so:

[[1,4,'mid'], [3 5,'hi'], [7,2,'low']]

And now the point labels would be ‘mid’, ‘low’, and ‘hi’.

Options to the point labels and a custom labels array can be passed into the “pointLabels” option on the series option like so:

series:[{pointLabels:{
   labels:['mid', 'hi', 'low'],
   location:'se',
   ypadding: 12
   }
}]

A custom labels array in the options takes precendence over any labels in the series data.  If you have a custom labels array in the options, but still want to use values from the series array as labels, set the “labelsFromSeries” option to true.

By default, html entities (<, >, etc.) are escaped in point labels.  If you want to include actual html markup in the labels, set the “escapeHTML” option to false.

Summary
Properties
showshow the labels or not.
locationcompass location where to position the label around the point.
labelsFromSeriestrue to use labels within data point arrays.
seriesLabelIndexarray index for location of labels within data point arrays.
labelsarray of arrays of labels, one array for each series.
stackedValuetrue to display value as stacked in a stacked plot.
ypaddingvertical padding in pixels between point and label
xpaddinghorizontal padding in pixels between point and label
escapeHTMLtrue to escape html entities in the labels.
edgeToleranceNumber of pixels that the label must be away from an axis boundary in order to be drawn.
formatterA class of a formatter for the tick text.
formatStringstring passed to the formatter.
hideZerostrue to not show a label for a value which is 0.

Properties

show

this.show = $.jqplot.config.enablePlugins

show the labels or not.

location

this.location = 'n'

compass location where to position the label around the point.  ‘n’, ‘ne’, ‘e’, ‘se’, ‘s’, ‘sw’, ‘w’, ‘nw’

labelsFromSeries

this.labelsFromSeries = false

true to use labels within data point arrays.

seriesLabelIndex

this.seriesLabelIndex = null

array index for location of labels within data point arrays. if null, will use the last element of the data point array.

labels

this.labels = []

array of arrays of labels, one array for each series.

stackedValue

this.stackedValue = false

true to display value as stacked in a stacked plot. no effect if labels is specified.

ypadding

this.ypadding = 6

vertical padding in pixels between point and label

xpadding

this.xpadding = 6

horizontal padding in pixels between point and label

escapeHTML

this.escapeHTML = true

true to escape html entities in the labels.  If you want to include markup in the labels, set to false.

edgeTolerance

this.edgeTolerance = -5

Number of pixels that the label must be away from an axis boundary in order to be drawn.  Negative values will allow overlap with the grid boundaries.

formatter

this.formatter = $.jqplot.DefaultTickFormatter

A class of a formatter for the tick text.  sprintf by default.

formatString

this.formatString = ''

string passed to the formatter.

hideZeros

this.hideZeros = false

true to not show a label for a value which is 0.

this.show = $.jqplot.config.enablePlugins
show the labels or not.
this.location = 'n'
compass location where to position the label around the point.
this.labelsFromSeries = false
true to use labels within data point arrays.
this.seriesLabelIndex = null
array index for location of labels within data point arrays.
this.labels = []
array of arrays of labels, one array for each series.
this.stackedValue = false
true to display value as stacked in a stacked plot.
this.ypadding = 6
vertical padding in pixels between point and label
this.xpadding = 6
horizontal padding in pixels between point and label
this.escapeHTML = true
true to escape html entities in the labels.
this.edgeTolerance = -5
Number of pixels that the label must be away from an axis boundary in order to be drawn.
this.formatter = $.jqplot.DefaultTickFormatter
A class of a formatter for the tick text.
this.formatString = ''
string passed to the formatter.
this.hideZeros = false
true to not show a label for a value which is 0.
Close