highcharts
Version:
JavaScript charting framework
13 lines • 4.33 kB
JavaScript
!/**
* Highcharts JS v12.6.0 (2026-04-13)
* @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 o={448:t=>{t.exports=e},512:t=>{t.exports=r},944:e=>{e.exports=t}},i={};function s(t){var e=i[t];if(void 0!==e)return e.exports;var r=i[t]={exports:{}};return o[t](r,r.exports,s),r.exports}s.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return s.d(e,{a:e}),e},s.d=(t,e)=>{for(var r in e)s.o(e,r)&&!s.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},s.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var a={};s.d(a,{default:()=>j});var n=s(944),l=s.n(n),p=s(448),h=s.n(p);class c extends h().prototype.pointClass{destroy(){this.targetGraphic&&(this.targetGraphic=this.targetGraphic.destroy()),super.destroy.apply(this,arguments)}}var d=s(512),u=s.n(d);let{doc:g,win:y}=l();function f(t){return m(t)&&"number"==typeof t.nodeType}function b(t){return"number"==typeof t&&!isNaN(t)&&t<1/0&&t>-1/0}function m(t,e){let r;return!!t&&"object"==typeof t&&(!e||"[object Array]"!==(r=Object.prototype.toString.call(t))&&"[object Array Iterator]"!==r)}function x(t,...e){let r,o=[t,...e],i={},s=function(t,e){return"object"!=typeof t&&(t={}),function(t,e,r){for(let r in t)Object.hasOwnProperty.call(t,r)&&e.call((0,t[r]),t[r],r,t)}(e,function(r,o){if("__proto__"!==o&&"constructor"!==o){let i;!m(r,!0)||(i=r?.constructor,m(r,!0)&&!f(r)&&i?.name&&"Object"!==i.name)||f(r)?t[o]=e[o]:t[o]=s(t[o]||{},r)}}),t};!0===t&&(i=o[1],o=Array.prototype.slice.call(o,2));let a=o.length;for(r=0;r<a;r++)i=s(i,o[r]);return i}function w(){let t=arguments,e=t.length;for(let r=0;r<e;r++){let e=t[r];if(null!=e)return e}}Array.prototype.find;class M extends h(){drawPoints(){let t=this.chart,e=this.options,r=e.animationLimit||250;for(let s of(super.drawPoints.apply(this,arguments),this.points)){let a=s.options,n=s.target,l=s.y,p,h=s.targetGraphic,c,d,u,g;if(b(n)&&null!==n){var o,i;d=(u=x(e.targetOptions,a.targetOptions)).height;let y=s.shapeArgs;s.dlBox&&y&&!b(y.width)&&(y=s.dlBox),o=u.width,i=y.width,c=/%$/.test(o)?i*parseFloat(o)/100+0:parseFloat(o),g=this.yAxis.translate(n,!1,!0,!1,!0)-u.height/2-.5,p=this.crispCol.apply({chart:t,borderWidth:u.borderWidth,options:{crisp:e.crisp}},[y.x+y.width/2-c/2,g,c,d]),h?(h[t.pointCount<r?"animate":"attr"](p),b(l)&&null!==l?h.element.point=s:h.element.point=void 0):s.targetGraphic=h=t.renderer.rect().attr(p).add(this.group),t.styledMode||h.attr({fill:w(u.color,a.color,this.zones.length&&(s.getZone.call({series:this,x:s.x,y:n,options:{}}).color||this.color)||void 0,s.color,this.color),stroke:w(u.borderColor,s.borderColor,this.options.borderColor),"stroke-width":u.borderWidth,r:u.borderRadius}),b(l)&&null!==l&&(h.element.point=s),h.addClass(s.getClassName()+" highcharts-bullet-target",!0)}else h&&(s.targetGraphic=h.destroy())}}getExtremes(t){let e=super.getExtremes.call(this,t),r=this.targetData;if(r&&r.length){let t=super.getExtremes.call(this,r);b(t.dataMin)&&(e.dataMin=Math.min(w(e.dataMin,1/0),t.dataMin)),b(t.dataMax)&&(e.dataMax=Math.max(w(e.dataMax,-1/0),t.dataMax))}return e}}M.defaultOptions=x(h().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/>'}}),function(t,e){let r;for(r in t||(t={}),e)t[r]=e[r]}(M.prototype,{parallelArrays:["x","y","target"],pointArrayMap:["y","target"]}),M.prototype.pointClass=c,u().registerSeriesType("bullet",M);let j=l();return a.default})());