UNPKG

highcharts

Version:
13 lines 3.73 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 */function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(t._Highcharts,t._Highcharts.Series.types.column,t._Highcharts.SeriesRegistry):"function"==typeof define&&define.amd?define("highcharts/modules/bullet",["highcharts/highcharts"],function(t){return e(t,t.Series,["types"],["column"],t.SeriesRegistry)}):"object"==typeof exports?exports["highcharts/modules/bullet"]=e(t._Highcharts,t._Highcharts.Series.types.column,t._Highcharts.SeriesRegistry):t.Highcharts=e(t.Highcharts,t.Highcharts.Series.types.column,t.Highcharts.SeriesRegistry)}("u"<typeof window?this:window,(t,e,r)=>(()=>{"use strict";var i={448(t){t.exports=e},512(t){t.exports=r},944(e){e.exports=t}};let s={};function o(t){let e=s[t];if(void 0!==e)return e.exports;let r=s[t]={exports:{}};return i[t](r,r.exports,o),r.exports}o.n=t=>{let e=t&&t.__esModule?()=>t.default:()=>t;return o.d(e,{a:e}),e},o.d=(t,e)=>{if(Array.isArray(e))for(var r=0;r<e.length;){var i=e[r++],s=e[r++];o.o(t,i)?0===s&&r++:0===s?Object.defineProperty(t,i,{enumerable:!0,value:e[r++]}):Object.defineProperty(t,i,{enumerable:!0,get:s})}else for(var i in e)o.o(e,i)&&!o.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},o.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);let a={};o.d(a,{default:()=>y});var l=o(944),h=o.n(l),n=o(448),p=o.n(n);class d extends p().prototype.pointClass{destroy(){this.targetGraphic&&(this.targetGraphic=this.targetGraphic.destroy()),super.destroy.apply(this,arguments)}}var c=o(512),g=o.n(c);class u extends p(){drawPoints(){let t=this.chart,e=this.options,r=e.animationLimit||250;for(let i of(super.drawPoints.apply(this,arguments),this.points)){let s=i.options,o=i.target,a=i.y,h,n=i.targetGraphic,p,d,c,g;if((0,l.isNumber)(o)&&null!==o){d=(c=(0,l.merge)(e.targetOptions,s.targetOptions)).height;let u=i.shapeArgs;i.dlBox&&u&&!(0,l.isNumber)(u.width)&&(u=i.dlBox),p=(0,l.relativeLength)(c.width,u.width),g=this.yAxis.translate(o,!1,!0,!1,!0)-c.height/2-.5,h=this.crispCol.apply({chart:t,borderWidth:c.borderWidth,options:{crisp:e.crisp}},[u.x+u.width/2-p/2,g,p,d]),n?(n[t.pointCount<r?"animate":"attr"](h),(0,l.isNumber)(a)&&null!==a?n.element.point=i:n.element.point=void 0):i.targetGraphic=n=t.renderer.rect().attr(h).add(this.group),t.styledMode||n.attr({fill:(0,l.pick)(c.color,s.color,this.zones.length&&(i.getZone.call({series:this,x:i.x,y:o,options:{}})?.color||this.color)||void 0,i.color,this.color),stroke:(0,l.pick)(c.borderColor,i.borderColor,this.options.borderColor),"stroke-width":c.borderWidth,r:c.borderRadius}),(0,l.isNumber)(a)&&null!==a&&(n.element.point=i),n.addClass(i.getClassName()+" highcharts-bullet-target",!0)}else n&&(i.targetGraphic=n.destroy())}}getExtremes(t){let e=super.getExtremes.call(this,t),r=this.targetData;if(r&&r.length){let t=super.getExtremes.call(this,r);(0,l.isNumber)(t.dataMin)&&(e.dataMin=Math.min((0,l.pick)(e.dataMin,1/0),t.dataMin)),(0,l.isNumber)(t.dataMax)&&(e.dataMax=Math.max((0,l.pick)(e.dataMax,-1/0),t.dataMax))}return e}}u.defaultOptions=(0,l.merge)(p().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,l.extend)(u.prototype,{parallelArrays:["x","y","target"],pointArrayMap:["y","target"]}),u.prototype.pointClass=d,g().registerSeriesType("bullet",u);let y=h();return a.default})());