jqPlotOptions.txt 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392
  1. Title: jqPlot Options
  2. **This document is out of date. While the options described here should still be
  3. relavent and valid, it has not been updated for many new options. Sorry for
  4. this inconvenience.**
  5. This document describes the options available to jqPlot. These are set with the
  6. third argument to the $.jqplot('target', data, options) function. Options are
  7. described using the following convention:
  8. {{{
  9. property: default, // notes
  10. }}}
  11. This document is not complete! Not all options are shown!
  12. Further information about the options can be found in the online API
  13. documentation. For details on how the options relate to the API documentation,
  14. see the <Options Tutorial> in the optionsTutorial.txt file.
  15. {{{
  16. options =
  17. {
  18. seriesColors: [ "#4bb2c5", "#c5b47f", "#EAA228", "#579575", "#839557", "#958c12",
  19. "#953579", "#4b5de4", "#d8b83f", "#ff5800", "#0085cc"], // colors that will
  20. // be assigned to the series. If there are more series than colors, colors
  21. // will wrap around and start at the beginning again.
  22. // when fillToZero is enabled, this sets the colors to use for portions of the line below zero.
  23. negativeSeriesColors: [ "#498991", "#C08840", "#9F9274", "#546D61", "#646C4A", "#6F6621",
  24. "#6E3F5F", "#4F64B0", "#A89050", "#C45923", "#187399", "#945381",
  25. "#959E5C", "#C7AF7B", "#478396", "#907294"],
  26. sortData : true, // if true, will sort the data passed in by the user.
  27. stackSeries: false, // if true, will create a stack plot.
  28. // Currently supported by line and bar graphs.
  29. title: '', // Title for the plot. Can also be specified as an object like:
  30. title: {
  31. text: '', // title for the plot,
  32. show: true,
  33. },
  34. animate : false, // if true, the series will be animated on initial drawing.
  35. // This support is renderer-dependent; the renderer must support animation.
  36. animateReplot : false, // if true, the series will be animated after every replot() call.
  37. // Use with caution! Replots can happen very frequently under
  38. // certain circumstances (e.g. resizing, dragging points) and
  39. // animation in these situations can cause problems.
  40. captureRightClick : false, // if true, right-click events are intercepted and a jqplotRightClick
  41. // event will be fired. This will also block the context menu.
  42. dataRenderer : undefined, // A callable which can be used to preprocess data passed into the plot.
  43. // Will be called with 3 arguments: the plot data, a reference to the plot,
  44. // and the value of dataRendererOptions.
  45. dataRendererOptions : undefined, // Options that will be passed to the dataRenderer,
  46. // if that option is supplied. Can be of any type.
  47. gridData : [], // array of grid coordinates corresponding to the data points;
  48. // normally jqPlot will calculate this for you.
  49. axesDefaults: {
  50. show: false, // whether or not to render the axis. Determined automatically.
  51. min: null, // minimum numerical value of the axis. Determined automatically.
  52. max: null, // maximum numerical value of the axis. Determined automatically.
  53. pad: 1.2, // a factor multiplied by the data range on the axis to give the
  54. // axis range so that data points don't fall on the edges of the axis.
  55. ticks: [], // a 1D [val1, val2, ...], or 2D [[val, label], [val, label], ...]
  56. // array of ticks to use. Computed automatically.
  57. numberTicks: undefined,
  58. renderer: $.jqplot.LinearAxisRenderer, // renderer to use to draw the axis,
  59. rendererOptions: {}, // options to pass to the renderer. LinearAxisRenderer
  60. // has no options,
  61. tickOptions: {
  62. mark: 'outside', // Where to put the tick mark on the axis
  63. // 'outside', 'inside' or 'cross'
  64. showMark: true, // whether or not to show the mark on the axis
  65. showGridline: true, // whether to draw a gridline (across the whole grid) at this tick
  66. isMinorTick: false, // whether this is a minor tick
  67. markSize: 4, // length the tick will extend beyond the grid in pixels. For
  68. // 'cross', length will be added above and below the grid boundary
  69. show: true, // whether to show the tick (mark and label)
  70. showLabel: true, // whether to show the text label at the tick
  71. prefix: '', // String to prepend to the tick label.
  72. // Prefix is prepended to the formatted tick label
  73. suffix: '', // String to append to the tick label.
  74. // Suffix is appended to the formatted tick label
  75. formatString: '', // format string to use with the axis tick formatter
  76. fontFamily: '', // css spec for the font-size css attribute
  77. fontSize: '', // css spec for the font-size css attribute
  78. textColor: '', // css spec for the color attribute
  79. escapeHTML: false // true to escape HTML entities in the label
  80. }
  81. showTicks: true, // whether or not to show the tick labels,
  82. showTickMarks: true, // whether or not to show the tick marks
  83. },
  84. axes: {
  85. xaxis: {
  86. // same options as axesDefaults
  87. },
  88. yaxis: {
  89. // same options as axesDefaults
  90. },
  91. x2axis: {
  92. // same options as axesDefaults
  93. },
  94. y2axis: {
  95. // same options as axesDefaults
  96. }
  97. },
  98. seriesDefaults: {
  99. show: true, // whether to render the series.
  100. xaxis: 'xaxis', // either 'xaxis' or 'x2axis'.
  101. yaxis: 'yaxis', // either 'yaxis' or 'y2axis'.
  102. label: '', // label to use in the legend for this line.
  103. color: '', // CSS color spec to use for the line. Determined automatically.
  104. lineWidth: 2.5, // Width of the line in pixels.
  105. shadow: true, // show shadow or not.
  106. shadowAngle: 45, // angle (degrees) of the shadow, clockwise from x axis.
  107. shadowOffset: 1.25, // offset from the line of the shadow.
  108. shadowDepth: 3, // Number of strokes to make when drawing shadow. Each
  109. // stroke offset by shadowOffset from the last.
  110. shadowAlpha: 0.1, // Opacity of the shadow.
  111. showLine: true, // whether to render the line segments or not.
  112. showMarker: true, // render the data point markers or not.
  113. fill: false, // fill under the line,
  114. fillAndStroke: false, // stroke a line at top of fill area.
  115. fillColor: undefined, // custom fill color for filled lines (default is line color).
  116. fillAlpha: undefined, // custom alpha to apply to fillColor.
  117. renderer: $.jqplot.LineRenderer], // renderer used to draw the series.
  118. rendererOptions: {}, // options passed to the renderer. LineRenderer has no options.
  119. markerRenderer: $.jqplot.MarkerRenderer, // renderer to use to draw the data
  120. // point markers.
  121. markerOptions: {
  122. show: true, // whether to show data point markers.
  123. style: 'filledCircle', // circle, diamond, square, filledCircle.
  124. // filledDiamond or filledSquare.
  125. lineWidth: 2, // width of the stroke drawing the marker.
  126. size: 9, // size (diameter, edge length, etc.) of the marker.
  127. color: '#666666' // color of marker, set to color of line by default.
  128. shadow: true, // whether to draw shadow on marker or not.
  129. shadowAngle: 45, // angle of the shadow. Clockwise from x axis.
  130. shadowOffset: 1, // offset from the line of the shadow,
  131. shadowDepth: 3, // Number of strokes to make when drawing shadow. Each stroke
  132. // offset by shadowOffset from the last.
  133. shadowAlpha: 0.07 // Opacity of the shadow
  134. }
  135. },
  136. series:[
  137. {Each series has same options as seriesDefaults},
  138. {You can override each series individually here}
  139. ],
  140. legend: {
  141. show: false,
  142. location: 'ne', // compass direction, nw, n, ne, e, se, s, sw, w.
  143. xoffset: 12, // pixel offset of the legend box from the x (or x2) axis.
  144. yoffset: 12, // pixel offset of the legend box from the y (or y2) axis.
  145. },
  146. grid: {
  147. drawGridLines: true, // whether to draw lines across the grid or not.
  148. gridLineColor: '#cccccc' // Color of the grid lines.
  149. background: '#fffdf6', // CSS color spec for background color of grid.
  150. borderColor: '#999999', // CSS color spec for border around grid.
  151. borderWidth: 2.0, // pixel width of border around grid.
  152. shadow: true, // draw a shadow for grid.
  153. shadowAngle: 45, // angle of the shadow. Clockwise from x axis.
  154. shadowOffset: 1.5, // offset from the line of the shadow.
  155. shadowWidth: 3, // width of the stroke for the shadow.
  156. shadowDepth: 3, // Number of strokes to make when drawing shadow.
  157. // Each stroke offset by shadowOffset from the last.
  158. shadowAlpha: 0.07 // Opacity of the shadow
  159. renderer: $.jqplot.CanvasGridRenderer, // renderer to use to draw the grid.
  160. rendererOptions: {} // options to pass to the renderer. Note, the default
  161. // CanvasGridRenderer takes no additional options.
  162. },
  163. // Size of the grid containing the plot.
  164. gridDimensions: {
  165. height: null,
  166. width: null
  167. },
  168. // Padding to apply around the grid containing the plot.
  169. gridPadding: {
  170. top: null,
  171. bottom: null,
  172. left: null,
  173. right: null
  174. },
  175. noDataIndicator : object, // For setting up a mock plot with a data loading indicator if
  176. // no data is specified. Must have .show=true, .axes, and a
  177. // .indicator string that will be displayed.
  178. // Plugin and renderer options.
  179. // BarRenderer.
  180. // With BarRenderer, you can specify additional options in the rendererOptions object
  181. // on the series or on the seriesDefaults object. Note, some options are re-specified
  182. // (like shadowDepth) to override lineRenderer defaults from which BarRenderer inherits.
  183. seriesDefaults: {
  184. rendererOptions: {
  185. barPadding: 8, // number of pixels between adjacent bars in the same
  186. // group (same category or bin).
  187. barMargin: 10, // number of pixels between adjacent groups of bars.
  188. barDirection: 'vertical', // vertical or horizontal.
  189. barWidth: null, // width of the bars. null to calculate automatically.
  190. shadowOffset: 2, // offset from the bar edge to stroke the shadow.
  191. shadowDepth: 5, // number of strokes to make for the shadow.
  192. shadowAlpha: 0.8, // transparency of the shadow.
  193. }
  194. },
  195. // Cursor
  196. // Options are passed to the cursor plugin through the "cursor" object at the top
  197. // level of the options object.
  198. cursor: {
  199. style: 'crosshair', // A CSS spec for the cursor type to change the
  200. // cursor to when over plot.
  201. show: true,
  202. showTooltip: true, // show a tooltip showing cursor position.
  203. followMouse: false, // whether tooltip should follow the mouse or be stationary.
  204. tooltipLocation: 'se', // location of the tooltip either relative to the mouse
  205. // (followMouse=true) or relative to the plot. One of
  206. // the compass directions, n, ne, e, se, etc.
  207. tooltipOffset: 6, // pixel offset of the tooltip from the mouse or the axes.
  208. showTooltipGridPosition: false, // show the grid pixel coordinates of the mouse
  209. // in the tooltip.
  210. showTooltipUnitPosition: true, // show the coordinates in data units of the mouse
  211. // in the tooltip.
  212. tooltipFormatString: '%.4P', // sprintf style format string for tooltip values.
  213. useAxesFormatters: true, // whether to use the same formatter and formatStrings
  214. // as used by the axes, or to use the formatString
  215. // specified on the cursor with sprintf.
  216. tooltipAxesGroups: [], // show only specified axes groups in tooltip. Would specify like:
  217. // [['xaxis', 'yaxis'], ['xaxis', 'y2axis']]. By default, all axes
  218. // combinations with for the series in the plot are shown.
  219. },
  220. // Dragable
  221. // Dragable options are specified with the "dragable" object at the top level
  222. // of the options object.
  223. // (Note that 'dragable' is the name and spelling used by the plugin, even though
  224. // the correct word is 'draggable'.)
  225. dragable: {
  226. color: undefined, // custom color to use for the dragged point and dragged line
  227. // section. default will use a transparent variant of the line color.
  228. constrainTo: 'none', // Constrain dragging motion to an axis: 'x', 'y', or 'none'.
  229. },
  230. // Highlighter
  231. // Highlighter options are specified with the "highlighter" object at the top level
  232. // of the options object.
  233. highlighter: {
  234. lineWidthAdjust: 2.5, // pixels to add to the size line stroking the data point marker
  235. // when showing highlight. Only affects non filled data point markers.
  236. sizeAdjust: 5, // pixels to add to the size of filled markers when drawing highlight.
  237. showTooltip: true, // show a tooltip with data point values.
  238. tooltipLocation: 'nw', // location of tooltip: n, ne, e, se, s, sw, w, nw.
  239. fadeTooltip: true, // use fade effect to show/hide tooltip.
  240. tooltipFadeSpeed: "fast"// slow, def, fast, or a number of milliseconds.
  241. tooltipOffset: 2, // pixel offset of tooltip from the highlight.
  242. tooltipAxes: 'both', // which axis values to display in the tooltip, x, y or both.
  243. tooltipSeparator: ', ' // separator between values in the tooltip.
  244. useAxesFormatters: true // use the same format string and formatters as used in the axes to
  245. // display values in the tooltip.
  246. tooltipFormatString: '%.5P' // sprintf format string for the tooltip. only used if
  247. // useAxesFormatters is false. Will use sprintf formatter with
  248. // this string, not the axes formatters.
  249. },
  250. // LogAxisRenderer
  251. // LogAxisRenderer add 2 options to the axes object. These options are specified directly on
  252. // the axes or axesDefaults object.
  253. axesDefaults: {
  254. base: 10, // the logarithmic base.
  255. tickDistribution: 'even', // 'even' or 'power'. 'even' will produce ticks with even visual
  256. // (pixel) spacing on the axis. 'power' will produce ticks spaced by
  257. // increasing powers of the log base.
  258. },
  259. // PieRenderer
  260. // PieRenderer accepts options from the rendererOptions object of the series or seriesDefaults object.
  261. seriesDefaults: {
  262. rendererOptions: {
  263. diameter: undefined, // diameter of pie, auto computed by default.
  264. padding: 20, // padding between pie and neighboring legend or plot margin.
  265. sliceMargin: 0, // gap between slices.
  266. fill: true, // render solid (filled) slices.
  267. shadowOffset: 2, // offset of the shadow from the chart.
  268. shadowDepth: 5, // Number of strokes to make when drawing shadow. Each stroke is
  269. // offset by shadowOffset from the last.
  270. shadowAlpha: 0.07 // Opacity of the shadow
  271. }
  272. },
  273. // Trendline
  274. // Trendline takes options on the trendline object of the series or seriesDefaults object.
  275. seriesDefaults: {
  276. trendline: {
  277. show: true, // show the trend line
  278. color: '#666666', // CSS color spec for the trend line.
  279. label: '', // label for the trend line.
  280. type: 'linear', // 'linear', 'exponential' or 'exp'
  281. shadow: true, // show the trend line shadow.
  282. lineWidth: 1.5, // width of the trend line.
  283. shadowAngle: 45, // angle of the shadow. Clockwise from x axis.
  284. shadowOffset: 1.5, // offset from the line of the shadow.
  285. shadowDepth: 3, // Number of strokes to make when drawing shadow.
  286. // Each stroke offset by shadowOffset from the last.
  287. shadowAlpha: 0.07 // Opacity of the shadow
  288. }
  289. }
  290. }
  291. }}}
  292. Options to be described:
  293. lineRenderer:
  294. .markerOptions?
  295. bands
  296. fill
  297. fillAndStroke
  298. fillStyle
  299. highlightColor
  300. highlightMouseDown
  301. highlightMouseOver
  302. shadow
  303. shadowOffset
  304. showLine
  305. shadowRenderer:
  306. alpha
  307. closePath
  308. depth
  309. fill
  310. fillRect
  311. fillStyle
  312. isarc
  313. lineCap
  314. lineJoin
  315. linePattern
  316. lineWidth
  317. offset
  318. strokeStyle
  319. shapeRenderer:
  320. clearRect
  321. closePath
  322. fill
  323. fillRect
  324. fillStyle
  325. isarc
  326. lineCap
  327. lineJoin
  328. linePattern
  329. lineWidth
  330. strokeRect
  331. strokeStyle
  332. jqplot.effects:
  333. options.duration ; options.complete
  334. LinearAxisRenderer:
  335. .min, .max (?)
  336. numberTicks
  337. tickInternal
  338. forceTickAt0 : false, // If true, a tick will always be drawn at 0.
  339. markerRenderer:
  340. color
  341. fillStyle
  342. strokeStyle
  343. canvasGridRenderer:
  344. lineWidth