Вход Регистрация
Файл: templates/backend/default/assets/plugins/jquery-ricksaw-chart/js/Rickshaw.Graph.Renderer.min.js
Строк: 98
<?php
Rickshaw
.namespace("Rickshaw.Graph.Renderer"),Rickshaw.Graph.Renderer=Rickshaw.Class.create({initialize:function(l){this.graph=l.graph,this.tension=l.tension||this.tension,this.graph.unstacker=this.graph.unstacker||new Rickshaw.Graph.Unstacker({graph:this.graph}),this.configure(l)},seriesPathFactory:function(){},seriesStrokeFactory:function(){},defaults:function(){return{tension:.8,strokeWidth:2,unstack:!0,padding:{top:.01,right:0,bottom:.01,left:0},stroke:!1,fill:!1}},domain:function(l){var e=l||this.graph.stackedData||this.graph.stackData(),t=e[0][0];if(void 0===t)return{x:[null,null],y:[null,null]};var n=t.x,i=t.x,a=t.y+t.y0,o=t.y+t.y0;return e.forEach(function(l){l.forEach(function(l){if(null!=l.y){var e=l.y+l.y0;a>e&&(a=e),e>o&&(o=e)}}),l[0].x<n&&(n=l[0].x),l[l.length-1].x>i&&(i=l[l.length-1].x)}),n-=(i-n)*this.padding.left,i+=(i-n)*this.padding.right,a="auto"===this.graph.min?a:this.graph.min||0,o=void 0===this.graph.max?o:this.graph.max,("auto"===this.graph.min||0>a)&&(a-=(o-a)*this.padding.bottom),void 0===this.graph.max&&(o+=(o-a)*this.padding.top),{x:[n,i],y:[a,o]}},render:function(l){l=l||{};var e=this.graph,t=l.series||e.series,n=l.vis||e.vis;n.selectAll("*").remove();var i=t.filter(function(l){return!l.disabled}).map(function(l){return l.stack}),a=n.selectAll("path").data(i).enter().append("svg:path").attr("d",this.seriesPathFactory()),o=0;t.forEach(function(l){l.disabled||(l.path=a[0][o++],this._styleSeries(l))},this)},_styleSeries:function(l){var e=this.fill?l.color:"none",t=this.stroke?l.color:"none";l.path.setAttribute("fill",e),l.path.setAttribute("stroke",t),l.path.setAttribute("stroke-width",this.strokeWidth),l.path.setAttribute("class",l.className)},configure:function(l){l=l||{},Rickshaw.keys(this.defaults()).forEach(function(e){return l.hasOwnProperty(e)?("object"==typeof this.defaults()[e]?Rickshaw.keys(this.defaults()[e]).forEach(function(t){this[e][t]=void 0!==l[e][t]?l[e][t]:void 0!==this[e][t]?this[e][t]:this.defaults()[e][t]},this):this[e]=void 0!==l[e]?l[e]:void 0!==this[e]?this[e]:void 0!==this.graph[e]?this.graph[e]:this.defaults()[e],void 0):(this[e]=this[e]||this.graph[e]||this.defaults()[e],void 0)},this)},setStrokeWidth:function(l){void 0!==l&&(this.strokeWidth=l)},setTension:function(l){void 0!==l&&(this.tension=l)}});
?>
Онлайн: 0
Реклама