UNPKG

highcharts

Version:
14 lines 4.73 kB
!/** * Highstock JS v12.5.0 (2026-01-12) * @module highcharts/modules/pointandfigure * @requires highcharts * @requires highcharts/modules/stock * * Point and figure series type for Highcharts Stock * * (c) 2010-2026 Highsoft AS * Author: Kamil Musialowski * * A commercial license may be required depending on use. * See www.highcharts.com/license */function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(e._Highcharts,e._Highcharts.SeriesRegistry,e._Highcharts.RendererRegistry):"function"==typeof define&&define.amd?define("highcharts/modules/pointandfigure",["highcharts/highcharts"],function(e){return t(e,e.SeriesRegistry,e.RendererRegistry)}):"object"==typeof exports?exports["highcharts/modules/pointandfigure"]=t(e._Highcharts,e._Highcharts.SeriesRegistry,e._Highcharts.RendererRegistry):e.Highcharts=t(e.Highcharts,e.Highcharts.SeriesRegistry,e.Highcharts.RendererRegistry)}("u"<typeof window?this:window,(e,t,r)=>(()=>{"use strict";var s,o={512:e=>{e.exports=t},608:e=>{e.exports=r},944:t=>{t.exports=e}},i={};function a(e){var t=i[e];if(void 0!==t)return t.exports;var r=i[e]={exports:{}};return o[e](r,r.exports,a),r.exports}a.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},a.d=(e,t)=>{for(var r in t)a.o(t,r)&&!a.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var n={};a.d(n,{default:()=>P});var h=a(944),l=a.n(h),p=a(512),d=a.n(p);let{seriesTypes:{scatter:{prototype:{pointClass:u}}}}=d(),c=class extends u{resolveMarker(){let e=this.series.options;this.marker=this.options.marker=this.upTrend?e.markerUp:e.marker,this.color=this.options.marker.lineColor}resolveColor(){super.resolveColor(),this.resolveMarker()}getClassName(){return super.getClassName.call(this)+(this.upTrend?" highcharts-point-up":" highcharts-point-down")}};var g=a(608),f=a.n(g);let y=[];function m(e,t,r,s){return[["M",e,t],["L",e+r,t+s],["M",e+r,t],["L",e,t+s],["Z"]]}(s||(s={})).compose=function(e){-1===y.indexOf(e)&&(y.push(e),e.prototype.symbols.cross=m);let t=f().getRendererType();y.indexOf(t)&&y.push(t)};let x=s,{composed:b}=l(),{scatter:k,column:{prototype:C}}=d().seriesTypes,{extend:R,merge:v,pushUnique:M,isNumber:H,relativeLength:S}=l();class w extends k{constructor(){super(...arguments),this.allowDG=!1}static compose(e){M(b,"pointandfigure")&&x.compose(e)}init(){super.init.apply(this,arguments),this.pnfDataGroups=[]}getProcessedData(){let e;if(!this.pnfDataGroups)return{modified:this.dataTable.getModified(),cropped:!1,cropStart:0,closestPointRange:1};let t=this.dataTable.getModified(),r=this.options,s=this.getColumn("x",!0),o=this.getColumn("y",!0),i=r.boxSize,a=H(i)?i:S(i,o[0]),n=this.pnfDataGroups,h=a*r.reversalAmount;function l(e,t,r){let s=n[n.length-1],o=t?1:-1,i=Math.floor(o*(e-r)/a);for(let e=1;e<=i;e++){let t=r+a*e*o;s.y.push(t)}}if(this.calculatedBoxSize=a,this.isDirtyData||0===n.length){this.pnfDataGroups.length=0;for(let t=0;t<o.length;t++){let r=s[t],i=o[t],h=o[0];if(i-h>=a){e=!0,n.push({x:r,y:[i],upTrend:e});break}if(h-i>=a){e=!1,n.push({x:r,y:[i],upTrend:e});break}}o.forEach((t,r)=>{let o,i=s[r],p=(o=n[n.length-1].y)[o.length-1];e&&(t-p>=a&&l(t,e,p),p-t>=h&&(e=!1,n.push({x:i,y:[],upTrend:e}),l(t,e,p))),!e&&(p-t>=a&&l(t,e,p),t-p>=h&&(e=!0,n.push({x:i,y:[],upTrend:e}),l(t,e,p)))})}let p=[],d=[],u=[];return n.forEach(e=>{let t=e.x,r=e.upTrend;e.y.forEach(e=>{d.push(t),u.push(e),p.push({x:t,y:e,upTrend:r})})}),t.setColumn("x",d),t.setColumn("y",u),this.pnfDataGroups=n,this.processedData=p,{modified:t,cropped:!1,cropStart:0,closestPointRange:1}}markerAttribs(e){let t=this.options,r={},s=e.pos();return r.width=this.markerWidth,r.height=this.markerHeight,s&&r.width&&r.height&&(r.x=s[0]-Math.round(r.width)/2,r.y=s[1]-Math.round(r.height)/2),t.crisp&&r.x&&(r.x=Math.floor(r.x)),r}translate(){let e=this.getColumnMetrics(),t=this.calculatedBoxSize;this.markerWidth=e.width+e.paddedWidth+e.offset,this.markerHeight=this.yAxis.toPixels(0)-this.yAxis.toPixels(t),super.translate()}}w.defaultOptions=v(k.defaultOptions,{boxSize:"1%",reversalAmount:3,tooltip:{pointFormat:'<span style="color:{point.color}">●</span> <b> {series.name}</b><br/>Close: {point.y:.2f}<br/>',headerFormat:""},turboThreshold:0,groupPadding:.2,pointPadding:.1,pointRange:null,dataGrouping:{enabled:!1},markerUp:{symbol:"cross",lineColor:"#00FF00",lineWidth:2},marker:{symbol:"circle",fillColor:"transparent",lineColor:"#FF0000",lineWidth:2},legendSymbol:"lineMarker"}),R(w.prototype,{takeOrdinalPosition:!0,pnfDataGroups:[],getColumnMetrics:C.getColumnMetrics,pointClass:c,sorted:!0}),d().registerSeriesType("pointandfigure",w);let D=l();w.compose(D.Renderer);let P=l();return n.default})());