UNPKG

highcharts

Version:
13 lines 2.99 kB
/** * Highcharts JS v13.0.1 (2026-08-17) * @module highcharts/modules/bullet * @requires highcharts * * Bullet graph series type for Highcharts * * (c) 2010-2026 Highsoft AS * Author: Kacper Madej * * A commercial license may be required depending on use, * see www.highcharts.com/license */import*as t from"../highcharts.js";let e={};e.n=t=>{let r=t&&t.__esModule?()=>t.default:()=>t;return e.d(r,{a:r}),r},e.d=(t,r)=>{if(Array.isArray(r))for(var a=0;a<r.length;){var i=r[a++],o=r[a++];e.o(t,i)?0===o&&a++:0===o?Object.defineProperty(t,i,{enumerable:!0,value:r[a++]}):Object.defineProperty(t,i,{enumerable:!0,get:o})}else for(var i in r)e.o(r,i)&&!e.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:r[i]})},e.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);let r=t.default;var a=e.n(r);let i=t.default.Series.types.column;var o=e.n(i);class s extends o().prototype.pointClass{destroy(){this.targetGraphic&&(this.targetGraphic=this.targetGraphic.destroy()),super.destroy.apply(this,arguments)}}let l=t.default.SeriesRegistry;var n=e.n(l);class p extends o(){drawPoints(){let t=this.chart,e=this.options,a=e.animationLimit||250;for(let i of(super.drawPoints.apply(this,arguments),this.points)){let o=i.options,s=i.target,l=i.y,n,p=i.targetGraphic,d,h,c,g;if((0,r.isNumber)(s)&&null!==s){h=(c=(0,r.merge)(e.targetOptions,o.targetOptions)).height;let u=i.shapeArgs;i.dlBox&&u&&!(0,r.isNumber)(u.width)&&(u=i.dlBox),d=(0,r.relativeLength)(c.width,u.width),g=this.yAxis.translate(s,!1,!0,!1,!0)-c.height/2-.5,n=this.crispCol.apply({chart:t,borderWidth:c.borderWidth,options:{crisp:e.crisp}},[u.x+u.width/2-d/2,g,d,h]),p?(p[t.pointCount<a?"animate":"attr"](n),(0,r.isNumber)(l)&&null!==l?p.element.point=i:p.element.point=void 0):i.targetGraphic=p=t.renderer.rect().attr(n).add(this.group),t.styledMode||p.attr({fill:(0,r.pick)(c.color,o.color,this.zones.length&&(i.getZone.call({series:this,x:i.x,y:s,options:{}})?.color||this.color)||void 0,i.color,this.color),stroke:(0,r.pick)(c.borderColor,i.borderColor,this.options.borderColor),"stroke-width":c.borderWidth,r:c.borderRadius}),(0,r.isNumber)(l)&&null!==l&&(p.element.point=i),p.addClass(i.getClassName()+" highcharts-bullet-target",!0)}else p&&(i.targetGraphic=p.destroy())}}getExtremes(t){let e=super.getExtremes.call(this,t),a=this.targetData;if(a&&a.length){let t=super.getExtremes.call(this,a);(0,r.isNumber)(t.dataMin)&&(e.dataMin=Math.min((0,r.pick)(e.dataMin,1/0),t.dataMin)),(0,r.isNumber)(t.dataMax)&&(e.dataMax=Math.max((0,r.pick)(e.dataMax,-1/0),t.dataMax))}return e}}p.defaultOptions=(0,r.merge)(o().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/>'}}),(0,r.extend)(p.prototype,{parallelArrays:["x","y","target"],pointArrayMap:["y","target"]}),p.prototype.pointClass=s,n().registerSeriesType("bullet",p);let d=a();export{d as default};