UNPKG

highcharts

Version:
11 lines 6.91 kB
!/** * Highcharts JS v13.0.1 (2026-08-17) * @module highcharts/modules/dumbbell * @requires highcharts * * (c) 2009-2026 Highsoft AS * Author: Sebastian Bochan, Rafał Sebestjański * * 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.SeriesRegistry,t._Highcharts.SVGRenderer):"function"==typeof define&&define.amd?define("highcharts/modules/dumbbell",["highcharts/highcharts"],function(t){return e(t,t.SeriesRegistry,t.SVGRenderer)}):"object"==typeof exports?exports["highcharts/modules/dumbbell"]=e(t._Highcharts,t._Highcharts.SeriesRegistry,t._Highcharts.SVGRenderer):t.Highcharts=e(t.Highcharts,t.Highcharts.SeriesRegistry,t.Highcharts.SVGRenderer)}("u"<typeof window?this:window,(t,e,o)=>(()=>{"use strict";var r={540(t){t.exports=o},512(t){t.exports=e},944(e){e.exports=t}};let i={};function s(t){let e=i[t];if(void 0!==e)return e.exports;let o=i[t]={exports:{}};return r[t](o,o.exports,s),o.exports}s.n=t=>{let e=t&&t.__esModule?()=>t.default:()=>t;return s.d(e,{a:e}),e},s.d=(t,e)=>{if(Array.isArray(e))for(var o=0;o<e.length;){var r=e[o++],i=e[o++];s.o(t,r)?0===i&&o++:0===i?Object.defineProperty(t,r,{enumerable:!0,value:e[o++]}):Object.defineProperty(t,r,{enumerable:!0,get:i})}else 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);let h={};s.d(h,{default:()=>b});var l=s(944),a=s.n(l),n=s(512),p=s.n(n);let{area:{prototype:{pointClass:c,pointClass:{prototype:d}}}}=p().seriesTypes,g=class extends c{setState(){let t=this.state,e=this.series,o=e.chart.polar;(0,l.defined)(this.plotHigh)||(this.plotHigh=e.yAxis.toPixels(this.high,!0)),(0,l.defined)(this.plotLow)||(this.plotLow=this.plotY=e.yAxis.toPixels(this.low,!0)),e.lowerStateMarkerGraphic=e.stateMarkerGraphic,e.stateMarkerGraphic=e.upperStateMarkerGraphic,this.graphic=this.graphics&&this.graphics[1],this.plotY=this.plotHigh,o&&(0,l.isNumber)(this.plotHighX)&&(this.plotX=this.plotHighX),d.setState.apply(this,arguments),this.state=t,this.plotY=this.plotLow,this.graphic=this.graphics&&this.graphics[0],o&&(0,l.isNumber)(this.plotLowX)&&(this.plotX=this.plotLowX),e.upperStateMarkerGraphic=e.stateMarkerGraphic,e.stateMarkerGraphic=e.lowerStateMarkerGraphic,e.lowerStateMarkerGraphic=void 0;let r=e.modifyMarkerSettings();d.setState.apply(this,arguments),e.restoreMarkerSettings(r)}haloPath(){let t=this.series.chart.polar,e=[];return this.plotY=this.plotLow,t&&(0,l.isNumber)(this.plotLowX)&&(this.plotX=this.plotLowX),this.isInside&&(e=d.haloPath.apply(this,arguments)),this.plotY=this.plotHigh,t&&(0,l.isNumber)(this.plotHighX)&&(this.plotX=this.plotHighX),this.isTopInside&&(e=e.concat(d.haloPath.apply(this,arguments))),e}isValid(){return(0,l.isNumber)(this.low)&&(0,l.isNumber)(this.high)}};class y extends g{setState(){let t=this.series,e=t.chart,o=t.options.lowColor,r=t.options.marker,i=t.options.lowMarker,s=this.options,h=s.lowColor,a=this.zone&&this.zone.color,n=(0,l.pick)(h,i?.fillColor,o,s.color,a,this.color,t.color),p="attr",c,d;if(this.pointSetState.apply(this,arguments),!this.state){p="animate";let[t,o]=this.graphics||[];t&&!e.styledMode&&(t.attr({fill:n}),o&&(d={y:this.y,zone:this.zone},this.y=this.high,this.zone=this.zone?this.getZone():void 0,c=(0,l.pick)(this.marker?this.marker.fillColor:void 0,r?r.fillColor:void 0,s.color,this.zone?this.zone.color:void 0,this.color),o.attr({fill:c}),(0,l.extend)(this,d)))}this.connector?.[p](t.getConnectorAttribs(this))}destroy(t){return this.graphic||(this.graphic=this.connector,this.connector=void 0),super.destroy(t)}}(0,l.extend)(y.prototype,{pointSetState:g.prototype.setState});var u=s(540),f=s.n(u);let{noop:w}=a(),{arearange:m,column:k,columnrange:C}=p().seriesTypes;class x extends m{getConnectorAttribs(t){let e=this.chart,o=t.options,r=this.options,i=this.xAxis,s=this.yAxis,h=(0,l.pick)(r.states&&r.states.hover&&r.states.hover.connectorWidthPlus,1),a=(0,l.pick)(o.dashStyle,r.dashStyle),n=s.toPixels(r.threshold||0,!0),p=e.inverted?s.len-n:n,c=(0,l.pick)(o.connectorWidth,r.connectorWidth),d=(0,l.pick)(o.connectorColor,r.connectorColor,o.color,t.zone?t.zone.color:void 0,t.color),g=(0,l.pick)(t.plotLow,t.plotY),y=(0,l.pick)(t.plotHigh,p),u;if("number"!=typeof g)return{};t.state&&(c+=h),g<0?g=0:g>=s.len&&(g=s.len),y<0?y=0:y>=s.len&&(y=s.len),(t.plotX<0||t.plotX>i.len)&&(c=0),t.graphics&&t.graphics[1]&&(u={y:t.y,zone:t.zone},t.y=t.high,t.zone=t.zone?t.getZone():void 0,d=(0,l.pick)(o.connectorColor,r.connectorColor,o.color,t.zone?t.zone.color:void 0,t.color),(0,l.extend)(t,u));let w={d:f().prototype.crispLine([["M",t.plotX,g],["L",t.plotX,y]],c)};return!e.styledMode&&(w.stroke=d,w["stroke-width"]=c,a&&(w.dashstyle=a)),w}drawConnector(t){let e=(0,l.pick)(this.options.animationLimit,250),o=t.connector&&this.chart.pointCount<e?"animate":"attr";t.connector||(t.connector=this.chart.renderer.path().addClass("highcharts-lollipop-stem").attr({zIndex:-1}).add(this.group)),t.connector[o](this.getConnectorAttribs(t))}getColumnMetrics(){let t=k.prototype.getColumnMetrics.apply(this,arguments);return t.offset+=t.width/2,t}translate(){let t=this.chart.inverted;for(let e of(this.setShapeArgs.apply(this),this.translatePoint.apply(this,arguments),this.points)){let{pointWidth:o,shapeArgs:r={},tooltipPos:i}=e;e.plotX=r.x||0,r.x=e.plotX-o/2,i&&(t?i[1]=this.xAxis.len-e.plotX:i[0]=e.plotX)}this.columnMetrics.offset-=this.columnMetrics.width/2}drawPoints(){let t=this.chart,e=this.points.length,o=this.lowColor=this.options.lowColor,r=this.options.lowMarker,i=0,s,h,a;for(this.seriesDrawPoints.apply(this,arguments);i<e;){let[e,n]=(h=this.points[i]).graphics||[];this.drawConnector(h),n&&(n.element.point=h,n.addClass("highcharts-lollipop-high")),h.connector&&(h.connector.element.point=h),e&&(a=h.zone&&h.zone.color,s=(0,l.pick)(h.options.lowColor,r?.fillColor,o,h.options.color,a,h.color,this.color),t.styledMode||e.attr({fill:s}),e.addClass("highcharts-lollipop-low")),i++}}pointAttribs(t,e){let o=super.pointAttribs.apply(this,arguments);return"hover"===e&&delete o.fill,o}setShapeArgs(){k.prototype.translate.apply(this),C.prototype.afterColumnTranslate.apply(this)}}x.defaultOptions=(0,l.merge)(m.defaultOptions,{trackByArea:!1,fillColor:"none",lineWidth:0,pointRange:1,connectorWidth:1,stickyTracking:!1,groupPadding:.2,crisp:!1,pointPadding:.1,legendSymbol:"rectangle",lowColor:"var(--highcharts-neutral-color-80)",states:{hover:{lineWidthPlus:0,connectorWidthPlus:1,halo:!1}}}),(0,l.extend)(x.prototype,{crispCol:k.prototype.crispCol,drawGraph:w,drawTracker:k.prototype.drawTracker,pointClass:y,seriesDrawPoints:m.prototype.drawPoints,trackerGroups:["group","markerGroup","dataLabelsGroup"],translatePoint:m.prototype.translate}),p().registerSeriesType("dumbbell",x);let b=a();return h.default})());