highcharts
Version:
JavaScript charting framework
11 lines • 6.19 kB
JavaScript
/**
* 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
*/import*as t from"../highcharts.js";let o={};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 i=0;i<e.length;){var r=e[i++],s=e[i++];o.o(t,r)?0===s&&i++:0===s?Object.defineProperty(t,r,{enumerable:!0,value:e[i++]}):Object.defineProperty(t,r,{enumerable:!0,get:s})}else for(var r in e)o.o(e,r)&&!o.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},o.o=(t,o)=>Object.prototype.hasOwnProperty.call(t,o);let e=t.default;var i=o.n(e);let r=t.default.SeriesRegistry;var s=o.n(r);let{area:{prototype:{pointClass:l,pointClass:{prototype:h}}}}=s().seriesTypes,a=class extends l{setState(){let t=this.state,o=this.series,i=o.chart.polar;(0,e.defined)(this.plotHigh)||(this.plotHigh=o.yAxis.toPixels(this.high,!0)),(0,e.defined)(this.plotLow)||(this.plotLow=this.plotY=o.yAxis.toPixels(this.low,!0)),o.lowerStateMarkerGraphic=o.stateMarkerGraphic,o.stateMarkerGraphic=o.upperStateMarkerGraphic,this.graphic=this.graphics&&this.graphics[1],this.plotY=this.plotHigh,i&&(0,e.isNumber)(this.plotHighX)&&(this.plotX=this.plotHighX),h.setState.apply(this,arguments),this.state=t,this.plotY=this.plotLow,this.graphic=this.graphics&&this.graphics[0],i&&(0,e.isNumber)(this.plotLowX)&&(this.plotX=this.plotLowX),o.upperStateMarkerGraphic=o.stateMarkerGraphic,o.stateMarkerGraphic=o.lowerStateMarkerGraphic,o.lowerStateMarkerGraphic=void 0;let r=o.modifyMarkerSettings();h.setState.apply(this,arguments),o.restoreMarkerSettings(r)}haloPath(){let t=this.series.chart.polar,o=[];return this.plotY=this.plotLow,t&&(0,e.isNumber)(this.plotLowX)&&(this.plotX=this.plotLowX),this.isInside&&(o=h.haloPath.apply(this,arguments)),this.plotY=this.plotHigh,t&&(0,e.isNumber)(this.plotHighX)&&(this.plotX=this.plotHighX),this.isTopInside&&(o=o.concat(h.haloPath.apply(this,arguments))),o}isValid(){return(0,e.isNumber)(this.low)&&(0,e.isNumber)(this.high)}};class p extends a{setState(){let t=this.series,o=t.chart,i=t.options.lowColor,r=t.options.marker,s=t.options.lowMarker,l=this.options,h=l.lowColor,a=this.zone&&this.zone.color,p=(0,e.pick)(h,s?.fillColor,i,l.color,a,this.color,t.color),n="attr",c,d;if(this.pointSetState.apply(this,arguments),!this.state){n="animate";let[t,i]=this.graphics||[];t&&!o.styledMode&&(t.attr({fill:p}),i&&(d={y:this.y,zone:this.zone},this.y=this.high,this.zone=this.zone?this.getZone():void 0,c=(0,e.pick)(this.marker?this.marker.fillColor:void 0,r?r.fillColor:void 0,l.color,this.zone?this.zone.color:void 0,this.color),i.attr({fill:c}),(0,e.extend)(this,d)))}this.connector?.[n](t.getConnectorAttribs(this))}destroy(t){return this.graphic||(this.graphic=this.connector,this.connector=void 0),super.destroy(t)}}(0,e.extend)(p.prototype,{pointSetState:a.prototype.setState});let n=t.default.SVGRenderer;var c=o.n(n);let{noop:d}=i(),{arearange:g,column:y,columnrange:u}=s().seriesTypes;class f extends g{getConnectorAttribs(t){let o=this.chart,i=t.options,r=this.options,s=this.xAxis,l=this.yAxis,h=(0,e.pick)(r.states&&r.states.hover&&r.states.hover.connectorWidthPlus,1),a=(0,e.pick)(i.dashStyle,r.dashStyle),p=l.toPixels(r.threshold||0,!0),n=o.inverted?l.len-p:p,d=(0,e.pick)(i.connectorWidth,r.connectorWidth),g=(0,e.pick)(i.connectorColor,r.connectorColor,i.color,t.zone?t.zone.color:void 0,t.color),y=(0,e.pick)(t.plotLow,t.plotY),u=(0,e.pick)(t.plotHigh,n),f;if("number"!=typeof y)return{};t.state&&(d+=h),y<0?y=0:y>=l.len&&(y=l.len),u<0?u=0:u>=l.len&&(u=l.len),(t.plotX<0||t.plotX>s.len)&&(d=0),t.graphics&&t.graphics[1]&&(f={y:t.y,zone:t.zone},t.y=t.high,t.zone=t.zone?t.getZone():void 0,g=(0,e.pick)(i.connectorColor,r.connectorColor,i.color,t.zone?t.zone.color:void 0,t.color),(0,e.extend)(t,f));let k={d:c().prototype.crispLine([["M",t.plotX,y],["L",t.plotX,u]],d)};return!o.styledMode&&(k.stroke=g,k["stroke-width"]=d,a&&(k.dashstyle=a)),k}drawConnector(t){let o=(0,e.pick)(this.options.animationLimit,250),i=t.connector&&this.chart.pointCount<o?"animate":"attr";t.connector||(t.connector=this.chart.renderer.path().addClass("highcharts-lollipop-stem").attr({zIndex:-1}).add(this.group)),t.connector[i](this.getConnectorAttribs(t))}getColumnMetrics(){let t=y.prototype.getColumnMetrics.apply(this,arguments);return t.offset+=t.width/2,t}translate(){let t=this.chart.inverted;for(let o of(this.setShapeArgs.apply(this),this.translatePoint.apply(this,arguments),this.points)){let{pointWidth:e,shapeArgs:i={},tooltipPos:r}=o;o.plotX=i.x||0,i.x=o.plotX-e/2,r&&(t?r[1]=this.xAxis.len-o.plotX:r[0]=o.plotX)}this.columnMetrics.offset-=this.columnMetrics.width/2}drawPoints(){let t=this.chart,o=this.points.length,i=this.lowColor=this.options.lowColor,r=this.options.lowMarker,s=0,l,h,a;for(this.seriesDrawPoints.apply(this,arguments);s<o;){let[o,p]=(h=this.points[s]).graphics||[];this.drawConnector(h),p&&(p.element.point=h,p.addClass("highcharts-lollipop-high")),h.connector&&(h.connector.element.point=h),o&&(a=h.zone&&h.zone.color,l=(0,e.pick)(h.options.lowColor,r?.fillColor,i,h.options.color,a,h.color,this.color),t.styledMode||o.attr({fill:l}),o.addClass("highcharts-lollipop-low")),s++}}pointAttribs(t,o){let e=super.pointAttribs.apply(this,arguments);return"hover"===o&&delete e.fill,e}setShapeArgs(){y.prototype.translate.apply(this),u.prototype.afterColumnTranslate.apply(this)}}f.defaultOptions=(0,e.merge)(g.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,e.extend)(f.prototype,{crispCol:y.prototype.crispCol,drawGraph:d,drawTracker:y.prototype.drawTracker,pointClass:p,seriesDrawPoints:g.prototype.drawPoints,trackerGroups:["group","markerGroup","dataLabelsGroup"],translatePoint:g.prototype.translate}),s().registerSeriesType("dumbbell",f);let k=i();export{k as default};