UNPKG

openui5-financial-charts

Version:
1 lines 1.12 kB
sap.ui.define(["sap/ui/core/Control","./library","./thirdparty/d3"],function(t){"use strict";return t.extend("openui5.financial.chart.Series",{metadata:{library:"openui5.financial.chart",aggregations:{items:{type:"openui5.financial.chart.SeriesItem",multiple:true}},defaultAggregation:"items"},bindAggregation:function(t,e){if(!e.length)e.length=1e6;return sap.ui.core.Control.prototype.bindAggregation.apply(this,arguments)},addItem:function(t){this.addAggregation("items",t,true)},removeItem:function(t){this.removeAggregation("items",t,true)},_getTickWidth:function(){var t=this.getItems();if(t.length<1)return;var e=this.getParent();var i=e.getPeriod();var n=e.getAggregation("_timeAxis")._scale;return n(moment(moment(e.getStart()).toDate()).add(i,"m").toDate())},_getMin:function(){var t=this.getItems();return d3.min(t,function(t){return t._getMin()})},_getMax:function(){var t=this.getItems();return d3.max(t,function(t){return t._getMax()})},_draw:function(){var t=this.getParent();d3.select("#"+this.getId()).attr("transform",`translate(${t._fPaddingLeft}, ${t._fPaddingTop})`).selectAll("*").remove()}})});