Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
F
flot
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
HS-public
flot
Commits
c6ddfa56
Commit
c6ddfa56
authored
Dec 03, 2012
by
David Schnur
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #896 from dnschnur/license-headers
Updated license headers for #805.
parents
8df11479
9e21074d
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
452 additions
and
438 deletions
+452
-438
jquery.flot.categories.js
jquery.flot.categories.js
+32
-32
jquery.flot.crosshair.js
jquery.flot.crosshair.js
+41
-36
jquery.flot.errorbars.js
jquery.flot.errorbars.js
+57
-53
jquery.flot.image.js
jquery.flot.image.js
+51
-48
jquery.flot.js
jquery.flot.js
+6
-5
jquery.flot.navigate.js
jquery.flot.navigate.js
+72
-74
jquery.flot.pie.js
jquery.flot.pie.js
+45
-51
jquery.flot.resize.js
jquery.flot.resize.js
+12
-12
jquery.flot.selection.js
jquery.flot.selection.js
+51
-53
jquery.flot.stack.js
jquery.flot.stack.js
+35
-31
jquery.flot.symbol.js
jquery.flot.symbol.js
+10
-9
jquery.flot.threshold.js
jquery.flot.threshold.js
+36
-30
jquery.flot.time.js
jquery.flot.time.js
+4
-4
No files found.
jquery.flot.categories.js
View file @
c6ddfa56
/*
/* Flot plugin for plotting textual data or categories.
Flot plugin for plotting textual data or categories. Consider a
dataset like [["February", 34], ["March", 20], ...]. This plugin
Copyright (c) 2007-2012 IOLA and Ole Laursen.
Licensed under the MIT license.
Consider a dataset like [["February", 34], ["March", 20], ...]. This plugin
allows you to plot such a dataset directly.
allows you to plot such a dataset directly.
To enable it, you must specify mode: "categories" on the axis with the
To enable it, you must specify mode: "categories" on the axis with the
textual
textual
labels, e.g.
labels, e.g.
$.plot("#placeholder", data, { xaxis: { mode: "categories" } });
$.plot("#placeholder", data, { xaxis: { mode: "categories" } });
By default, the labels are ordered as they are met in the data series.
By default, the labels are ordered as they are met in the data series.
If you
If you need a different ordering, you can specify "categories" on the
need a different ordering, you can specify "categories" on the axis options
a
xis options a
nd list the categories there:
and list the categories there:
xaxis: {
xaxis: {
mode: "categories",
mode: "categories",
categories: ["February", "March", "April"]
categories: ["February", "March", "April"]
}
}
If you need to customize the distances between the categories, you can
If you need to customize the distances between the categories, you can
specify
specify
"categories" as an object mapping labels to values
"categories" as an object mapping labels to values
xaxis: {
xaxis: {
mode: "categories",
mode: "categories",
categories: { "February": 1, "March": 3, "April": 4 }
categories: { "February": 1, "March": 3, "April": 4 }
}
}
If you don't specify all categories, the remaining encountered
If you don't specify all categories, the remaining categories will be numbered
categories will be numbered from the max value plus 1 (with a spacing
from the max value plus 1 (with a spacing of 1 between each).
of 1 between each).
Internally, the plugin works by transforming the input data through an auto-
generated mapping where the first category becomes 0, the second 1, etc.
Hence, a point like ["February", 34] becomes [0, 34] internally in Flot (this
is visible in hover and click events that return numbers rather than the
category labels). The plugin also overrides the tick generator to spit out the
categories as ticks instead of the values.
Internally, the plugin works by transforming the input data through an
If you need to map a value back to its label, the mapping is always accessible
auto-generated mapping where the first category becomes 0, the second
as "categories" on the axis object, e.g. plot.getAxes().xaxis.categories.
1, etc. Hence, a point like ["February", 34] becomes [0, 34]
internally in Flot (this is visible in hover and click events that
return numbers rather than the category labels). The plugin also
overrides the tick generator to spit out the categories as ticks
instead of the values.
If you need to map a value back to its label, the mapping is always
accessible as "categories" on the axis object, e.g.
plot.getAxes().xaxis.categories.
*/
*/
(
function
(
$
)
{
(
function
(
$
)
{
...
...
jquery.flot.crosshair.js
View file @
c6ddfa56
/*
/* Flot plugin for showing crosshairs when the mouse hovers over the plot.
Flot plugin for showing crosshairs, thin lines, when the mouse hovers
over the plot.
Copyright (c) 2007-2012 IOLA and Ole Laursen.
Licensed under the MIT license.
The plugin supports these options:
crosshair: {
crosshair: {
mode: null or "x" or "y" or "xy"
mode: null or "x" or "y" or "xy"
...
@@ -8,22 +11,21 @@ over the plot.
...
@@ -8,22 +11,21 @@ over the plot.
lineWidth: number
lineWidth: number
}
}
Set the mode to one of "x", "y" or "xy". The "x" mode enables a
Set the mode to one of "x", "y" or "xy". The "x" mode enables a
vertical
vertical crosshair that lets you trace the values on the x axis, "y"
crosshair that lets you trace the values on the x axis, "y" enables a
enables a horizontal crosshair and "xy" enables them both. "color" is
horizontal crosshair and "xy" enables them both. "color" is the color of the
the color of the crosshair (default is "rgba(170, 0, 0, 0.80)"),
crosshair (default is "rgba(170, 0, 0, 0.80)"), "lineWidth" is the width of
"lineWidth" is the width of
the drawn lines (default is 1).
the drawn lines (default is 1).
The plugin also adds four public methods:
The plugin also adds four public methods:
- setCrosshair(
pos
)
- setCrosshair(
pos
)
Set the position of the crosshair. Note that this is cleared if
Set the position of the crosshair. Note that this is cleared if the user
the user moves the mouse. "pos" is in coordinates of the plot and
moves the mouse. "pos" is in coordinates of the plot and should be on the
should be on the form { x: xpos, y: ypos } (you can use x2/x3/...
form { x: xpos, y: ypos } (you can use x2/x3/... if you're using multiple
if you're using multiple axes), which is coincidentally the same
axes), which is coincidentally the same format as what you get from a
format as what you get from a "plothover" event. If "pos" is null,
"plothover" event. If "pos" is null, the crosshair is cleared.
the crosshair is cleared.
- clearCrosshair()
- clearCrosshair()
...
@@ -31,18 +33,21 @@ The plugin also adds four public methods:
...
@@ -31,18 +33,21 @@ The plugin also adds four public methods:
- lockCrosshair(pos)
- lockCrosshair(pos)
Cause the crosshair to lock to the current location, no longer
Cause the crosshair to lock to the current location, no longer
updating if
updating if the user moves the mouse. Optionally supply a position
the user moves the mouse. Optionally supply a position (passed on to
(passed on to
setCrosshair()) to move it to.
setCrosshair()) to move it to.
Example usage:
Example usage:
var myFlot = $.plot( $("#graph"), ..., { crosshair: { mode: "x" } } };
var myFlot = $.plot( $("#graph"), ..., { crosshair: { mode: "x" } } };
$("#graph").bind("plothover", function (evt, position, item
) {
$("#graph").bind( "plothover", function ( evt, position, item
) {
if (item
) {
if ( item
) {
// Lock the crosshair to the data point being hovered
// Lock the crosshair to the data point being hovered
myFlot.lockCrosshair({ x: item.datapoint[0], y: item.datapoint[1] });
myFlot.lockCrosshair({
}
x: item.datapoint[ 0 ],
else {
y: item.datapoint[ 1 ]
});
} else {
// Return normal crosshair operation
// Return normal crosshair operation
myFlot.unlockCrosshair();
myFlot.unlockCrosshair();
}
}
...
...
jquery.flot.errorbars.js
View file @
c6ddfa56
/*
/* Flot plugin for plotting error bars.
Flot plugin for plotting error bars, i.e. to show standard deviation
and other statistical properties in a plot.
Copyright (c) 2007-2012 IOLA and Ole Laursen.
Licensed under the MIT license.
Error bars are used to show standard deviation and other statistical
properties in a plot.
* Created by Rui Pereira - rui (dot) pereira (at) gmail (dot) com
* Created by Rui Pereira - rui (dot) pereira (at) gmail (dot) com
This plugin allows you to plot error-bars over points. Set "errorbars"
This plugin allows you to plot error-bars over points. Set "errorbars"
inside
inside the points series to the axis name over which there will be
the points series to the axis name over which there will be error values in
error values in your data array (*even* if you do not intend to plot
your data array (*even* if you do not intend to plot them later, by setting
them later, by setting
"show: null" on xerr/yerr).
"show: null" on xerr/yerr).
Options for the plugin are
The plugin supports these options:
series: {
series: {
points: {
points: {
errorbars: "x" or "y" or "xy",
errorbars: "x" or "y" or "xy",
xerr: { show: null/false or true,
xerr: {
show: null/false or true,
asymmetric: null/false or true,
asymmetric: null/false or true,
upperCap: null or "-" or function,
upperCap: null or "-" or function,
lowerCap: null or "-" or function,
lowerCap: null or "-" or function,
color: null or color,
color: null or color,
radius: null or number},
radius: null or number
},
yerr: { same options as xerr }
yerr: { same options as xerr }
}
}
}
}
Each data point array is expected to be of the type
Each data point array is expected to be of the type
:
"x" [x,y,xerr
]
"x" [ x, y, xerr
]
"y" [x,y,yerr
]
"y" [ x, y, yerr
]
"xy" [x,y,xerr,yerr
]
"xy" [ x, y, xerr, yerr
]
where xerr becomes xerr_lower,xerr_upper for the asymmetric error
Where xerr becomes xerr_lower,xerr_upper for the asymmetric error case, and
case, and equivalently for yerr. Eg., a datapoint for the "xy" case
equivalently for yerr. Eg., a datapoint for the "xy" case with symmetric
with symmetric
error-bars on X and asymmetric on Y would be:
error-bars on X and asymmetric on Y would be:
[x,y,xerr,yerr_lower,yerr_upper
]
[ x, y, xerr, yerr_lower, yerr_upper
]
By default no end caps are drawn. Setting upperCap and/or lowerCap to
By default no end caps are drawn. Setting upperCap and/or lowerCap to "-" will
"-" will draw a small cap perpendicular to the error bar. They can
draw a small cap perpendicular to the error bar. They can also be set to a
also be set to a user-defined drawing function, with (ctx, x, y,
user-defined drawing function, with (ctx, x, y, radius) as parameters, as eg.
radius) as parameters, as eg.
function drawSemiCircle(ctx, x, y, radius)
{
function drawSemiCircle( ctx, x, y, radius )
{
ctx.beginPath();
ctx.beginPath();
ctx.arc(x, y, radius, 0, Math.PI, false
);
ctx.arc( x, y, radius, 0, Math.PI, false
);
ctx.moveTo(x - radius, y
);
ctx.moveTo( x - radius, y
);
ctx.lineTo(x + radius, y
);
ctx.lineTo( x + radius, y
);
ctx.stroke();
ctx.stroke();
}
}
Color and radius both default to the same ones of the points series if
Color and radius both default to the same ones of the points series if not
not set. The independent radius parameter on xerr/yerr is useful for
set. The independent radius parameter on xerr/yerr is useful for the case when
the case when we may want to add error-bars to a line, without showing
we may want to add error-bars to a line, without showing the interconnecting
the interconnecting points (with radius: 0), and still showing end
points (with radius: 0), and still showing end caps on the error-bars.
caps on the error-bars. shadowSize and lineWidth are derived as well
shadowSize and lineWidth are derived as well from the points series.
from the points series.
*/
*/
...
...
jquery.flot.image.js
View file @
c6ddfa56
/*
/* Flot plugin for plotting images.
Flot plugin for plotting images, e.g. useful for putting ticks on a
prerendered complex visualization.
Copyright (c) 2007-2012 IOLA and Ole Laursen.
Licensed under the MIT license.
The data syntax is [[image, x1, y1, x2, y2], ...] where (x1, y1) and
(x2, y2) are where you intend the two opposite corners of the image to
The data syntax is [ [ image, x1, y1, x2, y2 ], ... ] where (x1, y1) and
end up in the plot. Image must be a fully loaded Javascript image (you
(x2, y2) are where you intend the two opposite corners of the image to end up
can make one with new Image()). If the image is not complete, it's
in the plot. Image must be a fully loaded Javascript image (you can make one
skipped when plotting.
with new Image()). If the image is not complete, it's skipped when plotting.
There are two helpers included for retrieving images. The easiest work
There are two helpers included for retrieving images. The easiest work the way
the way that you put in URLs instead of images in the data (like
that you put in URLs instead of images in the data, like this:
["myimage.png", 0, 0, 10, 10]), then call $.plot.image.loadData(data,
options, callback) where data and options are the same as you pass in
[ "myimage.png", 0, 0, 10, 10 ]
to $.plot. This loads the images, replaces the URLs in the data with
the corresponding images and calls "callback" when all images are
Then call $.plot.image.loadData( data, options, callback ) where data and
loaded (or failed loading). In the callback, you can then call $.plot
options are the same as you pass in to $.plot. This loads the images, replaces
with the data set. See the included example.
the URLs in the data with the corresponding images and calls "callback" when
all images are loaded (or failed loading). In the callback, you can then call
A more low-level helper, $.plot.image.load(urls, callback) is also
$.plot with the data set. See the included example.
included. Given a list of URLs, it calls callback with an object
mapping from URL to Image object when all images are loaded or have
A more low-level helper, $.plot.image.load(urls, callback) is also included.
failed loading.
Given a list of URLs, it calls callback with an object mapping from URL to
Image object when all images are loaded or have failed loading.
Options for the plugin are
The plugin supports these options:
series: {
series: {
images: {
images: {
show: boolean
show: boolean
anchor: "corner" or "center"
anchor: "corner" or "center"
alpha: [0,1
]
alpha: [ 0, 1
]
}
}
}
}
which can be specified for a specific series
They can be specified for a specific series:
$.plot($("#placeholder"), [{ data: [ ... ], images: { ... } ])
Note that because the data format is different from usual data points,
$.plot( $("#placeholder"), [{
you can't use images with anything else in a specific data series.
data: [ ... ],
images: { ... }
])
Setting "anchor" to "center" causes the pixels in the image to be
Note that because the data format is different from usual data points, you
anchored at the corner pixel centers inside of at the pixel corners,
can't use images with anything else in a specific data series.
effectively letting half a pixel stick out to each side in the plot.
Setting "anchor" to "center" causes the pixels in the image to be anchored at
the corner pixel centers inside of at the pixel corners, effectively letting
half a pixel stick out to each side in the plot.
A possible future direction could be support for tiling for large
A possible future direction could be support for tiling for large
images (like
images (like
Google Maps).
Google Maps).
*/
*/
...
...
jquery.flot.js
View file @
c6ddfa56
/*! Javascript plotting library for jQuery, version 0.8 alpha.
/* Javascript plotting library for jQuery, version 0.8 alpha.
*
* Released under the MIT license by IOLA, December 2007.
Copyright (c) 2007-2012 IOLA and Ole Laursen.
*
Licensed under the MIT license.
*/
*/
// first an inline dependency, jquery.colorhelpers.js, we inline it here
// first an inline dependency, jquery.colorhelpers.js, we inline it here
// for convenience
// for convenience
...
...
jquery.flot.navigate.js
View file @
c6ddfa56
/*
/* Flot plugin for adding the ability to pan and zoom the plot.
Flot plugin for adding panning and zooming capabilities to a plot.
Copyright (c) 2007-2012 IOLA and Ole Laursen.
Licensed under the MIT license.
The default behaviour is double click and scrollwheel up/down to zoom
The default behaviour is double click and scrollwheel up/down to zoom in, drag
in, drag to pan. The plugin defines plot.zoom({ center }),
to pan. The plugin defines plot.zoom({ center }), plot.zoomOut() and
plot.zoomOut() and plot.pan(offset) so you easily can add custom
plot.pan( offset ) so you easily can add custom controls. It also fires
controls. It also fires a "plotpan" and "plotzoom" event when
"plotpan" and "plotzoom" events, useful for synchronizing plots.
something happens, useful for synchronizing plots.
O
ptions:
The plugin supports these o
ptions:
zoom: {
zoom: {
interactive: false
interactive: false
...
@@ -22,41 +23,41 @@ Options:
...
@@ -22,41 +23,41 @@ Options:
}
}
xaxis, yaxis, x2axis, y2axis: {
xaxis, yaxis, x2axis, y2axis: {
zoomRange: null // or [number, number
] (min range, max range) or false
zoomRange: null // or [ number, number
] (min range, max range) or false
panRange: null // or [number, number
] (min, max) or false
panRange: null // or [ number, number
] (min, max) or false
}
}
"interactive" enables the built-in drag/click behaviour. If you enable
"interactive" enables the built-in drag/click behaviour. If you enable
interactive for pan, then you'll have a basic plot that supports
interactive for pan, then you'll have a basic plot that supports
moving
moving
around; the same for zoom.
around; the same for zoom.
"amount" specifies the default amount to zoom in (so 1.5 = 150%)
"amount" specifies the default amount to zoom in (so 1.5 = 150%)
relative to
relative to
the current viewport.
the current viewport.
"cursor" is a standard CSS mouse cursor string used for visual
"cursor" is a standard CSS mouse cursor string used for visual
feedback to the
feedback to the
user when dragging.
user when dragging.
"frameRate" specifies the maximum number of times per second the plot
"frameRate" specifies the maximum number of times per second the plot
will
will update itself while the user is panning around on it (set to null
update itself while the user is panning around on it (set to null to disable
to disable intermediate pans, the plot will then not update until the
intermediate pans, the plot will then not update until the mouse button is
mouse button is
released).
released).
"zoomRange" is the interval in which zooming can happen, e.g. with
"zoomRange" is the interval in which zooming can happen, e.g. with
zoomRange:
zoomRange: [1, 100] the zoom will never scale the axis so that the
[1, 100] the zoom will never scale the axis so that the difference between min
difference between min and max is smaller than 1 or larger than 100.
and max is smaller than 1 or larger than 100. You can set either end to null
You can set either end to null to ignore, e.g. [1, null]. If you set
to ignore, e.g. [1, null]. If you set zoomRange to false, zooming on that axis
zoomRange to false, zooming on that axis
will be disabled.
will be disabled.
"panRange" confines the panning to stay within a range, e.g. with
"panRange" confines the panning to stay within a range, e.g. with
panRange:
panRange: [-10, 20] panning stops at -10 in one end and at 20 in the
[-10, 20] panning stops at -10 in one end and at 20 in the other. Either can
other. Either can be null, e.g. [-10, null]. If you set
be null, e.g. [-10, null]. If you set panRange to false, panning on that axis
panRange to false, panning on that axis
will be disabled.
will be disabled.
Example API usage:
Example API usage:
plot = $.plot(...);
plot = $.plot(...);
// zoom default amount in on the pixel (10, 20)
// zoom default amount in on the pixel ( 10, 20 )
plot.zoom({ center: { left: 10, top: 20 } });
plot.zoom({ center: { left: 10, top: 20 } });
// zoom out again
// zoom out again
...
@@ -68,18 +69,16 @@ Example API usage:
...
@@ -68,18 +69,16 @@ Example API usage:
// pan 100 pixels to the left and 20 down
// pan 100 pixels to the left and 20 down
plot.pan({ left: -100, top: 20 })
plot.pan({ left: -100, top: 20 })
Here, "center" specifies where the center of the zooming should
Here, "center" specifies where the center of the zooming should happen. Note
happen. Note that this is defined in pixel space, not the space of the
that this is defined in pixel space, not the space of the data points (you can
data points (you can use the p2c helpers on the axes in Flot to help
use the p2c helpers on the axes in Flot to help you convert between these).
you convert between these).
"amount" is the amount to zoom the viewport relative to the current
"amount" is the amount to zoom the viewport relative to the current
range, so
range, so 1 is 100% (i.e. no change), 1.5 is 150% (zoom in), 0.7 is
1 is 100% (i.e. no change), 1.5 is 150% (zoom in), 0.7 is 70% (zoom out). You
70% (zoom out). You
can set the default in the options.
can set the default in the options.
*/
*/
// First two dependencies, jquery.event.drag.js and
// First two dependencies, jquery.event.drag.js and
// jquery.mousewheel.js, we put them inline here to save people the
// jquery.mousewheel.js, we put them inline here to save people the
// effort of downloading them.
// effort of downloading them.
...
@@ -90,7 +89,6 @@ Licensed under the MIT License ~ http://threedubmedia.googlecode.com/files/MIT-L
...
@@ -90,7 +89,6 @@ Licensed under the MIT License ~ http://threedubmedia.googlecode.com/files/MIT-L
*/
*/
(
function
(
E
){
E
.
fn
.
drag
=
function
(
L
,
K
,
J
){
if
(
K
){
this
.
bind
(
"dragstart"
,
L
)}
if
(
J
){
this
.
bind
(
"dragend"
,
J
)}
return
!
L
?
this
.
trigger
(
"drag"
):
this
.
bind
(
"drag"
,
K
?
K
:
L
)};
var
A
=
E
.
event
,
B
=
A
.
special
,
F
=
B
.
drag
=
{
not
:
":input"
,
distance
:
0
,
which
:
1
,
dragging
:
false
,
setup
:
function
(
J
){
J
=
E
.
extend
({
distance
:
F
.
distance
,
which
:
F
.
which
,
not
:
F
.
not
},
J
||
{});
J
.
distance
=
I
(
J
.
distance
);
A
.
add
(
this
,
"mousedown"
,
H
,
J
);
if
(
this
.
attachEvent
){
this
.
attachEvent
(
"ondragstart"
,
D
)}},
teardown
:
function
(){
A
.
remove
(
this
,
"mousedown"
,
H
);
if
(
this
===
F
.
dragging
){
F
.
dragging
=
F
.
proxy
=
false
}
G
(
this
,
true
);
if
(
this
.
detachEvent
){
this
.
detachEvent
(
"ondragstart"
,
D
)}}};
B
.
dragstart
=
B
.
dragend
=
{
setup
:
function
(){},
teardown
:
function
(){}};
function
H
(
L
){
var
K
=
this
,
J
,
M
=
L
.
data
||
{};
if
(
M
.
elem
){
K
=
L
.
dragTarget
=
M
.
elem
;
L
.
dragProxy
=
F
.
proxy
||
K
;
L
.
cursorOffsetX
=
M
.
pageX
-
M
.
left
;
L
.
cursorOffsetY
=
M
.
pageY
-
M
.
top
;
L
.
offsetX
=
L
.
pageX
-
L
.
cursorOffsetX
;
L
.
offsetY
=
L
.
pageY
-
L
.
cursorOffsetY
}
else
{
if
(
F
.
dragging
||
(
M
.
which
>
0
&&
L
.
which
!=
M
.
which
)
||
E
(
L
.
target
).
is
(
M
.
not
)){
return
}}
switch
(
L
.
type
){
case
"mousedown"
:
E
.
extend
(
M
,
E
(
K
).
offset
(),{
elem
:
K
,
target
:
L
.
target
,
pageX
:
L
.
pageX
,
pageY
:
L
.
pageY
});
A
.
add
(
document
,
"mousemove mouseup"
,
H
,
M
);
G
(
K
,
false
);
F
.
dragging
=
null
;
return
false
;
case
!
F
.
dragging
&&
"mousemove"
:
if
(
I
(
L
.
pageX
-
M
.
pageX
)
+
I
(
L
.
pageY
-
M
.
pageY
)
<
M
.
distance
){
break
}
L
.
target
=
M
.
target
;
J
=
C
(
L
,
"dragstart"
,
K
);
if
(
J
!==
false
){
F
.
dragging
=
K
;
F
.
proxy
=
L
.
dragProxy
=
E
(
J
||
K
)[
0
]}
case
"mousemove"
:
if
(
F
.
dragging
){
J
=
C
(
L
,
"drag"
,
K
);
if
(
B
.
drop
){
B
.
drop
.
allowed
=
(
J
!==
false
);
B
.
drop
.
handler
(
L
)}
if
(
J
!==
false
){
break
}
L
.
type
=
"mouseup"
}
case
"mouseup"
:
A
.
remove
(
document
,
"mousemove mouseup"
,
H
);
if
(
F
.
dragging
){
if
(
B
.
drop
){
B
.
drop
.
handler
(
L
)}
C
(
L
,
"dragend"
,
K
)}
G
(
K
,
true
);
F
.
dragging
=
F
.
proxy
=
M
.
elem
=
false
;
break
}
return
true
}
function
C
(
M
,
K
,
L
){
M
.
type
=
K
;
var
J
=
E
.
event
.
handle
.
call
(
L
,
M
);
return
J
===
false
?
false
:
J
||
M
.
result
}
function
I
(
J
){
return
Math
.
pow
(
J
,
2
)}
function
D
(){
return
(
F
.
dragging
===
false
)}
function
G
(
K
,
J
){
if
(
!
K
){
return
}
K
.
unselectable
=
J
?
"off"
:
"on"
;
K
.
onselectstart
=
function
(){
return
J
};
if
(
K
.
style
){
K
.
style
.
MozUserSelect
=
J
?
""
:
"none"
}}})(
jQuery
);
(
function
(
E
){
E
.
fn
.
drag
=
function
(
L
,
K
,
J
){
if
(
K
){
this
.
bind
(
"dragstart"
,
L
)}
if
(
J
){
this
.
bind
(
"dragend"
,
J
)}
return
!
L
?
this
.
trigger
(
"drag"
):
this
.
bind
(
"drag"
,
K
?
K
:
L
)};
var
A
=
E
.
event
,
B
=
A
.
special
,
F
=
B
.
drag
=
{
not
:
":input"
,
distance
:
0
,
which
:
1
,
dragging
:
false
,
setup
:
function
(
J
){
J
=
E
.
extend
({
distance
:
F
.
distance
,
which
:
F
.
which
,
not
:
F
.
not
},
J
||
{});
J
.
distance
=
I
(
J
.
distance
);
A
.
add
(
this
,
"mousedown"
,
H
,
J
);
if
(
this
.
attachEvent
){
this
.
attachEvent
(
"ondragstart"
,
D
)}},
teardown
:
function
(){
A
.
remove
(
this
,
"mousedown"
,
H
);
if
(
this
===
F
.
dragging
){
F
.
dragging
=
F
.
proxy
=
false
}
G
(
this
,
true
);
if
(
this
.
detachEvent
){
this
.
detachEvent
(
"ondragstart"
,
D
)}}};
B
.
dragstart
=
B
.
dragend
=
{
setup
:
function
(){},
teardown
:
function
(){}};
function
H
(
L
){
var
K
=
this
,
J
,
M
=
L
.
data
||
{};
if
(
M
.
elem
){
K
=
L
.
dragTarget
=
M
.
elem
;
L
.
dragProxy
=
F
.
proxy
||
K
;
L
.
cursorOffsetX
=
M
.
pageX
-
M
.
left
;
L
.
cursorOffsetY
=
M
.
pageY
-
M
.
top
;
L
.
offsetX
=
L
.
pageX
-
L
.
cursorOffsetX
;
L
.
offsetY
=
L
.
pageY
-
L
.
cursorOffsetY
}
else
{
if
(
F
.
dragging
||
(
M
.
which
>
0
&&
L
.
which
!=
M
.
which
)
||
E
(
L
.
target
).
is
(
M
.
not
)){
return
}}
switch
(
L
.
type
){
case
"mousedown"
:
E
.
extend
(
M
,
E
(
K
).
offset
(),{
elem
:
K
,
target
:
L
.
target
,
pageX
:
L
.
pageX
,
pageY
:
L
.
pageY
});
A
.
add
(
document
,
"mousemove mouseup"
,
H
,
M
);
G
(
K
,
false
);
F
.
dragging
=
null
;
return
false
;
case
!
F
.
dragging
&&
"mousemove"
:
if
(
I
(
L
.
pageX
-
M
.
pageX
)
+
I
(
L
.
pageY
-
M
.
pageY
)
<
M
.
distance
){
break
}
L
.
target
=
M
.
target
;
J
=
C
(
L
,
"dragstart"
,
K
);
if
(
J
!==
false
){
F
.
dragging
=
K
;
F
.
proxy
=
L
.
dragProxy
=
E
(
J
||
K
)[
0
]}
case
"mousemove"
:
if
(
F
.
dragging
){
J
=
C
(
L
,
"drag"
,
K
);
if
(
B
.
drop
){
B
.
drop
.
allowed
=
(
J
!==
false
);
B
.
drop
.
handler
(
L
)}
if
(
J
!==
false
){
break
}
L
.
type
=
"mouseup"
}
case
"mouseup"
:
A
.
remove
(
document
,
"mousemove mouseup"
,
H
);
if
(
F
.
dragging
){
if
(
B
.
drop
){
B
.
drop
.
handler
(
L
)}
C
(
L
,
"dragend"
,
K
)}
G
(
K
,
true
);
F
.
dragging
=
F
.
proxy
=
M
.
elem
=
false
;
break
}
return
true
}
function
C
(
M
,
K
,
L
){
M
.
type
=
K
;
var
J
=
E
.
event
.
handle
.
call
(
L
,
M
);
return
J
===
false
?
false
:
J
||
M
.
result
}
function
I
(
J
){
return
Math
.
pow
(
J
,
2
)}
function
D
(){
return
(
F
.
dragging
===
false
)}
function
G
(
K
,
J
){
if
(
!
K
){
return
}
K
.
unselectable
=
J
?
"off"
:
"on"
;
K
.
onselectstart
=
function
(){
return
J
};
if
(
K
.
style
){
K
.
style
.
MozUserSelect
=
J
?
""
:
"none"
}}})(
jQuery
);
/* jquery.mousewheel.min.js
/* jquery.mousewheel.min.js
* Copyright (c) 2011 Brandon Aaron (http://brandonaaron.net)
* Copyright (c) 2011 Brandon Aaron (http://brandonaaron.net)
* Licensed under the MIT License (LICENSE.txt).
* Licensed under the MIT License (LICENSE.txt).
...
...
jquery.flot.pie.js
View file @
c6ddfa56
/*
/* Flot plugin for rendering pie charts.
Flot plugin for rendering pie charts.
Copyright (c) 2007-2012 IOLA and Ole Laursen.
Copyright (c) 2007-2012 IOLA and Ole Laursen.
Licensed under the MIT license.
Licensed under the MIT license.
The plugin assumes that each series has a single data value, and that
The plugin assumes that each series has a single data value, and that
each
each value is a positive integer or zero. Negative numbers don't make
value is a positive integer or zero. Negative numbers don't make sense for a
sense for a pie chart, and have unpredictable results. The values do
pie chart, and have unpredictable results. The values do NOT need to be
NOT need to be passed in as percentages; the plugin will calculate th
e
passed in as percentages; the plugin will calculate the total and per-slic
e
total and per-slice
percentages internally.
percentages internally.
* Created by Brian Medendorp, June 2009
* Created by Brian Medendorp
* Updated November 2009 with contributions from: btburnett3, Anthony Aragues and Xavi Ivars
* Changes:
* Updated with contributions from btburnett3, Anthony Aragues and Xavi Ivars
2009-10-22: lineJoin set to round
2009-10-23: IE full circle fix, donut
2009-11-11: Added basic hover from btburnett3 - does not work in IE, and center is off in Chrome and Opera
2009-11-17: Added IE hover capability submitted by Anthony Aragues
2009-11-18: Added bug fix submitted by Xavi Ivars (issues with arrays when other JS libraries are included as well)
Available options are:
The plugin supports these options:
series: {
series: {
pie: {
pie: {
show: true/false
show: true/false
radius: 0-1 for percentage of fullsize, or a specified pixel length, or 'auto'
radius: 0-1 for percentage of fullsize, or a specified pixel length, or 'auto'
...
@@ -55,7 +49,7 @@ series: {
...
@@ -55,7 +49,7 @@ series: {
opacity: 0-1
opacity: 0-1
}
}
}
}
}
}
More detail and specific examples can be found in the included HTML file.
More detail and specific examples can be found in the included HTML file.
...
...
jquery.flot.resize.js
View file @
c6ddfa56
/*
/* Flot plugin for automatically redrawing plots as the placeholder resizes.
Flot plugin for automatically redrawing plots when the placeholder
size changes, e.g. on window resizes.
It works by listening for changes on the placeholder div (through the
Copyright (c) 2007-2012 IOLA and Ole Laursen.
jQuery resize event plugin) - if the size changes, it will redraw the
Licensed under the MIT license.
plot.
There are no options. If you need to disable the plugin for some
It works by listening for changes on the placeholder div (through the jQuery
plots, you can just fix the size of their placeholders.
resize event plugin) - if the size changes, it will redraw the plot.
*/
There are no options. If you need to disable the plugin for some plots, you
can just fix the size of their placeholders.
*/
/* Inline dependency:
/* Inline dependency:
* jQuery resize event - v1.1 - 3/14/2010
* jQuery resize event - v1.1 - 3/14/2010
...
@@ -19,8 +19,8 @@ plots, you can just fix the size of their placeholders.
...
@@ -19,8 +19,8 @@ plots, you can just fix the size of their placeholders.
* Dual licensed under the MIT and GPL licenses.
* Dual licensed under the MIT and GPL licenses.
* http://benalman.com/about/license/
* http://benalman.com/about/license/
*/
*/
(
function
(
$
,
h
,
c
){
var
a
=
$
([]),
e
=
$
.
resize
=
$
.
extend
(
$
.
resize
,{}),
i
,
k
=
"setTimeout"
,
j
=
"resize"
,
d
=
j
+
"-special-event"
,
b
=
"delay"
,
f
=
"throttleWindow"
;
e
[
b
]
=
250
;
e
[
f
]
=
true
;
$
.
event
.
special
[
j
]
=
{
setup
:
function
(){
if
(
!
e
[
f
]
&&
this
[
k
]){
return
false
}
var
l
=
$
(
this
);
a
=
a
.
add
(
l
);
$
.
data
(
this
,
d
,{
w
:
l
.
width
(),
h
:
l
.
height
()});
if
(
a
.
length
===
1
){
g
()}},
teardown
:
function
(){
if
(
!
e
[
f
]
&&
this
[
k
]){
return
false
}
var
l
=
$
(
this
);
a
=
a
.
not
(
l
);
l
.
removeData
(
d
);
if
(
!
a
.
length
){
clearTimeout
(
i
)}},
add
:
function
(
l
){
if
(
!
e
[
f
]
&&
this
[
k
]){
return
false
}
var
n
;
function
m
(
s
,
o
,
p
){
var
q
=
$
(
this
),
r
=
$
.
data
(
this
,
d
);
r
.
w
=
o
!==
c
?
o
:
q
.
width
();
r
.
h
=
p
!==
c
?
p
:
q
.
height
();
n
.
apply
(
this
,
arguments
)}
if
(
$
.
isFunction
(
l
)){
n
=
l
;
return
m
}
else
{
n
=
l
.
handler
;
l
.
handler
=
m
}}};
function
g
(){
i
=
h
[
k
](
function
(){
a
.
each
(
function
(){
var
n
=
$
(
this
),
m
=
n
.
width
(),
l
=
n
.
height
(),
o
=
$
.
data
(
this
,
d
);
if
(
m
!==
o
.
w
||
l
!==
o
.
h
){
n
.
trigger
(
j
,[
o
.
w
=
m
,
o
.
h
=
l
])}});
g
()},
e
[
b
])}})(
jQuery
,
this
);
(
function
(
$
,
h
,
c
){
var
a
=
$
([]),
e
=
$
.
resize
=
$
.
extend
(
$
.
resize
,{}),
i
,
k
=
"setTimeout"
,
j
=
"resize"
,
d
=
j
+
"-special-event"
,
b
=
"delay"
,
f
=
"throttleWindow"
;
e
[
b
]
=
250
;
e
[
f
]
=
true
;
$
.
event
.
special
[
j
]
=
{
setup
:
function
(){
if
(
!
e
[
f
]
&&
this
[
k
]){
return
false
}
var
l
=
$
(
this
);
a
=
a
.
add
(
l
);
$
.
data
(
this
,
d
,{
w
:
l
.
width
(),
h
:
l
.
height
()});
if
(
a
.
length
===
1
){
g
()}},
teardown
:
function
(){
if
(
!
e
[
f
]
&&
this
[
k
]){
return
false
}
var
l
=
$
(
this
);
a
=
a
.
not
(
l
);
l
.
removeData
(
d
);
if
(
!
a
.
length
){
clearTimeout
(
i
)}},
add
:
function
(
l
){
if
(
!
e
[
f
]
&&
this
[
k
]){
return
false
}
var
n
;
function
m
(
s
,
o
,
p
){
var
q
=
$
(
this
),
r
=
$
.
data
(
this
,
d
);
r
.
w
=
o
!==
c
?
o
:
q
.
width
();
r
.
h
=
p
!==
c
?
p
:
q
.
height
();
n
.
apply
(
this
,
arguments
)}
if
(
$
.
isFunction
(
l
)){
n
=
l
;
return
m
}
else
{
n
=
l
.
handler
;
l
.
handler
=
m
}}};
function
g
(){
i
=
h
[
k
](
function
(){
a
.
each
(
function
(){
var
n
=
$
(
this
),
m
=
n
.
width
(),
l
=
n
.
height
(),
o
=
$
.
data
(
this
,
d
);
if
(
m
!==
o
.
w
||
l
!==
o
.
h
){
n
.
trigger
(
j
,[
o
.
w
=
m
,
o
.
h
=
l
])}});
g
()},
e
[
b
])}})(
jQuery
,
this
);
(
function
(
$
)
{
(
function
(
$
)
{
var
options
=
{
};
// no options
var
options
=
{
};
// no options
...
...
jquery.flot.selection.js
View file @
c6ddfa56
/*
/* Flot plugin for selecting regions of a plot.
Flot plugin for selecting regions.
The plugin defines the following options:
Copyright (c) 2007-2012 IOLA and Ole Laursen.
Licensed under the MIT license.
selection: {
The plugin supports these options:
selection: {
mode: null or "x" or "y" or "xy",
mode: null or "x" or "y" or "xy",
color: color
color: color
}
}
Selection support is enabled by setting the mode to one of "x", "y" or
Selection support is enabled by setting the mode to one of "x", "y" or "xy".
"xy". In "x" mode, the user will only be able to specify the x range,
In "x" mode, the user will only be able to specify the x range, similarly for
similarly for "y" mode. For "xy", the selection becomes a rectangle
"y" mode. For "xy", the selection becomes a rectangle where both ranges can be
where both ranges can be specified. "color" is color of the selection
specified. "color" is color of the selection (if you need to change the color
(if you need to change the color later on, you can get to it with
later on, you can get to it with plot.getOptions().selection.color).
plot.getOptions().selection.color).
When selection support is enabled, a "plotselected" event will be
When selection support is enabled, a "plotselected" event will be emitted on
emitted on the DOM element you passed into the plot function. The
the DOM element you passed into the plot function. The event handler gets a
event handler gets a parameter with the ranges selected on the axes,
parameter with the ranges selected on the axes, like this:
like this:
placeholder.bind("plotselected", function(event, ranges
) {
placeholder.bind( "plotselected", function( event, ranges
) {
alert("You selected " + ranges.xaxis.from + " to " + ranges.xaxis.to)
alert("You selected " + ranges.xaxis.from + " to " + ranges.xaxis.to)
// similar for yaxis - with multiple axes, the extra ones are in
// similar for yaxis - with multiple axes, the extra ones are in
// x2axis, x3axis, ...
// x2axis, x3axis, ...
});
});
The "plotselected" event is only fired when the user has finished
The "plotselected" event is only fired when the user has finished
making the
making the selection. A "plotselecting" event is fired during th
e
selection. A "plotselecting" event is fired during the process with the sam
e
p
rocess with the same parameters as the "plotselected" event, in case
p
arameters as the "plotselected" event, in case you want to know what's
you want to know what's
happening while it's happening,
happening while it's happening,
A "plotunselected" event with no arguments is emitted when the user
A "plotunselected" event with no arguments is emitted when the user
clicks the
clicks the
mouse to remove the selection.
mouse to remove the selection.
The plugin allso adds the following methods to the plot object:
The plugin allso adds the following methods to the plot object:
- setSelection(
ranges, preventEvent
)
- setSelection(
ranges, preventEvent
)
Set the selection rectangle. The passed in ranges is on the same
Set the selection rectangle. The passed in ranges is on the same
form as
form as returned in the "plotselected" event. If the selection mode
returned in the "plotselected" event. If the selection mode is "x", you
is "x", you should put in either an xaxis range, if the mode is "y"
should put in either an xaxis range, if the mode is "y" you need to put in
you need to put in an yaxis range and both xaxis and yaxis if th
e
an yaxis range and both xaxis and yaxis if the selection mode is "xy", lik
e
selection mode is "xy", like
this:
this:
setSelection({ xaxis: { from: 0, to: 10 }, yaxis: { from: 40, to: 60 } });
setSelection({ xaxis: { from: 0, to: 10 }, yaxis: { from: 40, to: 60 } });
setSelection will trigger the "plotselected" event when called. If
setSelection will trigger the "plotselected" event when called. If you don't
you don't want that to happen, e.g. if you're inside a
want that to happen, e.g. if you're inside a "plotselected" handler, pass
"plotselected" handler, pass true as the second parameter. If you
true as the second parameter. If you are using multiple axes, you can
are using multiple axes, you can specify the ranges on any of those,
specify the ranges on any of those, e.g. as x2axis/x3axis/... instead of
e.g. as x2axis/x3axis/... instead of xaxis, the plugin picks the
xaxis, the plugin picks the first one it sees.
first one it sees.
- clearSelection(
preventEvent
)
- clearSelection(
preventEvent
)
Clear the selection rectangle. Pass in true to avoid getting a
Clear the selection rectangle. Pass in true to avoid getting a
"plotunselected" event.
"plotunselected" event.
- getSelection()
- getSelection()
Returns the current selection in the same format as the
Returns the current selection in the same format as the "plotselected"
"plotselected" event. If there's currently no selection, the
event. If there's currently no selection, the function returns null.
function returns null.
*/
*/
...
...
jquery.flot.stack.js
View file @
c6ddfa56
/*
/*
Flot plugin for stacking data sets rather than overlyaing them.
Flot plugin for stacking data sets, i.e. putting them on top of each
other, for accumulative graphs
.
Copyright (c) 2007-2012 IOLA and Ole Laursen
.
Licensed under the MIT license.
The plugin assumes the data is sorted on x (or y if stacking
horizontally). For line charts, it is assumed that if a line has an
The plugin assumes the data is sorted on x (or y if stacking horizontally).
undefined gap (from a null point), then the line above it should have
For line charts, it is assumed that if a line has an undefined gap (from a
the same gap - insert zeros instead of "null" if you want another
null point), then the line above it should have the same gap - insert zeros
behaviour. This also holds for the start and end of the chart. Note
instead of "null" if you want another behaviour. This also holds for the start
that stacking a mix of positive and negative values in most instanc
es
and end of the chart. Note that stacking a mix of positive and negative valu
es
doesn't make sense (so it looks weird).
in most instances
doesn't make sense (so it looks weird).
Two or more series are stacked when their "stack" attribute is set to
Two or more series are stacked when their "stack" attribute is set to
the same
the same key (which can be any number or string or just "true"). To
key (which can be any number or string or just "true"). To specify the default
s
pecify the default stack, you can set
s
tack, you can set the stack option like this:
series: {
series: {
stack: null or true or key (number/string)
stack: null or true or key (number/string)
}
}
or specify it for a specific series
You can also specify it for a single series, like this:
$.plot( $("#placeholder"), [{
data: [ ... ],
stack: true
}])
$.plot($("#placeholder"), [{ data: [ ... ], stack: true }])
The stacking order is determined by the order of the data series in the array
(later series end up on top of the previous).
The stacking order is determined by the order of the data series in
Internally, the plugin modifies the datapoints in each series, adding an
the array (later series end up on top of the previous).
offset to the y value. For line series, extra data points are inserted through
interpolation. If there's a second y value, it's also adjusted (e.g for bar
charts or filled areas).
Internally, the plugin modifies the datapoints in each series, adding
an offset to the y value. For line series, extra data points are
inserted through interpolation. If there's a second y value, it's also
adjusted (e.g for bar charts or filled areas).
*/
*/
(
function
(
$
)
{
(
function
(
$
)
{
...
...
jquery.flot.symbol.js
View file @
c6ddfa56
/*
/* Flot plugin that adds some extra symbols for plotting points.
Flot plugin that adds some extra symbols for plotting points.
The symbols are accessed as strings through the standard symbol
Copyright (c) 2007-2012 IOLA and Ole Laursen.
choice:
Licensed under the MIT license.
The symbols are accessed as strings through the standard symbol options:
series: {
series: {
points: {
points: {
...
...
jquery.flot.threshold.js
View file @
c6ddfa56
/*
/* Flot plugin for thresholding data.
Flot plugin for thresholding data. Controlled through the option
"threshold" in either the global series options
Copyright (c) 2007-2012 IOLA and Ole Laursen.
Licensed under the MIT license.
The plugin supports these options:
series: {
series: {
threshold: {
threshold: {
...
@@ -9,11 +12,14 @@ Flot plugin for thresholding data. Controlled through the option
...
@@ -9,11 +12,14 @@ Flot plugin for thresholding data. Controlled through the option
}
}
}
}
or in a specific series
It can also be applied to a single series, like this:
$.plot($("#placeholder"), [{ data: [ ... ], threshold: { ... }}])
$.plot( $("#placeholder"), [{
data: [ ... ],
threshold: { ... }
}])
An array can be passed for multiple thresholding
An array can be passed for multiple thresholding
, like this:
threshold: [{
threshold: [{
below: number1
below: number1
...
@@ -23,17 +29,17 @@ An array can be passed for multiple thresholding
...
@@ -23,17 +29,17 @@ An array can be passed for multiple thresholding
color: color2
color: color2
}]
}]
These multiple threshold objects can be passed in any order since they
These multiple threshold objects can be passed in any order since they are
are sorted by the processing function.
sorted by the processing function.
The data points below "below" are drawn with the specified color. This makes
it easy to mark points below 0, e.g. for budget data.
The data points below "below" are drawn with the specified color. This
Internally, the plugin works by splitting the data into two series, above and
makes it easy to mark points below 0, e.g. for budget data.
below the threshold. The extra series below the threshold will have its label
cleared and the special "originSeries" attribute set to the original series.
You may need to check for this in hover events.
Internally, the plugin works by splitting the data into two series,
above and below the threshold. The extra series below the threshold
will have its label cleared and the special "originSeries" attribute
set to the original series. You may need to check for this in hover
events.
*/
*/
(
function
(
$
)
{
(
function
(
$
)
{
...
...
jquery.flot.time.js
View file @
c6ddfa56
/*
/* Pretty handling of time axes.
Pretty handling of time axes.
Copyright (c) 2007-2012 IOLA and Ole Laursen.
Copyright (c) 2007-2012 IOLA and Ole Laursen.
Licensed under the MIT license.
Licensed under the MIT license.
Set axis.mode to "time" to enable. See the section "Time series data" in API.txt
Set axis.mode to "time" to enable. See the section "Time series data" in
for details.
API.txt for details.
*/
*/
(
function
(
$
)
{
(
function
(
$
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment