UNPKG

highcharts

Version:
1 lines 2.38 kB
import*as t from"../highcharts.js";var e={};e.n=t=>{var r=t&&t.__esModule?()=>t.default:()=>t;return e.d(r,{a:r}),r},e.d=(t,r)=>{for(var a in r)e.o(r,a)&&!e.o(t,a)&&Object.defineProperty(t,a,{enumerable:!0,get:r[a]})},e.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);let r=t.default;var a=e.n(r);let o=t.default.Series.types.column;var i=e.n(o);class s extends i().prototype.pointClass{destroy(){this.targetGraphic&&(this.targetGraphic=this.targetGraphic.destroy()),super.destroy.apply(this,arguments)}}let l=t.default.SeriesRegistry;var p=e.n(l);let{extend:n,isNumber:d,merge:h,pick:c,relativeLength:g}=a();class u extends i(){drawPoints(){let t=this.chart,e=this.options,r=e.animationLimit||250;for(let a of(super.drawPoints.apply(this,arguments),this.points)){let o=a.options,i=a.target,s=a.y,l,p=a.targetGraphic,n,u,y,b;if(d(i)&&null!==i){u=(y=h(e.targetOptions,o.targetOptions)).height;let m=a.shapeArgs;a.dlBox&&m&&!d(m.width)&&(m=a.dlBox),n=g(y.width,m.width),b=this.yAxis.translate(i,!1,!0,!1,!0)-y.height/2-.5,l=this.crispCol.apply({chart:t,borderWidth:y.borderWidth,options:{crisp:e.crisp}},[m.x+m.width/2-n/2,b,n,u]),p?(p[t.pointCount<r?"animate":"attr"](l),d(s)&&null!==s?p.element.point=a:p.element.point=void 0):a.targetGraphic=p=t.renderer.rect().attr(l).add(this.group),t.styledMode||p.attr({fill:c(y.color,o.color,this.zones.length&&(a.getZone.call({series:this,x:a.x,y:i,options:{}}).color||this.color)||void 0,a.color,this.color),stroke:c(y.borderColor,a.borderColor,this.options.borderColor),"stroke-width":y.borderWidth,r:y.borderRadius}),d(s)&&null!==s&&(p.element.point=a),p.addClass(a.getClassName()+" highcharts-bullet-target",!0)}else p&&(a.targetGraphic=p.destroy())}}getExtremes(t){let e=super.getExtremes.call(this,t),r=this.targetData;if(r&&r.length){let t=super.getExtremes.call(this,r);d(t.dataMin)&&(e.dataMin=Math.min(c(e.dataMin,1/0),t.dataMin)),d(t.dataMax)&&(e.dataMax=Math.max(c(e.dataMax,-1/0),t.dataMax))}return e}}u.defaultOptions=h(i().defaultOptions,{targetOptions:{width:"140%",height:3,borderWidth:0,borderRadius:0},tooltip:{pointFormat:'<span style="color:{series.color}">●</span> {series.name}: <b>{point.y}</b>. Target: <b>{point.target}</b><br/>'}}),n(u.prototype,{parallelArrays:["x","y","target"],pointArrayMap:["y","target"]}),u.prototype.pointClass=s,p().registerSeriesType("bullet",u);let y=a();export{y as default};