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