apply: bool true => series will be drawn as curved line
apply: bool true => series will be drawn as curved line
fit: bool true => forces the max,mins of the curve to be on the datapoints
fit: bool true => forces the max,mins of the curve to be on the datapoints
curvePointFactor number defines how many "virtual" points are used per "real" data point to
curvePointFactor int defines how many "virtual" points are used per "real" data point to
emulate the curvedLines
emulate the curvedLines
fitPointDist: number guessed by default can be set manually.
fitPointDist: int defines the x axis distance of the additional two points that are used
defines the x axis distance of the additional two points that are used
to enforce the min max condition. (you will get curvePointFactor * 3 * |datapoints|
to enforce the min max condition. (you will get curvePointFactor * 3 * |datapoints|
"virtual" points if fit is true)
"virtual" points if fit is true)
+ line options (since v0.5 curved lines use flots line implementation for drawing
+ line options (since v0.5 curved lines use flots line implementation for drawing
=> line options like fill, show ... are supported out of the box)
=> line options like fill, show ... are supported out of the box)
*/
*/
/*
/*
* v0.1 initial commit
* v0.1 initial commit
* v0.15 negative values should work now (outcommented a negative -> 0 hook hope it does no harm)
* 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.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.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.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).
* 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,
* 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
* shadow) are now supported out of the box
*/
*/
(function($){
(function($){
varoptions={
varoptions={
series:{
series:{
curvedLines:{
curvedLines:{
active:false,
active:false,
apply:false,
apply:false,
fit:false,
fit:false,
curvePointFactor:20,
curvePointFactor:20,
fitPointDist:undefined
fitPointDist:undefined
}
}
}
}
};
};
functioninit(plot){
functioninit(plot){
plot.hooks.processOptions.push(processOptions);
plot.hooks.processOptions.push(processOptions);
//if the plugin is active register processDatapoints method
//if the plugin is active register processDatapoints method