* v0.15 negative values should work now (outcommented a negative -> 0 hook hope it does no harm)
* v0.2 added fill option (thanks to monemihir) and multi axis support (thanks to soewono effendi)
* v0.3 improved saddle handling and added basic handling of Dates
*
*/
(function($){
active: bool true => plugin can be used
apply: bool true => series will be drawn as curved line
varoptions={
fit: bool true => forces the max,mins of the curve to be on the datapoints
series:{
curvePointFactor int defines how many "virtual" points are used per "real" data point to
curvedLines:{
emulate the curvedLines
active:false,
fitPointDist: int defines the x axis distance of the additional two points that are used
show:false,
to enforce the min max condition. (you will get curvePointFactor * 3 * |datapoints|
fit:false,
"virtual" points if fit is true)
fill:false,
fillColor:null,
+ line options (since v0.5 curved lines use flots line implementation for drawing
lineWidth:2,
=> line options like fill, show ... are supported out of the box)
curvePointFactor:20,
fitPointDist:0.0001
}
}
};
functioninit(plot){
*/
plot.hooks.processOptions.push(processOptions);
/*
* v0.1 initial commit
* v0.15 negative values should work now (outcommented a negative -> 0 hook hope it does no harm)
* v0.2 added fill option (thanks to monemihir) and multi axis support (thanks to soewono effendi)
* v0.3 improved saddle handling and added basic handling of Dates
* v0.4 rewritten fill option (thomas ritou) mostly from original flot code (now fill between points rather than to graph bottom), corrected fill Opacity bug
* v0.5 rewritten instead of implementing a own draw function CurvedLines is now based on the processDatapoints flot hook (credits go to thomas ritou).
* This change breakes existing code however CurvedLines are now just many tiny straight lines to flot and therefore all flot lines options (like gradient fill,
* shadow) are now supported out of the box
*/
//if the plugin is active register draw method
(function($){
functionprocessOptions(plot,options){
if(options.series.curvedLines.active){
plot.hooks.draw.push(draw);
}
}
//select the data sets that should be drawn with curved lines and draws them