UNPKG

highcharts

Version:
14 lines 3.73 kB
!/** * Highstock JS v13.0.1 (2026-08-17) * @module highcharts/modules/hollowcandlestick * @requires highcharts * @requires highcharts/modules/stock * * Hollow Candlestick series type for Highcharts Stock * * (c) 2010-2026 Highsoft AS * Author: Karol Kołodziej * * 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.Axis):"function"==typeof define&&define.amd?define("highcharts/modules/hollowcandlestick",["highcharts/highcharts"],function(t){return e(t,t.SeriesRegistry,t.Axis)}):"object"==typeof exports?exports["highcharts/modules/hollowcandlestick"]=e(t._Highcharts,t._Highcharts.SeriesRegistry,t._Highcharts.Axis):t.Highcharts=e(t.Highcharts,t.Highcharts.SeriesRegistry,t.Highcharts.Axis)}("u"<typeof window?this:window,(t,e,i)=>(()=>{"use strict";var o={532(t){t.exports=i},512(t){t.exports=e},944(e){e.exports=t}};let s={};function r(t){let e=s[t];if(void 0!==e)return e.exports;let i=s[t]={exports:{}};return o[t](i,i.exports,r),i.exports}r.n=t=>{let e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{if(Array.isArray(e))for(var i=0;i<e.length;){var o=e[i++],s=e[i++];r.o(t,o)?0===s&&i++:0===s?Object.defineProperty(t,o,{enumerable:!0,value:e[i++]}):Object.defineProperty(t,o,{enumerable:!0,get:s})}else for(var o in e)r.o(e,o)&&!r.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);let l={};r.d(l,{default:()=>y});var a=r(944),h=r.n(a),n=r(512),c=r.n(n);let{seriesTypes:{candlestick:p}}=c();class u extends p.prototype.pointClass{getClassName(){let t=super.getClassName.apply(this),e=this.index,i=this.series.hollowCandlestickData[e];return i.isBullish||"up"!==i.trendDirection||(t+="-bearish-up"),t}}var d=r(532),g=r.n(d);let{seriesTypes:{candlestick:f}}=c();class v extends f{constructor(){super(...arguments),this.hollowCandlestickData=[]}getPriceMovement(){let t,e=this.allGroupedTable||this.dataTable,i=e.rowCount,o=this.hollowCandlestickData;o.length=0;for(let s=0;s<i;s++){let i=e.getRowObject(s,this.pointArrayMap);o.push(this.isBullish(i,s?t:i)),t=i}}getLineColor(t){return"up"===t?this.options.upColor||"var(--highcharts-positive-color)":this.options.color||"var(--highcharts-negative-color)"}getPointFill(t){return t.isBullish?"transparent":"up"===t.trendDirection?this.options.upColor||"var(--highcharts-positive-color)":this.options.color||"var(--highcharts-negative-color)"}init(){super.init.apply(this,arguments),this.hollowCandlestickData=[]}isBullish(t,e){return{isBullish:(t.open||0)<=(t.close||0),trendDirection:(t.close||0)<(e?.close||0)?"down":"up"}}pointAttribs(t,e){let i,o=super.pointAttribs.call(this,t,e),s=t?.index,r=this.hollowCandlestickData[s||0]||{};return o.fill=this.getPointFill(r)||o.fill,o.stroke=this.getLineColor(r.trendDirection)||o.stroke,e&&(o.fill=(i=this.options.states?.[e]||{}).color||o.fill,o.stroke=i.lineColor||o.stroke,o["stroke-width"]=i.lineWidth||o["stroke-width"]),o}}v.defaultOptions=(0,a.merge)(f.defaultOptions,{color:"var(--highcharts-negative-color)",dataGrouping:{groupAll:!0,groupPixelWidth:10},lineColor:"var(--highcharts-negative-color)",upColor:"var(--highcharts-positive-color)",upLineColor:"var(--highcharts-positive-color)"}),(0,a.addEvent)(v,"updatedData",function(){this.hollowCandlestickData.length&&(this.hollowCandlestickData.length=0)}),(0,a.addEvent)(g(),"postProcessData",function(){this.series.forEach(function(t){t.is("hollowcandlestick")&&t.getPriceMovement()})}),v.prototype.pointClass=u,c().registerSeriesType("hollowcandlestick",v);let y=h();return l.default})());