Much of the styling of jqPlot is done by css.  The jqPlot css file is, unremarkably, jquery.jqplot.css and resides in the same directory as jqPlot itself.

There exist some styling related javascript properties on the plot objects themselves (like fontStyle, fontSize, etc.).  These can be set with the options object at plot creation.  Generally, setting these options is NOT the preferred way to customize the look of the plot.  Use the css file instead.  These options are deprecated and may disappear.  The exceptions are certain background and color options which control attributes of something renderered on a canvas.  This would be line color, grid background, etc.  These must be set by the options object.  For a list of available options, see jqPlot Options.

Objects in the plot that can be customized by css are given a css class like “.jqplot-*”.  For example, the plot title will have a “.jqplot-title” class, the axes “.jqplot-axis”, etc.

Currently assigned classes in jqPlot are as follows:

.jqplot-targetStyles for the plot target div.  These will be cascaded down to all plot elements according to css rules.
.jqplot-axisStyles for all axes
.jqplot-xaxisStyles applied to the primary x axis only.
.jqplot-yaxisStyles applied to the primary y axis only.
.jqplot-x2axis, .jqplot-x3axis, ...Styles applied to the 2nd, 3rd, etc. x axis only.
.jqplot-y2axis, .jqplot-y3axis, ...Styles applied to the 2nd, 3rd, etc.y axis only.
.jqplot-axis-tickStyles applied to all axis ticks
.jqplot-xaxis-tickStyles applied to primary x axis ticks only.
.jqplot-x2axis-tickStyles applied to secondary x axis ticks only.
.jqplot-yaxis-tickStyles applied to primary y axis ticks only.
.jqplot-y2axis-tickStyles applied to secondary y axis ticks only.
table.jqplot-table-legendStyles applied to the legend box table.
.jqplot-titleStyles applied to the title.
.jqplot-cursor-tooltipStyles applied to the cursor tooltip
.jqplot-highlighter-tooltipStyles applied to the highlighter tooltip.
div.jqplot-table-legend-swatchthe div element used for the colored swatch on the legend.

Note that axes will be assigned 2 classes like: class=”.jqplot-axis .jqplot-xaxis”.

This document is out of date.
Close