highcharts
Version:
JavaScript charting framework
15 lines • 5.36 kB
JavaScript
!/**
* Highstock JS v12.6.0 (2026-04-13)
* @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 Musiałowski
*
* 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):"function"==typeof define&&define.amd?define("highcharts/modules/pointandfigure",["highcharts/highcharts"],function(t){return e(t,t.SeriesRegistry)}):"object"==typeof exports?exports["highcharts/modules/pointandfigure"]=e(t._Highcharts,t._Highcharts.SeriesRegistry):t.Highcharts=e(t.Highcharts,t.Highcharts.SeriesRegistry)}("u"<typeof window?this:window,(t,e)=>(()=>{"use strict";var r,o={512:t=>{t.exports=e},944:e=>{e.exports=t}},s={};function i(t){var e=s[t];if(void 0!==e)return e.exports;var r=s[t]={exports:{}};return o[t](r,r.exports,i),r.exports}i.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{for(var r in e)i.o(e,r)&&!i.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var n={};i.d(n,{default:()=>w});var a=i(944),l=i.n(a),p=i(512),h=i.n(p);let{seriesTypes:{scatter:{prototype:{pointClass:u}}}}=h(),c=class extends u{resolveMarker(){let t=this.series.options;this.marker=this.options.marker=this.upTrend?t.markerUp:t.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")}},{doc:d,win:f}=l();function g(t){return y(t)&&"number"==typeof t.nodeType}function y(t,e){let r;return!!t&&"object"==typeof t&&(!e||"[object Array]"!==(r=Object.prototype.toString.call(t))&&"[object Array Iterator]"!==r)}function m(t,e){return 0>t.indexOf(e)&&!!t.push(e)}Array.prototype.find;let{composed:b}=l();function x(t,e,r,o){return[["M",t,e],["L",t+r,e+o],["M",t+r,e],["L",t,e+o],["Z"]]}(r||(r={})).compose=function(t){m(b,"Series.CrossSymbol")&&(t.prototype.symbols.cross=x)};let C=r,{composed:k}=l(),{scatter:v,column:{prototype:M}}=h().seriesTypes;class S extends v{constructor(){super(...arguments),this.allowDG=!1}static compose(t){m(k,"pointandfigure")&&C.compose(t)}init(){super.init.apply(this,arguments),this.pnfDataGroups=[]}getProcessedData(){var t;let e;if(!this.pnfDataGroups)return{modified:this.dataTable.getModified(),cropped:!1,cropStart:0,closestPointRange:1};let r=this.dataTable.getModified(),o=this.options,s=this.getColumn("x",!0),i=this.getColumn("y",!0),n=o.boxSize,a="number"==typeof n&&!isNaN(n)&&n<1/0&&n>-1/0?n:(t=i[0],/%$/.test(n)?t*parseFloat(n)/100+0:parseFloat(n)),l=this.pnfDataGroups,p=a*o.reversalAmount;function h(t,e,r){let o=l[l.length-1],s=e?1:-1,i=Math.floor(s*(t-r)/a);for(let t=1;t<=i;t++){let e=r+a*t*s;o.y.push(e)}}if(this.calculatedBoxSize=a,this.isDirtyData||0===l.length){this.pnfDataGroups.length=0;for(let t=0;t<i.length;t++){let r=s[t],o=i[t],n=i[0];if(o-n>=a){e=!0,l.push({x:r,y:[o],upTrend:e});break}if(n-o>=a){e=!1,l.push({x:r,y:[o],upTrend:e});break}}i.forEach((t,r)=>{let o,i=s[r],n=(o=l[l.length-1].y)[o.length-1];e&&(t-n>=a&&h(t,e,n),n-t>=p&&(e=!1,l.push({x:i,y:[],upTrend:e}),h(t,e,n))),!e&&(n-t>=a&&h(t,e,n),t-n>=p&&(e=!0,l.push({x:i,y:[],upTrend:e}),h(t,e,n)))})}let u=[],c=[],d=[];return l.forEach(t=>{let e=t.x,r=t.upTrend;t.y.forEach(t=>{c.push(e),d.push(t),u.push({x:e,y:t,upTrend:r})})}),r.setColumn("x",c),r.setColumn("y",d),this.pnfDataGroups=l,this.processedData=u,{modified:r,cropped:!1,cropStart:0,closestPointRange:1}}markerAttribs(t){let e=this.options,r={},o=t.pos();return r.width=this.markerWidth,r.height=this.markerHeight,o&&r.width&&r.height&&(r.x=o[0]-Math.round(r.width)/2,r.y=o[1]-Math.round(r.height)/2),e.crisp&&r.x&&(r.x=Math.floor(r.x)),r}translate(){let t=this.getColumnMetrics(),e=this.calculatedBoxSize;this.markerWidth=t.width+t.paddedWidth+t.offset,this.markerHeight=this.yAxis.toPixels(0)-this.yAxis.toPixels(e),super.translate()}}S.defaultOptions=function(t,...e){let r,o=[t,...e],s={},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 s;!y(r,!0)||(s=r?.constructor,y(r,!0)&&!g(r)&&s?.name&&"Object"!==s.name)||g(r)?t[o]=e[o]:t[o]=i(t[o]||{},r)}}),t};!0===t&&(s=o[1],o=Array.prototype.slice.call(o,2));let n=o.length;for(r=0;r<n;r++)s=i(s,o[r]);return s}(v.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"}),function(t,e){let r;for(r in t||(t={}),e)t[r]=e[r]}(S.prototype,{takeOrdinalPosition:!0,pnfDataGroups:[],getColumnMetrics:M.getColumnMetrics,pointClass:c,sorted:!0}),h().registerSeriesType("pointandfigure",S);let j=l();S.compose(j.Renderer);let w=l();return n.default})());