PlotKit.Layout.toString=function(){
return this.__repr__();
};
-PlotKit.Layout.valid_styles=["bar","line","pie","point"];
PlotKit.Layout=function(_28,_29){
-this.options={"barWidthFillFraction":0.75,"barOrientation":"vertical","xOriginIsZero":true,"yOriginIsZero":true,"xAxis":null,"yAxis":null,"xTicks":null,"yTicks":null,"xNumberOfTicks":10,"yNumberOfTicks":5,"xTickPrecision":1,"yTickPrecision":1,"pieRadius":0.4};
+this.options={"xOriginIsZero":true,"yOriginIsZero":true,"xAxis":null,"yAxis":null,"xTicks":null,"yTicks":null,};
this.style=_28;
MochiKit.Base.update(this.options,_29?_29:{});
-if(!MochiKit.Base.isUndefinedOrNull(this.options.xAxis)){
-this.minxval=this.options.xAxis[0];
-this.maxxval=this.options.xAxis[1];
-this.xscale=this.maxxval-this.minxval;
-}else{
this.minxval=0;
this.maxxval=null;
this.xscale=null;
-}
-if(!MochiKit.Base.isUndefinedOrNull(this.options.yAxis)){
-this.minyval=this.options.yAxis[0];
-this.maxyval=this.options.yAxis[1];
-this.yscale=this.maxyval-this.minyval;
-}else{
this.minyval=0;
this.maxyval=null;
this.yscale=null;
-}
this.points=new Array();
this.xticks=new Array();
this.yticks=new Array();
this.dateWindow_=_60.dateWindow||null;
this.valueRange_=_60.valueRange||null;
this.wilsonInterval_=_60.wilsonInterval||true;
-this.customBars_=_60.customBars||false;
div.innerHTML="";
if(div.style.width==""){
div.style.width=Dygraph.DEFAULT_WIDTH+"px";
MochiKit.Base.update(this.attrs_,Dygraph.DEFAULT_ATTRS);
this.labelsFromCSV_=(this.attr_("labels")==null);
this.createInterface_();
-this.layoutOptions_={"errorBars":(this.attr_("errorBars")||this.customBars_),"xOriginIsZero":false};
+this.layoutOptions_={"errorBars":(this.attr_("errorBars")||this.attr_("customBars")),"xOriginIsZero":false};
MochiKit.Base.update(this.layoutOptions_,this.attrs_);
MochiKit.Base.update(this.layoutOptions_,this.user_attrs_);
this.layout_=new DygraphLayout(this.layoutOptions_);
};
Dygraph.prototype.extremeValues_=function(_183){
var minY=null,maxY=null;
-var bars=this.attr_("errorBars")||this.customBars_;
+var bars=this.attr_("errorBars")||this.attr_("customBars");
if(bars){
for(var j=0;j<_183.length;j++){
var y=_183[j][1][0];
_187[j]=[date,data[j][i]];
}
_187=this.rollingAverage(_187,this.rollPeriod_);
-var bars=this.attr_("errorBars")||this.customBars_;
+var bars=this.attr_("errorBars")||this.attr_("customBars");
if(this.dateWindow_){
var low=this.dateWindow_[0];
var high=this.dateWindow_[1];
}
}
}else{
-if(this.customBars_){
+if(this.attr_("customBars")){
var low=0;
var mid=0;
var high=0;
_225[(j+1)/2]=[parseFloat(_224[j]),parseFloat(_224[j+1])];
}
}else{
-if(this.customBars_){
+if(this.attr_("customBars")){
for(var j=1;j<_224.length;j++){
var vals=_224[j].split(";");
_225[j]=[parseFloat(vals[0]),parseFloat(vals[1]),parseFloat(vals[2])];
}
};
Dygraph.prototype.updateOptions=function(_234){
-if(_234.customBars){
-this.customBars_=_234.customBars;
-}
if(_234.rollPeriod){
this.rollPeriod_=_234.rollPeriod;
}
return this.__repr__();
}
-PlotKit.Layout.valid_styles = ["bar", "line", "pie", "point"];
-
// --------------------------------------------------------------------
// Start of Layout definition
// --------------------------------------------------------------------
PlotKit.Layout = function(style, options) {
this.options = {
- "barWidthFillFraction": 0.75,
- "barOrientation": "vertical",
"xOriginIsZero": true,
"yOriginIsZero": true,
"xAxis": null, // [xmin, xmax]
"yAxis": null, // [ymin, ymax]
"xTicks": null, // [{label: "somelabel", v: value}, ..] (label opt.)
"yTicks": null, // [{label: "somelabel", v: value}, ..] (label opt.)
- "xNumberOfTicks": 10,
- "yNumberOfTicks": 5,
- "xTickPrecision": 1,
- "yTickPrecision": 1,
- "pieRadius": 0.4
};
// valid external options : TODO: input verification
this.style = style;
MochiKit.Base.update(this.options, options ? options : {});
- // externally visible states
- // overriden if xAxis and yAxis are set in options
- if (!MochiKit.Base.isUndefinedOrNull(this.options.xAxis)) {
- this.minxval = this.options.xAxis[0];
- this.maxxval = this.options.xAxis[1];
- this.xscale = this.maxxval - this.minxval;
- }
- else {
- this.minxval = 0;
- this.maxxval = null;
- this.xscale = null; // val -> pos factor (eg, xval * xscale = xpos)
- }
+ this.minxval = 0;
+ this.maxxval = null;
+ this.xscale = null; // val -> pos factor (eg, xval * xscale = xpos)
- if (!MochiKit.Base.isUndefinedOrNull(this.options.yAxis)) {
- this.minyval = this.options.yAxis[0];
- this.maxyval = this.options.yAxis[1];
- this.yscale = this.maxyval - this.minyval;
- }
- else {
- this.minyval = 0;
- this.maxyval = null;
- this.yscale = null;
- }
+ this.minyval = 0;
+ this.maxyval = null;
+ this.yscale = null;
this.points = new Array(); // array of points to plot for line plots