mirror of
https://github.com/librenms/librenms.git
synced 2024-09-22 10:58:42 +00:00
bugfix
git-svn-id: http://www.observium.org/svn/observer/trunk@2608 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
parent
884bca1184
commit
19202ba38a
@ -4,7 +4,7 @@
|
||||
|
||||
$scale_min = 0;
|
||||
$colours = "red";
|
||||
$nototal = 0;
|
||||
$nototal = (($width<224) ? 1 : 0);
|
||||
$unit_text = "Packets/sec";
|
||||
$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/app-powerdns-".$app['app_id'].".rrd";
|
||||
$array = array(
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
$scale_min = 0;
|
||||
$colours = "blue";
|
||||
$nototal = 0;
|
||||
$nototal = (($width<224) ? 1 : 0);
|
||||
$unit_text = "Packets/sec";
|
||||
$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/app-powerdns-".$app['app_id'].".rrd";
|
||||
$array = array(
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
$scale_min = 0;
|
||||
$colours = "mixed";
|
||||
$nototal = 0;
|
||||
$nototal = (($width<224) ? 1 : 0);
|
||||
$unit_text = "Packets/sec";
|
||||
$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/app-powerdns-".$app['app_id'].".rrd";
|
||||
$array = array(
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
$scale_min = 0;
|
||||
$colours = "mixed";
|
||||
$nototal = 0;
|
||||
$nototal = (($width<224) ? 1 : 0);
|
||||
$unit_text = "Packets/sec";
|
||||
$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/app-powerdns-".$app['app_id'].".rrd";
|
||||
$array = array(
|
||||
|
@ -140,12 +140,11 @@ if ($config['page_refresh']) { echo("<meta http-equiv='refresh' content='".$conf
|
||||
<?php
|
||||
if ($_SESSION['widescreen']) { echo('<link rel="stylesheet" href="css/styles-wide.css" type="text/css" />'); }
|
||||
?>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<script type="text/javascript" src="js/mktree.js"></script>
|
||||
<script type="text/javascript" src="js/sorttable.js"></script>
|
||||
<script type="text/javascript" src="js/jquery-1.5.2.min.js"></script>
|
||||
<script type="text/javascript" src="js/jquery.min.js"></script>
|
||||
<script type="text/javascript" src="js/jquery-checkbox.js"></script>
|
||||
<script type="text/javascript" src="js/qtip/jquery.qtip-1.0.0-rc3.min.js"></script>
|
||||
<!--[if IE]>
|
||||
@ -153,7 +152,7 @@ if ($config['page_refresh']) { echo("<meta http-equiv='refresh' content='".$conf
|
||||
<![endif]-->
|
||||
<!--[if lt IE 9]><script language="javascript" type="text/javascript" src="js/jqplot/excanvas.js"></script><![endif]-->
|
||||
<script language="javascript" type="text/javascript" src="js/jqplot/jquery.jqplot.min.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="js/jqplot/jquery.jqplot.css" />
|
||||
<link rel="stylesheet" type="text/css" href="js/jqplot/jquery.jqplot.min.css" />
|
||||
<script type="text/javascript" src="js/jqplot/plugins/jqplot.pieRenderer.min.js"></script>
|
||||
<script type="text/javascript" src="js/jqplot/plugins/jqplot.donutRenderer.min.js"></script>
|
||||
<script type="text/javascript">
|
||||
@ -228,7 +227,7 @@ function popUp(URL)
|
||||
}
|
||||
// End -->
|
||||
</script>
|
||||
<script type="text/javascript" src="js/overlib.js"></script>
|
||||
<script type="text/javascript" src="js/overlib_mini.js"></script>
|
||||
<div id="container">
|
||||
|
||||
<?php
|
||||
|
@ -1,77 +0,0 @@
|
||||
Title: jqPlot Readme
|
||||
|
||||
Pure JavaScript plotting plugin for jQuery.
|
||||
|
||||
To learn how to use jqPlot, start with the Basic Unsage Instructions below. Then read the
|
||||
usage.txt and jqPlotOptions.txt files included with the distribution.
|
||||
|
||||
The jqPlot home page is at <http://www.jqplot.com/>.
|
||||
|
||||
Downloads can be found at <http://bitbucket.org/cleonello/jqplot/downloads/>.
|
||||
|
||||
The mailing list is at <http://groups.google.com/group/jqplot-users>.
|
||||
|
||||
Examples and unit tests are at <http://www.jqplot.com/tests/>.
|
||||
|
||||
Documentation is at <http://www.jqplot.com/docs/>.
|
||||
|
||||
The project page and source code are at <http://www.bitbucket.org/cleonello/jqplot/>.
|
||||
|
||||
Bugs, issues, feature requests: <http://www.bitbucket.org/cleonello/jqplot/issues/>.
|
||||
|
||||
Basic Usage Instructions:
|
||||
|
||||
jqPlot requires jQuery (1.4+ required for certain features). jQuery 1.4.4 is included in
|
||||
the distribution. To use jqPlot include jQuery, the jqPlot jQuery plugin, the jqPlot css file and
|
||||
optionally the excanvas script to support IE version prior to IE 9 in your web page:
|
||||
|
||||
> <!--[if lt IE 9]><script language="javascript" type="text/javascript" src="excanvas.js"></script><![endif]-->
|
||||
> <script language="javascript" type="text/javascript" src="jquery-1.4.4.min.js"></script>
|
||||
> <script language="javascript" type="text/javascript" src="jquery.jqplot.min.js"></script>
|
||||
> <link rel="stylesheet" type="text/css" href="jquery.jqplot.css" />
|
||||
|
||||
For usage instructions, see <jqPlot Usage> in usage.txt. For available options, see
|
||||
<jqPlot Options> in jqPlotOptions.txt.
|
||||
|
||||
Building from source:
|
||||
|
||||
If you've cloned the repository, you can build a distribution from source.
|
||||
You need to have ant <http://ant.apache.org> installed. You can simply
|
||||
type "ant" from the jqplot directory to build the default "all" target.
|
||||
There are 6 pertinent targets: clean, dist, min, docs, compress and all. Use:
|
||||
|
||||
> ant -p
|
||||
|
||||
to get a description of the various build targets.
|
||||
|
||||
Legal Notices:
|
||||
|
||||
Copyright (c) 2009-2010 Chris Leonello
|
||||
jqPlot is currently available for use in all personal or commercial projects
|
||||
under both the MIT and GPL version 2.0 licenses. This means that you can
|
||||
choose the license that best suits your project and use it accordingly.
|
||||
|
||||
Although not required, the author would appreciate an email letting him
|
||||
know of any substantial use of jqPlot. You can reach the author at:
|
||||
chris at jqplot or see http://www.jqplot.com/info.php .
|
||||
|
||||
If you are feeling kind and generous, consider supporting the project by
|
||||
making a donation at: http://www.jqplot.com/donate.php .
|
||||
|
||||
jqPlot includes date instance methods and printf/sprintf functions by other authors:
|
||||
|
||||
Date instance methods:
|
||||
|
||||
author Ken Snyder (ken d snyder at gmail dot com)
|
||||
date 2008-09-10
|
||||
version 2.0.2 (http://kendsnyder.com/sandbox/date/)
|
||||
license Creative Commons Attribution License 3.0 (http://creativecommons.org/licenses/by/3.0/)
|
||||
|
||||
JavaScript printf/sprintf functions.
|
||||
|
||||
version 2007.04.27
|
||||
author Ash Searle
|
||||
http://hexmen.com/blog/2007/03/printf-sprintf/
|
||||
http://hexmen.com/js/sprintf.js
|
||||
The author (Ash Searle) has placed this code in the public domain:
|
||||
"This code is unrestricted: you are free to use it however you like."
|
@ -1,395 +0,0 @@
|
||||
Title: Change Log
|
||||
|
||||
1.0.0b2:
|
||||
* Major improvements in memory usage:
|
||||
** Merged in changes from Timo Besenruether to reuse canvas elements and improve
|
||||
memory performance.
|
||||
** Fixed all identifiable DOM leaks.
|
||||
** Mergged in changes from cguillot for memory improvements in IE < 9.
|
||||
* Added vertical and dashed vertical line support for canvas overlay.
|
||||
* Fixed bug where initially hidden plots would not display.
|
||||
* Fixed bug with point labels and null data points.
|
||||
* Updated to jQuery 1.6.1.
|
||||
* Improved pie slice margin calculation and fixed slice margin and pie positioning
|
||||
with small slices.
|
||||
* Improved bar renderer so bars always start at 0 if:
|
||||
** The axis is a linear axis (not log/date).
|
||||
** There are no other line types besides bars attached to the axis.
|
||||
** The data on the axis is all >= 0.
|
||||
** The user has not specified a pad, padMin or forceTickAt0 = true option.
|
||||
* Modified tick prefix behavious so prefix no added to all ticks, even if format
|
||||
string is specified.
|
||||
* Fix to ensure original tick formats are applied when zooming and resetting
|
||||
zoom.
|
||||
* Updated auto tick format string so format adjusted when zooming.
|
||||
* Modified auto tick computation to put less ticks on small plots and more
|
||||
ticks on large plots.
|
||||
* Update bubble render to support gradients in IE 9.
|
||||
|
||||
1.0.0b1:
|
||||
* Much improved tick generation algorithm to get precise rounded
|
||||
tick values (Thanks Scott Prahl!).
|
||||
* Auto compute tick format string if none is provided.
|
||||
* Much better "slicing" of pie charts when using "sliceMargin" option to set
|
||||
a gap between the slices.
|
||||
* Expanded canvasOverlay plugin to create arbitrary dashed and solid
|
||||
horizontal and vertical lines on top of plot.
|
||||
* Added defaultColors and defaultNegativeColors options to $.jqplot.config.
|
||||
* Fixed issue #318, highlighter & bar renderer incompatability.
|
||||
* Improve highlighter tooltip positioning with negative bars.
|
||||
* Fixed #305, mispelling of jqlotDragStart and jqlotDragStop. MUST NOW BIND
|
||||
TO jqplotDragStart and jqplotDragStop.
|
||||
* Fixed #290, some variables left in global scope.
|
||||
* Fixed #289, OHLC line widths hard coded at 1.5. Now set by lineWidth option.
|
||||
* Fixed #296 for determining databounds on log axes.
|
||||
* Updated to jQuery 1.5.1
|
||||
* Fixed waterfall plot to ensure first and last bars always fill to zero.
|
||||
* Added lineJoin and lineCap option to series lines.
|
||||
* Bar widths now based on width of grid, not plot target for better scaling.
|
||||
* Added looseZoom option to cursor so zooming can produce well rounded ticks.
|
||||
* Added forceTickAt0 and forceTickAt100 options to ensure there will always
|
||||
be a tick at 0 or 100 in the plot.
|
||||
* Fixed bug where cursor legend didn't honor series showLabel option.
|
||||
|
||||
|
||||
1.0.0a:
|
||||
|
||||
* Series can now be moved forward or backward in stack to e.g. bring a line
|
||||
forward when mousing over a point.
|
||||
* Can now move outside of grid area while zooming. Can have zoom
|
||||
constrained to grid area or allow zooming outside.
|
||||
* Fixed issue #142 with tooltip drawn on top of event canvas, hiding
|
||||
mouse events.
|
||||
* Fixed #147 where pie slices with 0 value not rendering properly in IE.
|
||||
* Fixed #130 where stack data not sorted properly.
|
||||
* Fixed bug with null values not handled properly in category axes.
|
||||
* Fixed #156 where pie charts not rendering on QTWebKit.
|
||||
* Now using feature detection for canvas and canvas text capability
|
||||
rather than browser version.
|
||||
* Added enahncedLegendRenderer plugin to allow multi row/column legends
|
||||
and clickable labels to show/hide series.
|
||||
* Added fillToValue option to allow filled line plot to fill to an
|
||||
arbitrary value.
|
||||
* Added block plot plugin.
|
||||
* Added funnel type charts.
|
||||
* Added meter gauge type charts.
|
||||
* Added plot theming support.
|
||||
* $.jqplot.config.enablePlugins now false by default.
|
||||
* Implemented highlighting on bar, pie, donut, funnel, etc. charts.
|
||||
* Fix to pointlabels plugin to align labels properly on multi series plots.
|
||||
* Added custom error handling to display error message in plot area.
|
||||
* Fixed issue where would call to draw grid border of 0 width would
|
||||
result in a default border being drawn.
|
||||
* Added options to place legend outside of grid and shrink grid so everything
|
||||
stays within plot div.
|
||||
* Fixed bug in color generator so now calls to get() continually cycle
|
||||
through colors just like next().
|
||||
* Added defaultAxisStart option.
|
||||
* Added gradient fills to bubbles.
|
||||
* Added bubble charts.
|
||||
* Added showLabels option to bubble charts.
|
||||
* Pass bubble radius to event callback in bubble charts.
|
||||
* Fixed #207, typo in docs.
|
||||
* Fixed #206 where "value" pie slice data labels were displaying wrong
|
||||
value.
|
||||
* Fixed #147 with 0 value slices in IE6.
|
||||
* Fixed issue #241, disabled varyBarColor option in stacked charts.
|
||||
* Added dataRenderer option to allow custom processors for JSON, AJAX
|
||||
and anywhere else you might want to get data.
|
||||
* Fixed null value handling so plot now properly skip or join over nulls.
|
||||
* Fixed showTicks and showTickMarks option conflicts.
|
||||
* Fixed issue #185 where pointLabels plugin incompatibility could crash
|
||||
pie, donut and other plots.
|
||||
* Fixed #23 and #143 to obey gridPadding option.
|
||||
* Fixed #233 with highlighter tooltip separator.
|
||||
* Fixed #224 where type checking failing on GWT.
|
||||
* Fixed #272 with pie highlighting not working on replot.
|
||||
* Memory performance improvements.
|
||||
* Changes to build script so everything should build when pulled from repo.
|
||||
* Fixed issue #275, IE 6/7 don't support array indexing of strings.
|
||||
* Added event listener hooks for mouseUp, mouseDown, etc. to all line plots.
|
||||
* Fixed bug with highlighter not working when null in data.
|
||||
* Updated to jQuery 1.4.4
|
||||
* Fixed bug where donut plots showed value of radians of slice instead
|
||||
of actual data.
|
||||
* Reverted to excanvas r3 so IE8 no longer has to emulate IE7.
|
||||
* Added tooltipContentEditor option to highlighter, allowing callback
|
||||
to manipulate tooltip content at run time (thanks Tim Bunce!).
|
||||
* Fixed bug where axes scale not resetting.
|
||||
* Fixed bug with date axes where data bounds not properly set.
|
||||
* Fixed issue where tick marks disappear if grid lines turned off.
|
||||
* Updated replot method to allow passing in axes options for more control.
|
||||
* Added experimental support for "broken" axes.
|
||||
* Fixed bug with pies where pies with 0 valued slices did not draw correctly.
|
||||
* Added canvasOverlay plugin to allow drawing of arbitrary shapes on a canvas
|
||||
over the plot.
|
||||
* Added option to display arbitrary text/html (message, animated gif, etc.) if
|
||||
plot is constructed without data. Allow a "data loading" indicator to be shown.
|
||||
* Added resetAxisValues method to manually update axis ticks without
|
||||
redrawing the plot.
|
||||
* Fix to labels on negative bars so label postiion of 'n' will be below a negative bar,
|
||||
just as it is above a positive bar (thanks guigod!).
|
||||
* Added thousands separator character (') to sprintf formatting (thanks yuichi1004!).
|
||||
* Re-factored date parsing/formatting to use new jsDate module which does not
|
||||
extend the Date prototype.
|
||||
|
||||
|
||||
0.9.7:
|
||||
|
||||
* Added Mekko chart plot type with enhanced legend and axes support.
|
||||
* Implemented vertical waterfall charts. Can create waterfall plot as
|
||||
option to bar chart. See examples folder of distribution.
|
||||
* Enhanced plot labels for waterfall style.
|
||||
* Enhanced bar plots so you can now color each bar of a series
|
||||
independently with the "varyBarColor" option.
|
||||
* Re-factored series drawing so that each series and series shadow drawn
|
||||
on it's own canvas. Allows series to be redrawn independently of each other.
|
||||
* Added additional default series colors.
|
||||
* Added useNegativeColors option to turn off negative color array and use
|
||||
only seriesColors array to define all bar/filled line colors.
|
||||
* Fix css for cursor legend.
|
||||
* Modified shape renderer so rectangles can be stroked and filled.
|
||||
* Re-factored date methods out of dateAxisRenderer so that date formatter
|
||||
and methods can be accesses outside of dateAxisRenderer plugin.
|
||||
* Fixed #132, now trigger series change event on plot target instead of drag canvas.
|
||||
* Fixes issue #116 where some source files had mix of tabs and spaces
|
||||
for indentation. Should have been all spaces.
|
||||
* Fixed issue #126, some links broken in docs section of web site.
|
||||
* Fixed issue #90, trendline plugin incompatibility with pie renderer.
|
||||
* Updated samples in examples folder of distribution to include navigation
|
||||
links if web server is set up to process .html files with php.
|
||||
|
||||
|
||||
0.9.6:
|
||||
|
||||
* New, easier to use, replot() method for placing plots in tabs, accordions,
|
||||
resizable containers or for changing plot parameters programmatically.
|
||||
* Updated legend renderer for pie charts to draw swatches which will
|
||||
print correctly.
|
||||
* Fixed issue #118 with patch from taum so autoscale option will
|
||||
honor tickInterval and numberTicks options
|
||||
* Fix to plot diameter calculation for initially hidden plots.
|
||||
* Added examples for making plots in jQuery UI tabs and accordions.
|
||||
* Fixed issue #120 where pie chart with single slice not displaying
|
||||
correctly in IE and Chrome
|
||||
|
||||
|
||||
0.9.5.2:
|
||||
|
||||
* Fixed #102 where double clicking on plot that has zoom enabled, but
|
||||
has not been zoomed resulted in error.
|
||||
* Fixed bug where candlestick coloring options not working.
|
||||
* Added option to turn individual series labels off in the legend.
|
||||
|
||||
|
||||
0.9.5.1:
|
||||
|
||||
* Fixed bug where tooltip not working with OHLC and candlestick charts.
|
||||
* Added additional marker styles: plus, X and dash.
|
||||
|
||||
|
||||
0.9.5:
|
||||
|
||||
* Implemented "zoomProxy". zoomProxy allows zooming one plot from another
|
||||
such as an overview plot.
|
||||
* Zooming can now be constrained to just x or y axis.
|
||||
* Enhanced cursor plugin with vertical "dataTracking" line. This is a line
|
||||
at the cursor location with a readout of data points at the line location
|
||||
which are displayed in the chart legend.
|
||||
* Changed cursor tooltip format string. Now one format string is used for
|
||||
entire tooltip.
|
||||
* Added mechanisms to specify plot size when plot target is hidden or plot
|
||||
height/width otherwise cannot be determined from markup.
|
||||
* Added $.jqplot.config object to specify jqplot wide configuration options.
|
||||
These include enablePlugins to globally set the default plugin state on/off
|
||||
and defaultHeight/defaultWidth to specify default plot height/width.
|
||||
* Added fillToZero option which forces filled charts to fill to zero as opposed
|
||||
to axis minimum. Thus negative filled bar/line values will fill upwards to
|
||||
zero axis value.
|
||||
* Added option to disable stacking on individual lines.
|
||||
* Changed targetId property of the plot object so it now includes a "#" before
|
||||
the id string.
|
||||
* Improved tick and body sizing of Open Hi Low Close and candlestick charts.
|
||||
* Removed lots of web site related files from the repository. This means that,
|
||||
if working from the sources, user's won't be able to build the jqplot web
|
||||
site and the docs/tests that are hosted on that site. The minified and
|
||||
compressed distribution packages will build fine.
|
||||
* Lots of examples were added to a separate examples directory to better show
|
||||
functionality of jqPlot for local testing with the distribution.
|
||||
* Many various bug fixes and other minor enhancements.
|
||||
|
||||
|
||||
0.9.4:
|
||||
|
||||
* Implemented axis labels. Labels can be rendered in div tags or as canvas
|
||||
elements supporting rotated text.
|
||||
* Improved rotated axis label positioning so labels will start or end at a
|
||||
tick position.
|
||||
* Fixed bug where an empty data series would hang plot rendering.
|
||||
* completed issue #66 for misc. improvements to documentation.
|
||||
* Fixed issue #64 where the same ID's were assigned to cursor and highlighter
|
||||
elements.
|
||||
* Added option to legend to encode special HTML characters.
|
||||
* Fixed undesirable behavior where point labels for points off the plot
|
||||
were being rendered.
|
||||
* Added edgeTolerance option to point label renderer to control rendering of
|
||||
labels near plot edges.
|
||||
|
||||
|
||||
0.9.3:
|
||||
|
||||
* Preliminary support for axis labels. Currently rendered into DIV tags,
|
||||
so no rotated label support. This feature is currently experimental.
|
||||
* Fixed bug #52, needed space in tick div tag between style and class declarations
|
||||
or plot failed in certain application doctypes.
|
||||
* Fixed issue #54, miter style line join for chart lines causing spikes at steep
|
||||
changes in slope. Changed miter style to round.
|
||||
* Added examples for new autoscaling algorithm.
|
||||
* Fixed bug #57, category axis labels disappear on redraw()
|
||||
* Improved algorithm which controlled maximum number of labels that would display
|
||||
on a category axis.
|
||||
* Fixed bug #45 where null values causing errors in plotData and gridData.
|
||||
* Fixed issue #60 where seriesColors option was not working.
|
||||
|
||||
|
||||
0.9.2:
|
||||
|
||||
* Fixed bug #45 where a plot could crash if series had different numbers of points.
|
||||
* Fixed issue #50, added option to turn off sorting of series data.
|
||||
* Fixed issue #31, implemented a better axis autoscaling algorithm and added an autoscale option.
|
||||
|
||||
0.9.1:
|
||||
|
||||
* Fixed bug #40, when axis pad, padMax, padMin set to 0, graph would fail to render.
|
||||
* Fixed bug #41 where pie and bar charts not rendered correctly on redraw().
|
||||
* Fixed bug #11, filled stacked line plots not rendering correctly in IE.
|
||||
* Fixed bug #42 where stacked charts not rendering with string date axis ticks.
|
||||
* Fixed bug in redraw() method where axes ticks were not reset.
|
||||
* Fixed "jqplotPreRedrawEvent" that should have been named "jqplotPostRedraw" event.
|
||||
|
||||
0.9.0:
|
||||
|
||||
* Added Open Hi Low Close charts, Candlestick charts and Hi Low Close charts.
|
||||
* Added support for arbitrary labels on the data points.
|
||||
* Enhanced highlighter plugin to allow custom formatting control of entire tooltip.
|
||||
* Enhanced highlighter to support multiple y values in a data point.
|
||||
* Fixed bug #38 where series with a single point with a negative value would fail.
|
||||
* Improvements to examples to show what plugins to include.
|
||||
* Expanded documentation for some of the plugins.
|
||||
|
||||
0.8.5:
|
||||
|
||||
* Added zooming ability with double click or single click options to reset zoom.
|
||||
* Modified default tick spacing algorithm for date axes to give more space to ticks.
|
||||
* Fixed bug #2 where tickInterval wasn't working properly.
|
||||
* Added neighborThreshold option to control how close mouse must be to
|
||||
point to trigger neighbor detection.
|
||||
* Added double click event handler on plot.
|
||||
|
||||
0.8.0:
|
||||
|
||||
* Support for up to 9 y axes.
|
||||
* Added option to control padding at max/min bounds of axes separately.
|
||||
* Closed issue #21, added options to control grid line color and width.
|
||||
* Closed issue #20, added options to filled line charts to stoke above
|
||||
fill and customize fill color and transparency.
|
||||
* Improved structure of on line documentation to make usage and options
|
||||
docs default.
|
||||
* Added much documentation on options and css styling.
|
||||
|
||||
0.7.1:
|
||||
|
||||
* Bug fix release
|
||||
* Fixed bug #6, missing semi-colons messing up some javascript compressors.
|
||||
* Fixed bug #13 where 2D ticks array of [values, labels] would fail to
|
||||
renderer with DateAxisRenderer.
|
||||
* Fixes bug #16 where pie renderer overwriting options for all plot types
|
||||
and crashing non pie plots.
|
||||
* Fixes bug #17 constrainTo dragable option mispelled as "contstrainTo".
|
||||
Fixed dragable color issue when used with trend lines.
|
||||
|
||||
0.7.0:
|
||||
|
||||
* Pie chart support
|
||||
* Enabled tooltipLocation option in highlighter.
|
||||
* Highlighter Tooltip will account for mark size and highlight size when
|
||||
positioning itself.
|
||||
* Added ability to show just x, y or both axes in highlighter tooltip.
|
||||
* Added customization of separator between axes values in highlighter tooltip.
|
||||
* Modified how shadows are drawn for lines, bars and markers. Now drawn first,
|
||||
so they are always behind the object.
|
||||
* Adjustments to shadow parameters on lines to account for new shadow positioning.
|
||||
* Added a ColorGenerator class to robustly return next available color
|
||||
for a plot with wrap around to first color at end.
|
||||
* Udates to docs about css file.
|
||||
* Fixed bug with String x values in series and IE error on sorting (Category Axis).
|
||||
* Added cursor changes in dragable plugin when cursor near dragable point.
|
||||
|
||||
0.6.6b:
|
||||
|
||||
* Added excanvas.js and excanvas.min.js to compressed distributions.
|
||||
* Added example/test html pages I had locally into repository and to
|
||||
compressed distributions.
|
||||
|
||||
0.6.6a:
|
||||
|
||||
* Removed absolute positioning from dom element and put back into css file.
|
||||
* Duplicate of 0.6.6 with a suffix to unambiguously differentiate between
|
||||
previously posted 0.6.6 release.
|
||||
|
||||
0.6.6:
|
||||
|
||||
* Fixed bug #5, trend line plugin failing when no trend line options specified.
|
||||
* Added absolute position css spec to axis tick dom element.
|
||||
* Enhancement to category axes, more intuitive handling of series with
|
||||
missing data values.
|
||||
|
||||
0.6.5:
|
||||
|
||||
* Fixed bug #4, series of unequal data length not rendering correctly.
|
||||
This is a bugfix release only.
|
||||
|
||||
0.6.4:
|
||||
|
||||
* Fixed bug (issue #1 in tracker) where flat line data series (all x and/or y
|
||||
values are euqal) or single value data series would crash.
|
||||
|
||||
0.6.3:
|
||||
|
||||
* Support for stacked line (a.k.a. area) and stacked bar (horizontal and
|
||||
vertical) charts.
|
||||
* Refactored barRenderer to use default shape and shadow renderers.
|
||||
* Added info (contacts & support information) page to web site.
|
||||
|
||||
0.6.2:
|
||||
|
||||
* This is a minor upgrade to docs and build only. No functionality has changed.
|
||||
* Ant build script generates entire site, examples, tests and distribution.
|
||||
* Improvements to documentation.
|
||||
|
||||
0.6.1:
|
||||
|
||||
* New sprintf implementation from Ash Searle that implements %g.
|
||||
* Fix to sprintf e/f formats.
|
||||
* Created new format specifier, %p and %P to preserve significance.
|
||||
* Modified p/P format to better display larger numbers.
|
||||
* Fixed and simplified significant digits calculation for sprintf.
|
||||
* Added option to have cursor tooltip follow the mouse or not.
|
||||
* Added options to change size of highlight.
|
||||
* Updates to handle dates like '6-May-09'.
|
||||
* Mods to improve look of web site.
|
||||
* Updates to documentation.
|
||||
* Added license and copyright statement to source files.
|
||||
|
||||
0.6.0:
|
||||
|
||||
* Added rotated text support. Uses native canvas text functionality in
|
||||
browsers that support it or draws text on canvas with Hershey font
|
||||
* metrics for non-supporting browsers.
|
||||
* Removed lots of lint in js code.
|
||||
* Moved tick css from js code into css file.
|
||||
* Fix to tick positioning css. y axis ticks were positioned to wrong side of axis div.
|
||||
* Re-factored axis tick renderer instantiation into the axes renderers themselves.
|
||||
|
||||
|
||||
For changes prior to 0.6.0 release, please see change log at http://bitbucket.org/cleonello/jqplot/changesets/
|
@ -1,280 +0,0 @@
|
||||
Title: GPL Version 2
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Lesser General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
@ -1,239 +0,0 @@
|
||||
Title: Options Tutorial
|
||||
|
||||
This document will help you understand how jqPlot's options
|
||||
relate to the API documentation and the jqPlot object
|
||||
itself. For a listing of options available to jqPlot,
|
||||
see <jqPlot Options> in the jqPlotOptions.txt file.
|
||||
|
||||
The key to effectively using jqPlot is understanding jqPlot's
|
||||
options. The online documentation is API documentation. While
|
||||
it explains what attributes and methods various objects posses,
|
||||
it doesn't explain how to use or set those attributes through
|
||||
options. This tutorial will help explain that.
|
||||
|
||||
Lets assume you are creating a plot
|
||||
like this:
|
||||
|
||||
> chart = $.jqplot('chart', dataSeries, optionsObj);
|
||||
|
||||
First, note that you shouldn't try to directly set attributes on the
|
||||
"chart" object (like chart.grid.shadow) after your call to $.jqplot().
|
||||
At best this won't do anything **(see below). You should pass options in via
|
||||
the "optionsObj".
|
||||
|
||||
the optionsObj really represents the plot object (jqPlot object, not
|
||||
to be confused with the $.jqplot function which will create a jqPlot
|
||||
object). Attributes you specify on that object will be merged with
|
||||
attributes in the jqPlot object. The axes, legend, series, etc. are
|
||||
attributes on the jqPlot object. The jqPlot/optionsObj object looks
|
||||
something like (only some attributes shown):
|
||||
|
||||
> jqPlot-|
|
||||
> |-seriesColors
|
||||
> |-textColor
|
||||
> |-fontFamily
|
||||
> |-fontSize
|
||||
> |-stackSeries
|
||||
> |-series(Array)-|
|
||||
> | |-Series1-|
|
||||
> | | |-lineWidth
|
||||
> | | |-shadow
|
||||
> | | |-showLine
|
||||
> | | |-showMarker
|
||||
> | | |-color
|
||||
> | |-Series2...
|
||||
> | |-...
|
||||
> | |-SeriesN
|
||||
> |
|
||||
> |-grid(Object)-|
|
||||
> | |-drawGridLines
|
||||
> | |-background
|
||||
> | |-borderColor
|
||||
> | |-borderWidth
|
||||
> | |-shadow
|
||||
> |
|
||||
> |-title(Object)-|
|
||||
> | |-text
|
||||
> | |-show
|
||||
> | |-fontFamily
|
||||
> | |-fontSize
|
||||
> | |-textAlign
|
||||
> | |-textColor
|
||||
> |
|
||||
> |-axes(Object)-|
|
||||
> | |-xais-|
|
||||
> | | |-min
|
||||
> | | |-max
|
||||
> | | |-numberTicks
|
||||
> | | |-showTicks
|
||||
> | | |-showTickMarks
|
||||
> | | |-pad
|
||||
> |
|
||||
> | ... and so on
|
||||
|
||||
The optionsObj should follow the same construction as if it were a
|
||||
jqPlot object (with some exceptions/shortcuts I'll mention in a
|
||||
moment). So generally, when you see something like
|
||||
"this.drawGridLines" in the grid properties in the docs, just replace
|
||||
"this" with "grid" in your options object. So it becomes
|
||||
optionsObj.grid.drawGridLines. Do likewise with the other objects in
|
||||
the plot, replacing "this", with the respective attribute on the plot
|
||||
like "legend" or "title". Series and Axes are handled a little
|
||||
different, because series is an array and axes has 4 distinct children
|
||||
"xaxis", "yaxis", "x2axis" and "y2axis".
|
||||
|
||||
So, to remove the shadow from the grid and change the grid border size
|
||||
you would do:
|
||||
|
||||
> optionObj = {grid:{shadow:false, borderWidth:9.0}};
|
||||
|
||||
To do the same as above but also make all the text in the plot red you
|
||||
would do:
|
||||
|
||||
> optionObj = {
|
||||
> textColor:"#ff0000",
|
||||
> grid:{shadow:false, borderWidth:9.0}
|
||||
> }
|
||||
|
||||
Here is a more deeply nested example. Say you want to specify a min
|
||||
and max on your y axis and use a specific color for your second
|
||||
series. That would look like:
|
||||
|
||||
> optionsObj = {
|
||||
> axes:{yaxis:{min:5, max:230}},
|
||||
> series:[{},{color:"#33ff66"}]
|
||||
> }
|
||||
|
||||
Note that series options are an array in order of the series data you
|
||||
sent in to your plot. To get to the second series, you have to put an
|
||||
object (even if empty) in place of the first series.
|
||||
|
||||
There is a handy shortcut to assign options to all axes or all series
|
||||
at one go. Use axesDefaults and seriesDefaults. So, if you wanted
|
||||
both x and y axes to start at 0 and you wanted all series to not show
|
||||
markers, you could do:
|
||||
|
||||
> optionsObj = {axesDefaults:{min:0}, seriesDefaults:{showMarker:false}}
|
||||
|
||||
Another shortcut is for the plot title. Normally, you would assign
|
||||
options to the title as an object. If you specify a title option as a
|
||||
string, it will assign that to the title.text property automatically.
|
||||
So these two are equivalent:
|
||||
|
||||
> optionsObj = {title:{text:"My Plot"}}
|
||||
|
||||
and
|
||||
|
||||
> optionsObj = {title:"My Plot"}
|
||||
|
||||
Where things need more explaination is with renderers, plugins and
|
||||
their options. Briefly, what's renderer, what's a plugin.
|
||||
|
||||
A renderer is an object that is used to draw something and gets
|
||||
attached to an existing object in the plot in order to draw it. A
|
||||
plugin does more than just provide drawing functionality to an
|
||||
object. It will do more like calculate a trend line, change the
|
||||
cursor, provide event driven functionality, etc. I consider renderers
|
||||
plugins, but plugins don't have to be renderers.
|
||||
|
||||
So, how do you use renderers, plugins, and specify their options?
|
||||
Some common renderes are for bar charts and category axes. If you
|
||||
want to render your series as a bar chart with each set of bars
|
||||
showing up in a category on the x axis, you do:
|
||||
|
||||
> optionsObj = {
|
||||
> seriesDefaults:{renderer:$.jqplot.BarRenderer},
|
||||
> axes:{xaxis:{renderer:$.jqplot.CategoryAxisRenderer}}
|
||||
> }
|
||||
|
||||
This replaces the default renderer used for all series in the plot
|
||||
with a bar renderer and the x axis default renderer (but not any other
|
||||
axis) with a category renderer.
|
||||
|
||||
Now, how would I assign options to those renderers? The renderer's
|
||||
attributes may not be present in the pre-existing jqPlot object, they
|
||||
may be specific to the renderer. This is done through the
|
||||
"rendererOptions" option on the appropriate object. So, if I wanted my
|
||||
bars to be 25 pixels wide, I would do:
|
||||
|
||||
|
||||
> optionsObj = {
|
||||
> seriesDefaults:{
|
||||
> renderer:$.jqplot.BarRenderer},
|
||||
> rendererOptions:{
|
||||
> barWidth:25
|
||||
> },
|
||||
> axes:{xaxis:{renderer:$.jqplot.CategoryAxisRenderer}}
|
||||
> }
|
||||
|
||||
Again, this is using the "seriesDefaults" option, which will apply
|
||||
options to all series in the plot. You could do the same on any
|
||||
particular series in the plot through the "series" options array.
|
||||
|
||||
Plugins are free to add their own options. For example, the
|
||||
highlighter plugin has it's own set of options that are unique to it.
|
||||
As a result, it responds to options placed in the "highlighter"
|
||||
attribute of your options object. So, if I wanted to change the
|
||||
highlighter tooltip to fade in and out slowly and be positioned
|
||||
directly above the point I'm highlighting:
|
||||
|
||||
> optionsObj = {
|
||||
> highlighter:{tooltipFadeSpeed:'slow', tooltipLocation:'n'}
|
||||
> }
|
||||
|
||||
Other plugins, like dragable and trendlines, add their options in with
|
||||
the series. This is because both of those plugins can have different
|
||||
options for different series in the plot. So, if you wanted to specify the
|
||||
color of the dragable and constrain it to drag only on the x axis as well
|
||||
as specify the color of the trend line you could do:
|
||||
|
||||
> series:[{
|
||||
> dragable: {
|
||||
> color: '#ff3366',
|
||||
> constrainTo: 'x'
|
||||
> },
|
||||
> trendline: {
|
||||
> color: '#cccccc'
|
||||
> }
|
||||
> }]
|
||||
|
||||
This would apply those options to the first series only. If you had 2 series
|
||||
and wanted to turn off dragging and trend lines on the second series, you could do:
|
||||
|
||||
> series:[{
|
||||
> dragable: {
|
||||
> color: '#ff3366',
|
||||
> constrainTo: 'x'
|
||||
> },
|
||||
> trendline: {
|
||||
> color: '#cccccc'
|
||||
> }
|
||||
> }, {
|
||||
> isDragable: false,
|
||||
> trendline:{
|
||||
> show: false
|
||||
> }
|
||||
> }]
|
||||
|
||||
Note, series dragability is turned off with the "isDragable" option directly on
|
||||
the series itself, not with a suboption of "dragable". This may be improved
|
||||
in the future.
|
||||
|
||||
I hope this is helpful.
|
||||
A few key points to remember:
|
||||
|
||||
- When you see "this" in the api docs, you generally replace it with
|
||||
the name of the object (in lowercase) you are looking at in your
|
||||
options object.
|
||||
- seriesDefaults and axesDefaults are convenient shortcuts.
|
||||
- to assign options to a renderer, generally use the "rendererOptions"
|
||||
- plugins may add their own options attribute, like "highlighter" or
|
||||
"cursor".
|
||||
|
||||
** Note: you can set attributes after the plot is created (like
|
||||
plot.grid.shadow = false), but you'll have to issue the appropriate
|
||||
calls to possibly reinitialize and redraw the plot. jqPlot can
|
||||
definitely handle this to change the plot after creation (this is how
|
||||
the dragable plugin updates the plot data and the trend line plugin
|
||||
recomputes itself when data changes). This hasn't been documented
|
||||
yet, however.
|
@ -1,126 +0,0 @@
|
||||
Title: jqPlot Usage
|
||||
|
||||
Usage Documentation:
|
||||
|
||||
Introduction:
|
||||
|
||||
jqPlot is a jQuery plugin to generate pure client-side javascript charts in your web pages.
|
||||
|
||||
The jqPlot home page is at <http://www.jqplot.com/>.
|
||||
|
||||
The project page and downloads are at <http://www.bitbucket.org/cleonello/jqplot/>.
|
||||
|
||||
Below are a few examples to demonstrate jqPlot usage. These plots are shown as static images.
|
||||
Many more examples of dynamically rendered plots can be seen on the test and examples pages here: <../../tests/>.
|
||||
|
||||
Include the Files:
|
||||
|
||||
jqPlot requires jQuery (1.4+ required for certain features). jQuery 1.4.4 is included in the distribution.
|
||||
To use jqPlot include jquery, the jqPlot jQuery plugin, jqPlot css file and optionally the excanvas
|
||||
script for IE support in your web page. Note, excanvas is required only for IE versions below 9. IE 9 includes
|
||||
native support for the canvas element and does not require excanvas:
|
||||
|
||||
> <!--[if lt IE 9]><script language="javascript" type="text/javascript" src="excanvas.js"></script><![endif]-->
|
||||
> <script language="javascript" type="text/javascript" src="jquery-1.4.4.min.js"></script>
|
||||
> <script language="javascript" type="text/javascript" src="jquery.jqplot.min.js"></script>
|
||||
> <link rel="stylesheet" type="text/css" href="jquery.jqplot.css" />
|
||||
|
||||
Add a plot container:
|
||||
|
||||
Add a container (target) to your web page where you want your plot to show up.
|
||||
Be sure to give your target a width and a height:
|
||||
|
||||
> <div id="chartdiv" style="height:400px;width:300px; "></div>
|
||||
|
||||
Create a plot:
|
||||
|
||||
Then, create the actual plot by calling the
|
||||
$.jqplot plugin with the id of your target and some data:
|
||||
|
||||
> $.jqplot('chartdiv', [[[1, 2],[3,5.12],[5,13.1],[7,33.6],[9,85.9],[11,219.9]]]);
|
||||
|
||||
Which will produce a
|
||||
chart like:
|
||||
|
||||
(see images/basicline.png)
|
||||
|
||||
Plot Options:
|
||||
|
||||
You can customize the plot by passing options to the $.jqplot function. Options are described in
|
||||
<jqPlot Options> in the jqPlotOptions.txt file. An example of options usage:
|
||||
|
||||
> $.jqplot('chartdiv', [[[1, 2],[3,5.12],[5,13.1],[7,33.6],[9,85.9],[11,219.9]]],
|
||||
> { title:'Exponential Line',
|
||||
> axes:{yaxis:{min:-10, max:240}},
|
||||
> series:[{color:'#5FAB78'}]
|
||||
> });
|
||||
|
||||
Which will produce
|
||||
a plot like:
|
||||
|
||||
(see images/basicoptions.png)
|
||||
|
||||
Using Plugins:
|
||||
|
||||
You can use jqPlot plugins (that is, plugins to the jqPlot plugin) by including them in your html
|
||||
after you include the jqPlot plugin. Here is how to include the log axis plugin:
|
||||
|
||||
> <link rel="stylesheet" type="text/css" href="jquery.jqplot.css" />
|
||||
> <!--[if IE]><script language="javascript" type="text/javascript" src="excanvas.js"></script><![endif]-->
|
||||
> <script language="javascript" type="text/javascript" src="jquery-1.4.4.min.js"></script>
|
||||
> <script language="javascript" type="text/javascript" src="jquery.jqplot.min.js"></script>
|
||||
> <script language="javascript" type="text/javascript" src="jqplot.logAxisRenderer.js"></script>
|
||||
|
||||
Important note: For jqplot builds r529 and above (0.9.7r529 and higher), you must explicitly
|
||||
enable plugins via either the { show: true } plugin option to the plot or by using
|
||||
the $.jqplot.config.enablePlugins = true; config options set on the page before plot creation.
|
||||
Only plugins that can be immediately active upon loading are affected. This includes
|
||||
non-renderer plugins like cursor, dragable, highlighter, and trendline.
|
||||
|
||||
Here is a the same $.jqplot call
|
||||
but with a log y axis:
|
||||
|
||||
> $.jqplot('chartdiv', [[[1, 2],[3,5.12],[5,13.1],[7,33.6],[9,85.9],[11,219.9]]],
|
||||
> { title:'Exponential Line',
|
||||
> axes:{yaxis:{renderer: $.jqplot.LogAxisRenderer}},
|
||||
> series:[{color:'#5FAB78'}]
|
||||
> });
|
||||
|
||||
Which produces
|
||||
a plot like:
|
||||
|
||||
(see images/basiclogaxis.png)
|
||||
|
||||
You can further customize with options specific
|
||||
to the log axis plugin:
|
||||
|
||||
> $.jqplot('chartdiv', [[[1, 2],[3,5.12],[5,13.1],[7,33.6],[9,85.9],[11,219.9]]],
|
||||
> { title:'Exponential Line',
|
||||
> axes:{yaxis:{renderer: $.jqplot.LogAxisRenderer, tickDistribution:'power'}},
|
||||
> series:[{color:'#5FAB78'}]
|
||||
> });
|
||||
|
||||
Which makes a
|
||||
plot like:
|
||||
|
||||
(see images/basiclogoptions.png)
|
||||
|
||||
For a full list of options, see <jqPlot Options> in the jqPlotOptions.txt file.
|
||||
|
||||
You can add as many plugins as you wish. Order is generally not important.
|
||||
Some plugins, like the highlighter plugin which highlights data points near the
|
||||
mouse, don't need any extra options or setup to function. Highlighter does have
|
||||
additional options which the user can set.
|
||||
|
||||
Other plugins, the barRenderer for example, provide functionality the must be specified
|
||||
in the chart options object. To render a series as a bar graph with the bar renderer,
|
||||
you would first include the plugin after jqPlot:
|
||||
|
||||
> <script language="javascript" type="text/javascript" src="plugins/jqplot.barRenderer.min.js"></script>
|
||||
|
||||
Then you would create
|
||||
a chart like:
|
||||
|
||||
> $.jqplot('chartdiv', [[34.53, 56.32, 25.1, 18.6]], {series:[{renderer:$.jqplot.BarRenderer}]});
|
||||
|
||||
Here the default LineRenderer is replaced by a BarRenderer to generate a bar graph for the first (an only) series.
|
Loading…
Reference in New Issue
Block a user