UNPKG

openui5-financial-charts

Version:
1 lines 1.06 kB
sap.ui.define(["../Series","../library","../thirdparty/d3","../thirdparty/moment-with-locales"],function(e){"use strict";return e.extend("openui5.financial.chart.indicator.CCIOZ",{metadata:{properties:{overboughtZone:"float",oversoldZone:"float"}},renderer:{},_draw:function(){e.prototype._draw.apply(this);var t=this.getParent();var a=this.getItems();if(a.length<1)return;var r=t.getAggregation("_timeAxis")._scale;var i=t.getAggregation("_valueAxis")._scale;var i=t.getAggregation("_valueAxis")._scale;var s=d3.select("#"+this.getId());var l=.8;var g=this._getTickWidth();var n=this.getOverboughtZone();var o=this.getOversoldZone();var d=s.selectAll().data(a).enter().append("g").classed("fcBullish",e=>e.getValue()>n).classed("fcBearish",e=>e.getValue()<o).classed("fcNone",e=>e.getValue()>=o&&e.getValue()<=n);d.append("rect").classed("fcCandleBody",true).attr("x",e=>r(moment(e.getTime()).toDate())+(1-l)*g/2).attr("y",e=>i(Math.max(e.getValue(),0))).attr("height",e=>Math.max(1,i(Math.min(e.getValue(),0))-i(Math.max(e.getValue(),0)))).attr("width",l*g)}})});