highcharts 9.1.1 → 9.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bower.json +1 -1
- package/css/annotations/popup.css +29 -28
- package/css/annotations/popup.scss +29 -27
- package/css/highcharts.css +15 -0
- package/css/highcharts.scss +12 -0
- package/css/stocktools/gui.css +1 -0
- package/css/stocktools/gui.scss +1 -0
- package/css/themes/dark-unica.css +15 -0
- package/css/themes/grid-light.css +15 -0
- package/css/themes/sand-signika.css +15 -0
- package/es-modules/Accessibility/Components/InfoRegionsComponent.js +8 -2
- package/es-modules/Accessibility/Components/LegendComponent.js +19 -8
- package/es-modules/Accessibility/Components/MenuComponent.js +19 -13
- package/es-modules/Accessibility/Components/SeriesComponent/SeriesDescriber.js +4 -8
- package/es-modules/Accessibility/FocusBorder.js +1 -3
- package/es-modules/Accessibility/Options/LangOptions.js +3 -3
- package/es-modules/Accessibility/Utils/Announcer.js +22 -5
- package/es-modules/Accessibility/Utils/ChartUtilities.js +6 -1
- package/es-modules/Core/Animation/AnimationUtilities.js +12 -4
- package/es-modules/Core/Animation/Fx.js +15 -12
- package/es-modules/Core/Axis/Axis.js +25 -13
- package/es-modules/Core/Axis/AxisDefaults.js +0 -1
- package/es-modules/Core/Axis/BrokenAxis.js +32 -15
- package/es-modules/Core/Axis/Color/ColorAxis.js +665 -0
- package/es-modules/Core/Axis/Color/ColorAxisComposition.js +237 -0
- package/es-modules/Core/Axis/Color/ColorAxisDefaults.js +434 -0
- package/es-modules/Core/Axis/DateTimeAxis.js +163 -133
- package/es-modules/Core/Axis/GridAxis.js +8 -3
- package/es-modules/Core/Axis/LogarithmicAxis.js +159 -117
- package/es-modules/Core/Axis/OrdinalAxis.js +666 -460
- package/es-modules/Core/Axis/PlotLineOrBand/PlotLineOrBand.js +874 -0
- package/es-modules/Core/Axis/PlotLineOrBand/PlotLineOrBandAxis.js +292 -0
- package/es-modules/Core/Axis/RadialAxis.js +858 -745
- package/es-modules/Core/Axis/ScrollbarAxis.js +7 -0
- package/es-modules/Core/Axis/StackingAxis.js +159 -140
- package/es-modules/Core/Axis/Tick.js +17 -27
- package/es-modules/Core/Chart/Chart.js +24 -38
- package/es-modules/Core/Chart/ChartDefaults.js +1 -1
- package/es-modules/Core/Chart/StockChart.js +12 -0
- package/es-modules/Core/Color/Color.js +96 -104
- package/es-modules/Core/DefaultOptions.js +269 -248
- package/es-modules/Core/Foundation.js +9 -8
- package/es-modules/Core/Geometry/CircleUtilities.js +385 -0
- package/es-modules/Core/Geometry/GeometryUtilities.js +83 -0
- package/es-modules/Core/Globals.js +23 -1
- package/es-modules/{Extensions/Ajax.js → Core/HttpUtilities.js} +86 -42
- package/es-modules/Core/{Legend.js → Legend/Legend.js} +142 -116
- package/es-modules/{Mixins → Core/Legend}/LegendSymbol.js +54 -38
- package/es-modules/Core/Navigator.js +3 -0
- package/es-modules/Core/Pointer.js +9 -0
- package/es-modules/Core/Renderer/HTML/AST.js +100 -82
- package/es-modules/Core/Renderer/HTML/HTMLElement.js +17 -7
- package/es-modules/Core/Renderer/HTML/HTMLRenderer.js +26 -9
- package/es-modules/Core/Renderer/RendererRegistry.js +9 -4
- package/es-modules/Core/Renderer/RendererUtilities.js +159 -0
- package/es-modules/Core/Renderer/SVG/SVGElement.js +13 -7
- package/es-modules/Core/Renderer/SVG/SVGLabel.js +9 -29
- package/es-modules/Core/Renderer/SVG/SVGRenderer.js +2 -2
- package/es-modules/Core/Renderer/SVG/TextBuilder.js +18 -16
- package/es-modules/Core/Responsive.js +166 -148
- package/es-modules/Core/Series/DataLabel.js +564 -0
- package/es-modules/Core/Series/Point.js +233 -209
- package/es-modules/Core/Series/Series.js +174 -2339
- package/es-modules/Core/Series/SeriesDefaults.js +2293 -0
- package/es-modules/Core/Series/SeriesRegistry.js +3 -9
- package/es-modules/Core/Time.js +78 -2
- package/es-modules/Core/Tooltip.js +178 -236
- package/es-modules/Core/Utilities.js +409 -394
- package/es-modules/Extensions/Annotations/Annotations.js +102 -49
- package/es-modules/Extensions/Annotations/Mixins/EventEmitterMixin.js +9 -1
- package/es-modules/Extensions/Annotations/NavigationBindings.js +30 -25
- package/es-modules/Extensions/Annotations/Popup.js +16 -7
- package/es-modules/Extensions/Boost/BoostOverrides.js +5 -1
- package/es-modules/Extensions/Boost/WGLRenderer.js +5 -4
- package/es-modules/Extensions/Boost/WGLVBuffer.js +3 -0
- package/es-modules/Extensions/BoostCanvas.js +1 -1
- package/es-modules/Extensions/CurrentDateIndication.js +1 -1
- package/es-modules/Extensions/Data.js +82 -76
- package/es-modules/Extensions/DataGrouping.js +225 -184
- package/es-modules/Extensions/Debugger/ErrorMessages.js +2 -2
- package/es-modules/Extensions/DraggablePoints.js +13 -5
- package/es-modules/Extensions/Drilldown.js +41 -14
- package/es-modules/Extensions/ExportData.js +7 -4
- package/es-modules/Extensions/Exporting/Exporting.js +1273 -0
- package/es-modules/Extensions/Exporting/ExportingDefaults.js +803 -0
- package/es-modules/Extensions/Exporting/ExportingSymbols.js +73 -0
- package/es-modules/Extensions/FullScreen.js +7 -5
- package/es-modules/Extensions/NoDataToDisplay.js +1 -1
- package/es-modules/Extensions/OfflineExporting/OfflineExporting.js +617 -0
- package/es-modules/Extensions/OfflineExporting/OfflineExportingDefaults.js +58 -0
- package/es-modules/Extensions/Oldie/Oldie.js +1 -1
- package/es-modules/Extensions/Pane.js +0 -1
- package/es-modules/Extensions/PatternFill.js +23 -10
- package/es-modules/Extensions/Polar.js +2 -1
- package/es-modules/Extensions/RangeSelector.js +1 -1
- package/es-modules/Extensions/Themes/Avocado.js +49 -20
- package/es-modules/Extensions/Themes/DarkBlue.js +226 -203
- package/es-modules/Extensions/Themes/DarkGreen.js +231 -203
- package/es-modules/Extensions/Themes/DarkUnica.js +201 -172
- package/es-modules/Extensions/Themes/Gray.js +228 -205
- package/es-modules/Extensions/Themes/Grid.js +109 -81
- package/es-modules/Extensions/Themes/GridLight.js +83 -55
- package/es-modules/Extensions/Themes/HighContrastDark.js +192 -164
- package/es-modules/Extensions/Themes/HighContrastLight.js +49 -21
- package/es-modules/Extensions/Themes/SandSignika.js +115 -86
- package/es-modules/Extensions/Themes/Skies.js +102 -74
- package/es-modules/Extensions/Themes/Sunset.js +47 -19
- package/es-modules/Mixins/ColorSeries.js +0 -1
- package/es-modules/Mixins/MultipleLines.js +6 -0
- package/es-modules/Mixins/TreeSeries.js +1 -1
- package/es-modules/Series/Area/AreaSeries.js +2 -2
- package/es-modules/Series/AreaSpline/AreaSplineSeries.js +2 -2
- package/es-modules/Series/Bubble/BubbleLegendComposition.js +279 -0
- package/es-modules/Series/Bubble/BubbleLegendDefaults.js +267 -0
- package/es-modules/Series/Bubble/BubbleLegendItem.js +472 -0
- package/es-modules/Series/Bubble/BubbleSeries.js +6 -2
- package/es-modules/Series/Column/ColumnDataLabel.js +109 -0
- package/es-modules/Series/Column/ColumnSeries.js +39 -26
- package/es-modules/Series/Column3D/Column3DComposition.js +5 -2
- package/es-modules/Series/Flags/FlagsSeries.js +8 -1
- package/es-modules/Series/Gantt/GanttSeries.js +3 -3
- package/es-modules/Series/Heatmap/HeatmapSeries.js +9 -5
- package/es-modules/Series/HeikinAshi/HeikinAshiPoint.js +60 -0
- package/es-modules/Series/HeikinAshi/HeikinAshiSeries.js +277 -0
- package/es-modules/Series/HollowCandlestick/HollowCandlestickPoint.js +83 -0
- package/es-modules/Series/HollowCandlestick/HollowCandlestickSeries.js +370 -0
- package/es-modules/Series/Line/LineSeries.js +12 -8
- package/es-modules/Series/Map/MapSeries.js +5 -3
- package/es-modules/Series/MapBubble/MapBubbleSeries.js +6 -5
- package/es-modules/Series/OHLC/OHLCPoint.js +11 -0
- package/es-modules/Series/PackedBubble/PackedBubbleSeries.js +3 -1
- package/es-modules/Series/Pie/PieDataLabel.js +448 -0
- package/es-modules/Series/Pie/PiePoint.js +35 -34
- package/es-modules/Series/Pie/PieSeries.js +19 -16
- package/es-modules/Series/Polygon/PolygonSeries.js +3 -3
- package/es-modules/Series/Sankey/SankeySeries.js +9 -7
- package/es-modules/Series/SolidGauge/SolidGaugeSeries.js +2 -2
- package/es-modules/Series/Sunburst/SunburstSeries.js +1 -14
- package/es-modules/Series/Timeline/TimelinePoint.js +6 -0
- package/es-modules/Series/Timeline/TimelineSeries.js +14 -17
- package/es-modules/Series/Treemap/TreemapSeries.js +3 -3
- package/es-modules/Series/Venn/VennSeries.js +4 -4
- package/es-modules/Series/Venn/VennUtils.js +10 -16
- package/es-modules/Series/Waterfall/WaterfallSeries.js +40 -35
- package/es-modules/Series/Wordcloud/WordcloudSeries.js +1 -0
- package/es-modules/Series/XRange/XRangeSeries.js +4 -2
- package/es-modules/Stock/Indicators/SMA/SMAIndicator.js +92 -75
- package/es-modules/Stock/Indicators/Supertrend/SupertrendIndicator.js +20 -8
- package/es-modules/Stock/Indicators/VBP/VBPIndicator.js +17 -4
- package/es-modules/Stock/StockToolsBindings.js +77 -38
- package/es-modules/Stock/StockToolsGui.js +28 -3
- package/es-modules/masters/highcharts-3d.src.js +1 -1
- package/es-modules/masters/highcharts-gantt.src.js +1 -1
- package/es-modules/masters/highcharts-more.src.js +11 -7
- package/es-modules/masters/highcharts.src.js +25 -9
- package/es-modules/masters/highmaps.src.js +1 -1
- package/es-modules/masters/highstock.src.js +1 -1
- package/es-modules/masters/indicators/acceleration-bands.src.js +1 -1
- package/es-modules/masters/indicators/accumulation-distribution.src.js +1 -1
- package/es-modules/masters/indicators/ao.src.js +1 -1
- package/es-modules/masters/indicators/apo.src.js +1 -1
- package/es-modules/masters/indicators/aroon-oscillator.src.js +1 -1
- package/es-modules/masters/indicators/aroon.src.js +1 -1
- package/es-modules/masters/indicators/atr.src.js +1 -1
- package/es-modules/masters/indicators/bollinger-bands.src.js +1 -1
- package/es-modules/masters/indicators/cci.src.js +1 -1
- package/es-modules/masters/indicators/chaikin.src.js +1 -1
- package/es-modules/masters/indicators/cmf.src.js +1 -1
- package/es-modules/masters/indicators/cmo.src.js +1 -1
- package/es-modules/masters/indicators/dema.src.js +1 -1
- package/es-modules/masters/indicators/disparity-index.src.js +1 -1
- package/es-modules/masters/indicators/dmi.src.js +1 -1
- package/es-modules/masters/indicators/dpo.src.js +1 -1
- package/es-modules/masters/indicators/ema.src.js +1 -1
- package/es-modules/masters/indicators/ichimoku-kinko-hyo.src.js +1 -1
- package/es-modules/masters/indicators/indicators-all.src.js +1 -1
- package/es-modules/masters/indicators/indicators.src.js +1 -1
- package/es-modules/masters/indicators/keltner-channels.src.js +1 -1
- package/es-modules/masters/indicators/klinger.src.js +1 -1
- package/es-modules/masters/indicators/macd.src.js +1 -1
- package/es-modules/masters/indicators/mfi.src.js +1 -1
- package/es-modules/masters/indicators/momentum.src.js +1 -1
- package/es-modules/masters/indicators/natr.src.js +1 -1
- package/es-modules/masters/indicators/obv.src.js +1 -1
- package/es-modules/masters/indicators/pivot-points.src.js +1 -1
- package/es-modules/masters/indicators/ppo.src.js +1 -1
- package/es-modules/masters/indicators/price-channel.src.js +1 -1
- package/es-modules/masters/indicators/price-envelopes.src.js +1 -1
- package/es-modules/masters/indicators/psar.src.js +1 -1
- package/es-modules/masters/indicators/regressions.src.js +1 -1
- package/es-modules/masters/indicators/roc.src.js +1 -1
- package/es-modules/masters/indicators/rsi.src.js +1 -1
- package/es-modules/masters/indicators/slow-stochastic.src.js +1 -1
- package/es-modules/masters/indicators/stochastic.src.js +1 -1
- package/es-modules/masters/indicators/supertrend.src.js +1 -1
- package/es-modules/masters/indicators/tema.src.js +1 -1
- package/es-modules/masters/indicators/trendline.src.js +1 -1
- package/es-modules/masters/indicators/trix.src.js +1 -1
- package/es-modules/masters/indicators/volume-by-price.src.js +1 -1
- package/es-modules/masters/indicators/vwap.src.js +1 -1
- package/es-modules/masters/indicators/williams-r.src.js +1 -1
- package/es-modules/masters/indicators/wma.src.js +1 -1
- package/es-modules/masters/indicators/zigzag.src.js +1 -1
- package/es-modules/masters/modules/accessibility.src.js +1 -1
- package/es-modules/masters/modules/annotations-advanced.src.js +1 -1
- package/es-modules/masters/modules/annotations.src.js +1 -1
- package/es-modules/masters/modules/arrow-symbols.src.js +1 -1
- package/es-modules/masters/modules/boost-canvas.src.js +1 -1
- package/es-modules/masters/modules/boost.src.js +1 -1
- package/es-modules/masters/modules/broken-axis.src.js +1 -1
- package/es-modules/masters/modules/bullet.src.js +1 -1
- package/es-modules/masters/modules/coloraxis.src.js +6 -2
- package/es-modules/masters/modules/current-date-indicator.src.js +1 -1
- package/es-modules/masters/modules/cylinder.src.js +1 -1
- package/es-modules/masters/modules/data.src.js +8 -1
- package/es-modules/masters/modules/datagrouping.src.js +1 -1
- package/es-modules/masters/modules/debugger.src.js +1 -1
- package/es-modules/masters/modules/dependency-wheel.src.js +1 -1
- package/es-modules/masters/modules/dotplot.src.js +1 -1
- package/es-modules/masters/modules/drag-panes.src.js +1 -1
- package/es-modules/masters/modules/draggable-points.src.js +1 -1
- package/es-modules/masters/modules/drilldown.src.js +1 -1
- package/es-modules/masters/modules/dumbbell.src.js +1 -1
- package/es-modules/masters/modules/export-data.src.js +1 -1
- package/es-modules/masters/modules/exporting.src.js +10 -2
- package/es-modules/masters/modules/full-screen.src.js +1 -1
- package/es-modules/masters/modules/funnel.src.js +1 -1
- package/es-modules/masters/modules/funnel3d.src.js +1 -1
- package/es-modules/masters/modules/gantt.src.js +9 -4
- package/es-modules/masters/modules/grid-axis.src.js +1 -1
- package/es-modules/masters/modules/heatmap.src.js +6 -2
- package/es-modules/masters/modules/heikinashi.src.js +14 -0
- package/es-modules/masters/modules/histogram-bellcurve.src.js +1 -1
- package/es-modules/masters/modules/hollowcandlestick.src.js +14 -0
- package/es-modules/masters/modules/item-series.src.js +1 -1
- package/es-modules/masters/modules/lollipop.src.js +1 -1
- package/es-modules/masters/modules/map.src.js +10 -6
- package/es-modules/masters/modules/marker-clusters.src.js +1 -1
- package/es-modules/masters/modules/networkgraph.src.js +1 -1
- package/es-modules/masters/modules/no-data-to-display.src.js +1 -1
- package/es-modules/masters/modules/offline-exporting.src.js +8 -2
- package/es-modules/masters/modules/oldie-polyfills.src.js +1 -1
- package/es-modules/masters/modules/oldie.src.js +1 -1
- package/es-modules/masters/modules/organization.src.js +1 -1
- package/es-modules/masters/modules/overlapping-datalabels.src.js +1 -1
- package/es-modules/masters/modules/parallel-coordinates.src.js +1 -1
- package/es-modules/masters/modules/pareto.src.js +1 -1
- package/es-modules/masters/modules/pathfinder.src.js +1 -1
- package/es-modules/masters/modules/pattern-fill.src.js +1 -1
- package/es-modules/masters/modules/price-indicator.src.js +1 -1
- package/es-modules/masters/modules/pyramid3d.src.js +1 -1
- package/es-modules/masters/modules/sankey.src.js +1 -1
- package/es-modules/masters/modules/series-label.src.js +1 -1
- package/es-modules/masters/modules/solid-gauge.src.js +1 -1
- package/es-modules/masters/modules/sonification.src.js +1 -1
- package/es-modules/masters/modules/static-scale.src.js +1 -1
- package/es-modules/masters/modules/stock-tools.src.js +1 -1
- package/es-modules/masters/modules/stock.src.js +3 -2
- package/es-modules/masters/modules/streamgraph.src.js +1 -1
- package/es-modules/masters/modules/sunburst.src.js +1 -1
- package/es-modules/masters/modules/tilemap.src.js +1 -1
- package/es-modules/masters/modules/timeline.src.js +1 -1
- package/es-modules/masters/modules/treegrid.src.js +1 -1
- package/es-modules/masters/modules/treemap.src.js +1 -1
- package/es-modules/masters/modules/variable-pie.src.js +1 -1
- package/es-modules/masters/modules/variwide.src.js +1 -1
- package/es-modules/masters/modules/vector.src.js +1 -1
- package/es-modules/masters/modules/venn.src.js +1 -1
- package/es-modules/masters/modules/windbarb.src.js +1 -1
- package/es-modules/masters/modules/wordcloud.src.js +1 -1
- package/es-modules/masters/modules/xrange.src.js +1 -1
- package/es-modules/masters/themes/avocado.src.js +5 -2
- package/es-modules/masters/themes/dark-blue.src.js +5 -2
- package/es-modules/masters/themes/dark-green.src.js +5 -2
- package/es-modules/masters/themes/dark-unica.src.js +5 -2
- package/es-modules/masters/themes/gray.src.js +5 -2
- package/es-modules/masters/themes/grid-light.src.js +5 -2
- package/es-modules/masters/themes/grid.src.js +5 -2
- package/es-modules/masters/themes/high-contrast-dark.src.js +5 -2
- package/es-modules/masters/themes/high-contrast-light.src.js +5 -2
- package/es-modules/masters/themes/sand-signika.src.js +5 -2
- package/es-modules/masters/themes/skies.src.js +5 -2
- package/es-modules/masters/themes/sunset.src.js +5 -2
- package/gfx/stock-icons/annotations-hidden.svg +1 -1
- package/gfx/stock-icons/annotations-visible.svg +2 -2
- package/gfx/stock-icons/arrow-bottom.svg +1 -1
- package/gfx/stock-icons/arrow-left.svg +1 -1
- package/gfx/stock-icons/arrow-line.svg +1 -1
- package/gfx/stock-icons/arrow-ray.svg +1 -1
- package/gfx/stock-icons/arrow-right.svg +1 -1
- package/gfx/stock-icons/arrow-segment.svg +1 -2
- package/gfx/stock-icons/circle.svg +1 -1
- package/gfx/stock-icons/close.svg +2 -2
- package/gfx/stock-icons/crooked-3.svg +1 -1
- package/gfx/stock-icons/crooked-5.svg +1 -1
- package/gfx/stock-icons/current-price-hide.svg +3 -3
- package/gfx/stock-icons/current-price-show.svg +2 -2
- package/gfx/stock-icons/destroy.svg +1 -1
- package/gfx/stock-icons/drawing.svg +18 -0
- package/gfx/stock-icons/edit.svg +1 -1
- package/gfx/stock-icons/elliott-3.svg +1 -1
- package/gfx/stock-icons/elliott-5.svg +1 -1
- package/gfx/stock-icons/ellipse.svg +11 -0
- package/gfx/stock-icons/fibonacci-timezone.svg +16 -0
- package/gfx/stock-icons/fibonacci.svg +1 -1
- package/gfx/stock-icons/flag-basic.svg +1 -1
- package/gfx/stock-icons/flag-diamond.svg +2 -2
- package/gfx/stock-icons/flag-elipse.svg +1 -1
- package/gfx/stock-icons/flag-trapeze.svg +2 -2
- package/gfx/stock-icons/fullscreen.svg +4 -4
- package/gfx/stock-icons/horizontal-line.svg +1 -1
- package/gfx/stock-icons/indicators.svg +3 -3
- package/gfx/stock-icons/label.svg +4 -4
- package/gfx/stock-icons/line.svg +1 -1
- package/gfx/stock-icons/linear.svg +11 -0
- package/gfx/stock-icons/logarithmic.svg +1 -0
- package/gfx/stock-icons/measure-x.svg +2 -2
- package/gfx/stock-icons/measure-xy.svg +1 -1
- package/gfx/stock-icons/measure-y.svg +1 -1
- package/gfx/stock-icons/panning.svg +17 -0
- package/gfx/stock-icons/parallel-channel.svg +1 -1
- package/gfx/stock-icons/pitchfork.svg +1 -1
- package/gfx/stock-icons/ray.svg +1 -1
- package/gfx/stock-icons/rectangle.svg +1 -1
- package/gfx/stock-icons/remove-annotations.svg +2 -2
- package/gfx/stock-icons/save-chart.svg +3 -3
- package/gfx/stock-icons/segment.svg +1 -1
- package/gfx/stock-icons/separator.svg +1 -1
- package/gfx/stock-icons/series-candlestick.svg +1 -1
- package/gfx/stock-icons/series-heikin-ashi.svg +1 -0
- package/gfx/stock-icons/series-hlc.svg +1 -0
- package/gfx/stock-icons/series-hollow-candlestick.svg +1 -0
- package/gfx/stock-icons/series-line.svg +1 -1
- package/gfx/stock-icons/series-ohlc.svg +4 -4
- package/gfx/stock-icons/time-cycles.svg +35 -0
- package/gfx/stock-icons/vertical-arrow.svg +1 -1
- package/gfx/stock-icons/vertical-counter.svg +1 -1
- package/gfx/stock-icons/vertical-double-arrow.svg +1 -1
- package/gfx/stock-icons/vertical-label.svg +3 -3
- package/gfx/stock-icons/vertical-line.svg +1 -1
- package/gfx/stock-icons/zoom-x.svg +2 -2
- package/gfx/stock-icons/zoom-xy.svg +2 -2
- package/gfx/stock-icons/zoom-y.svg +2 -2
- package/highcharts-3d.js +24 -24
- package/highcharts-3d.js.map +1 -1
- package/highcharts-3d.src.js +6 -3
- package/highcharts-gantt.js +800 -792
- package/highcharts-gantt.js.map +1 -1
- package/highcharts-gantt.src.js +16535 -15918
- package/highcharts-more.d.ts +73 -1
- package/highcharts-more.js +193 -192
- package/highcharts-more.js.map +1 -1
- package/highcharts-more.src.d.ts +73 -1
- package/highcharts-more.src.js +8044 -7839
- package/highcharts.d.ts +3850 -177
- package/highcharts.js +589 -581
- package/highcharts.js.map +1 -1
- package/highcharts.src.d.ts +3850 -177
- package/highcharts.src.js +16635 -16060
- package/highmaps.js +708 -698
- package/highmaps.js.map +1 -1
- package/highmaps.src.js +17419 -16521
- package/highstock.js +782 -769
- package/highstock.js.map +1 -1
- package/highstock.src.js +28867 -27975
- package/indicators/acceleration-bands.js +9 -9
- package/indicators/acceleration-bands.js.map +1 -1
- package/indicators/acceleration-bands.src.js +7 -1
- package/indicators/accumulation-distribution.js +1 -1
- package/indicators/accumulation-distribution.src.js +1 -1
- package/indicators/ao.js +1 -1
- package/indicators/ao.src.js +1 -1
- package/indicators/apo.js +1 -1
- package/indicators/apo.src.js +1 -1
- package/indicators/aroon-oscillator.js +9 -9
- package/indicators/aroon-oscillator.js.map +1 -1
- package/indicators/aroon-oscillator.src.js +7 -1
- package/indicators/aroon.js +9 -9
- package/indicators/aroon.js.map +1 -1
- package/indicators/aroon.src.js +7 -1
- package/indicators/atr.js +1 -1
- package/indicators/atr.src.js +1 -1
- package/indicators/bollinger-bands.js +9 -9
- package/indicators/bollinger-bands.js.map +1 -1
- package/indicators/bollinger-bands.src.js +7 -1
- package/indicators/cci.js +1 -1
- package/indicators/cci.src.js +1 -1
- package/indicators/chaikin.js +1 -1
- package/indicators/chaikin.src.js +1 -1
- package/indicators/cmf.js +1 -1
- package/indicators/cmf.src.js +1 -1
- package/indicators/cmo.js +1 -1
- package/indicators/cmo.src.js +1 -1
- package/indicators/dema.js +1 -1
- package/indicators/dema.src.js +1 -1
- package/indicators/disparity-index.js +1 -1
- package/indicators/disparity-index.src.js +1 -1
- package/indicators/dmi.js +11 -11
- package/indicators/dmi.js.map +1 -1
- package/indicators/dmi.src.js +7 -1
- package/indicators/dpo.js +1 -1
- package/indicators/dpo.src.js +1 -1
- package/indicators/ema.js +1 -1
- package/indicators/ema.src.js +1 -1
- package/indicators/ichimoku-kinko-hyo.js +1 -1
- package/indicators/ichimoku-kinko-hyo.src.js +1 -1
- package/indicators/indicators-all.js +203 -200
- package/indicators/indicators-all.js.map +1 -1
- package/indicators/indicators-all.src.js +206 -104
- package/indicators/indicators.js +12 -11
- package/indicators/indicators.js.map +1 -1
- package/indicators/indicators.src.js +108 -90
- package/indicators/keltner-channels.js +9 -9
- package/indicators/keltner-channels.js.map +1 -1
- package/indicators/keltner-channels.src.js +7 -1
- package/indicators/klinger.js +13 -13
- package/indicators/klinger.js.map +1 -1
- package/indicators/klinger.src.js +7 -1
- package/indicators/macd.js +1 -1
- package/indicators/macd.src.js +1 -1
- package/indicators/mfi.js +1 -1
- package/indicators/mfi.src.js +1 -1
- package/indicators/momentum.js +1 -1
- package/indicators/momentum.src.js +1 -1
- package/indicators/natr.js +1 -1
- package/indicators/natr.src.js +1 -1
- package/indicators/obv.js +1 -1
- package/indicators/obv.src.js +1 -1
- package/indicators/pivot-points.js +1 -1
- package/indicators/pivot-points.src.js +1 -1
- package/indicators/ppo.js +1 -1
- package/indicators/ppo.src.js +1 -1
- package/indicators/price-channel.js +9 -9
- package/indicators/price-channel.js.map +1 -1
- package/indicators/price-channel.src.js +7 -1
- package/indicators/price-envelopes.js +1 -1
- package/indicators/price-envelopes.src.js +1 -1
- package/indicators/psar.js +1 -1
- package/indicators/psar.src.js +1 -1
- package/indicators/regressions.js +1 -1
- package/indicators/regressions.src.js +1 -1
- package/indicators/roc.js +1 -1
- package/indicators/roc.src.js +1 -1
- package/indicators/rsi.js +1 -1
- package/indicators/rsi.src.js +1 -1
- package/indicators/slow-stochastic.js +1 -1
- package/indicators/slow-stochastic.src.js +1 -1
- package/indicators/stochastic.js +10 -10
- package/indicators/stochastic.js.map +1 -1
- package/indicators/stochastic.src.js +7 -1
- package/indicators/supertrend.js +10 -10
- package/indicators/supertrend.js.map +1 -1
- package/indicators/supertrend.src.js +23 -10
- package/indicators/tema.js +1 -1
- package/indicators/tema.src.js +1 -1
- package/indicators/trendline.js +1 -1
- package/indicators/trendline.src.js +1 -1
- package/indicators/trix.js +1 -1
- package/indicators/trix.src.js +1 -1
- package/indicators/volume-by-price.js +17 -15
- package/indicators/volume-by-price.js.map +1 -1
- package/indicators/volume-by-price.src.js +71 -6
- package/indicators/vwap.js +1 -1
- package/indicators/vwap.src.js +1 -1
- package/indicators/williams-r.js +1 -1
- package/indicators/williams-r.src.js +1 -1
- package/indicators/wma.js +1 -1
- package/indicators/wma.src.js +1 -1
- package/indicators/zigzag.js +1 -1
- package/indicators/zigzag.src.js +1 -1
- package/modules/accessibility.js +203 -202
- package/modules/accessibility.js.map +1 -1
- package/modules/accessibility.src.js +89 -49
- package/modules/annotations-advanced.js +164 -163
- package/modules/annotations-advanced.js.map +1 -1
- package/modules/annotations-advanced.src.js +162 -87
- package/modules/annotations.js +111 -111
- package/modules/annotations.js.map +1 -1
- package/modules/annotations.src.js +162 -87
- package/modules/arrow-symbols.js +1 -1
- package/modules/arrow-symbols.src.js +1 -1
- package/modules/boost-canvas.js +2 -2
- package/modules/boost-canvas.js.map +1 -1
- package/modules/boost-canvas.src.js +2 -2
- package/modules/boost.js +52 -52
- package/modules/boost.js.map +1 -1
- package/modules/boost.src.js +15 -7
- package/modules/broken-axis.js +13 -13
- package/modules/broken-axis.js.map +1 -1
- package/modules/broken-axis.src.js +34 -15
- package/modules/bullet.js +1 -1
- package/modules/bullet.src.js +1 -1
- package/modules/coloraxis.js +24 -22
- package/modules/coloraxis.js.map +1 -1
- package/modules/coloraxis.src.js +954 -774
- package/modules/current-date-indicator.js +2 -2
- package/modules/current-date-indicator.js.map +1 -1
- package/modules/current-date-indicator.src.js +2 -2
- package/modules/cylinder.js +1 -1
- package/modules/cylinder.src.js +1 -1
- package/modules/data.js +33 -32
- package/modules/data.js.map +1 -1
- package/modules/data.src.js +182 -134
- package/modules/datagrouping.d.ts +5 -0
- package/modules/datagrouping.js +20 -20
- package/modules/datagrouping.js.map +1 -1
- package/modules/datagrouping.src.d.ts +5 -0
- package/modules/datagrouping.src.js +270 -228
- package/modules/debugger.js +3 -3
- package/modules/debugger.js.map +1 -1
- package/modules/debugger.src.js +3 -3
- package/modules/dependency-wheel.js +1 -1
- package/modules/dependency-wheel.src.js +1 -1
- package/modules/dotplot.js +1 -1
- package/modules/dotplot.src.js +1 -1
- package/modules/drag-panes.js +1 -1
- package/modules/drag-panes.src.js +1 -1
- package/modules/draggable-points.js +34 -34
- package/modules/draggable-points.js.map +1 -1
- package/modules/draggable-points.src.js +14 -5
- package/modules/drilldown.d.ts +27 -0
- package/modules/drilldown.js +18 -18
- package/modules/drilldown.js.map +1 -1
- package/modules/drilldown.src.d.ts +27 -0
- package/modules/drilldown.src.js +42 -16
- package/modules/dumbbell.js +1 -1
- package/modules/dumbbell.src.js +1 -1
- package/modules/export-data.js +20 -20
- package/modules/export-data.js.map +1 -1
- package/modules/export-data.src.js +8 -5
- package/modules/exporting.d.ts +29 -0
- package/modules/exporting.js +38 -35
- package/modules/exporting.js.map +1 -1
- package/modules/exporting.src.d.ts +29 -0
- package/modules/exporting.src.js +1937 -1614
- package/modules/full-screen.js +2 -2
- package/modules/full-screen.js.map +1 -1
- package/modules/full-screen.src.js +8 -6
- package/modules/funnel.js +1 -1
- package/modules/funnel.src.js +1 -1
- package/modules/funnel3d.js +1 -1
- package/modules/funnel3d.src.js +1 -1
- package/modules/gantt.js +218 -217
- package/modules/gantt.js.map +1 -1
- package/modules/gantt.src.js +74 -32
- package/modules/grid-axis.js +23 -22
- package/modules/grid-axis.js.map +1 -1
- package/modules/grid-axis.src.js +9 -4
- package/modules/heatmap.js +39 -37
- package/modules/heatmap.js.map +1 -1
- package/modules/heatmap.src.js +963 -779
- package/modules/heikinashi.js +17 -0
- package/modules/heikinashi.js.map +1 -0
- package/modules/heikinashi.src.js +394 -0
- package/modules/histogram-bellcurve.js +1 -1
- package/modules/histogram-bellcurve.src.js +1 -1
- package/modules/hollowcandlestick.js +18 -0
- package/modules/hollowcandlestick.js.map +1 -0
- package/modules/hollowcandlestick.src.js +504 -0
- package/modules/item-series.js +1 -1
- package/modules/item-series.src.js +1 -1
- package/modules/lollipop.js +1 -1
- package/modules/lollipop.src.js +1 -1
- package/modules/map.d.ts +9 -0
- package/modules/map.js +122 -119
- package/modules/map.js.map +1 -1
- package/modules/map.src.d.ts +9 -0
- package/modules/map.src.js +1655 -1332
- package/modules/marker-clusters.js +1 -1
- package/modules/marker-clusters.src.js +1 -1
- package/modules/networkgraph.js +1 -1
- package/modules/networkgraph.src.js +1 -1
- package/modules/no-data-to-display.js +3 -3
- package/modules/no-data-to-display.js.map +1 -1
- package/modules/no-data-to-display.src.js +2 -2
- package/modules/offline-exporting.js +18 -16
- package/modules/offline-exporting.js.map +1 -1
- package/modules/offline-exporting.src.js +623 -562
- package/modules/oldie-polyfills.js +1 -1
- package/modules/oldie-polyfills.src.js +1 -1
- package/modules/oldie.js +2 -2
- package/modules/oldie.src.js +2 -2
- package/modules/organization.js +1 -1
- package/modules/organization.src.js +1 -1
- package/modules/overlapping-datalabels.js +1 -1
- package/modules/overlapping-datalabels.src.js +1 -1
- package/modules/parallel-coordinates.js +1 -1
- package/modules/parallel-coordinates.src.js +1 -1
- package/modules/pareto.js +1 -1
- package/modules/pareto.src.js +1 -1
- package/modules/pathfinder.js +1 -1
- package/modules/pathfinder.src.js +1 -1
- package/modules/pattern-fill.js +14 -14
- package/modules/pattern-fill.js.map +1 -1
- package/modules/pattern-fill.src.js +24 -12
- package/modules/price-indicator.js +1 -1
- package/modules/price-indicator.src.js +1 -1
- package/modules/pyramid3d.js +1 -1
- package/modules/pyramid3d.src.js +1 -1
- package/modules/sankey.js +28 -28
- package/modules/sankey.js.map +1 -1
- package/modules/sankey.src.js +11 -11
- package/modules/series-label.js +1 -1
- package/modules/series-label.src.js +1 -1
- package/modules/solid-gauge.js +2 -2
- package/modules/solid-gauge.js.map +1 -1
- package/modules/solid-gauge.src.js +3 -3
- package/modules/sonification.js +1 -1
- package/modules/sonification.src.js +1 -1
- package/modules/static-scale.js +1 -1
- package/modules/static-scale.src.js +1 -1
- package/modules/stock-tools.js +159 -157
- package/modules/stock-tools.js.map +1 -1
- package/modules/stock-tools.src.js +253 -123
- package/modules/stock.d.ts +5 -0
- package/modules/stock.js +196 -191
- package/modules/stock.js.map +1 -1
- package/modules/stock.src.d.ts +5 -0
- package/modules/stock.src.js +7749 -7432
- package/modules/streamgraph.js +1 -1
- package/modules/streamgraph.src.js +1 -1
- package/modules/sunburst.js +5 -5
- package/modules/sunburst.js.map +1 -1
- package/modules/sunburst.src.js +6 -19
- package/modules/tilemap.js +1 -1
- package/modules/tilemap.src.js +1 -1
- package/modules/timeline.js +18 -17
- package/modules/timeline.js.map +1 -1
- package/modules/timeline.src.js +21 -24
- package/modules/treegrid.js +57 -57
- package/modules/treegrid.js.map +1 -1
- package/modules/treegrid.src.js +43 -19
- package/modules/treemap.js +5 -5
- package/modules/treemap.js.map +1 -1
- package/modules/treemap.src.js +5 -5
- package/modules/variable-pie.js +1 -1
- package/modules/variable-pie.src.js +1 -1
- package/modules/variwide.js +1 -1
- package/modules/variwide.src.js +1 -1
- package/modules/vector.js +1 -1
- package/modules/vector.src.js +1 -1
- package/modules/venn.js +31 -30
- package/modules/venn.js.map +1 -1
- package/modules/venn.src.js +508 -424
- package/modules/windbarb.js +1 -1
- package/modules/windbarb.src.js +1 -1
- package/modules/wordcloud.js +4 -4
- package/modules/wordcloud.js.map +1 -1
- package/modules/wordcloud.src.js +2 -1
- package/modules/xrange.js +17 -17
- package/modules/xrange.js.map +1 -1
- package/modules/xrange.src.js +7 -4
- package/package.json +1 -1
- package/themes/avocado.d.ts +6 -1
- package/themes/avocado.js +3 -3
- package/themes/avocado.js.map +1 -1
- package/themes/avocado.src.d.ts +6 -1
- package/themes/avocado.src.js +53 -22
- package/themes/dark-blue.d.ts +6 -1
- package/themes/dark-blue.js +3 -3
- package/themes/dark-blue.js.map +1 -1
- package/themes/dark-blue.src.d.ts +6 -1
- package/themes/dark-blue.src.js +231 -205
- package/themes/dark-green.d.ts +6 -1
- package/themes/dark-green.js +4 -4
- package/themes/dark-green.js.map +1 -1
- package/themes/dark-green.src.d.ts +6 -1
- package/themes/dark-green.src.js +236 -205
- package/themes/dark-unica.d.ts +6 -1
- package/themes/dark-unica.js +7 -7
- package/themes/dark-unica.js.map +1 -1
- package/themes/dark-unica.src.d.ts +6 -1
- package/themes/dark-unica.src.js +206 -174
- package/themes/gray.d.ts +6 -1
- package/themes/gray.js +3 -3
- package/themes/gray.js.map +1 -1
- package/themes/gray.src.d.ts +6 -1
- package/themes/gray.src.js +233 -207
- package/themes/grid-light.d.ts +6 -1
- package/themes/grid-light.js +4 -4
- package/themes/grid-light.js.map +1 -1
- package/themes/grid-light.src.d.ts +6 -1
- package/themes/grid-light.src.js +88 -57
- package/themes/grid.d.ts +6 -1
- package/themes/grid.js +3 -3
- package/themes/grid.js.map +1 -1
- package/themes/grid.src.d.ts +6 -1
- package/themes/grid.src.js +114 -83
- package/themes/high-contrast-dark.js +5 -4
- package/themes/high-contrast-dark.js.map +1 -1
- package/themes/high-contrast-dark.src.js +197 -166
- package/themes/high-contrast-light.js +3 -3
- package/themes/high-contrast-light.js.map +1 -1
- package/themes/high-contrast-light.src.js +54 -23
- package/themes/sand-signika.d.ts +6 -1
- package/themes/sand-signika.js +5 -5
- package/themes/sand-signika.js.map +1 -1
- package/themes/sand-signika.src.d.ts +6 -1
- package/themes/sand-signika.src.js +119 -88
- package/themes/skies.d.ts +6 -1
- package/themes/skies.js +5 -5
- package/themes/skies.js.map +1 -1
- package/themes/skies.src.d.ts +6 -1
- package/themes/skies.src.js +107 -76
- package/themes/sunset.d.ts +6 -1
- package/themes/sunset.js +3 -3
- package/themes/sunset.js.map +1 -1
- package/themes/sunset.src.d.ts +6 -1
- package/themes/sunset.src.js +52 -21
- package/es-modules/Core/Axis/ColorAxis.js +0 -1164
- package/es-modules/Core/Axis/HiddenAxis.js +0 -46
- package/es-modules/Core/Axis/PlotLineOrBand.js +0 -1051
- package/es-modules/Core/Series/DataLabels.js +0 -1173
- package/es-modules/Extensions/Exporting.js +0 -2024
- package/es-modules/Extensions/OfflineExporting.js +0 -621
- package/es-modules/Mixins/Geometry.js +0 -56
- package/es-modules/Mixins/GeometryCircles.js +0 -320
- package/es-modules/Series/Bubble/BubbleLegend.js +0 -893
package/modules/map.src.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Highmaps JS v9.
|
|
2
|
+
* @license Highmaps JS v9.2.2 (2021-08-24)
|
|
3
3
|
*
|
|
4
4
|
* Highmaps as a plugin for Highcharts or Highcharts Stock.
|
|
5
5
|
*
|
|
@@ -238,7 +238,6 @@
|
|
|
238
238
|
*/
|
|
239
239
|
var colorSeriesMixin = {
|
|
240
240
|
optionalAxis: 'colorAxis',
|
|
241
|
-
colorAxis: 0,
|
|
242
241
|
/* eslint-disable valid-jsdoc */
|
|
243
242
|
/**
|
|
244
243
|
* In choropleth maps,
|
|
@@ -281,7 +280,7 @@
|
|
|
281
280
|
|
|
282
281
|
return exports;
|
|
283
282
|
});
|
|
284
|
-
_registerModule(_modules, 'Core/Axis/
|
|
283
|
+
_registerModule(_modules, 'Core/Axis/Color/ColorAxisComposition.js', [_modules['Core/Color/Color.js'], _modules['Mixins/ColorSeries.js'], _modules['Core/Utilities.js']], function (Color, ColorSeriesMixins, U) {
|
|
285
284
|
/* *
|
|
286
285
|
*
|
|
287
286
|
* (c) 2010-2021 Torstein Honsi
|
|
@@ -291,715 +290,310 @@
|
|
|
291
290
|
* !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
|
|
292
291
|
*
|
|
293
292
|
* */
|
|
294
|
-
var __extends = (this && this.__extends) || (function () {
|
|
295
|
-
var extendStatics = function (d,
|
|
296
|
-
b) {
|
|
297
|
-
extendStatics = Object.setPrototypeOf ||
|
|
298
|
-
({ __proto__: [] } instanceof Array && function (d,
|
|
299
|
-
b) { d.__proto__ = b; }) ||
|
|
300
|
-
function (d,
|
|
301
|
-
b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
302
|
-
return extendStatics(d, b);
|
|
303
|
-
};
|
|
304
|
-
return function (d, b) {
|
|
305
|
-
extendStatics(d, b);
|
|
306
|
-
function __() { this.constructor = d; }
|
|
307
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
308
|
-
};
|
|
309
|
-
})();
|
|
310
293
|
var color = Color.parse;
|
|
311
|
-
var colorPointMixin =
|
|
312
|
-
colorSeriesMixin =
|
|
313
|
-
var noop = H.noop;
|
|
294
|
+
var colorPointMixin = ColorSeriesMixins.colorPointMixin,
|
|
295
|
+
colorSeriesMixin = ColorSeriesMixins.colorSeriesMixin;
|
|
314
296
|
var addEvent = U.addEvent,
|
|
315
|
-
erase = U.erase,
|
|
316
297
|
extend = U.extend,
|
|
317
|
-
isNumber = U.isNumber,
|
|
318
298
|
merge = U.merge,
|
|
319
299
|
pick = U.pick,
|
|
320
300
|
splat = U.splat;
|
|
321
|
-
|
|
322
|
-
* Color axis types
|
|
323
|
-
*
|
|
324
|
-
* @typedef {"linear"|"logarithmic"} Highcharts.ColorAxisTypeValue
|
|
325
|
-
*/
|
|
326
|
-
''; // detach doclet above
|
|
327
|
-
extend(Series.prototype, colorSeriesMixin);
|
|
328
|
-
extend(Point.prototype, colorPointMixin);
|
|
329
|
-
Chart.prototype.collectionsWithUpdate.push('colorAxis');
|
|
330
|
-
Chart.prototype.collectionsWithInit.colorAxis = [Chart.prototype.addColorAxis];
|
|
331
|
-
/* eslint-disable no-invalid-this, valid-jsdoc */
|
|
332
|
-
/**
|
|
333
|
-
* The ColorAxis object for inclusion in gradient legends.
|
|
334
|
-
*
|
|
335
|
-
* @class
|
|
336
|
-
* @name Highcharts.ColorAxis
|
|
337
|
-
* @augments Highcharts.Axis
|
|
301
|
+
/* *
|
|
338
302
|
*
|
|
339
|
-
*
|
|
340
|
-
* The related chart of the color axis.
|
|
303
|
+
* Composition
|
|
341
304
|
*
|
|
342
|
-
*
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
var ColorAxis = /** @class */ (function (_super) {
|
|
346
|
-
__extends(ColorAxis, _super);
|
|
305
|
+
* */
|
|
306
|
+
var ColorAxisComposition;
|
|
307
|
+
(function (ColorAxisComposition) {
|
|
347
308
|
/* *
|
|
348
309
|
*
|
|
349
|
-
*
|
|
310
|
+
* Constants
|
|
350
311
|
*
|
|
351
312
|
* */
|
|
352
|
-
|
|
353
|
-
* @private
|
|
354
|
-
*/
|
|
355
|
-
function ColorAxis(chart, userOptions) {
|
|
356
|
-
var _this = _super.call(this,
|
|
357
|
-
chart,
|
|
358
|
-
userOptions) || this;
|
|
359
|
-
_this.beforePadding = false; // Prevents unnecessary padding with `hc-more`
|
|
360
|
-
_this.chart = void 0;
|
|
361
|
-
_this.coll = 'colorAxis';
|
|
362
|
-
_this.dataClasses = void 0;
|
|
363
|
-
_this.legendItem = void 0;
|
|
364
|
-
_this.legendItems = void 0;
|
|
365
|
-
_this.name = ''; // Prevents 'undefined' in legend in IE8
|
|
366
|
-
_this.options = void 0;
|
|
367
|
-
_this.stops = void 0;
|
|
368
|
-
_this.visible = true;
|
|
369
|
-
_this.init(chart, userOptions);
|
|
370
|
-
return _this;
|
|
371
|
-
}
|
|
313
|
+
var composedClasses = [];
|
|
372
314
|
/* *
|
|
373
315
|
*
|
|
374
|
-
*
|
|
316
|
+
* Variables
|
|
375
317
|
*
|
|
376
318
|
* */
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
*
|
|
380
|
-
* @function Highcharts.ColorAxis#init
|
|
319
|
+
var ColorAxisClass;
|
|
320
|
+
/* *
|
|
381
321
|
*
|
|
382
|
-
*
|
|
383
|
-
* The related chart of the color axis.
|
|
322
|
+
* Functions
|
|
384
323
|
*
|
|
385
|
-
*
|
|
386
|
-
|
|
324
|
+
* */
|
|
325
|
+
/* eslint-disable valid-jsdoc */
|
|
326
|
+
/**
|
|
327
|
+
* @private
|
|
387
328
|
*/
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
329
|
+
function compose(ColorAxisType, ChartClass, FxClass, LegendClass, SeriesClass) {
|
|
330
|
+
if (!ColorAxisClass) {
|
|
331
|
+
ColorAxisClass = ColorAxisType;
|
|
332
|
+
}
|
|
333
|
+
if (composedClasses.indexOf(ChartClass) === -1) {
|
|
334
|
+
composedClasses.push(ChartClass);
|
|
335
|
+
var chartProto = ChartClass.prototype;
|
|
336
|
+
chartProto.collectionsWithUpdate.push('colorAxis');
|
|
337
|
+
chartProto.collectionsWithInit.colorAxis = [chartProto.addColorAxis];
|
|
338
|
+
addEvent(ChartClass, 'afterGetAxes', onChartAfterGetAxes);
|
|
339
|
+
wrapChartCreateAxis(ChartClass);
|
|
340
|
+
}
|
|
341
|
+
if (composedClasses.indexOf(FxClass) === -1) {
|
|
342
|
+
composedClasses.push(FxClass);
|
|
343
|
+
var fxProto = FxClass.prototype;
|
|
344
|
+
fxProto.fillSetter = wrapFxFillSetter;
|
|
345
|
+
fxProto.strokeSetter = wrapFxStrokeSetter;
|
|
346
|
+
}
|
|
347
|
+
if (composedClasses.indexOf(LegendClass) === -1) {
|
|
348
|
+
composedClasses.push(LegendClass);
|
|
349
|
+
addEvent(LegendClass, 'afterGetAllItems', onLegendAfterGetAllItems);
|
|
350
|
+
addEvent(LegendClass, 'afterColorizeItem', onLegendAfterColorizeItem);
|
|
351
|
+
addEvent(LegendClass, 'afterUpdate', onLegendAfterUpdate);
|
|
352
|
+
}
|
|
353
|
+
if (composedClasses.indexOf(SeriesClass) === -1) {
|
|
354
|
+
composedClasses.push(SeriesClass);
|
|
355
|
+
extend(SeriesClass.prototype, colorSeriesMixin);
|
|
356
|
+
extend(SeriesClass.prototype.pointClass.prototype, colorPointMixin);
|
|
357
|
+
addEvent(SeriesClass, 'afterTranslate', onSeriesAfterTranslate);
|
|
358
|
+
addEvent(SeriesClass, 'bindAxes', onSeriesBindAxes);
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
ColorAxisComposition.compose = compose;
|
|
362
|
+
/**
|
|
363
|
+
* Extend the chart getAxes method to also get the color axis.
|
|
364
|
+
* @private
|
|
365
|
+
*/
|
|
366
|
+
function onChartAfterGetAxes() {
|
|
367
|
+
var _this = this;
|
|
368
|
+
var options = this.options;
|
|
369
|
+
this.colorAxis = [];
|
|
370
|
+
if (options.colorAxis) {
|
|
371
|
+
options.colorAxis = splat(options.colorAxis);
|
|
372
|
+
options.colorAxis.forEach(function (axisOptions, i) {
|
|
373
|
+
axisOptions.index = i;
|
|
374
|
+
new ColorAxisClass(_this, axisOptions); // eslint-disable-line no-new
|
|
400
375
|
});
|
|
401
|
-
axis.coll = 'colorAxis';
|
|
402
|
-
axis.side = userOptions.side || horiz ? 2 : 1;
|
|
403
|
-
axis.reversed = userOptions.reversed || !horiz;
|
|
404
|
-
axis.opposite = !horiz;
|
|
405
|
-
_super.prototype.init.call(this, chart, options);
|
|
406
|
-
// Base init() pushes it to the xAxis array, now pop it again
|
|
407
|
-
// chart[this.isXAxis ? 'xAxis' : 'yAxis'].pop();
|
|
408
|
-
// Prepare data classes
|
|
409
|
-
if (userOptions.dataClasses) {
|
|
410
|
-
axis.initDataClasses(userOptions);
|
|
411
376
|
}
|
|
412
|
-
|
|
413
|
-
// Override original axis properties
|
|
414
|
-
axis.horiz = horiz;
|
|
415
|
-
axis.zoomEnabled = false;
|
|
416
|
-
};
|
|
377
|
+
}
|
|
417
378
|
/**
|
|
379
|
+
* Add the color axis. This also removes the axis' own series to prevent
|
|
380
|
+
* them from showing up individually.
|
|
418
381
|
* @private
|
|
419
382
|
*/
|
|
420
|
-
|
|
421
|
-
var
|
|
422
|
-
var
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
axis.legendItems = [];
|
|
430
|
-
userOptions.dataClasses.forEach(function (dataClass, i) {
|
|
431
|
-
var colors;
|
|
432
|
-
dataClass = merge(dataClass);
|
|
433
|
-
dataClasses.push(dataClass);
|
|
434
|
-
if (!chart.styledMode && dataClass.color) {
|
|
435
|
-
return;
|
|
383
|
+
function onLegendAfterGetAllItems(e) {
|
|
384
|
+
var _this = this;
|
|
385
|
+
var colorAxes = this.chart.colorAxis || [],
|
|
386
|
+
destroyItem = function (item) {
|
|
387
|
+
var i = e.allItems.indexOf(item);
|
|
388
|
+
if (i !== -1) {
|
|
389
|
+
// #15436
|
|
390
|
+
_this.destroyItem(e.allItems[i]);
|
|
391
|
+
e.allItems.splice(i, 1);
|
|
436
392
|
}
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
393
|
+
};
|
|
394
|
+
var colorAxisItems = [],
|
|
395
|
+
options,
|
|
396
|
+
i;
|
|
397
|
+
colorAxes.forEach(function (colorAxis) {
|
|
398
|
+
options = colorAxis.options;
|
|
399
|
+
if (options && options.showInLegend) {
|
|
400
|
+
// Data classes
|
|
401
|
+
if (options.dataClasses && options.visible) {
|
|
402
|
+
colorAxisItems = colorAxisItems.concat(colorAxis.getDataClassLegendSymbols());
|
|
403
|
+
// Gradient legend
|
|
442
404
|
}
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
if (colorCounter === colorCount) {
|
|
447
|
-
colorCounter = 0;
|
|
405
|
+
else if (options.visible) {
|
|
406
|
+
// Add this axis on top
|
|
407
|
+
colorAxisItems.push(colorAxis);
|
|
448
408
|
}
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
409
|
+
// If dataClasses are defined or showInLegend option is not set
|
|
410
|
+
// to true, do not add color axis' series to legend.
|
|
411
|
+
colorAxis.series.forEach(function (series) {
|
|
412
|
+
if (!series.options.showInLegend || options.dataClasses) {
|
|
413
|
+
if (series.options.legendType === 'point') {
|
|
414
|
+
series.points.forEach(function (point) {
|
|
415
|
+
destroyItem(point);
|
|
416
|
+
});
|
|
417
|
+
}
|
|
418
|
+
else {
|
|
419
|
+
destroyItem(series);
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
});
|
|
453
423
|
}
|
|
454
424
|
});
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
*
|
|
461
|
-
* @return {boolean}
|
|
462
|
-
* True, if the series has points, otherwise false.
|
|
463
|
-
*/
|
|
464
|
-
ColorAxis.prototype.hasData = function () {
|
|
465
|
-
return !!(this.tickPositions || []).length;
|
|
466
|
-
};
|
|
425
|
+
i = colorAxisItems.length;
|
|
426
|
+
while (i--) {
|
|
427
|
+
e.allItems.unshift(colorAxisItems[i]);
|
|
428
|
+
}
|
|
429
|
+
}
|
|
467
430
|
/**
|
|
468
|
-
* Override so that ticks are not added in data class axes (#6914)
|
|
469
431
|
* @private
|
|
470
432
|
*/
|
|
471
|
-
|
|
472
|
-
if (
|
|
473
|
-
|
|
433
|
+
function onLegendAfterColorizeItem(e) {
|
|
434
|
+
if (e.visible && e.item.legendColor) {
|
|
435
|
+
e.item.legendSymbol.attr({
|
|
436
|
+
fill: e.item.legendColor
|
|
437
|
+
});
|
|
474
438
|
}
|
|
475
|
-
}
|
|
439
|
+
}
|
|
476
440
|
/**
|
|
441
|
+
* Updates in the legend need to be reflected in the color axis. (#6888)
|
|
477
442
|
* @private
|
|
478
443
|
*/
|
|
479
|
-
|
|
480
|
-
var
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
});
|
|
488
|
-
};
|
|
444
|
+
function onLegendAfterUpdate() {
|
|
445
|
+
var colorAxes = this.chart.colorAxis;
|
|
446
|
+
if (colorAxes) {
|
|
447
|
+
colorAxes.forEach(function (colorAxis) {
|
|
448
|
+
colorAxis.update({}, arguments[2]);
|
|
449
|
+
});
|
|
450
|
+
}
|
|
451
|
+
}
|
|
489
452
|
/**
|
|
490
|
-
*
|
|
453
|
+
* Calculate and set colors for points.
|
|
491
454
|
* @private
|
|
492
455
|
*/
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
456
|
+
function onSeriesAfterTranslate() {
|
|
457
|
+
if (this.chart.colorAxis &&
|
|
458
|
+
this.chart.colorAxis.length ||
|
|
459
|
+
this.colorAttribs) {
|
|
460
|
+
this.translateColors();
|
|
461
|
+
}
|
|
462
|
+
}
|
|
498
463
|
/**
|
|
464
|
+
* Add colorAxis to series axisTypes.
|
|
499
465
|
* @private
|
|
500
466
|
*/
|
|
501
|
-
|
|
502
|
-
var
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
var legendOptions = chart.options.legend || {};
|
|
506
|
-
var x,
|
|
507
|
-
y,
|
|
508
|
-
width,
|
|
509
|
-
height;
|
|
510
|
-
if (symbol) {
|
|
511
|
-
this.left = x = symbol.attr('x');
|
|
512
|
-
this.top = y = symbol.attr('y');
|
|
513
|
-
this.width = width = symbol.attr('width');
|
|
514
|
-
this.height = height = symbol.attr('height');
|
|
515
|
-
this.right = chart.chartWidth - x - width;
|
|
516
|
-
this.bottom = chart.chartHeight - y - height;
|
|
517
|
-
this.len = this.horiz ? width : height;
|
|
518
|
-
this.pos = this.horiz ? x : y;
|
|
467
|
+
function onSeriesBindAxes() {
|
|
468
|
+
var axisTypes = this.axisTypes;
|
|
469
|
+
if (!axisTypes) {
|
|
470
|
+
this.axisTypes = ['colorAxis'];
|
|
519
471
|
}
|
|
520
|
-
else {
|
|
521
|
-
|
|
522
|
-
// and such (#5205)
|
|
523
|
-
this.len = (this.horiz ?
|
|
524
|
-
legendOptions.symbolWidth :
|
|
525
|
-
legendOptions.symbolHeight) || ColorAxis.defaultLegendLength;
|
|
472
|
+
else if (axisTypes.indexOf('colorAxis') === -1) {
|
|
473
|
+
axisTypes.push('colorAxis');
|
|
526
474
|
}
|
|
527
|
-
}
|
|
475
|
+
}
|
|
528
476
|
/**
|
|
529
477
|
* @private
|
|
530
478
|
*/
|
|
531
|
-
|
|
532
|
-
var
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
479
|
+
function wrapChartCreateAxis(ChartClass) {
|
|
480
|
+
var superCreateAxis = ChartClass.prototype.createAxis;
|
|
481
|
+
ChartClass.prototype.createAxis = function (type, options) {
|
|
482
|
+
if (type !== 'colorAxis') {
|
|
483
|
+
return superCreateAxis.apply(this, arguments);
|
|
484
|
+
}
|
|
485
|
+
var axis = new ColorAxisClass(this,
|
|
486
|
+
merge(options.axis, {
|
|
487
|
+
index: this[type].length,
|
|
488
|
+
isX: false
|
|
489
|
+
}));
|
|
490
|
+
this.isDirtyLegend = true;
|
|
491
|
+
// Clear before 'bindAxes' (#11924)
|
|
492
|
+
this.axes.forEach(function (axis) {
|
|
493
|
+
axis.series = [];
|
|
494
|
+
});
|
|
495
|
+
this.series.forEach(function (series) {
|
|
496
|
+
series.bindAxes();
|
|
497
|
+
series.isDirtyData = true;
|
|
498
|
+
});
|
|
499
|
+
if (pick(options.redraw, true)) {
|
|
500
|
+
this.redraw(options.animation);
|
|
501
|
+
}
|
|
502
|
+
return axis;
|
|
503
|
+
};
|
|
504
|
+
}
|
|
539
505
|
/**
|
|
540
|
-
*
|
|
506
|
+
* Handle animation of the color attributes directly.
|
|
541
507
|
* @private
|
|
542
508
|
*/
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
var stops = axis.stops;
|
|
547
|
-
var pos,
|
|
548
|
-
from,
|
|
549
|
-
to,
|
|
550
|
-
color,
|
|
551
|
-
dataClass,
|
|
552
|
-
i;
|
|
553
|
-
if (dataClasses) {
|
|
554
|
-
i = dataClasses.length;
|
|
555
|
-
while (i--) {
|
|
556
|
-
dataClass = dataClasses[i];
|
|
557
|
-
from = dataClass.from;
|
|
558
|
-
to = dataClass.to;
|
|
559
|
-
if ((typeof from === 'undefined' || value >= from) &&
|
|
560
|
-
(typeof to === 'undefined' || value <= to)) {
|
|
561
|
-
color = dataClass.color;
|
|
562
|
-
if (point) {
|
|
563
|
-
point.dataClass = i;
|
|
564
|
-
point.colorIndex = dataClass.colorIndex;
|
|
565
|
-
}
|
|
566
|
-
break;
|
|
567
|
-
}
|
|
568
|
-
}
|
|
569
|
-
}
|
|
570
|
-
else {
|
|
571
|
-
pos = axis.normalizedValue(value);
|
|
572
|
-
i = stops.length;
|
|
573
|
-
while (i--) {
|
|
574
|
-
if (pos > stops[i][0]) {
|
|
575
|
-
break;
|
|
576
|
-
}
|
|
577
|
-
}
|
|
578
|
-
from = stops[i] || stops[i + 1];
|
|
579
|
-
to = stops[i + 1] || from;
|
|
580
|
-
// The position within the gradient
|
|
581
|
-
pos = 1 - (to[0] - pos) / ((to[0] - from[0]) || 1);
|
|
582
|
-
color = from.color.tweenTo(to.color, pos);
|
|
583
|
-
}
|
|
584
|
-
return color;
|
|
585
|
-
};
|
|
586
|
-
/**
|
|
587
|
-
* Override the getOffset method to add the whole axis groups inside the
|
|
588
|
-
* legend.
|
|
589
|
-
* @private
|
|
590
|
-
*/
|
|
591
|
-
ColorAxis.prototype.getOffset = function () {
|
|
592
|
-
var axis = this;
|
|
593
|
-
var group = axis.legendGroup;
|
|
594
|
-
var sideOffset = axis.chart.axisOffset[axis.side];
|
|
595
|
-
if (group) {
|
|
596
|
-
// Hook for the getOffset method to add groups to this parent
|
|
597
|
-
// group
|
|
598
|
-
axis.axisParent = group;
|
|
599
|
-
// Call the base
|
|
600
|
-
_super.prototype.getOffset.call(this);
|
|
601
|
-
// First time only
|
|
602
|
-
if (!axis.added) {
|
|
603
|
-
axis.added = true;
|
|
604
|
-
axis.labelLeft = 0;
|
|
605
|
-
axis.labelRight = axis.width;
|
|
606
|
-
}
|
|
607
|
-
// Reset it to avoid color axis reserving space
|
|
608
|
-
axis.chart.axisOffset[axis.side] = sideOffset;
|
|
609
|
-
}
|
|
610
|
-
};
|
|
611
|
-
/**
|
|
612
|
-
* Create the color gradient.
|
|
613
|
-
* @private
|
|
614
|
-
*/
|
|
615
|
-
ColorAxis.prototype.setLegendColor = function () {
|
|
616
|
-
var axis = this;
|
|
617
|
-
var horiz = axis.horiz;
|
|
618
|
-
var reversed = axis.reversed;
|
|
619
|
-
var one = reversed ? 1 : 0;
|
|
620
|
-
var zero = reversed ? 0 : 1;
|
|
621
|
-
var grad = horiz ? [one, 0,
|
|
622
|
-
zero, 0] : [0,
|
|
623
|
-
zero, 0,
|
|
624
|
-
one]; // #3190
|
|
625
|
-
axis.legendColor = {
|
|
626
|
-
linearGradient: {
|
|
627
|
-
x1: grad[0],
|
|
628
|
-
y1: grad[1],
|
|
629
|
-
x2: grad[2],
|
|
630
|
-
y2: grad[3]
|
|
631
|
-
},
|
|
632
|
-
stops: axis.stops
|
|
633
|
-
};
|
|
634
|
-
};
|
|
635
|
-
/**
|
|
636
|
-
* The color axis appears inside the legend and has its own legend symbol.
|
|
637
|
-
* @private
|
|
638
|
-
*/
|
|
639
|
-
ColorAxis.prototype.drawLegendSymbol = function (legend, item) {
|
|
640
|
-
var axis = this;
|
|
641
|
-
var padding = legend.padding;
|
|
642
|
-
var legendOptions = legend.options;
|
|
643
|
-
var horiz = axis.horiz;
|
|
644
|
-
var width = pick(legendOptions.symbolWidth,
|
|
645
|
-
horiz ? ColorAxis.defaultLegendLength : 12);
|
|
646
|
-
var height = pick(legendOptions.symbolHeight,
|
|
647
|
-
horiz ? 12 : ColorAxis.defaultLegendLength);
|
|
648
|
-
var labelPadding = pick(legendOptions.labelPadding,
|
|
649
|
-
horiz ? 16 : 30);
|
|
650
|
-
var itemDistance = pick(legendOptions.itemDistance, 10);
|
|
651
|
-
this.setLegendColor();
|
|
652
|
-
// Create the gradient
|
|
653
|
-
item.legendSymbol = this.chart.renderer.rect(0, legend.baseline - 11, width, height).attr({
|
|
654
|
-
zIndex: 1
|
|
655
|
-
}).add(item.legendGroup);
|
|
656
|
-
// Set how much space this legend item takes up
|
|
657
|
-
axis.legendItemWidth = width + padding + (horiz ? itemDistance : labelPadding);
|
|
658
|
-
axis.legendItemHeight = height + padding + (horiz ? labelPadding : 0);
|
|
659
|
-
};
|
|
660
|
-
/**
|
|
661
|
-
* Fool the legend.
|
|
662
|
-
* @private
|
|
663
|
-
*/
|
|
664
|
-
ColorAxis.prototype.setState = function (state) {
|
|
665
|
-
this.series.forEach(function (series) {
|
|
666
|
-
series.setState(state);
|
|
667
|
-
});
|
|
668
|
-
};
|
|
669
|
-
/**
|
|
670
|
-
* @private
|
|
671
|
-
*/
|
|
672
|
-
ColorAxis.prototype.setVisible = function () {
|
|
673
|
-
};
|
|
674
|
-
/**
|
|
675
|
-
* @private
|
|
676
|
-
*/
|
|
677
|
-
ColorAxis.prototype.getSeriesExtremes = function () {
|
|
678
|
-
var axis = this;
|
|
679
|
-
var series = axis.series;
|
|
680
|
-
var colorValArray,
|
|
681
|
-
colorKey,
|
|
682
|
-
colorValIndex,
|
|
683
|
-
pointArrayMap,
|
|
684
|
-
calculatedExtremes,
|
|
685
|
-
cSeries,
|
|
686
|
-
i = series.length,
|
|
687
|
-
yData,
|
|
688
|
-
j;
|
|
689
|
-
this.dataMin = Infinity;
|
|
690
|
-
this.dataMax = -Infinity;
|
|
691
|
-
while (i--) { // x, y, value, other
|
|
692
|
-
cSeries = series[i];
|
|
693
|
-
colorKey = cSeries.colorKey = pick(cSeries.options.colorKey, cSeries.colorKey, cSeries.pointValKey, cSeries.zoneAxis, 'y');
|
|
694
|
-
pointArrayMap = cSeries.pointArrayMap;
|
|
695
|
-
calculatedExtremes = cSeries[colorKey + 'Min'] &&
|
|
696
|
-
cSeries[colorKey + 'Max'];
|
|
697
|
-
if (cSeries[colorKey + 'Data']) {
|
|
698
|
-
colorValArray = cSeries[colorKey + 'Data'];
|
|
699
|
-
}
|
|
700
|
-
else {
|
|
701
|
-
if (!pointArrayMap) {
|
|
702
|
-
colorValArray = cSeries.yData;
|
|
703
|
-
}
|
|
704
|
-
else {
|
|
705
|
-
colorValArray = [];
|
|
706
|
-
colorValIndex = pointArrayMap.indexOf(colorKey);
|
|
707
|
-
yData = cSeries.yData;
|
|
708
|
-
if (colorValIndex >= 0 && yData) {
|
|
709
|
-
for (j = 0; j < yData.length; j++) {
|
|
710
|
-
colorValArray.push(pick(yData[j][colorValIndex], yData[j]));
|
|
711
|
-
}
|
|
712
|
-
}
|
|
713
|
-
}
|
|
714
|
-
}
|
|
715
|
-
// If color key extremes are already calculated, use them.
|
|
716
|
-
if (calculatedExtremes) {
|
|
717
|
-
cSeries.minColorValue = cSeries[colorKey + 'Min'];
|
|
718
|
-
cSeries.maxColorValue = cSeries[colorKey + 'Max'];
|
|
719
|
-
}
|
|
720
|
-
else {
|
|
721
|
-
var cExtremes = Series.prototype.getExtremes.call(cSeries,
|
|
722
|
-
colorValArray);
|
|
723
|
-
cSeries.minColorValue = cExtremes.dataMin;
|
|
724
|
-
cSeries.maxColorValue = cExtremes.dataMax;
|
|
725
|
-
}
|
|
726
|
-
if (typeof cSeries.minColorValue !== 'undefined') {
|
|
727
|
-
this.dataMin =
|
|
728
|
-
Math.min(this.dataMin, cSeries.minColorValue);
|
|
729
|
-
this.dataMax =
|
|
730
|
-
Math.max(this.dataMax, cSeries.maxColorValue);
|
|
731
|
-
}
|
|
732
|
-
if (!calculatedExtremes) {
|
|
733
|
-
Series.prototype.applyExtremes.call(cSeries);
|
|
734
|
-
}
|
|
735
|
-
}
|
|
736
|
-
};
|
|
737
|
-
/**
|
|
738
|
-
* Internal function to draw a crosshair.
|
|
739
|
-
*
|
|
740
|
-
* @function Highcharts.ColorAxis#drawCrosshair
|
|
741
|
-
*
|
|
742
|
-
* @param {Highcharts.PointerEventObject} [e]
|
|
743
|
-
* The event arguments from the modified pointer event, extended with
|
|
744
|
-
* `chartX` and `chartY`
|
|
745
|
-
*
|
|
746
|
-
* @param {Highcharts.Point} [point]
|
|
747
|
-
* The Point object if the crosshair snaps to points.
|
|
748
|
-
*
|
|
749
|
-
* @fires Highcharts.ColorAxis#event:afterDrawCrosshair
|
|
750
|
-
* @fires Highcharts.ColorAxis#event:drawCrosshair
|
|
751
|
-
*/
|
|
752
|
-
ColorAxis.prototype.drawCrosshair = function (e, point) {
|
|
753
|
-
var axis = this;
|
|
754
|
-
var plotX = point && point.plotX;
|
|
755
|
-
var plotY = point && point.plotY;
|
|
756
|
-
var axisPos = axis.pos;
|
|
757
|
-
var axisLen = axis.len;
|
|
758
|
-
var crossPos;
|
|
759
|
-
if (point) {
|
|
760
|
-
crossPos = axis.toPixels(point.getNestedProperty(point.series.colorKey));
|
|
761
|
-
if (crossPos < axisPos) {
|
|
762
|
-
crossPos = axisPos - 2;
|
|
763
|
-
}
|
|
764
|
-
else if (crossPos > axisPos + axisLen) {
|
|
765
|
-
crossPos = axisPos + axisLen + 2;
|
|
766
|
-
}
|
|
767
|
-
point.plotX = crossPos;
|
|
768
|
-
point.plotY = axis.len - crossPos;
|
|
769
|
-
_super.prototype.drawCrosshair.call(this, e, point);
|
|
770
|
-
point.plotX = plotX;
|
|
771
|
-
point.plotY = plotY;
|
|
772
|
-
if (axis.cross &&
|
|
773
|
-
!axis.cross.addedToColorAxis &&
|
|
774
|
-
axis.legendGroup) {
|
|
775
|
-
axis.cross
|
|
776
|
-
.addClass('highcharts-coloraxis-marker')
|
|
777
|
-
.add(axis.legendGroup);
|
|
778
|
-
axis.cross.addedToColorAxis = true;
|
|
779
|
-
if (!axis.chart.styledMode &&
|
|
780
|
-
typeof axis.crosshair === 'object') {
|
|
781
|
-
axis.cross.attr({
|
|
782
|
-
fill: axis.crosshair.color
|
|
783
|
-
});
|
|
784
|
-
}
|
|
785
|
-
}
|
|
786
|
-
}
|
|
787
|
-
};
|
|
509
|
+
function wrapFxFillSetter() {
|
|
510
|
+
this.elem.attr('fill', color(this.start).tweenTo(color(this.end), this.pos), void 0, true);
|
|
511
|
+
}
|
|
788
512
|
/**
|
|
513
|
+
* Handle animation of the color attributes directly.
|
|
789
514
|
* @private
|
|
790
515
|
*/
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
* @function Highcharts.ColorAxis#remove
|
|
873
|
-
*
|
|
874
|
-
* @param {boolean} [redraw=true]
|
|
875
|
-
* Whether to redraw the chart following the remove.
|
|
876
|
-
*/
|
|
877
|
-
ColorAxis.prototype.remove = function (redraw) {
|
|
878
|
-
this.destroyItems();
|
|
879
|
-
_super.prototype.remove.call(this, redraw);
|
|
880
|
-
};
|
|
881
|
-
/**
|
|
882
|
-
* Get the legend item symbols for data classes.
|
|
883
|
-
* @private
|
|
884
|
-
*/
|
|
885
|
-
ColorAxis.prototype.getDataClassLegendSymbols = function () {
|
|
886
|
-
var axis = this;
|
|
887
|
-
var chart = axis.chart;
|
|
888
|
-
var legendItems = axis.legendItems;
|
|
889
|
-
var legendOptions = chart.options.legend;
|
|
890
|
-
var valueDecimals = legendOptions.valueDecimals;
|
|
891
|
-
var valueSuffix = legendOptions.valueSuffix || '';
|
|
892
|
-
var name;
|
|
893
|
-
if (!legendItems.length) {
|
|
894
|
-
axis.dataClasses.forEach(function (dataClass, i) {
|
|
895
|
-
var vis = true,
|
|
896
|
-
from = dataClass.from,
|
|
897
|
-
to = dataClass.to;
|
|
898
|
-
var numberFormatter = chart.numberFormatter;
|
|
899
|
-
// Assemble the default name. This can be overridden
|
|
900
|
-
// by legend.options.labelFormatter
|
|
901
|
-
name = '';
|
|
902
|
-
if (typeof from === 'undefined') {
|
|
903
|
-
name = '< ';
|
|
904
|
-
}
|
|
905
|
-
else if (typeof to === 'undefined') {
|
|
906
|
-
name = '> ';
|
|
907
|
-
}
|
|
908
|
-
if (typeof from !== 'undefined') {
|
|
909
|
-
name += numberFormatter(from, valueDecimals) + valueSuffix;
|
|
910
|
-
}
|
|
911
|
-
if (typeof from !== 'undefined' && typeof to !== 'undefined') {
|
|
912
|
-
name += ' - ';
|
|
913
|
-
}
|
|
914
|
-
if (typeof to !== 'undefined') {
|
|
915
|
-
name += numberFormatter(to, valueDecimals) + valueSuffix;
|
|
916
|
-
}
|
|
917
|
-
// Add a mock object to the legend items
|
|
918
|
-
legendItems.push(extend({
|
|
919
|
-
chart: chart,
|
|
920
|
-
name: name,
|
|
921
|
-
options: {},
|
|
922
|
-
drawLegendSymbol: LegendSymbolMixin.drawRectangle,
|
|
923
|
-
visible: true,
|
|
924
|
-
setState: noop,
|
|
925
|
-
isDataClass: true,
|
|
926
|
-
setVisible: function () {
|
|
927
|
-
vis = axis.visible = !vis;
|
|
928
|
-
axis.series.forEach(function (series) {
|
|
929
|
-
series.points.forEach(function (point) {
|
|
930
|
-
if (point.dataClass === i) {
|
|
931
|
-
point.setVisible(vis);
|
|
932
|
-
}
|
|
933
|
-
});
|
|
934
|
-
});
|
|
935
|
-
chart.legend.colorizeItem(this, vis);
|
|
936
|
-
}
|
|
937
|
-
}, dataClass));
|
|
938
|
-
});
|
|
939
|
-
}
|
|
940
|
-
return legendItems;
|
|
941
|
-
};
|
|
942
|
-
/* *
|
|
943
|
-
*
|
|
944
|
-
* Static Functions
|
|
945
|
-
*
|
|
946
|
-
* */
|
|
947
|
-
ColorAxis.defaultLegendLength = 200;
|
|
948
|
-
/**
|
|
949
|
-
* A color axis for series. Visually, the color
|
|
950
|
-
* axis will appear as a gradient or as separate items inside the
|
|
951
|
-
* legend, depending on whether the axis is scalar or based on data
|
|
952
|
-
* classes.
|
|
953
|
-
*
|
|
954
|
-
* For supported color formats, see the
|
|
955
|
-
* [docs article about colors](https://www.highcharts.com/docs/chart-design-and-style/colors).
|
|
956
|
-
*
|
|
957
|
-
* A scalar color axis is represented by a gradient. The colors either
|
|
958
|
-
* range between the [minColor](#colorAxis.minColor) and the
|
|
959
|
-
* [maxColor](#colorAxis.maxColor), or for more fine grained control the
|
|
960
|
-
* colors can be defined in [stops](#colorAxis.stops). Often times, the
|
|
961
|
-
* color axis needs to be adjusted to get the right color spread for the
|
|
962
|
-
* data. In addition to stops, consider using a logarithmic
|
|
963
|
-
* [axis type](#colorAxis.type), or setting [min](#colorAxis.min) and
|
|
964
|
-
* [max](#colorAxis.max) to avoid the colors being determined by
|
|
965
|
-
* outliers.
|
|
966
|
-
*
|
|
967
|
-
* When [dataClasses](#colorAxis.dataClasses) are used, the ranges are
|
|
968
|
-
* subdivided into separate classes like categories based on their
|
|
969
|
-
* values. This can be used for ranges between two values, but also for
|
|
970
|
-
* a true category. However, when your data is categorized, it may be as
|
|
971
|
-
* convenient to add each category to a separate series.
|
|
972
|
-
*
|
|
973
|
-
* Color axis does not work with: `sankey`, `sunburst`, `dependencywheel`,
|
|
974
|
-
* `networkgraph`, `wordcloud`, `venn`, `gauge` and `solidgauge` series
|
|
975
|
-
* types.
|
|
976
|
-
*
|
|
977
|
-
* Since v7.2.0 `colorAxis` can also be an array of options objects.
|
|
978
|
-
*
|
|
979
|
-
* See [the Axis object](/class-reference/Highcharts.Axis) for
|
|
980
|
-
* programmatic access to the axis.
|
|
981
|
-
*
|
|
982
|
-
* @sample {highcharts} highcharts/coloraxis/custom-color-key
|
|
983
|
-
* Column chart with color axis
|
|
984
|
-
* @sample {highcharts} highcharts/coloraxis/horizontal-layout
|
|
985
|
-
* Horizontal layout
|
|
986
|
-
* @sample {highmaps} maps/coloraxis/dataclasscolor
|
|
987
|
-
* With data classes
|
|
988
|
-
* @sample {highmaps} maps/coloraxis/mincolor-maxcolor
|
|
989
|
-
* Min color and max color
|
|
990
|
-
*
|
|
991
|
-
* @extends xAxis
|
|
992
|
-
* @excluding alignTicks, allowDecimals, alternateGridColor, breaks,
|
|
993
|
-
* categories, crosshair, dateTimeLabelFormats, height, left,
|
|
994
|
-
* lineWidth, linkedTo, maxZoom, minRange, minTickInterval,
|
|
995
|
-
* offset, opposite, pane, plotBands, plotLines,
|
|
996
|
-
* reversedStacks, showEmpty, title, top, width, zoomEnabled
|
|
997
|
-
* @product highcharts highstock highmaps
|
|
998
|
-
* @type {*|Array<*>}
|
|
999
|
-
* @optionparent colorAxis
|
|
1000
|
-
* @ignore
|
|
1001
|
-
*/
|
|
1002
|
-
ColorAxis.defaultColorAxisOptions = {
|
|
516
|
+
function wrapFxStrokeSetter() {
|
|
517
|
+
this.elem.attr('stroke', color(this.start).tweenTo(color(this.end), this.pos), void 0, true);
|
|
518
|
+
}
|
|
519
|
+
})(ColorAxisComposition || (ColorAxisComposition = {}));
|
|
520
|
+
/* *
|
|
521
|
+
*
|
|
522
|
+
* Default Export
|
|
523
|
+
*
|
|
524
|
+
* */
|
|
525
|
+
|
|
526
|
+
return ColorAxisComposition;
|
|
527
|
+
});
|
|
528
|
+
_registerModule(_modules, 'Core/Axis/Color/ColorAxisDefaults.js', [_modules['Core/Color/Palette.js']], function (Palette) {
|
|
529
|
+
/* *
|
|
530
|
+
*
|
|
531
|
+
* (c) 2010-2021 Torstein Honsi
|
|
532
|
+
*
|
|
533
|
+
* License: www.highcharts.com/license
|
|
534
|
+
*
|
|
535
|
+
* !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
|
|
536
|
+
*
|
|
537
|
+
* */
|
|
538
|
+
/* *
|
|
539
|
+
*
|
|
540
|
+
* API Options
|
|
541
|
+
*
|
|
542
|
+
* */
|
|
543
|
+
/**
|
|
544
|
+
* A color axis for series. Visually, the color
|
|
545
|
+
* axis will appear as a gradient or as separate items inside the
|
|
546
|
+
* legend, depending on whether the axis is scalar or based on data
|
|
547
|
+
* classes.
|
|
548
|
+
*
|
|
549
|
+
* For supported color formats, see the
|
|
550
|
+
* [docs article about colors](https://www.highcharts.com/docs/chart-design-and-style/colors).
|
|
551
|
+
*
|
|
552
|
+
* A scalar color axis is represented by a gradient. The colors either
|
|
553
|
+
* range between the [minColor](#colorAxis.minColor) and the
|
|
554
|
+
* [maxColor](#colorAxis.maxColor), or for more fine grained control the
|
|
555
|
+
* colors can be defined in [stops](#colorAxis.stops). Often times, the
|
|
556
|
+
* color axis needs to be adjusted to get the right color spread for the
|
|
557
|
+
* data. In addition to stops, consider using a logarithmic
|
|
558
|
+
* [axis type](#colorAxis.type), or setting [min](#colorAxis.min) and
|
|
559
|
+
* [max](#colorAxis.max) to avoid the colors being determined by
|
|
560
|
+
* outliers.
|
|
561
|
+
*
|
|
562
|
+
* When [dataClasses](#colorAxis.dataClasses) are used, the ranges are
|
|
563
|
+
* subdivided into separate classes like categories based on their
|
|
564
|
+
* values. This can be used for ranges between two values, but also for
|
|
565
|
+
* a true category. However, when your data is categorized, it may be as
|
|
566
|
+
* convenient to add each category to a separate series.
|
|
567
|
+
*
|
|
568
|
+
* Color axis does not work with: `sankey`, `sunburst`, `dependencywheel`,
|
|
569
|
+
* `networkgraph`, `wordcloud`, `venn`, `gauge` and `solidgauge` series
|
|
570
|
+
* types.
|
|
571
|
+
*
|
|
572
|
+
* Since v7.2.0 `colorAxis` can also be an array of options objects.
|
|
573
|
+
*
|
|
574
|
+
* See [the Axis object](/class-reference/Highcharts.Axis) for
|
|
575
|
+
* programmatic access to the axis.
|
|
576
|
+
*
|
|
577
|
+
* @sample {highcharts} highcharts/coloraxis/custom-color-key
|
|
578
|
+
* Column chart with color axis
|
|
579
|
+
* @sample {highcharts} highcharts/coloraxis/horizontal-layout
|
|
580
|
+
* Horizontal layout
|
|
581
|
+
* @sample {highmaps} maps/coloraxis/dataclasscolor
|
|
582
|
+
* With data classes
|
|
583
|
+
* @sample {highmaps} maps/coloraxis/mincolor-maxcolor
|
|
584
|
+
* Min color and max color
|
|
585
|
+
*
|
|
586
|
+
* @extends xAxis
|
|
587
|
+
* @excluding alignTicks, allowDecimals, alternateGridColor, breaks,
|
|
588
|
+
* categories, crosshair, dateTimeLabelFormats, height, left,
|
|
589
|
+
* lineWidth, linkedTo, maxZoom, minRange, minTickInterval,
|
|
590
|
+
* offset, opposite, pane, plotBands, plotLines,
|
|
591
|
+
* reversedStacks, showEmpty, title, top, width, zoomEnabled
|
|
592
|
+
* @product highcharts highstock highmaps
|
|
593
|
+
* @type {*|Array<*>}
|
|
594
|
+
* @optionparent colorAxis
|
|
595
|
+
*/
|
|
596
|
+
var colorAxisDefaults = {
|
|
1003
597
|
/**
|
|
1004
598
|
* Whether to allow decimals on the color axis.
|
|
1005
599
|
* @type {boolean}
|
|
@@ -1229,7 +823,7 @@
|
|
|
1229
823
|
* @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}
|
|
1230
824
|
* @product highcharts highstock highmaps
|
|
1231
825
|
*/
|
|
1232
|
-
color:
|
|
826
|
+
color: Palette.neutralColor40
|
|
1233
827
|
},
|
|
1234
828
|
/**
|
|
1235
829
|
* The axis labels show the number for each tick.
|
|
@@ -1271,7 +865,7 @@
|
|
|
1271
865
|
* @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}
|
|
1272
866
|
* @product highcharts highstock highmaps
|
|
1273
867
|
*/
|
|
1274
|
-
minColor:
|
|
868
|
+
minColor: Palette.highlightColor10,
|
|
1275
869
|
/**
|
|
1276
870
|
* The color to represent the maximum of the color axis. Unless
|
|
1277
871
|
* [dataClasses](#colorAxis.dataClasses) or
|
|
@@ -1290,7 +884,7 @@
|
|
|
1290
884
|
* @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}
|
|
1291
885
|
* @product highcharts highstock highmaps
|
|
1292
886
|
*/
|
|
1293
|
-
maxColor:
|
|
887
|
+
maxColor: Palette.highlightColor100,
|
|
1294
888
|
/**
|
|
1295
889
|
* Color stops for the gradient of a scalar color axis. Use this in
|
|
1296
890
|
* cases where a linear gradient between a `minColor` and `maxColor`
|
|
@@ -1358,6 +952,681 @@
|
|
|
1358
952
|
*/
|
|
1359
953
|
showInLegend: true
|
|
1360
954
|
};
|
|
955
|
+
/* *
|
|
956
|
+
*
|
|
957
|
+
* Default Export
|
|
958
|
+
*
|
|
959
|
+
* */
|
|
960
|
+
|
|
961
|
+
return colorAxisDefaults;
|
|
962
|
+
});
|
|
963
|
+
_registerModule(_modules, 'Core/Axis/Color/ColorAxis.js', [_modules['Core/Axis/Axis.js'], _modules['Core/Color/Color.js'], _modules['Core/Axis/Color/ColorAxisComposition.js'], _modules['Core/Axis/Color/ColorAxisDefaults.js'], _modules['Core/Globals.js'], _modules['Core/Legend/LegendSymbol.js'], _modules['Core/Series/SeriesRegistry.js'], _modules['Core/Utilities.js']], function (Axis, Color, ColorAxisComposition, ColorAxisDefaults, H, LegendSymbol, SeriesRegistry, U) {
|
|
964
|
+
/* *
|
|
965
|
+
*
|
|
966
|
+
* (c) 2010-2021 Torstein Honsi
|
|
967
|
+
*
|
|
968
|
+
* License: www.highcharts.com/license
|
|
969
|
+
*
|
|
970
|
+
* !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
|
|
971
|
+
*
|
|
972
|
+
* */
|
|
973
|
+
var __extends = (this && this.__extends) || (function () {
|
|
974
|
+
var extendStatics = function (d,
|
|
975
|
+
b) {
|
|
976
|
+
extendStatics = Object.setPrototypeOf ||
|
|
977
|
+
({ __proto__: [] } instanceof Array && function (d,
|
|
978
|
+
b) { d.__proto__ = b; }) ||
|
|
979
|
+
function (d,
|
|
980
|
+
b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
981
|
+
return extendStatics(d, b);
|
|
982
|
+
};
|
|
983
|
+
return function (d, b) {
|
|
984
|
+
extendStatics(d, b);
|
|
985
|
+
function __() { this.constructor = d; }
|
|
986
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
987
|
+
};
|
|
988
|
+
})();
|
|
989
|
+
var color = Color.parse;
|
|
990
|
+
var noop = H.noop;
|
|
991
|
+
var Series = SeriesRegistry.series;
|
|
992
|
+
var extend = U.extend,
|
|
993
|
+
isNumber = U.isNumber,
|
|
994
|
+
merge = U.merge,
|
|
995
|
+
pick = U.pick;
|
|
996
|
+
/* *
|
|
997
|
+
*
|
|
998
|
+
* Class
|
|
999
|
+
*
|
|
1000
|
+
* */
|
|
1001
|
+
/* eslint-disable no-invalid-this, valid-jsdoc */
|
|
1002
|
+
/**
|
|
1003
|
+
* The ColorAxis object for inclusion in gradient legends.
|
|
1004
|
+
*
|
|
1005
|
+
* @class
|
|
1006
|
+
* @name Highcharts.ColorAxis
|
|
1007
|
+
* @augments Highcharts.Axis
|
|
1008
|
+
*
|
|
1009
|
+
* @param {Highcharts.Chart} chart
|
|
1010
|
+
* The related chart of the color axis.
|
|
1011
|
+
*
|
|
1012
|
+
* @param {Highcharts.ColorAxisOptions} userOptions
|
|
1013
|
+
* The color axis options for initialization.
|
|
1014
|
+
*/
|
|
1015
|
+
var ColorAxis = /** @class */ (function (_super) {
|
|
1016
|
+
__extends(ColorAxis, _super);
|
|
1017
|
+
/* *
|
|
1018
|
+
*
|
|
1019
|
+
* Constructors
|
|
1020
|
+
*
|
|
1021
|
+
* */
|
|
1022
|
+
/**
|
|
1023
|
+
* @private
|
|
1024
|
+
*/
|
|
1025
|
+
function ColorAxis(chart, userOptions) {
|
|
1026
|
+
var _this = _super.call(this,
|
|
1027
|
+
chart,
|
|
1028
|
+
userOptions) || this;
|
|
1029
|
+
_this.beforePadding = false; // Prevents unnecessary padding with `hc-more`
|
|
1030
|
+
_this.chart = void 0;
|
|
1031
|
+
_this.coll = 'colorAxis';
|
|
1032
|
+
_this.dataClasses = void 0;
|
|
1033
|
+
_this.legendItem = void 0;
|
|
1034
|
+
_this.legendItems = void 0;
|
|
1035
|
+
_this.name = ''; // Prevents 'undefined' in legend in IE8
|
|
1036
|
+
_this.options = void 0;
|
|
1037
|
+
_this.stops = void 0;
|
|
1038
|
+
_this.visible = true;
|
|
1039
|
+
_this.init(chart, userOptions);
|
|
1040
|
+
return _this;
|
|
1041
|
+
}
|
|
1042
|
+
/* *
|
|
1043
|
+
*
|
|
1044
|
+
* Static Functions
|
|
1045
|
+
*
|
|
1046
|
+
* */
|
|
1047
|
+
ColorAxis.compose = function (ChartClass, FxClass, LegendClass, SeriesClass) {
|
|
1048
|
+
ColorAxisComposition.compose(ColorAxis, ChartClass, FxClass, LegendClass, SeriesClass);
|
|
1049
|
+
};
|
|
1050
|
+
/* *
|
|
1051
|
+
*
|
|
1052
|
+
* Functions
|
|
1053
|
+
*
|
|
1054
|
+
* */
|
|
1055
|
+
/**
|
|
1056
|
+
* Initializes the color axis.
|
|
1057
|
+
*
|
|
1058
|
+
* @function Highcharts.ColorAxis#init
|
|
1059
|
+
*
|
|
1060
|
+
* @param {Highcharts.Chart} chart
|
|
1061
|
+
* The related chart of the color axis.
|
|
1062
|
+
*
|
|
1063
|
+
* @param {Highcharts.ColorAxisOptions} userOptions
|
|
1064
|
+
* The color axis options for initialization.
|
|
1065
|
+
*/
|
|
1066
|
+
ColorAxis.prototype.init = function (chart, userOptions) {
|
|
1067
|
+
var axis = this;
|
|
1068
|
+
var legend = chart.options.legend || {},
|
|
1069
|
+
horiz = userOptions.layout ?
|
|
1070
|
+
userOptions.layout !== 'vertical' :
|
|
1071
|
+
legend.layout !== 'vertical',
|
|
1072
|
+
visible = userOptions.visible;
|
|
1073
|
+
var options = merge(ColorAxis.defaultColorAxisOptions,
|
|
1074
|
+
userOptions, {
|
|
1075
|
+
showEmpty: false,
|
|
1076
|
+
title: null,
|
|
1077
|
+
visible: legend.enabled && visible !== false
|
|
1078
|
+
});
|
|
1079
|
+
axis.coll = 'colorAxis';
|
|
1080
|
+
axis.side = userOptions.side || horiz ? 2 : 1;
|
|
1081
|
+
axis.reversed = userOptions.reversed || !horiz;
|
|
1082
|
+
axis.opposite = !horiz;
|
|
1083
|
+
_super.prototype.init.call(this, chart, options);
|
|
1084
|
+
// #16053: Restore the actual userOptions.visible so the color axis
|
|
1085
|
+
// doesnt stay hidden forever when hiding and showing legend
|
|
1086
|
+
axis.userOptions.visible = visible;
|
|
1087
|
+
// Base init() pushes it to the xAxis array, now pop it again
|
|
1088
|
+
// chart[this.isXAxis ? 'xAxis' : 'yAxis'].pop();
|
|
1089
|
+
// Prepare data classes
|
|
1090
|
+
if (userOptions.dataClasses) {
|
|
1091
|
+
axis.initDataClasses(userOptions);
|
|
1092
|
+
}
|
|
1093
|
+
axis.initStops();
|
|
1094
|
+
// Override original axis properties
|
|
1095
|
+
axis.horiz = horiz;
|
|
1096
|
+
axis.zoomEnabled = false;
|
|
1097
|
+
};
|
|
1098
|
+
/**
|
|
1099
|
+
* @private
|
|
1100
|
+
*/
|
|
1101
|
+
ColorAxis.prototype.initDataClasses = function (userOptions) {
|
|
1102
|
+
var axis = this,
|
|
1103
|
+
chart = axis.chart,
|
|
1104
|
+
options = axis.options,
|
|
1105
|
+
len = userOptions.dataClasses.length;
|
|
1106
|
+
var dataClasses,
|
|
1107
|
+
colorCounter = 0,
|
|
1108
|
+
colorCount = chart.options.chart.colorCount;
|
|
1109
|
+
axis.dataClasses = dataClasses = [];
|
|
1110
|
+
axis.legendItems = [];
|
|
1111
|
+
(userOptions.dataClasses || []).forEach(function (dataClass, i) {
|
|
1112
|
+
var colors;
|
|
1113
|
+
dataClass = merge(dataClass);
|
|
1114
|
+
dataClasses.push(dataClass);
|
|
1115
|
+
if (!chart.styledMode && dataClass.color) {
|
|
1116
|
+
return;
|
|
1117
|
+
}
|
|
1118
|
+
if (options.dataClassColor === 'category') {
|
|
1119
|
+
if (!chart.styledMode) {
|
|
1120
|
+
colors = chart.options.colors;
|
|
1121
|
+
colorCount = colors.length;
|
|
1122
|
+
dataClass.color = colors[colorCounter];
|
|
1123
|
+
}
|
|
1124
|
+
dataClass.colorIndex = colorCounter;
|
|
1125
|
+
// increase and loop back to zero
|
|
1126
|
+
colorCounter++;
|
|
1127
|
+
if (colorCounter === colorCount) {
|
|
1128
|
+
colorCounter = 0;
|
|
1129
|
+
}
|
|
1130
|
+
}
|
|
1131
|
+
else {
|
|
1132
|
+
dataClass.color = color(options.minColor).tweenTo(color(options.maxColor), len < 2 ? 0.5 : i / (len - 1) // #3219
|
|
1133
|
+
);
|
|
1134
|
+
}
|
|
1135
|
+
});
|
|
1136
|
+
};
|
|
1137
|
+
/**
|
|
1138
|
+
* Returns true if the series has points at all.
|
|
1139
|
+
*
|
|
1140
|
+
* @function Highcharts.ColorAxis#hasData
|
|
1141
|
+
*
|
|
1142
|
+
* @return {boolean}
|
|
1143
|
+
* True, if the series has points, otherwise false.
|
|
1144
|
+
*/
|
|
1145
|
+
ColorAxis.prototype.hasData = function () {
|
|
1146
|
+
return !!(this.tickPositions || []).length;
|
|
1147
|
+
};
|
|
1148
|
+
/**
|
|
1149
|
+
* Override so that ticks are not added in data class axes (#6914)
|
|
1150
|
+
* @private
|
|
1151
|
+
*/
|
|
1152
|
+
ColorAxis.prototype.setTickPositions = function () {
|
|
1153
|
+
if (!this.dataClasses) {
|
|
1154
|
+
return _super.prototype.setTickPositions.call(this);
|
|
1155
|
+
}
|
|
1156
|
+
};
|
|
1157
|
+
/**
|
|
1158
|
+
* @private
|
|
1159
|
+
*/
|
|
1160
|
+
ColorAxis.prototype.initStops = function () {
|
|
1161
|
+
var axis = this;
|
|
1162
|
+
axis.stops = axis.options.stops || [
|
|
1163
|
+
[0, axis.options.minColor],
|
|
1164
|
+
[1, axis.options.maxColor]
|
|
1165
|
+
];
|
|
1166
|
+
axis.stops.forEach(function (stop) {
|
|
1167
|
+
stop.color = color(stop[1]);
|
|
1168
|
+
});
|
|
1169
|
+
};
|
|
1170
|
+
/**
|
|
1171
|
+
* Extend the setOptions method to process extreme colors and color stops.
|
|
1172
|
+
* @private
|
|
1173
|
+
*/
|
|
1174
|
+
ColorAxis.prototype.setOptions = function (userOptions) {
|
|
1175
|
+
var axis = this;
|
|
1176
|
+
_super.prototype.setOptions.call(this, userOptions);
|
|
1177
|
+
axis.options.crosshair = axis.options.marker;
|
|
1178
|
+
};
|
|
1179
|
+
/**
|
|
1180
|
+
* @private
|
|
1181
|
+
*/
|
|
1182
|
+
ColorAxis.prototype.setAxisSize = function () {
|
|
1183
|
+
var axis = this;
|
|
1184
|
+
var symbol = axis.legendSymbol;
|
|
1185
|
+
var chart = axis.chart;
|
|
1186
|
+
var legendOptions = chart.options.legend || {};
|
|
1187
|
+
var x,
|
|
1188
|
+
y,
|
|
1189
|
+
width,
|
|
1190
|
+
height;
|
|
1191
|
+
if (symbol) {
|
|
1192
|
+
this.left = x = symbol.attr('x');
|
|
1193
|
+
this.top = y = symbol.attr('y');
|
|
1194
|
+
this.width = width = symbol.attr('width');
|
|
1195
|
+
this.height = height = symbol.attr('height');
|
|
1196
|
+
this.right = chart.chartWidth - x - width;
|
|
1197
|
+
this.bottom = chart.chartHeight - y - height;
|
|
1198
|
+
this.len = this.horiz ? width : height;
|
|
1199
|
+
this.pos = this.horiz ? x : y;
|
|
1200
|
+
}
|
|
1201
|
+
else {
|
|
1202
|
+
// Fake length for disabled legend to avoid tick issues
|
|
1203
|
+
// and such (#5205)
|
|
1204
|
+
this.len = (this.horiz ?
|
|
1205
|
+
legendOptions.symbolWidth :
|
|
1206
|
+
legendOptions.symbolHeight) || ColorAxis.defaultLegendLength;
|
|
1207
|
+
}
|
|
1208
|
+
};
|
|
1209
|
+
/**
|
|
1210
|
+
* @private
|
|
1211
|
+
*/
|
|
1212
|
+
ColorAxis.prototype.normalizedValue = function (value) {
|
|
1213
|
+
var axis = this;
|
|
1214
|
+
if (axis.logarithmic) {
|
|
1215
|
+
value = axis.logarithmic.log2lin(value);
|
|
1216
|
+
}
|
|
1217
|
+
return 1 - ((axis.max - value) /
|
|
1218
|
+
((axis.max - axis.min) || 1));
|
|
1219
|
+
};
|
|
1220
|
+
/**
|
|
1221
|
+
* Translate from a value to a color.
|
|
1222
|
+
* @private
|
|
1223
|
+
*/
|
|
1224
|
+
ColorAxis.prototype.toColor = function (value, point) {
|
|
1225
|
+
var axis = this;
|
|
1226
|
+
var dataClasses = axis.dataClasses;
|
|
1227
|
+
var stops = axis.stops;
|
|
1228
|
+
var pos,
|
|
1229
|
+
from,
|
|
1230
|
+
to,
|
|
1231
|
+
color,
|
|
1232
|
+
dataClass,
|
|
1233
|
+
i;
|
|
1234
|
+
if (dataClasses) {
|
|
1235
|
+
i = dataClasses.length;
|
|
1236
|
+
while (i--) {
|
|
1237
|
+
dataClass = dataClasses[i];
|
|
1238
|
+
from = dataClass.from;
|
|
1239
|
+
to = dataClass.to;
|
|
1240
|
+
if ((typeof from === 'undefined' || value >= from) &&
|
|
1241
|
+
(typeof to === 'undefined' || value <= to)) {
|
|
1242
|
+
color = dataClass.color;
|
|
1243
|
+
if (point) {
|
|
1244
|
+
point.dataClass = i;
|
|
1245
|
+
point.colorIndex = dataClass.colorIndex;
|
|
1246
|
+
}
|
|
1247
|
+
break;
|
|
1248
|
+
}
|
|
1249
|
+
}
|
|
1250
|
+
}
|
|
1251
|
+
else {
|
|
1252
|
+
pos = axis.normalizedValue(value);
|
|
1253
|
+
i = stops.length;
|
|
1254
|
+
while (i--) {
|
|
1255
|
+
if (pos > stops[i][0]) {
|
|
1256
|
+
break;
|
|
1257
|
+
}
|
|
1258
|
+
}
|
|
1259
|
+
from = stops[i] || stops[i + 1];
|
|
1260
|
+
to = stops[i + 1] || from;
|
|
1261
|
+
// The position within the gradient
|
|
1262
|
+
pos = 1 - (to[0] - pos) / ((to[0] - from[0]) || 1);
|
|
1263
|
+
color = from.color.tweenTo(to.color, pos);
|
|
1264
|
+
}
|
|
1265
|
+
return color;
|
|
1266
|
+
};
|
|
1267
|
+
/**
|
|
1268
|
+
* Override the getOffset method to add the whole axis groups inside the
|
|
1269
|
+
* legend.
|
|
1270
|
+
* @private
|
|
1271
|
+
*/
|
|
1272
|
+
ColorAxis.prototype.getOffset = function () {
|
|
1273
|
+
var axis = this;
|
|
1274
|
+
var group = axis.legendGroup;
|
|
1275
|
+
var sideOffset = axis.chart.axisOffset[axis.side];
|
|
1276
|
+
if (group) {
|
|
1277
|
+
// Hook for the getOffset method to add groups to this parent
|
|
1278
|
+
// group
|
|
1279
|
+
axis.axisParent = group;
|
|
1280
|
+
// Call the base
|
|
1281
|
+
_super.prototype.getOffset.call(this);
|
|
1282
|
+
// First time only
|
|
1283
|
+
if (!axis.added) {
|
|
1284
|
+
axis.added = true;
|
|
1285
|
+
axis.labelLeft = 0;
|
|
1286
|
+
axis.labelRight = axis.width;
|
|
1287
|
+
}
|
|
1288
|
+
// Reset it to avoid color axis reserving space
|
|
1289
|
+
axis.chart.axisOffset[axis.side] = sideOffset;
|
|
1290
|
+
}
|
|
1291
|
+
};
|
|
1292
|
+
/**
|
|
1293
|
+
* Create the color gradient.
|
|
1294
|
+
* @private
|
|
1295
|
+
*/
|
|
1296
|
+
ColorAxis.prototype.setLegendColor = function () {
|
|
1297
|
+
var axis = this;
|
|
1298
|
+
var horiz = axis.horiz;
|
|
1299
|
+
var reversed = axis.reversed;
|
|
1300
|
+
var one = reversed ? 1 : 0;
|
|
1301
|
+
var zero = reversed ? 0 : 1;
|
|
1302
|
+
var grad = horiz ? [one, 0,
|
|
1303
|
+
zero, 0] : [0,
|
|
1304
|
+
zero, 0,
|
|
1305
|
+
one]; // #3190
|
|
1306
|
+
axis.legendColor = {
|
|
1307
|
+
linearGradient: {
|
|
1308
|
+
x1: grad[0],
|
|
1309
|
+
y1: grad[1],
|
|
1310
|
+
x2: grad[2],
|
|
1311
|
+
y2: grad[3]
|
|
1312
|
+
},
|
|
1313
|
+
stops: axis.stops
|
|
1314
|
+
};
|
|
1315
|
+
};
|
|
1316
|
+
/**
|
|
1317
|
+
* The color axis appears inside the legend and has its own legend symbol.
|
|
1318
|
+
* @private
|
|
1319
|
+
*/
|
|
1320
|
+
ColorAxis.prototype.drawLegendSymbol = function (legend, item) {
|
|
1321
|
+
var axis = this;
|
|
1322
|
+
var padding = legend.padding;
|
|
1323
|
+
var legendOptions = legend.options;
|
|
1324
|
+
var horiz = axis.horiz;
|
|
1325
|
+
var width = pick(legendOptions.symbolWidth,
|
|
1326
|
+
horiz ? ColorAxis.defaultLegendLength : 12);
|
|
1327
|
+
var height = pick(legendOptions.symbolHeight,
|
|
1328
|
+
horiz ? 12 : ColorAxis.defaultLegendLength);
|
|
1329
|
+
var labelPadding = pick(legendOptions.labelPadding,
|
|
1330
|
+
horiz ? 16 : 30);
|
|
1331
|
+
var itemDistance = pick(legendOptions.itemDistance, 10);
|
|
1332
|
+
this.setLegendColor();
|
|
1333
|
+
// Create the gradient
|
|
1334
|
+
item.legendSymbol = this.chart.renderer.rect(0, legend.baseline - 11, width, height).attr({
|
|
1335
|
+
zIndex: 1
|
|
1336
|
+
}).add(item.legendGroup);
|
|
1337
|
+
// Set how much space this legend item takes up
|
|
1338
|
+
axis.legendItemWidth = width + padding + (horiz ? itemDistance : labelPadding);
|
|
1339
|
+
axis.legendItemHeight = height + padding + (horiz ? labelPadding : 0);
|
|
1340
|
+
};
|
|
1341
|
+
/**
|
|
1342
|
+
* Fool the legend.
|
|
1343
|
+
* @private
|
|
1344
|
+
*/
|
|
1345
|
+
ColorAxis.prototype.setState = function (state) {
|
|
1346
|
+
this.series.forEach(function (series) {
|
|
1347
|
+
series.setState(state);
|
|
1348
|
+
});
|
|
1349
|
+
};
|
|
1350
|
+
/**
|
|
1351
|
+
* @private
|
|
1352
|
+
*/
|
|
1353
|
+
ColorAxis.prototype.setVisible = function () {
|
|
1354
|
+
};
|
|
1355
|
+
/**
|
|
1356
|
+
* @private
|
|
1357
|
+
*/
|
|
1358
|
+
ColorAxis.prototype.getSeriesExtremes = function () {
|
|
1359
|
+
var axis = this;
|
|
1360
|
+
var series = axis.series;
|
|
1361
|
+
var colorValArray,
|
|
1362
|
+
colorKey,
|
|
1363
|
+
colorValIndex,
|
|
1364
|
+
pointArrayMap,
|
|
1365
|
+
calculatedExtremes,
|
|
1366
|
+
cSeries,
|
|
1367
|
+
i = series.length,
|
|
1368
|
+
yData,
|
|
1369
|
+
j;
|
|
1370
|
+
this.dataMin = Infinity;
|
|
1371
|
+
this.dataMax = -Infinity;
|
|
1372
|
+
while (i--) { // x, y, value, other
|
|
1373
|
+
cSeries = series[i];
|
|
1374
|
+
colorKey = cSeries.colorKey = pick(cSeries.options.colorKey, cSeries.colorKey, cSeries.pointValKey, cSeries.zoneAxis, 'y');
|
|
1375
|
+
pointArrayMap = cSeries.pointArrayMap;
|
|
1376
|
+
calculatedExtremes = cSeries[colorKey + 'Min'] &&
|
|
1377
|
+
cSeries[colorKey + 'Max'];
|
|
1378
|
+
if (cSeries[colorKey + 'Data']) {
|
|
1379
|
+
colorValArray = cSeries[colorKey + 'Data'];
|
|
1380
|
+
}
|
|
1381
|
+
else {
|
|
1382
|
+
if (!pointArrayMap) {
|
|
1383
|
+
colorValArray = cSeries.yData;
|
|
1384
|
+
}
|
|
1385
|
+
else {
|
|
1386
|
+
colorValArray = [];
|
|
1387
|
+
colorValIndex = pointArrayMap.indexOf(colorKey);
|
|
1388
|
+
yData = cSeries.yData;
|
|
1389
|
+
if (colorValIndex >= 0 && yData) {
|
|
1390
|
+
for (j = 0; j < yData.length; j++) {
|
|
1391
|
+
colorValArray.push(pick(yData[j][colorValIndex], yData[j]));
|
|
1392
|
+
}
|
|
1393
|
+
}
|
|
1394
|
+
}
|
|
1395
|
+
}
|
|
1396
|
+
// If color key extremes are already calculated, use them.
|
|
1397
|
+
if (calculatedExtremes) {
|
|
1398
|
+
cSeries.minColorValue = cSeries[colorKey + 'Min'];
|
|
1399
|
+
cSeries.maxColorValue = cSeries[colorKey + 'Max'];
|
|
1400
|
+
}
|
|
1401
|
+
else {
|
|
1402
|
+
var cExtremes = Series.prototype.getExtremes.call(cSeries,
|
|
1403
|
+
colorValArray);
|
|
1404
|
+
cSeries.minColorValue = cExtremes.dataMin;
|
|
1405
|
+
cSeries.maxColorValue = cExtremes.dataMax;
|
|
1406
|
+
}
|
|
1407
|
+
if (typeof cSeries.minColorValue !== 'undefined') {
|
|
1408
|
+
this.dataMin =
|
|
1409
|
+
Math.min(this.dataMin, cSeries.minColorValue);
|
|
1410
|
+
this.dataMax =
|
|
1411
|
+
Math.max(this.dataMax, cSeries.maxColorValue);
|
|
1412
|
+
}
|
|
1413
|
+
if (!calculatedExtremes) {
|
|
1414
|
+
Series.prototype.applyExtremes.call(cSeries);
|
|
1415
|
+
}
|
|
1416
|
+
}
|
|
1417
|
+
};
|
|
1418
|
+
/**
|
|
1419
|
+
* Internal function to draw a crosshair.
|
|
1420
|
+
*
|
|
1421
|
+
* @function Highcharts.ColorAxis#drawCrosshair
|
|
1422
|
+
*
|
|
1423
|
+
* @param {Highcharts.PointerEventObject} [e]
|
|
1424
|
+
* The event arguments from the modified pointer event, extended with
|
|
1425
|
+
* `chartX` and `chartY`
|
|
1426
|
+
*
|
|
1427
|
+
* @param {Highcharts.Point} [point]
|
|
1428
|
+
* The Point object if the crosshair snaps to points.
|
|
1429
|
+
*
|
|
1430
|
+
* @fires Highcharts.ColorAxis#event:afterDrawCrosshair
|
|
1431
|
+
* @fires Highcharts.ColorAxis#event:drawCrosshair
|
|
1432
|
+
*/
|
|
1433
|
+
ColorAxis.prototype.drawCrosshair = function (e, point) {
|
|
1434
|
+
var axis = this;
|
|
1435
|
+
var plotX = point && point.plotX;
|
|
1436
|
+
var plotY = point && point.plotY;
|
|
1437
|
+
var axisPos = axis.pos;
|
|
1438
|
+
var axisLen = axis.len;
|
|
1439
|
+
var crossPos;
|
|
1440
|
+
if (point) {
|
|
1441
|
+
crossPos = axis.toPixels(point.getNestedProperty(point.series.colorKey));
|
|
1442
|
+
if (crossPos < axisPos) {
|
|
1443
|
+
crossPos = axisPos - 2;
|
|
1444
|
+
}
|
|
1445
|
+
else if (crossPos > axisPos + axisLen) {
|
|
1446
|
+
crossPos = axisPos + axisLen + 2;
|
|
1447
|
+
}
|
|
1448
|
+
point.plotX = crossPos;
|
|
1449
|
+
point.plotY = axis.len - crossPos;
|
|
1450
|
+
_super.prototype.drawCrosshair.call(this, e, point);
|
|
1451
|
+
point.plotX = plotX;
|
|
1452
|
+
point.plotY = plotY;
|
|
1453
|
+
if (axis.cross &&
|
|
1454
|
+
!axis.cross.addedToColorAxis &&
|
|
1455
|
+
axis.legendGroup) {
|
|
1456
|
+
axis.cross
|
|
1457
|
+
.addClass('highcharts-coloraxis-marker')
|
|
1458
|
+
.add(axis.legendGroup);
|
|
1459
|
+
axis.cross.addedToColorAxis = true;
|
|
1460
|
+
if (!axis.chart.styledMode &&
|
|
1461
|
+
typeof axis.crosshair === 'object') {
|
|
1462
|
+
axis.cross.attr({
|
|
1463
|
+
fill: axis.crosshair.color
|
|
1464
|
+
});
|
|
1465
|
+
}
|
|
1466
|
+
}
|
|
1467
|
+
}
|
|
1468
|
+
};
|
|
1469
|
+
/**
|
|
1470
|
+
* @private
|
|
1471
|
+
*/
|
|
1472
|
+
ColorAxis.prototype.getPlotLinePath = function (options) {
|
|
1473
|
+
var axis = this,
|
|
1474
|
+
left = axis.left,
|
|
1475
|
+
pos = options.translatedValue,
|
|
1476
|
+
top = axis.top;
|
|
1477
|
+
// crosshairs only
|
|
1478
|
+
return isNumber(pos) ? // pos can be 0 (#3969)
|
|
1479
|
+
(axis.horiz ? [
|
|
1480
|
+
['M', pos - 4, top - 6],
|
|
1481
|
+
['L', pos + 4, top - 6],
|
|
1482
|
+
['L', pos, top],
|
|
1483
|
+
['Z']
|
|
1484
|
+
] : [
|
|
1485
|
+
['M', left, pos],
|
|
1486
|
+
['L', left - 6, pos + 6],
|
|
1487
|
+
['L', left - 6, pos - 6],
|
|
1488
|
+
['Z']
|
|
1489
|
+
]) :
|
|
1490
|
+
_super.prototype.getPlotLinePath.call(this, options);
|
|
1491
|
+
};
|
|
1492
|
+
/**
|
|
1493
|
+
* Updates a color axis instance with a new set of options. The options are
|
|
1494
|
+
* merged with the existing options, so only new or altered options need to
|
|
1495
|
+
* be specified.
|
|
1496
|
+
*
|
|
1497
|
+
* @function Highcharts.ColorAxis#update
|
|
1498
|
+
*
|
|
1499
|
+
* @param {Highcharts.ColorAxisOptions} newOptions
|
|
1500
|
+
* The new options that will be merged in with existing options on the color
|
|
1501
|
+
* axis.
|
|
1502
|
+
*
|
|
1503
|
+
* @param {boolean} [redraw]
|
|
1504
|
+
* Whether to redraw the chart after the color axis is altered. If doing
|
|
1505
|
+
* more operations on the chart, it is a good idea to set redraw to `false`
|
|
1506
|
+
* and call {@link Highcharts.Chart#redraw} after.
|
|
1507
|
+
*/
|
|
1508
|
+
ColorAxis.prototype.update = function (newOptions, redraw) {
|
|
1509
|
+
var axis = this,
|
|
1510
|
+
chart = axis.chart,
|
|
1511
|
+
legend = chart.legend;
|
|
1512
|
+
this.series.forEach(function (series) {
|
|
1513
|
+
// Needed for Axis.update when choropleth colors change
|
|
1514
|
+
series.isDirtyData = true;
|
|
1515
|
+
});
|
|
1516
|
+
// When updating data classes, destroy old items and make sure new
|
|
1517
|
+
// ones are created (#3207)
|
|
1518
|
+
if (newOptions.dataClasses && legend.allItems || axis.dataClasses) {
|
|
1519
|
+
axis.destroyItems();
|
|
1520
|
+
}
|
|
1521
|
+
_super.prototype.update.call(this, newOptions, redraw);
|
|
1522
|
+
if (axis.legendItem) {
|
|
1523
|
+
axis.setLegendColor();
|
|
1524
|
+
legend.colorizeItem(this, true);
|
|
1525
|
+
}
|
|
1526
|
+
};
|
|
1527
|
+
/**
|
|
1528
|
+
* Destroy color axis legend items.
|
|
1529
|
+
* @private
|
|
1530
|
+
*/
|
|
1531
|
+
ColorAxis.prototype.destroyItems = function () {
|
|
1532
|
+
var axis = this;
|
|
1533
|
+
var chart = axis.chart;
|
|
1534
|
+
if (axis.legendItem) {
|
|
1535
|
+
chart.legend.destroyItem(axis);
|
|
1536
|
+
}
|
|
1537
|
+
else if (axis.legendItems) {
|
|
1538
|
+
axis.legendItems.forEach(function (item) {
|
|
1539
|
+
chart.legend.destroyItem(item);
|
|
1540
|
+
});
|
|
1541
|
+
}
|
|
1542
|
+
chart.isDirtyLegend = true;
|
|
1543
|
+
};
|
|
1544
|
+
// Removing the whole axis (#14283)
|
|
1545
|
+
ColorAxis.prototype.destroy = function () {
|
|
1546
|
+
this.chart.isDirtyLegend = true;
|
|
1547
|
+
this.destroyItems();
|
|
1548
|
+
_super.prototype.destroy.apply(this, [].slice.call(arguments));
|
|
1549
|
+
};
|
|
1550
|
+
/**
|
|
1551
|
+
* Removes the color axis and the related legend item.
|
|
1552
|
+
*
|
|
1553
|
+
* @function Highcharts.ColorAxis#remove
|
|
1554
|
+
*
|
|
1555
|
+
* @param {boolean} [redraw=true]
|
|
1556
|
+
* Whether to redraw the chart following the remove.
|
|
1557
|
+
*/
|
|
1558
|
+
ColorAxis.prototype.remove = function (redraw) {
|
|
1559
|
+
this.destroyItems();
|
|
1560
|
+
_super.prototype.remove.call(this, redraw);
|
|
1561
|
+
};
|
|
1562
|
+
/**
|
|
1563
|
+
* Get the legend item symbols for data classes.
|
|
1564
|
+
* @private
|
|
1565
|
+
*/
|
|
1566
|
+
ColorAxis.prototype.getDataClassLegendSymbols = function () {
|
|
1567
|
+
var axis = this;
|
|
1568
|
+
var chart = axis.chart;
|
|
1569
|
+
var legendItems = axis.legendItems;
|
|
1570
|
+
var legendOptions = chart.options.legend;
|
|
1571
|
+
var valueDecimals = legendOptions.valueDecimals;
|
|
1572
|
+
var valueSuffix = legendOptions.valueSuffix || '';
|
|
1573
|
+
var name;
|
|
1574
|
+
if (!legendItems.length) {
|
|
1575
|
+
axis.dataClasses.forEach(function (dataClass, i) {
|
|
1576
|
+
var from = dataClass.from,
|
|
1577
|
+
to = dataClass.to,
|
|
1578
|
+
numberFormatter = chart.numberFormatter;
|
|
1579
|
+
var vis = true;
|
|
1580
|
+
// Assemble the default name. This can be overridden
|
|
1581
|
+
// by legend.options.labelFormatter
|
|
1582
|
+
name = '';
|
|
1583
|
+
if (typeof from === 'undefined') {
|
|
1584
|
+
name = '< ';
|
|
1585
|
+
}
|
|
1586
|
+
else if (typeof to === 'undefined') {
|
|
1587
|
+
name = '> ';
|
|
1588
|
+
}
|
|
1589
|
+
if (typeof from !== 'undefined') {
|
|
1590
|
+
name += numberFormatter(from, valueDecimals) + valueSuffix;
|
|
1591
|
+
}
|
|
1592
|
+
if (typeof from !== 'undefined' && typeof to !== 'undefined') {
|
|
1593
|
+
name += ' - ';
|
|
1594
|
+
}
|
|
1595
|
+
if (typeof to !== 'undefined') {
|
|
1596
|
+
name += numberFormatter(to, valueDecimals) + valueSuffix;
|
|
1597
|
+
}
|
|
1598
|
+
// Add a mock object to the legend items
|
|
1599
|
+
legendItems.push(extend({
|
|
1600
|
+
chart: chart,
|
|
1601
|
+
name: name,
|
|
1602
|
+
options: {},
|
|
1603
|
+
drawLegendSymbol: LegendSymbol.drawRectangle,
|
|
1604
|
+
visible: true,
|
|
1605
|
+
setState: noop,
|
|
1606
|
+
isDataClass: true,
|
|
1607
|
+
setVisible: function () {
|
|
1608
|
+
vis = axis.visible = !vis;
|
|
1609
|
+
axis.series.forEach(function (series) {
|
|
1610
|
+
series.points.forEach(function (point) {
|
|
1611
|
+
if (point.dataClass === i) {
|
|
1612
|
+
point.setVisible(vis);
|
|
1613
|
+
}
|
|
1614
|
+
});
|
|
1615
|
+
});
|
|
1616
|
+
chart.legend.colorizeItem(this, vis);
|
|
1617
|
+
}
|
|
1618
|
+
}, dataClass));
|
|
1619
|
+
});
|
|
1620
|
+
}
|
|
1621
|
+
return legendItems;
|
|
1622
|
+
};
|
|
1623
|
+
/* *
|
|
1624
|
+
*
|
|
1625
|
+
* Static Properties
|
|
1626
|
+
*
|
|
1627
|
+
* */
|
|
1628
|
+
ColorAxis.defaultColorAxisOptions = ColorAxisDefaults;
|
|
1629
|
+
ColorAxis.defaultLegendLength = 200;
|
|
1361
1630
|
/**
|
|
1362
1631
|
* @private
|
|
1363
1632
|
*/
|
|
@@ -1370,121 +1639,29 @@
|
|
|
1370
1639
|
];
|
|
1371
1640
|
return ColorAxis;
|
|
1372
1641
|
}(Axis));
|
|
1642
|
+
/* *
|
|
1643
|
+
*
|
|
1644
|
+
* Registry
|
|
1645
|
+
*
|
|
1646
|
+
* */
|
|
1373
1647
|
// Properties to preserve after destroy, for Axis.update (#5881, #6025).
|
|
1374
1648
|
Array.prototype.push.apply(Axis.keepProps, ColorAxis.keepProps);
|
|
1375
|
-
|
|
1376
|
-
/**
|
|
1377
|
-
* Handle animation of the color attributes directly
|
|
1649
|
+
/* *
|
|
1378
1650
|
*
|
|
1379
|
-
*
|
|
1380
|
-
*
|
|
1381
|
-
*/
|
|
1382
|
-
*
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
//
|
|
1393
|
-
addEvent(Chart, 'afterGetAxes', function () {
|
|
1394
|
-
var chart = this,
|
|
1395
|
-
options = chart.options;
|
|
1396
|
-
this.colorAxis = [];
|
|
1397
|
-
if (options.colorAxis) {
|
|
1398
|
-
options.colorAxis = splat(options.colorAxis);
|
|
1399
|
-
options.colorAxis.forEach(function (axisOptions, i) {
|
|
1400
|
-
axisOptions.index = i;
|
|
1401
|
-
new ColorAxis(chart, axisOptions); // eslint-disable-line no-new
|
|
1402
|
-
});
|
|
1403
|
-
}
|
|
1404
|
-
});
|
|
1405
|
-
// Add colorAxis to series axisTypes
|
|
1406
|
-
addEvent(Series, 'bindAxes', function () {
|
|
1407
|
-
var axisTypes = this.axisTypes;
|
|
1408
|
-
if (!axisTypes) {
|
|
1409
|
-
this.axisTypes = ['colorAxis'];
|
|
1410
|
-
}
|
|
1411
|
-
else if (axisTypes.indexOf('colorAxis') === -1) {
|
|
1412
|
-
axisTypes.push('colorAxis');
|
|
1413
|
-
}
|
|
1414
|
-
});
|
|
1415
|
-
// Add the color axis. This also removes the axis' own series to prevent
|
|
1416
|
-
// them from showing up individually.
|
|
1417
|
-
addEvent(Legend, 'afterGetAllItems', function (e) {
|
|
1418
|
-
var _this = this;
|
|
1419
|
-
var colorAxisItems = [],
|
|
1420
|
-
colorAxes = this.chart.colorAxis || [],
|
|
1421
|
-
options,
|
|
1422
|
-
i;
|
|
1423
|
-
var destroyItem = function (item) {
|
|
1424
|
-
var i = e.allItems.indexOf(item);
|
|
1425
|
-
if (i !== -1) {
|
|
1426
|
-
// #15436
|
|
1427
|
-
_this.destroyItem(e.allItems[i]);
|
|
1428
|
-
e.allItems.splice(i, 1);
|
|
1429
|
-
}
|
|
1430
|
-
};
|
|
1431
|
-
colorAxes.forEach(function (colorAxis) {
|
|
1432
|
-
options = colorAxis.options;
|
|
1433
|
-
if (options && options.showInLegend) {
|
|
1434
|
-
// Data classes
|
|
1435
|
-
if (options.dataClasses && options.visible) {
|
|
1436
|
-
colorAxisItems = colorAxisItems.concat(colorAxis.getDataClassLegendSymbols());
|
|
1437
|
-
// Gradient legend
|
|
1438
|
-
}
|
|
1439
|
-
else if (options.visible) {
|
|
1440
|
-
// Add this axis on top
|
|
1441
|
-
colorAxisItems.push(colorAxis);
|
|
1442
|
-
}
|
|
1443
|
-
// If dataClasses are defined or showInLegend option is not set to
|
|
1444
|
-
// true, do not add color axis' series to legend.
|
|
1445
|
-
colorAxis.series.forEach(function (series) {
|
|
1446
|
-
if (!series.options.showInLegend || options.dataClasses) {
|
|
1447
|
-
if (series.options.legendType === 'point') {
|
|
1448
|
-
series.points.forEach(function (point) {
|
|
1449
|
-
destroyItem(point);
|
|
1450
|
-
});
|
|
1451
|
-
}
|
|
1452
|
-
else {
|
|
1453
|
-
destroyItem(series);
|
|
1454
|
-
}
|
|
1455
|
-
}
|
|
1456
|
-
});
|
|
1457
|
-
}
|
|
1458
|
-
});
|
|
1459
|
-
i = colorAxisItems.length;
|
|
1460
|
-
while (i--) {
|
|
1461
|
-
e.allItems.unshift(colorAxisItems[i]);
|
|
1462
|
-
}
|
|
1463
|
-
});
|
|
1464
|
-
addEvent(Legend, 'afterColorizeItem', function (e) {
|
|
1465
|
-
if (e.visible && e.item.legendColor) {
|
|
1466
|
-
e.item.legendSymbol.attr({
|
|
1467
|
-
fill: e.item.legendColor
|
|
1468
|
-
});
|
|
1469
|
-
}
|
|
1470
|
-
});
|
|
1471
|
-
// Updates in the legend need to be reflected in the color axis (6888)
|
|
1472
|
-
addEvent(Legend, 'afterUpdate', function () {
|
|
1473
|
-
var colorAxes = this.chart.colorAxis;
|
|
1474
|
-
if (colorAxes) {
|
|
1475
|
-
colorAxes.forEach(function (colorAxis) {
|
|
1476
|
-
colorAxis.update({}, arguments[2]);
|
|
1477
|
-
});
|
|
1478
|
-
}
|
|
1479
|
-
});
|
|
1480
|
-
// Calculate and set colors for points
|
|
1481
|
-
addEvent(Series, 'afterTranslate', function () {
|
|
1482
|
-
if (this.chart.colorAxis &&
|
|
1483
|
-
this.chart.colorAxis.length ||
|
|
1484
|
-
this.colorAttribs) {
|
|
1485
|
-
this.translateColors();
|
|
1486
|
-
}
|
|
1487
|
-
});
|
|
1651
|
+
* Default Export
|
|
1652
|
+
*
|
|
1653
|
+
* */
|
|
1654
|
+
/* *
|
|
1655
|
+
*
|
|
1656
|
+
* API Declarations
|
|
1657
|
+
*
|
|
1658
|
+
* */
|
|
1659
|
+
/**
|
|
1660
|
+
* Color axis types
|
|
1661
|
+
*
|
|
1662
|
+
* @typedef {"linear"|"logarithmic"} Highcharts.ColorAxisTypeValue
|
|
1663
|
+
*/
|
|
1664
|
+
''; // detach doclet above
|
|
1488
1665
|
|
|
1489
1666
|
return ColorAxis;
|
|
1490
1667
|
});
|
|
@@ -2647,7 +2824,7 @@
|
|
|
2647
2824
|
|
|
2648
2825
|
return MapPoint;
|
|
2649
2826
|
});
|
|
2650
|
-
_registerModule(_modules, 'Series/Map/MapSeries.js', [_modules['Mixins/ColorMapSeries.js'], _modules['Core/Globals.js'], _modules['
|
|
2827
|
+
_registerModule(_modules, 'Series/Map/MapSeries.js', [_modules['Mixins/ColorMapSeries.js'], _modules['Core/Globals.js'], _modules['Core/Legend/LegendSymbol.js'], _modules['Core/Chart/MapChart.js'], _modules['Series/Map/MapPoint.js'], _modules['Core/Color/Palette.js'], _modules['Core/Series/Series.js'], _modules['Core/Series/SeriesRegistry.js'], _modules['Core/Renderer/SVG/SVGRenderer.js'], _modules['Core/Utilities.js']], function (ColorMapMixin, H, LegendSymbol, MapChart, MapPoint, palette, Series, SeriesRegistry, SVGRenderer, U) {
|
|
2651
2828
|
/* *
|
|
2652
2829
|
*
|
|
2653
2830
|
* (c) 2010-2021 Torstein Honsi
|
|
@@ -3421,7 +3598,9 @@
|
|
|
3421
3598
|
dataLabels: {
|
|
3422
3599
|
crop: false,
|
|
3423
3600
|
formatter: function () {
|
|
3424
|
-
|
|
3601
|
+
var numberFormatter = this.series.chart.numberFormatter;
|
|
3602
|
+
var value = this.point.value;
|
|
3603
|
+
return isNumber(value) ? numberFormatter(value, -1) : '';
|
|
3425
3604
|
},
|
|
3426
3605
|
inside: true,
|
|
3427
3606
|
overflow: false,
|
|
@@ -3658,7 +3837,7 @@
|
|
|
3658
3837
|
drawDataLabels: noop,
|
|
3659
3838
|
// No graph for the map series
|
|
3660
3839
|
drawGraph: noop,
|
|
3661
|
-
drawLegendSymbol:
|
|
3840
|
+
drawLegendSymbol: LegendSymbol.drawRectangle,
|
|
3662
3841
|
forceDL: true,
|
|
3663
3842
|
getExtremesFromAll: true,
|
|
3664
3843
|
getSymbol: colorMapSeriesMixin.getSymbol,
|
|
@@ -4348,156 +4527,125 @@
|
|
|
4348
4527
|
|
|
4349
4528
|
return MapPointSeries;
|
|
4350
4529
|
});
|
|
4351
|
-
_registerModule(_modules, 'Series/Bubble/
|
|
4530
|
+
_registerModule(_modules, 'Series/Bubble/BubbleLegendDefaults.js', [_modules['Core/Color/Palette.js']], function (Palette) {
|
|
4352
4531
|
/* *
|
|
4353
4532
|
*
|
|
4354
|
-
* (c) 2010-2021
|
|
4533
|
+
* (c) 2010-2021 Highsoft AS
|
|
4534
|
+
*
|
|
4535
|
+
* Author: Paweł Potaczek
|
|
4355
4536
|
*
|
|
4356
4537
|
* License: www.highcharts.com/license
|
|
4357
4538
|
*
|
|
4358
4539
|
* !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
|
|
4359
4540
|
*
|
|
4360
4541
|
* */
|
|
4361
|
-
var __extends = (this && this.__extends) || (function () {
|
|
4362
|
-
var extendStatics = function (d,
|
|
4363
|
-
b) {
|
|
4364
|
-
extendStatics = Object.setPrototypeOf ||
|
|
4365
|
-
({ __proto__: [] } instanceof Array && function (d,
|
|
4366
|
-
b) { d.__proto__ = b; }) ||
|
|
4367
|
-
function (d,
|
|
4368
|
-
b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
4369
|
-
return extendStatics(d, b);
|
|
4370
|
-
};
|
|
4371
|
-
return function (d, b) {
|
|
4372
|
-
extendStatics(d, b);
|
|
4373
|
-
function __() { this.constructor = d; }
|
|
4374
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
4375
|
-
};
|
|
4376
|
-
})();
|
|
4377
|
-
var ScatterPoint = SeriesRegistry.seriesTypes.scatter.prototype.pointClass;
|
|
4378
|
-
var extend = U.extend;
|
|
4379
4542
|
/* *
|
|
4380
4543
|
*
|
|
4381
|
-
*
|
|
4544
|
+
* Constants
|
|
4382
4545
|
*
|
|
4383
4546
|
* */
|
|
4384
|
-
|
|
4385
|
-
|
|
4386
|
-
|
|
4387
|
-
|
|
4547
|
+
/**
|
|
4548
|
+
* The bubble legend is an additional element in legend which
|
|
4549
|
+
* presents the scale of the bubble series. Individual bubble ranges
|
|
4550
|
+
* can be defined by user or calculated from series. In the case of
|
|
4551
|
+
* automatically calculated ranges, a 1px margin of error is
|
|
4552
|
+
* permitted.
|
|
4553
|
+
*
|
|
4554
|
+
* @since 7.0.0
|
|
4555
|
+
* @product highcharts highstock highmaps
|
|
4556
|
+
* @requires highcharts-more
|
|
4557
|
+
* @optionparent legend.bubbleLegend
|
|
4558
|
+
*/
|
|
4559
|
+
var BubbleLegendDefaults = {
|
|
4560
|
+
/**
|
|
4561
|
+
* The color of the ranges borders,
|
|
4562
|
+
can be also defined for an
|
|
4563
|
+
* individual range.
|
|
4388
4564
|
*
|
|
4389
|
-
*
|
|
4565
|
+
* @sample highcharts/bubble-legend/similartoseries/
|
|
4566
|
+
* Similar look to the bubble series
|
|
4567
|
+
* @sample highcharts/bubble-legend/bordercolor/
|
|
4568
|
+
* Individual bubble border color
|
|
4390
4569
|
*
|
|
4391
|
-
*
|
|
4392
|
-
|
|
4393
|
-
|
|
4394
|
-
_this.options = void 0;
|
|
4395
|
-
_this.series = void 0;
|
|
4396
|
-
return _this;
|
|
4397
|
-
/* eslint-enable valid-jsdoc */
|
|
4398
|
-
}
|
|
4399
|
-
/* *
|
|
4400
|
-
*
|
|
4401
|
-
* Functions
|
|
4402
|
-
*
|
|
4403
|
-
* */
|
|
4404
|
-
/* eslint-disable valid-jsdoc */
|
|
4405
|
-
/**
|
|
4406
|
-
* @private
|
|
4407
|
-
*/
|
|
4408
|
-
BubblePoint.prototype.haloPath = function (size) {
|
|
4409
|
-
return Point.prototype.haloPath.call(this,
|
|
4410
|
-
// #6067
|
|
4411
|
-
size === 0 ? 0 : (this.marker ? this.marker.radius || 0 : 0) + size);
|
|
4412
|
-
};
|
|
4413
|
-
return BubblePoint;
|
|
4414
|
-
}(ScatterPoint));
|
|
4415
|
-
extend(BubblePoint.prototype, {
|
|
4416
|
-
ttBelow: false
|
|
4417
|
-
});
|
|
4418
|
-
/* *
|
|
4419
|
-
*
|
|
4420
|
-
* Default Export
|
|
4421
|
-
*
|
|
4422
|
-
* */
|
|
4423
|
-
|
|
4424
|
-
return BubblePoint;
|
|
4425
|
-
});
|
|
4426
|
-
_registerModule(_modules, 'Series/Bubble/BubbleLegend.js', [_modules['Core/Chart/Chart.js'], _modules['Core/Color/Color.js'], _modules['Core/FormatUtilities.js'], _modules['Core/Globals.js'], _modules['Core/Legend.js'], _modules['Core/DefaultOptions.js'], _modules['Core/Color/Palette.js'], _modules['Core/Series/Series.js'], _modules['Core/Utilities.js']], function (Chart, Color, F, H, Legend, D, palette, Series, U) {
|
|
4427
|
-
/* *
|
|
4428
|
-
*
|
|
4429
|
-
* (c) 2010-2021 Highsoft AS
|
|
4430
|
-
*
|
|
4431
|
-
* Author: Paweł Potaczek
|
|
4432
|
-
*
|
|
4433
|
-
* License: www.highcharts.com/license
|
|
4434
|
-
*
|
|
4435
|
-
* !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
|
|
4436
|
-
*
|
|
4437
|
-
* */
|
|
4438
|
-
var color = Color.parse;
|
|
4439
|
-
var noop = H.noop;
|
|
4440
|
-
var setOptions = D.setOptions;
|
|
4441
|
-
var addEvent = U.addEvent,
|
|
4442
|
-
arrayMax = U.arrayMax,
|
|
4443
|
-
arrayMin = U.arrayMin,
|
|
4444
|
-
isNumber = U.isNumber,
|
|
4445
|
-
merge = U.merge,
|
|
4446
|
-
objectEach = U.objectEach,
|
|
4447
|
-
pick = U.pick,
|
|
4448
|
-
stableSort = U.stableSort,
|
|
4449
|
-
wrap = U.wrap;
|
|
4450
|
-
/**
|
|
4451
|
-
* @interface Highcharts.BubbleLegendFormatterContextObject
|
|
4452
|
-
*/ /**
|
|
4453
|
-
* The center y position of the range.
|
|
4454
|
-
* @name Highcharts.BubbleLegendFormatterContextObject#center
|
|
4455
|
-
* @type {number}
|
|
4456
|
-
*/ /**
|
|
4457
|
-
* The radius of the bubble range.
|
|
4458
|
-
* @name Highcharts.BubbleLegendFormatterContextObject#radius
|
|
4459
|
-
* @type {number}
|
|
4460
|
-
*/ /**
|
|
4461
|
-
* The bubble value.
|
|
4462
|
-
* @name Highcharts.BubbleLegendFormatterContextObject#value
|
|
4463
|
-
* @type {number}
|
|
4464
|
-
*/
|
|
4465
|
-
''; // detach doclets above
|
|
4466
|
-
setOptions({
|
|
4467
|
-
legend: {
|
|
4570
|
+
* @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}
|
|
4571
|
+
*/
|
|
4572
|
+
borderColor: void 0,
|
|
4468
4573
|
/**
|
|
4469
|
-
* The
|
|
4470
|
-
|
|
4471
|
-
*
|
|
4472
|
-
* automatically calculated ranges, a 1px margin of error is
|
|
4473
|
-
* permitted.
|
|
4474
|
-
*
|
|
4475
|
-
* @since 7.0.0
|
|
4476
|
-
* @product highcharts highstock highmaps
|
|
4477
|
-
* @requires highcharts-more
|
|
4478
|
-
* @optionparent legend.bubbleLegend
|
|
4574
|
+
* The width of the ranges borders in pixels,
|
|
4575
|
+
can be also
|
|
4576
|
+
* defined for an individual range.
|
|
4479
4577
|
*/
|
|
4480
|
-
|
|
4481
|
-
|
|
4482
|
-
|
|
4483
|
-
|
|
4484
|
-
|
|
4485
|
-
|
|
4486
|
-
|
|
4487
|
-
|
|
4488
|
-
|
|
4489
|
-
|
|
4490
|
-
|
|
4491
|
-
|
|
4492
|
-
|
|
4493
|
-
|
|
4494
|
-
|
|
4495
|
-
|
|
4496
|
-
|
|
4497
|
-
|
|
4578
|
+
borderWidth: 2,
|
|
4579
|
+
/**
|
|
4580
|
+
* An additional class name to apply to the bubble legend'
|
|
4581
|
+
* circle graphical elements. This option does not replace
|
|
4582
|
+
* default class names of the graphical element.
|
|
4583
|
+
*
|
|
4584
|
+
* @sample {highcharts} highcharts/css/bubble-legend/
|
|
4585
|
+
* Styling by CSS
|
|
4586
|
+
*
|
|
4587
|
+
* @type {string}
|
|
4588
|
+
*/
|
|
4589
|
+
className: void 0,
|
|
4590
|
+
/**
|
|
4591
|
+
* The main color of the bubble legend. Applies to ranges,
|
|
4592
|
+
if
|
|
4593
|
+
* individual color is not defined.
|
|
4594
|
+
*
|
|
4595
|
+
* @sample highcharts/bubble-legend/similartoseries/
|
|
4596
|
+
* Similar look to the bubble series
|
|
4597
|
+
* @sample highcharts/bubble-legend/color/
|
|
4598
|
+
* Individual bubble color
|
|
4599
|
+
*
|
|
4600
|
+
* @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}
|
|
4601
|
+
*/
|
|
4602
|
+
color: void 0,
|
|
4603
|
+
/**
|
|
4604
|
+
* An additional class name to apply to the bubble legend's
|
|
4605
|
+
* connector graphical elements. This option does not replace
|
|
4606
|
+
* default class names of the graphical element.
|
|
4607
|
+
*
|
|
4608
|
+
* @sample {highcharts} highcharts/css/bubble-legend/
|
|
4609
|
+
* Styling by CSS
|
|
4610
|
+
*
|
|
4611
|
+
* @type {string}
|
|
4612
|
+
*/
|
|
4613
|
+
connectorClassName: void 0,
|
|
4614
|
+
/**
|
|
4615
|
+
* The color of the connector,
|
|
4616
|
+
can be also defined
|
|
4617
|
+
* for an individual range.
|
|
4618
|
+
*
|
|
4619
|
+
* @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}
|
|
4620
|
+
*/
|
|
4621
|
+
connectorColor: void 0,
|
|
4622
|
+
/**
|
|
4623
|
+
* The length of the connectors in pixels. If labels are
|
|
4624
|
+
* centered,
|
|
4625
|
+
the distance is reduced to 0.
|
|
4626
|
+
*
|
|
4627
|
+
* @sample highcharts/bubble-legend/connectorandlabels/
|
|
4628
|
+
* Increased connector length
|
|
4629
|
+
*/
|
|
4630
|
+
connectorDistance: 60,
|
|
4631
|
+
/**
|
|
4632
|
+
* The width of the connectors in pixels.
|
|
4633
|
+
*
|
|
4634
|
+
* @sample highcharts/bubble-legend/connectorandlabels/
|
|
4635
|
+
* Increased connector width
|
|
4636
|
+
*/
|
|
4637
|
+
connectorWidth: 1,
|
|
4638
|
+
/**
|
|
4639
|
+
* Enable or disable the bubble legend.
|
|
4640
|
+
*/
|
|
4641
|
+
enabled: false,
|
|
4642
|
+
/**
|
|
4643
|
+
* Options for the bubble legend labels.
|
|
4644
|
+
*/
|
|
4645
|
+
labels: {
|
|
4498
4646
|
/**
|
|
4499
|
-
* An additional class name to apply to the bubble legend
|
|
4500
|
-
*
|
|
4647
|
+
* An additional class name to apply to the bubble legend
|
|
4648
|
+
* label graphical elements. This option does not replace
|
|
4501
4649
|
* default class names of the graphical element.
|
|
4502
4650
|
*
|
|
4503
4651
|
* @sample {highcharts} highcharts/css/bubble-legend/
|
|
@@ -4507,209 +4655,201 @@
|
|
|
4507
4655
|
*/
|
|
4508
4656
|
className: void 0,
|
|
4509
4657
|
/**
|
|
4510
|
-
*
|
|
4511
|
-
* individual color is not defined.
|
|
4512
|
-
*
|
|
4513
|
-
* @sample highcharts/bubble-legend/similartoseries/
|
|
4514
|
-
* Similar look to the bubble series
|
|
4515
|
-
* @sample highcharts/bubble-legend/color/
|
|
4516
|
-
* Individual bubble color
|
|
4517
|
-
*
|
|
4518
|
-
* @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}
|
|
4658
|
+
* Whether to allow data labels to overlap.
|
|
4519
4659
|
*/
|
|
4520
|
-
|
|
4660
|
+
allowOverlap: false,
|
|
4521
4661
|
/**
|
|
4522
|
-
*
|
|
4523
|
-
*
|
|
4524
|
-
* default class names of the graphical element.
|
|
4662
|
+
* A format string for the bubble legend labels. Available
|
|
4663
|
+
* variables are the same as for `formatter`.
|
|
4525
4664
|
*
|
|
4526
|
-
* @sample
|
|
4527
|
-
*
|
|
4665
|
+
* @sample highcharts/bubble-legend/format/
|
|
4666
|
+
* Add a unit
|
|
4528
4667
|
*
|
|
4529
4668
|
* @type {string}
|
|
4530
4669
|
*/
|
|
4531
|
-
|
|
4670
|
+
format: '',
|
|
4532
4671
|
/**
|
|
4533
|
-
*
|
|
4534
|
-
* for an individual range.
|
|
4672
|
+
* Available `this` properties are:
|
|
4535
4673
|
*
|
|
4536
|
-
*
|
|
4537
|
-
*/
|
|
4538
|
-
connectorColor: void 0,
|
|
4539
|
-
/**
|
|
4540
|
-
* The length of the connectors in pixels. If labels are
|
|
4541
|
-
* centered, the distance is reduced to 0.
|
|
4674
|
+
* - `this.value`: The bubble value.
|
|
4542
4675
|
*
|
|
4543
|
-
*
|
|
4544
|
-
*
|
|
4676
|
+
* - `this.radius`: The radius of the bubble range.
|
|
4677
|
+
*
|
|
4678
|
+
* - `this.center`: The center y position of the range.
|
|
4679
|
+
*
|
|
4680
|
+
* @type {Highcharts.FormatterCallbackFunction<Highcharts.BubbleLegendFormatterContextObject>}
|
|
4545
4681
|
*/
|
|
4546
|
-
|
|
4682
|
+
formatter: void 0,
|
|
4547
4683
|
/**
|
|
4548
|
-
* The
|
|
4684
|
+
* The alignment of the labels compared to the bubble
|
|
4685
|
+
* legend. Can be one of `left`,
|
|
4686
|
+
`center` or `right`.
|
|
4549
4687
|
*
|
|
4550
4688
|
* @sample highcharts/bubble-legend/connectorandlabels/
|
|
4551
|
-
*
|
|
4552
|
-
|
|
4553
|
-
|
|
4554
|
-
/**
|
|
4555
|
-
* Enable or disable the bubble legend.
|
|
4689
|
+
* Labels on left
|
|
4690
|
+
*
|
|
4691
|
+
* @type {Highcharts.AlignValue}
|
|
4556
4692
|
*/
|
|
4557
|
-
|
|
4693
|
+
align: 'right',
|
|
4558
4694
|
/**
|
|
4559
|
-
*
|
|
4695
|
+
* CSS styles for the labels.
|
|
4696
|
+
*
|
|
4697
|
+
* @type {Highcharts.CSSObject}
|
|
4560
4698
|
*/
|
|
4561
|
-
|
|
4562
|
-
/**
|
|
4563
|
-
|
|
4564
|
-
|
|
4565
|
-
|
|
4566
|
-
*
|
|
4567
|
-
* @sample {highcharts} highcharts/css/bubble-legend/
|
|
4568
|
-
* Styling by CSS
|
|
4569
|
-
*
|
|
4570
|
-
* @type {string}
|
|
4571
|
-
*/
|
|
4572
|
-
className: void 0,
|
|
4573
|
-
/**
|
|
4574
|
-
* Whether to allow data labels to overlap.
|
|
4575
|
-
*/
|
|
4576
|
-
allowOverlap: false,
|
|
4577
|
-
/**
|
|
4578
|
-
* A format string for the bubble legend labels. Available
|
|
4579
|
-
* variables are the same as for `formatter`.
|
|
4580
|
-
*
|
|
4581
|
-
* @sample highcharts/bubble-legend/format/
|
|
4582
|
-
* Add a unit
|
|
4583
|
-
*
|
|
4584
|
-
* @type {string}
|
|
4585
|
-
*/
|
|
4586
|
-
format: '',
|
|
4587
|
-
/**
|
|
4588
|
-
* Available `this` properties are:
|
|
4589
|
-
*
|
|
4590
|
-
* - `this.value`: The bubble value.
|
|
4591
|
-
*
|
|
4592
|
-
* - `this.radius`: The radius of the bubble range.
|
|
4593
|
-
*
|
|
4594
|
-
* - `this.center`: The center y position of the range.
|
|
4595
|
-
*
|
|
4596
|
-
* @type {Highcharts.FormatterCallbackFunction<Highcharts.BubbleLegendFormatterContextObject>}
|
|
4597
|
-
*/
|
|
4598
|
-
formatter: void 0,
|
|
4599
|
-
/**
|
|
4600
|
-
* The alignment of the labels compared to the bubble
|
|
4601
|
-
* legend. Can be one of `left`, `center` or `right`.
|
|
4602
|
-
*
|
|
4603
|
-
* @sample highcharts/bubble-legend/connectorandlabels/
|
|
4604
|
-
* Labels on left
|
|
4605
|
-
*
|
|
4606
|
-
* @type {Highcharts.AlignValue}
|
|
4607
|
-
*/
|
|
4608
|
-
align: 'right',
|
|
4609
|
-
/**
|
|
4610
|
-
* CSS styles for the labels.
|
|
4611
|
-
*
|
|
4612
|
-
* @type {Highcharts.CSSObject}
|
|
4613
|
-
*/
|
|
4614
|
-
style: {
|
|
4615
|
-
/** @ignore-option */
|
|
4616
|
-
fontSize: '10px',
|
|
4617
|
-
/** @ignore-option */
|
|
4618
|
-
color: palette.neutralColor100
|
|
4619
|
-
},
|
|
4620
|
-
/**
|
|
4621
|
-
* The x position offset of the label relative to the
|
|
4622
|
-
* connector.
|
|
4623
|
-
*/
|
|
4624
|
-
x: 0,
|
|
4625
|
-
/**
|
|
4626
|
-
* The y position offset of the label relative to the
|
|
4627
|
-
* connector.
|
|
4628
|
-
*/
|
|
4629
|
-
y: 0
|
|
4699
|
+
style: {
|
|
4700
|
+
/** @ignore-option */
|
|
4701
|
+
fontSize: '10px',
|
|
4702
|
+
/** @ignore-option */
|
|
4703
|
+
color: Palette.neutralColor100
|
|
4630
4704
|
},
|
|
4631
4705
|
/**
|
|
4632
|
-
*
|
|
4633
|
-
*
|
|
4634
|
-
* from bubble series.
|
|
4635
|
-
*/
|
|
4636
|
-
maxSize: 60,
|
|
4637
|
-
/**
|
|
4638
|
-
* Minimum bubble legend range size. If values for ranges are
|
|
4639
|
-
* not specified, the `minSize` and the `maxSize` are calculated
|
|
4640
|
-
* from bubble series.
|
|
4641
|
-
*/
|
|
4642
|
-
minSize: 10,
|
|
4643
|
-
/**
|
|
4644
|
-
* The position of the bubble legend in the legend.
|
|
4645
|
-
* @sample highcharts/bubble-legend/connectorandlabels/
|
|
4646
|
-
* Bubble legend as last item in legend
|
|
4706
|
+
* The x position offset of the label relative to the
|
|
4707
|
+
* connector.
|
|
4647
4708
|
*/
|
|
4648
|
-
|
|
4709
|
+
x: 0,
|
|
4649
4710
|
/**
|
|
4650
|
-
*
|
|
4651
|
-
*
|
|
4652
|
-
*
|
|
4653
|
-
* @sample highcharts/bubble-legend/ranges/
|
|
4654
|
-
* Manually defined ranges
|
|
4655
|
-
* @sample highcharts/bubble-legend/autoranges/
|
|
4656
|
-
* Auto calculated ranges
|
|
4657
|
-
*
|
|
4658
|
-
* @type {Array<*>}
|
|
4711
|
+
* The y position offset of the label relative to the
|
|
4712
|
+
* connector.
|
|
4659
4713
|
*/
|
|
4660
|
-
|
|
4661
|
-
|
|
4662
|
-
|
|
4663
|
-
|
|
4664
|
-
|
|
4665
|
-
|
|
4666
|
-
|
|
4667
|
-
|
|
4668
|
-
|
|
4669
|
-
|
|
4670
|
-
|
|
4671
|
-
|
|
4672
|
-
|
|
4673
|
-
|
|
4674
|
-
|
|
4675
|
-
|
|
4676
|
-
|
|
4677
|
-
|
|
4678
|
-
|
|
4679
|
-
|
|
4680
|
-
|
|
4681
|
-
|
|
4714
|
+
y: 0
|
|
4715
|
+
},
|
|
4716
|
+
/**
|
|
4717
|
+
* Miximum bubble legend range size. If values for ranges are
|
|
4718
|
+
* not specified,
|
|
4719
|
+
the `minSize` and the `maxSize` are calculated
|
|
4720
|
+
* from bubble series.
|
|
4721
|
+
*/
|
|
4722
|
+
maxSize: 60,
|
|
4723
|
+
/**
|
|
4724
|
+
* Minimum bubble legend range size. If values for ranges are
|
|
4725
|
+
* not specified,
|
|
4726
|
+
the `minSize` and the `maxSize` are calculated
|
|
4727
|
+
* from bubble series.
|
|
4728
|
+
*/
|
|
4729
|
+
minSize: 10,
|
|
4730
|
+
/**
|
|
4731
|
+
* The position of the bubble legend in the legend.
|
|
4732
|
+
* @sample highcharts/bubble-legend/connectorandlabels/
|
|
4733
|
+
* Bubble legend as last item in legend
|
|
4734
|
+
*/
|
|
4735
|
+
legendIndex: 0,
|
|
4736
|
+
/**
|
|
4737
|
+
* Options for specific range. One range consists of bubble,
|
|
4738
|
+
* label and connector.
|
|
4739
|
+
*
|
|
4740
|
+
* @sample highcharts/bubble-legend/ranges/
|
|
4741
|
+
* Manually defined ranges
|
|
4742
|
+
* @sample highcharts/bubble-legend/autoranges/
|
|
4743
|
+
* Auto calculated ranges
|
|
4744
|
+
*
|
|
4745
|
+
* @type {Array<*>}
|
|
4746
|
+
*/
|
|
4747
|
+
ranges: {
|
|
4682
4748
|
/**
|
|
4683
|
-
*
|
|
4684
|
-
|
|
4685
|
-
*
|
|
4686
|
-
* bubble.
|
|
4687
|
-
*
|
|
4688
|
-
* @sample highcharts/bubble-legend/ranges/
|
|
4689
|
-
* Size by width
|
|
4690
|
-
*
|
|
4691
|
-
* @type {Highcharts.BubbleSizeByValue}
|
|
4749
|
+
* Range size value,
|
|
4750
|
+
similar to bubble Z data.
|
|
4751
|
+
* @type {number}
|
|
4692
4752
|
*/
|
|
4693
|
-
|
|
4753
|
+
value: void 0,
|
|
4694
4754
|
/**
|
|
4695
|
-
*
|
|
4696
|
-
*
|
|
4697
|
-
* zThreshold of 0, a bubble of value -1 will have the same size
|
|
4698
|
-
* as a bubble of value 1, while a bubble of value 0 will have a
|
|
4699
|
-
* smaller size according to minSize.
|
|
4755
|
+
* The color of the border for individual range.
|
|
4756
|
+
* @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}
|
|
4700
4757
|
*/
|
|
4701
|
-
|
|
4758
|
+
borderColor: void 0,
|
|
4702
4759
|
/**
|
|
4703
|
-
*
|
|
4760
|
+
* The color of the bubble for individual range.
|
|
4761
|
+
* @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}
|
|
4704
4762
|
*/
|
|
4705
|
-
|
|
4763
|
+
color: void 0,
|
|
4706
4764
|
/**
|
|
4707
|
-
*
|
|
4765
|
+
* The color of the connector for individual range.
|
|
4766
|
+
* @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}
|
|
4708
4767
|
*/
|
|
4709
|
-
|
|
4710
|
-
}
|
|
4711
|
-
|
|
4712
|
-
|
|
4768
|
+
connectorColor: void 0
|
|
4769
|
+
},
|
|
4770
|
+
/**
|
|
4771
|
+
* Whether the bubble legend range value should be represented
|
|
4772
|
+
* by the area or the width of the bubble. The default,
|
|
4773
|
+
area,
|
|
4774
|
+
* corresponds best to the human perception of the size of each
|
|
4775
|
+
* bubble.
|
|
4776
|
+
*
|
|
4777
|
+
* @sample highcharts/bubble-legend/ranges/
|
|
4778
|
+
* Size by width
|
|
4779
|
+
*
|
|
4780
|
+
* @type {Highcharts.BubbleSizeByValue}
|
|
4781
|
+
*/
|
|
4782
|
+
sizeBy: 'area',
|
|
4783
|
+
/**
|
|
4784
|
+
* When this is true,
|
|
4785
|
+
the absolute value of z determines the
|
|
4786
|
+
* size of the bubble. This means that with the default
|
|
4787
|
+
* zThreshold of 0,
|
|
4788
|
+
a bubble of value -1 will have the same size
|
|
4789
|
+
* as a bubble of value 1,
|
|
4790
|
+
while a bubble of value 0 will have a
|
|
4791
|
+
* smaller size according to minSize.
|
|
4792
|
+
*/
|
|
4793
|
+
sizeByAbsoluteValue: false,
|
|
4794
|
+
/**
|
|
4795
|
+
* Define the visual z index of the bubble legend.
|
|
4796
|
+
*/
|
|
4797
|
+
zIndex: 1,
|
|
4798
|
+
/**
|
|
4799
|
+
* Ranges with with lower value than zThreshold,
|
|
4800
|
+
are skipped.
|
|
4801
|
+
*/
|
|
4802
|
+
zThreshold: 0
|
|
4803
|
+
};
|
|
4804
|
+
/* *
|
|
4805
|
+
*
|
|
4806
|
+
* Default Export
|
|
4807
|
+
*
|
|
4808
|
+
* */
|
|
4809
|
+
|
|
4810
|
+
return BubbleLegendDefaults;
|
|
4811
|
+
});
|
|
4812
|
+
_registerModule(_modules, 'Series/Bubble/BubbleLegendItem.js', [_modules['Core/Color/Color.js'], _modules['Core/FormatUtilities.js'], _modules['Core/Globals.js'], _modules['Core/Utilities.js']], function (Color, F, H, U) {
|
|
4813
|
+
/* *
|
|
4814
|
+
*
|
|
4815
|
+
* (c) 2010-2021 Highsoft AS
|
|
4816
|
+
*
|
|
4817
|
+
* Author: Paweł Potaczek
|
|
4818
|
+
*
|
|
4819
|
+
* License: www.highcharts.com/license
|
|
4820
|
+
*
|
|
4821
|
+
* !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
|
|
4822
|
+
*
|
|
4823
|
+
* */
|
|
4824
|
+
var color = Color.parse;
|
|
4825
|
+
var noop = H.noop;
|
|
4826
|
+
var arrayMax = U.arrayMax,
|
|
4827
|
+
arrayMin = U.arrayMin,
|
|
4828
|
+
isNumber = U.isNumber,
|
|
4829
|
+
merge = U.merge,
|
|
4830
|
+
pick = U.pick,
|
|
4831
|
+
stableSort = U.stableSort;
|
|
4832
|
+
/**
|
|
4833
|
+
* @interface Highcharts.BubbleLegendFormatterContextObject
|
|
4834
|
+
*/ /**
|
|
4835
|
+
* The center y position of the range.
|
|
4836
|
+
* @name Highcharts.BubbleLegendFormatterContextObject#center
|
|
4837
|
+
* @type {number}
|
|
4838
|
+
*/ /**
|
|
4839
|
+
* The radius of the bubble range.
|
|
4840
|
+
* @name Highcharts.BubbleLegendFormatterContextObject#radius
|
|
4841
|
+
* @type {number}
|
|
4842
|
+
*/ /**
|
|
4843
|
+
* The bubble value.
|
|
4844
|
+
* @name Highcharts.BubbleLegendFormatterContextObject#value
|
|
4845
|
+
* @type {number}
|
|
4846
|
+
*/
|
|
4847
|
+
''; // detach doclets above
|
|
4848
|
+
/* *
|
|
4849
|
+
*
|
|
4850
|
+
* Class
|
|
4851
|
+
*
|
|
4852
|
+
* */
|
|
4713
4853
|
/* eslint-disable no-invalid-this, valid-jsdoc */
|
|
4714
4854
|
/**
|
|
4715
4855
|
* BubbleLegend class.
|
|
@@ -4718,12 +4858,13 @@
|
|
|
4718
4858
|
* @class
|
|
4719
4859
|
* @name Highcharts.BubbleLegend
|
|
4720
4860
|
* @param {Highcharts.LegendBubbleLegendOptions} options
|
|
4721
|
-
*
|
|
4861
|
+
* Options of BubbleLegendItem.
|
|
4862
|
+
*
|
|
4722
4863
|
* @param {Highcharts.Legend} legend
|
|
4723
|
-
*
|
|
4864
|
+
* Legend of item.
|
|
4724
4865
|
*/
|
|
4725
|
-
var
|
|
4726
|
-
function
|
|
4866
|
+
var BubbleLegendItem = /** @class */ (function () {
|
|
4867
|
+
function BubbleLegendItem(options, legend) {
|
|
4727
4868
|
this.chart = void 0;
|
|
4728
4869
|
this.fontMetrics = void 0;
|
|
4729
4870
|
this.legend = void 0;
|
|
@@ -4735,6 +4876,7 @@
|
|
|
4735
4876
|
this.maxLabel = void 0;
|
|
4736
4877
|
this.movementX = void 0;
|
|
4737
4878
|
this.ranges = void 0;
|
|
4879
|
+
this.selected = void 0;
|
|
4738
4880
|
this.visible = void 0;
|
|
4739
4881
|
this.symbols = void 0;
|
|
4740
4882
|
this.options = void 0;
|
|
@@ -4752,7 +4894,7 @@
|
|
|
4752
4894
|
* Legend
|
|
4753
4895
|
* @return {void}
|
|
4754
4896
|
*/
|
|
4755
|
-
|
|
4897
|
+
BubbleLegendItem.prototype.init = function (options, legend) {
|
|
4756
4898
|
this.options = options;
|
|
4757
4899
|
this.visible = true;
|
|
4758
4900
|
this.chart = legend.chart;
|
|
@@ -4767,7 +4909,7 @@
|
|
|
4767
4909
|
* All legend items
|
|
4768
4910
|
* @return {void}
|
|
4769
4911
|
*/
|
|
4770
|
-
|
|
4912
|
+
BubbleLegendItem.prototype.addToLegend = function (items) {
|
|
4771
4913
|
// Insert bubbleLegend into legend items
|
|
4772
4914
|
items.splice(this.options.legendIndex, 0, this);
|
|
4773
4915
|
};
|
|
@@ -4781,16 +4923,13 @@
|
|
|
4781
4923
|
* Legend instance
|
|
4782
4924
|
* @return {void}
|
|
4783
4925
|
*/
|
|
4784
|
-
|
|
4926
|
+
BubbleLegendItem.prototype.drawLegendSymbol = function (legend) {
|
|
4785
4927
|
var chart = this.chart,
|
|
4786
4928
|
options = this.options,
|
|
4787
|
-
size,
|
|
4788
4929
|
itemDistance = pick(legend.options.itemDistance, 20),
|
|
4789
|
-
connectorSpace,
|
|
4790
4930
|
ranges = options.ranges,
|
|
4791
|
-
radius,
|
|
4792
|
-
maxLabel,
|
|
4793
4931
|
connectorDistance = options.connectorDistance;
|
|
4932
|
+
var connectorSpace;
|
|
4794
4933
|
// Predict label dimensions
|
|
4795
4934
|
this.fontMetrics = chart.renderer.fontMetrics(options.labels.style.fontSize);
|
|
4796
4935
|
// Do not create bubbleLegend now if ranges or ranges valeus are not
|
|
@@ -4807,9 +4946,9 @@
|
|
|
4807
4946
|
this.setOptions();
|
|
4808
4947
|
this.render();
|
|
4809
4948
|
// Get max label size
|
|
4810
|
-
maxLabel = this.getMaxLabelSize()
|
|
4811
|
-
|
|
4812
|
-
|
|
4949
|
+
var maxLabel = this.getMaxLabelSize(),
|
|
4950
|
+
radius = this.ranges[0].radius,
|
|
4951
|
+
size = radius * 2;
|
|
4813
4952
|
// Space for connectors and labels.
|
|
4814
4953
|
connectorSpace =
|
|
4815
4954
|
connectorDistance - radius + maxLabel.width;
|
|
@@ -4827,7 +4966,7 @@
|
|
|
4827
4966
|
* @function Highcharts.BubbleLegend#setOptions
|
|
4828
4967
|
* @return {void}
|
|
4829
4968
|
*/
|
|
4830
|
-
|
|
4969
|
+
BubbleLegendItem.prototype.setOptions = function () {
|
|
4831
4970
|
var ranges = this.ranges,
|
|
4832
4971
|
options = this.options,
|
|
4833
4972
|
series = this.chart.series[options.seriesIndex],
|
|
@@ -4883,7 +5022,7 @@
|
|
|
4883
5022
|
* @return {number|null}
|
|
4884
5023
|
* Radius for one range
|
|
4885
5024
|
*/
|
|
4886
|
-
|
|
5025
|
+
BubbleLegendItem.prototype.getRangeRadius = function (value) {
|
|
4887
5026
|
var options = this.options,
|
|
4888
5027
|
seriesIndex = this.options.seriesIndex,
|
|
4889
5028
|
bubbleSeries = this.chart.series[seriesIndex],
|
|
@@ -4900,7 +5039,7 @@
|
|
|
4900
5039
|
* @function Highcharts.BubbleLegend#render
|
|
4901
5040
|
* @return {void}
|
|
4902
5041
|
*/
|
|
4903
|
-
|
|
5042
|
+
BubbleLegendItem.prototype.render = function () {
|
|
4904
5043
|
var renderer = this.chart.renderer,
|
|
4905
5044
|
zThreshold = this.options.zThreshold;
|
|
4906
5045
|
if (!this.symbols) {
|
|
@@ -4935,7 +5074,7 @@
|
|
|
4935
5074
|
* Range options
|
|
4936
5075
|
* @return {void}
|
|
4937
5076
|
*/
|
|
4938
|
-
|
|
5077
|
+
BubbleLegendItem.prototype.renderRange = function (range) {
|
|
4939
5078
|
var mainRange = this.ranges[0],
|
|
4940
5079
|
legend = this.legend,
|
|
4941
5080
|
options = this.options,
|
|
@@ -4945,35 +5084,32 @@
|
|
|
4945
5084
|
renderer = chart.renderer,
|
|
4946
5085
|
symbols = this.symbols,
|
|
4947
5086
|
labels = symbols.labels,
|
|
4948
|
-
label,
|
|
4949
5087
|
elementCenter = range.center,
|
|
4950
5088
|
absoluteRadius = Math.abs(range.radius),
|
|
4951
5089
|
connectorDistance = options.connectorDistance || 0,
|
|
4952
5090
|
labelsAlign = labelsOptions.align,
|
|
4953
5091
|
rtl = legend.options.rtl,
|
|
4954
|
-
connectorLength = rtl || labelsAlign === 'left' ?
|
|
4955
|
-
-connectorDistance : connectorDistance,
|
|
4956
5092
|
borderWidth = options.borderWidth,
|
|
4957
5093
|
connectorWidth = options.connectorWidth,
|
|
4958
5094
|
posX = mainRange.radius || 0,
|
|
4959
5095
|
posY = elementCenter - absoluteRadius -
|
|
4960
5096
|
borderWidth / 2 + connectorWidth / 2,
|
|
4961
|
-
labelY,
|
|
4962
|
-
labelX,
|
|
4963
5097
|
fontMetrics = this.fontMetrics,
|
|
4964
5098
|
labelMovement = fontMetrics.f / 2 -
|
|
4965
5099
|
(fontMetrics.h - fontMetrics.f) / 2,
|
|
4966
5100
|
crispMovement = (posY % 1 ? 1 : 0.5) -
|
|
4967
5101
|
(connectorWidth % 2 ? 0 : 0.5),
|
|
4968
5102
|
styledMode = renderer.styledMode;
|
|
5103
|
+
var connectorLength = rtl || labelsAlign === 'left' ?
|
|
5104
|
+
-connectorDistance : connectorDistance;
|
|
4969
5105
|
// Set options for centered labels
|
|
4970
5106
|
if (labelsAlign === 'center') {
|
|
4971
5107
|
connectorLength = 0; // do not use connector
|
|
4972
5108
|
options.connectorDistance = 0;
|
|
4973
5109
|
range.labelAttribs.align = 'center';
|
|
4974
5110
|
}
|
|
4975
|
-
labelY = posY + options.labels.y
|
|
4976
|
-
|
|
5111
|
+
var labelY = posY + options.labels.y,
|
|
5112
|
+
labelX = posX + connectorLength + options.labels.x;
|
|
4977
5113
|
// Render bubble symbol
|
|
4978
5114
|
symbols.bubbleItems.push(renderer
|
|
4979
5115
|
.circle(posX, elementCenter + crispMovement, absoluteRadius)
|
|
@@ -4997,12 +5133,14 @@
|
|
|
4997
5133
|
'highcharts-bubble-legend-connectors ' +
|
|
4998
5134
|
(options.connectorClassName || '')).add(this.legendSymbol));
|
|
4999
5135
|
// Render label
|
|
5000
|
-
label = renderer
|
|
5001
|
-
|
|
5002
|
-
|
|
5003
|
-
|
|
5004
|
-
|
|
5005
|
-
|
|
5136
|
+
var label = renderer
|
|
5137
|
+
.text(this.formatLabel(range),
|
|
5138
|
+
labelX,
|
|
5139
|
+
labelY + labelMovement)
|
|
5140
|
+
.attr((styledMode ? {} : range.labelAttribs))
|
|
5141
|
+
.css(styledMode ? {} : labelsOptions.style)
|
|
5142
|
+
.addClass('highcharts-bubble-legend-labels ' +
|
|
5143
|
+
(options.labels.className || '')).add(this.legendSymbol);
|
|
5006
5144
|
labels.push(label);
|
|
5007
5145
|
// To enable default 'hideOverlappingLabels' method
|
|
5008
5146
|
label.placed = true;
|
|
@@ -5018,9 +5156,9 @@
|
|
|
5018
5156
|
* @function Highcharts.BubbleLegend#getMaxLabelSize
|
|
5019
5157
|
* @return {Highcharts.BBoxObject}
|
|
5020
5158
|
*/
|
|
5021
|
-
|
|
5022
|
-
var labels = this.symbols.labels
|
|
5023
|
-
|
|
5159
|
+
BubbleLegendItem.prototype.getMaxLabelSize = function () {
|
|
5160
|
+
var labels = this.symbols.labels;
|
|
5161
|
+
var maxLabel,
|
|
5024
5162
|
labelSize;
|
|
5025
5163
|
labels.forEach(function (label) {
|
|
5026
5164
|
labelSize = label.getBBox(true);
|
|
@@ -5044,7 +5182,7 @@
|
|
|
5044
5182
|
* @return {string}
|
|
5045
5183
|
* Range label text
|
|
5046
5184
|
*/
|
|
5047
|
-
|
|
5185
|
+
BubbleLegendItem.prototype.formatLabel = function (range) {
|
|
5048
5186
|
var options = this.options,
|
|
5049
5187
|
formatter = options.labels.formatter,
|
|
5050
5188
|
format = options.labels.format;
|
|
@@ -5061,7 +5199,7 @@
|
|
|
5061
5199
|
* @function Highcharts.BubbleLegend#hideOverlappingLabels
|
|
5062
5200
|
* @return {void}
|
|
5063
5201
|
*/
|
|
5064
|
-
|
|
5202
|
+
BubbleLegendItem.prototype.hideOverlappingLabels = function () {
|
|
5065
5203
|
var chart = this.chart,
|
|
5066
5204
|
allowOverlap = this.options.labels.allowOverlap,
|
|
5067
5205
|
symbols = this.symbols;
|
|
@@ -5086,11 +5224,11 @@
|
|
|
5086
5224
|
* @return {Array<Highcharts.LegendBubbleLegendRangesOptions>}
|
|
5087
5225
|
* Array of range objects
|
|
5088
5226
|
*/
|
|
5089
|
-
|
|
5227
|
+
BubbleLegendItem.prototype.getRanges = function () {
|
|
5090
5228
|
var bubbleLegend = this.legend.bubbleLegend,
|
|
5091
5229
|
series = bubbleLegend.chart.series,
|
|
5092
|
-
ranges
|
|
5093
|
-
|
|
5230
|
+
rangesOptions = bubbleLegend.options.ranges;
|
|
5231
|
+
var ranges,
|
|
5094
5232
|
zData,
|
|
5095
5233
|
minZ = Number.MAX_VALUE,
|
|
5096
5234
|
maxZ = -Number.MAX_VALUE;
|
|
@@ -5138,7 +5276,7 @@
|
|
|
5138
5276
|
* @return {Array<number,number>}
|
|
5139
5277
|
* Calculated min and max bubble sizes
|
|
5140
5278
|
*/
|
|
5141
|
-
|
|
5279
|
+
BubbleLegendItem.prototype.predictBubbleSizes = function () {
|
|
5142
5280
|
var chart = this.chart,
|
|
5143
5281
|
fontMetrics = this.fontMetrics,
|
|
5144
5282
|
legendOptions = chart.legend.options,
|
|
@@ -5150,10 +5288,10 @@
|
|
|
5150
5288
|
bubbleSeries = chart.series[this.options.seriesIndex],
|
|
5151
5289
|
minSize = Math.ceil(bubbleSeries.minPxSize),
|
|
5152
5290
|
maxPxSize = Math.ceil(bubbleSeries.maxPxSize),
|
|
5153
|
-
maxSize = bubbleSeries.options.maxSize,
|
|
5154
5291
|
plotSize = Math.min(plotSizeY,
|
|
5155
|
-
plotSizeX)
|
|
5156
|
-
|
|
5292
|
+
plotSizeX);
|
|
5293
|
+
var calculatedSize,
|
|
5294
|
+
maxSize = bubbleSeries.options.maxSize;
|
|
5157
5295
|
// Calculate prediceted max size of bubble
|
|
5158
5296
|
if (floating || !(/%$/.test(maxSize))) {
|
|
5159
5297
|
calculatedSize = maxPxSize;
|
|
@@ -5181,7 +5319,7 @@
|
|
|
5181
5319
|
* @param {number} max
|
|
5182
5320
|
* @return {void}
|
|
5183
5321
|
*/
|
|
5184
|
-
|
|
5322
|
+
BubbleLegendItem.prototype.updateRanges = function (min, max) {
|
|
5185
5323
|
var bubbleLegendOptions = this.legend.options.bubbleLegend;
|
|
5186
5324
|
bubbleLegendOptions.minSize = min;
|
|
5187
5325
|
bubbleLegendOptions.maxSize = max;
|
|
@@ -5196,7 +5334,7 @@
|
|
|
5196
5334
|
* @function Highcharts.BubbleLegend#correctSizes
|
|
5197
5335
|
* @return {void}
|
|
5198
5336
|
*/
|
|
5199
|
-
|
|
5337
|
+
BubbleLegendItem.prototype.correctSizes = function () {
|
|
5200
5338
|
var legend = this.legend,
|
|
5201
5339
|
chart = this.chart,
|
|
5202
5340
|
bubbleSeries = chart.series[this.options.seriesIndex],
|
|
@@ -5208,216 +5346,389 @@
|
|
|
5208
5346
|
legend.render();
|
|
5209
5347
|
}
|
|
5210
5348
|
};
|
|
5211
|
-
return
|
|
5349
|
+
return BubbleLegendItem;
|
|
5212
5350
|
}());
|
|
5213
|
-
|
|
5214
|
-
|
|
5215
|
-
|
|
5216
|
-
|
|
5217
|
-
|
|
5218
|
-
|
|
5219
|
-
|
|
5220
|
-
|
|
5221
|
-
|
|
5222
|
-
|
|
5223
|
-
|
|
5224
|
-
|
|
5225
|
-
|
|
5351
|
+
/* *
|
|
5352
|
+
*
|
|
5353
|
+
* Default Export
|
|
5354
|
+
*
|
|
5355
|
+
* */
|
|
5356
|
+
|
|
5357
|
+
return BubbleLegendItem;
|
|
5358
|
+
});
|
|
5359
|
+
_registerModule(_modules, 'Series/Bubble/BubbleLegendComposition.js', [_modules['Series/Bubble/BubbleLegendDefaults.js'], _modules['Series/Bubble/BubbleLegendItem.js'], _modules['Core/DefaultOptions.js'], _modules['Core/Utilities.js']], function (BubbleLegendDefaults, BubbleLegendItem, D, U) {
|
|
5360
|
+
/* *
|
|
5361
|
+
*
|
|
5362
|
+
* (c) 2010-2021 Highsoft AS
|
|
5363
|
+
*
|
|
5364
|
+
* Author: Paweł Potaczek
|
|
5365
|
+
*
|
|
5366
|
+
* License: www.highcharts.com/license
|
|
5367
|
+
*
|
|
5368
|
+
* !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
|
|
5369
|
+
*
|
|
5370
|
+
* */
|
|
5371
|
+
var setOptions = D.setOptions;
|
|
5372
|
+
var addEvent = U.addEvent,
|
|
5373
|
+
objectEach = U.objectEach,
|
|
5374
|
+
wrap = U.wrap;
|
|
5375
|
+
/* *
|
|
5376
|
+
*
|
|
5377
|
+
* Namespace
|
|
5378
|
+
*
|
|
5379
|
+
* */
|
|
5380
|
+
var BubbleLegendComposition;
|
|
5381
|
+
(function (BubbleLegendComposition) {
|
|
5382
|
+
/* *
|
|
5383
|
+
*
|
|
5384
|
+
* Constants
|
|
5385
|
+
*
|
|
5386
|
+
* */
|
|
5387
|
+
var composedClasses = [];
|
|
5388
|
+
/* *
|
|
5389
|
+
*
|
|
5390
|
+
* Functions
|
|
5391
|
+
*
|
|
5392
|
+
* */
|
|
5393
|
+
/* eslint-disable valid-jsdoc */
|
|
5394
|
+
/**
|
|
5395
|
+
* If ranges are not specified, determine ranges from rendered bubble series
|
|
5396
|
+
* and render legend again.
|
|
5397
|
+
*/
|
|
5398
|
+
function chartDrawChartBox(proceed, options, callback) {
|
|
5399
|
+
var chart = this,
|
|
5400
|
+
legend = chart.legend,
|
|
5401
|
+
bubbleSeries = getVisibleBubbleSeriesIndex(chart) >= 0;
|
|
5402
|
+
var bubbleLegendOptions,
|
|
5403
|
+
bubbleSizes;
|
|
5404
|
+
if (legend && legend.options.enabled && legend.bubbleLegend &&
|
|
5405
|
+
legend.options.bubbleLegend.autoRanges && bubbleSeries) {
|
|
5406
|
+
bubbleLegendOptions = legend.bubbleLegend.options;
|
|
5407
|
+
bubbleSizes = legend.bubbleLegend.predictBubbleSizes();
|
|
5408
|
+
legend.bubbleLegend.updateRanges(bubbleSizes[0], bubbleSizes[1]);
|
|
5409
|
+
// Disable animation on init
|
|
5410
|
+
if (!bubbleLegendOptions.placed) {
|
|
5411
|
+
legend.group.placed = false;
|
|
5412
|
+
legend.allItems.forEach(function (item) {
|
|
5413
|
+
item.legendGroup.translateY = null;
|
|
5414
|
+
});
|
|
5415
|
+
}
|
|
5416
|
+
// Create legend with bubbleLegend
|
|
5417
|
+
legend.render();
|
|
5418
|
+
chart.getMargins();
|
|
5419
|
+
chart.axes.forEach(function (axis) {
|
|
5420
|
+
if (axis.visible) { // #11448
|
|
5421
|
+
axis.render();
|
|
5422
|
+
}
|
|
5423
|
+
if (!bubbleLegendOptions.placed) {
|
|
5424
|
+
axis.setScale();
|
|
5425
|
+
axis.updateNames();
|
|
5426
|
+
// Disable axis animation on init
|
|
5427
|
+
objectEach(axis.ticks, function (tick) {
|
|
5428
|
+
tick.isNew = true;
|
|
5429
|
+
tick.isNewLabel = true;
|
|
5430
|
+
});
|
|
5431
|
+
}
|
|
5432
|
+
});
|
|
5433
|
+
bubbleLegendOptions.placed = true;
|
|
5434
|
+
// After recalculate axes, calculate margins again.
|
|
5435
|
+
chart.getMargins();
|
|
5436
|
+
// Call default 'drawChartBox' method.
|
|
5437
|
+
proceed.call(chart, options, callback);
|
|
5438
|
+
// Check bubble legend sizes and correct them if necessary.
|
|
5439
|
+
legend.bubbleLegend.correctSizes();
|
|
5440
|
+
// Correct items positions with different dimensions in legend.
|
|
5441
|
+
retranslateItems(legend, getLinesHeights(legend));
|
|
5442
|
+
}
|
|
5443
|
+
else {
|
|
5444
|
+
proceed.call(chart, options, callback);
|
|
5445
|
+
// Allow color change on static bubble legend after click on legend
|
|
5446
|
+
if (legend && legend.options.enabled && legend.bubbleLegend) {
|
|
5447
|
+
legend.render();
|
|
5448
|
+
retranslateItems(legend, getLinesHeights(legend));
|
|
5449
|
+
}
|
|
5226
5450
|
}
|
|
5227
|
-
// Update bubbleLegend dimensions in each redraw
|
|
5228
|
-
legend.destroyItem(bubbleLegend);
|
|
5229
|
-
}
|
|
5230
|
-
// Create bubble legend
|
|
5231
|
-
if (bubbleSeriesIndex >= 0 &&
|
|
5232
|
-
legendOptions.enabled &&
|
|
5233
|
-
options.enabled) {
|
|
5234
|
-
options.seriesIndex = bubbleSeriesIndex;
|
|
5235
|
-
legend.bubbleLegend = new H.BubbleLegend(options, legend);
|
|
5236
|
-
legend.bubbleLegend.addToLegend(e.allItems);
|
|
5237
5451
|
}
|
|
5238
|
-
|
|
5239
|
-
|
|
5240
|
-
|
|
5241
|
-
|
|
5242
|
-
|
|
5243
|
-
|
|
5244
|
-
|
|
5245
|
-
|
|
5246
|
-
|
|
5247
|
-
|
|
5248
|
-
|
|
5249
|
-
|
|
5250
|
-
|
|
5251
|
-
|
|
5252
|
-
|
|
5253
|
-
|
|
5254
|
-
|
|
5255
|
-
|
|
5452
|
+
/**
|
|
5453
|
+
* Compose classes for use with Bubble series.
|
|
5454
|
+
* @private
|
|
5455
|
+
*
|
|
5456
|
+
* @param {Highcharts.Chart} ChartClass
|
|
5457
|
+
* Core chart class to use with Bubble series.
|
|
5458
|
+
*
|
|
5459
|
+
* @param {Highcharts.Legend} LegendClass
|
|
5460
|
+
* Core legend class to use with Bubble series.
|
|
5461
|
+
*
|
|
5462
|
+
* @param {Highcharts.Series} SeriesClass
|
|
5463
|
+
* Core series class to use with Bubble series.
|
|
5464
|
+
*/
|
|
5465
|
+
function compose(ChartClass, LegendClass, SeriesClass) {
|
|
5466
|
+
if (composedClasses.indexOf(ChartClass) === -1) {
|
|
5467
|
+
composedClasses.push(ChartClass);
|
|
5468
|
+
setOptions({
|
|
5469
|
+
// Set default bubble legend options
|
|
5470
|
+
legend: {
|
|
5471
|
+
bubbleLegend: BubbleLegendDefaults
|
|
5472
|
+
}
|
|
5473
|
+
});
|
|
5474
|
+
wrap(ChartClass.prototype, 'drawChartBox', chartDrawChartBox);
|
|
5475
|
+
}
|
|
5476
|
+
if (composedClasses.indexOf(LegendClass) === -1) {
|
|
5477
|
+
composedClasses.push(LegendClass);
|
|
5478
|
+
addEvent(LegendClass, 'afterGetAllItems', onLegendAfterGetAllItems);
|
|
5479
|
+
}
|
|
5480
|
+
if (composedClasses.indexOf(SeriesClass) === -1) {
|
|
5481
|
+
composedClasses.push(SeriesClass);
|
|
5482
|
+
addEvent(SeriesClass, 'legendItemClick', onSeriesLegendItemClick);
|
|
5256
5483
|
}
|
|
5257
|
-
i++;
|
|
5258
5484
|
}
|
|
5259
|
-
|
|
5260
|
-
|
|
5261
|
-
|
|
5262
|
-
|
|
5263
|
-
|
|
5264
|
-
|
|
5265
|
-
|
|
5266
|
-
|
|
5267
|
-
|
|
5268
|
-
|
|
5269
|
-
|
|
5270
|
-
|
|
5271
|
-
|
|
5272
|
-
|
|
5273
|
-
|
|
5274
|
-
|
|
5275
|
-
|
|
5276
|
-
|
|
5277
|
-
|
|
5278
|
-
|
|
5279
|
-
|
|
5485
|
+
BubbleLegendComposition.compose = compose;
|
|
5486
|
+
/**
|
|
5487
|
+
* Check if there is at least one visible bubble series.
|
|
5488
|
+
*
|
|
5489
|
+
* @private
|
|
5490
|
+
* @function getVisibleBubbleSeriesIndex
|
|
5491
|
+
* @param {Highcharts.Chart} chart
|
|
5492
|
+
* Chart to check.
|
|
5493
|
+
* @return {number}
|
|
5494
|
+
* First visible bubble series index
|
|
5495
|
+
*/
|
|
5496
|
+
function getVisibleBubbleSeriesIndex(chart) {
|
|
5497
|
+
var series = chart.series;
|
|
5498
|
+
var i = 0;
|
|
5499
|
+
while (i < series.length) {
|
|
5500
|
+
if (series[i] &&
|
|
5501
|
+
series[i].isBubble &&
|
|
5502
|
+
series[i].visible &&
|
|
5503
|
+
series[i].zData.length) {
|
|
5504
|
+
return i;
|
|
5505
|
+
}
|
|
5506
|
+
i++;
|
|
5280
5507
|
}
|
|
5281
|
-
|
|
5282
|
-
|
|
5283
|
-
|
|
5284
|
-
|
|
5285
|
-
|
|
5286
|
-
|
|
5287
|
-
|
|
5288
|
-
|
|
5289
|
-
|
|
5290
|
-
|
|
5291
|
-
|
|
5508
|
+
return -1;
|
|
5509
|
+
}
|
|
5510
|
+
/**
|
|
5511
|
+
* Calculate height for each row in legend.
|
|
5512
|
+
*
|
|
5513
|
+
* @private
|
|
5514
|
+
* @function getLinesHeights
|
|
5515
|
+
*
|
|
5516
|
+
* @param {Highcharts.Legend} legend
|
|
5517
|
+
* Legend to calculate from.
|
|
5518
|
+
*
|
|
5519
|
+
* @return {Array<Highcharts.Dictionary<number>>}
|
|
5520
|
+
* Informations about line height and items amount
|
|
5521
|
+
*/
|
|
5522
|
+
function getLinesHeights(legend) {
|
|
5523
|
+
var items = legend.allItems,
|
|
5524
|
+
lines = [],
|
|
5525
|
+
length = items.length;
|
|
5526
|
+
var lastLine,
|
|
5527
|
+
i = 0,
|
|
5528
|
+
j = 0;
|
|
5529
|
+
for (i = 0; i < length; i++) {
|
|
5530
|
+
if (items[i].legendItemHeight) {
|
|
5531
|
+
// for bubbleLegend
|
|
5532
|
+
items[i].itemHeight = items[i].legendItemHeight;
|
|
5533
|
+
}
|
|
5534
|
+
if ( // Line break
|
|
5535
|
+
items[i] === items[length - 1] ||
|
|
5536
|
+
items[i + 1] &&
|
|
5537
|
+
items[i]._legendItemPos[1] !==
|
|
5538
|
+
items[i + 1]._legendItemPos[1]) {
|
|
5539
|
+
lines.push({ height: 0 });
|
|
5540
|
+
lastLine = lines[lines.length - 1];
|
|
5541
|
+
// Find the highest item in line
|
|
5542
|
+
for (j; j <= i; j++) {
|
|
5543
|
+
if (items[j].itemHeight > lastLine.height) {
|
|
5544
|
+
lastLine.height = items[j].itemHeight;
|
|
5545
|
+
}
|
|
5292
5546
|
}
|
|
5547
|
+
lastLine.step = i;
|
|
5293
5548
|
}
|
|
5294
|
-
lastLine.step = i;
|
|
5295
5549
|
}
|
|
5550
|
+
return lines;
|
|
5296
5551
|
}
|
|
5297
|
-
|
|
5298
|
-
|
|
5299
|
-
|
|
5300
|
-
|
|
5301
|
-
|
|
5302
|
-
|
|
5303
|
-
|
|
5304
|
-
|
|
5305
|
-
|
|
5306
|
-
|
|
5307
|
-
|
|
5308
|
-
|
|
5309
|
-
|
|
5310
|
-
|
|
5311
|
-
|
|
5312
|
-
|
|
5313
|
-
|
|
5314
|
-
|
|
5315
|
-
items.forEach(function (item, index) {
|
|
5316
|
-
orgTranslateX = item.legendGroup.translateX;
|
|
5317
|
-
orgTranslateY = item._legendItemPos[1];
|
|
5318
|
-
movementX = item.movementX;
|
|
5319
|
-
if (movementX || (rtl && item.ranges)) {
|
|
5320
|
-
movementX = rtl ?
|
|
5321
|
-
orgTranslateX - item.options.maxSize / 2 :
|
|
5322
|
-
orgTranslateX + movementX;
|
|
5323
|
-
item.legendGroup.attr({ translateX: movementX });
|
|
5324
|
-
}
|
|
5325
|
-
if (index > lines[actualLine].step) {
|
|
5326
|
-
actualLine++;
|
|
5552
|
+
/**
|
|
5553
|
+
* Start the bubble legend creation process.
|
|
5554
|
+
*/
|
|
5555
|
+
function onLegendAfterGetAllItems(e) {
|
|
5556
|
+
var legend = this,
|
|
5557
|
+
bubbleLegend = legend.bubbleLegend,
|
|
5558
|
+
legendOptions = legend.options,
|
|
5559
|
+
options = legendOptions.bubbleLegend,
|
|
5560
|
+
bubbleSeriesIndex = getVisibleBubbleSeriesIndex(legend.chart);
|
|
5561
|
+
// Remove unnecessary element
|
|
5562
|
+
if (bubbleLegend && bubbleLegend.ranges && bubbleLegend.ranges.length) {
|
|
5563
|
+
// Allow change the way of calculating ranges in update
|
|
5564
|
+
if (options.ranges.length) {
|
|
5565
|
+
options.autoRanges =
|
|
5566
|
+
!!options.ranges[0].autoRanges;
|
|
5567
|
+
}
|
|
5568
|
+
// Update bubbleLegend dimensions in each redraw
|
|
5569
|
+
legend.destroyItem(bubbleLegend);
|
|
5327
5570
|
}
|
|
5328
|
-
|
|
5329
|
-
|
|
5330
|
-
|
|
5331
|
-
|
|
5332
|
-
|
|
5333
|
-
|
|
5334
|
-
|
|
5335
|
-
// Toggle bubble legend depending on the visible status of bubble series.
|
|
5336
|
-
addEvent(Series, 'legendItemClick', function () {
|
|
5337
|
-
var series = this,
|
|
5338
|
-
chart = series.chart,
|
|
5339
|
-
visible = series.visible,
|
|
5340
|
-
legend = series.chart.legend,
|
|
5341
|
-
status;
|
|
5342
|
-
if (legend && legend.bubbleLegend) {
|
|
5343
|
-
// Temporary correct 'visible' property
|
|
5344
|
-
series.visible = !visible;
|
|
5345
|
-
// Save future status for getRanges method
|
|
5346
|
-
series.ignoreSeries = visible;
|
|
5347
|
-
// Check if at lest one bubble series is visible
|
|
5348
|
-
status = chart.getVisibleBubbleSeriesIndex() >= 0;
|
|
5349
|
-
// Hide bubble legend if all bubble series are disabled
|
|
5350
|
-
if (legend.bubbleLegend.visible !== status) {
|
|
5351
|
-
// Show or hide bubble legend
|
|
5352
|
-
legend.update({
|
|
5353
|
-
bubbleLegend: { enabled: status }
|
|
5354
|
-
});
|
|
5355
|
-
legend.bubbleLegend.visible = status; // Restore default status
|
|
5571
|
+
// Create bubble legend
|
|
5572
|
+
if (bubbleSeriesIndex >= 0 &&
|
|
5573
|
+
legendOptions.enabled &&
|
|
5574
|
+
options.enabled) {
|
|
5575
|
+
options.seriesIndex = bubbleSeriesIndex;
|
|
5576
|
+
legend.bubbleLegend = new BubbleLegendItem(options, legend);
|
|
5577
|
+
legend.bubbleLegend.addToLegend(e.allItems);
|
|
5356
5578
|
}
|
|
5357
|
-
series.visible = visible;
|
|
5358
5579
|
}
|
|
5359
|
-
|
|
5360
|
-
|
|
5361
|
-
|
|
5362
|
-
|
|
5363
|
-
|
|
5364
|
-
|
|
5365
|
-
|
|
5366
|
-
|
|
5367
|
-
|
|
5368
|
-
|
|
5369
|
-
|
|
5370
|
-
|
|
5371
|
-
|
|
5372
|
-
|
|
5373
|
-
|
|
5374
|
-
|
|
5375
|
-
legend
|
|
5376
|
-
legend.
|
|
5377
|
-
|
|
5378
|
-
|
|
5580
|
+
/**
|
|
5581
|
+
* Toggle bubble legend depending on the visible status of bubble series.
|
|
5582
|
+
*/
|
|
5583
|
+
function onSeriesLegendItemClick() {
|
|
5584
|
+
var series = this,
|
|
5585
|
+
chart = series.chart,
|
|
5586
|
+
visible = series.visible,
|
|
5587
|
+
legend = series.chart.legend;
|
|
5588
|
+
var status;
|
|
5589
|
+
if (legend && legend.bubbleLegend) {
|
|
5590
|
+
// Temporary correct 'visible' property
|
|
5591
|
+
series.visible = !visible;
|
|
5592
|
+
// Save future status for getRanges method
|
|
5593
|
+
series.ignoreSeries = visible;
|
|
5594
|
+
// Check if at lest one bubble series is visible
|
|
5595
|
+
status = getVisibleBubbleSeriesIndex(chart) >= 0;
|
|
5596
|
+
// Hide bubble legend if all bubble series are disabled
|
|
5597
|
+
if (legend.bubbleLegend.visible !== status) {
|
|
5598
|
+
// Show or hide bubble legend
|
|
5599
|
+
legend.update({
|
|
5600
|
+
bubbleLegend: { enabled: status }
|
|
5601
|
+
});
|
|
5602
|
+
legend.bubbleLegend.visible = status; // Restore default status
|
|
5603
|
+
}
|
|
5604
|
+
series.visible = visible;
|
|
5379
5605
|
}
|
|
5380
|
-
|
|
5381
|
-
|
|
5382
|
-
|
|
5383
|
-
|
|
5384
|
-
|
|
5385
|
-
|
|
5606
|
+
}
|
|
5607
|
+
/**
|
|
5608
|
+
* Correct legend items translation in case of different elements heights.
|
|
5609
|
+
*
|
|
5610
|
+
* @private
|
|
5611
|
+
* @function Highcharts.Legend#retranslateItems
|
|
5612
|
+
*
|
|
5613
|
+
* @param {Highcharts.Legend} legend
|
|
5614
|
+
* Legend to translate in.
|
|
5615
|
+
*
|
|
5616
|
+
* @param {Array<Highcharts.Dictionary<number>>} lines
|
|
5617
|
+
* Informations about line height and items amount
|
|
5618
|
+
*/
|
|
5619
|
+
function retranslateItems(legend, lines) {
|
|
5620
|
+
var items = legend.allItems,
|
|
5621
|
+
rtl = legend.options.rtl;
|
|
5622
|
+
var orgTranslateX,
|
|
5623
|
+
orgTranslateY,
|
|
5624
|
+
movementX,
|
|
5625
|
+
actualLine = 0;
|
|
5626
|
+
items.forEach(function (item, index) {
|
|
5627
|
+
orgTranslateX = item.legendGroup.translateX;
|
|
5628
|
+
orgTranslateY = item._legendItemPos[1];
|
|
5629
|
+
movementX = item.movementX;
|
|
5630
|
+
if (movementX || (rtl && item.ranges)) {
|
|
5631
|
+
movementX = rtl ?
|
|
5632
|
+
orgTranslateX - item.options.maxSize / 2 :
|
|
5633
|
+
orgTranslateX + movementX;
|
|
5634
|
+
item.legendGroup.attr({ translateX: movementX });
|
|
5386
5635
|
}
|
|
5387
|
-
if (
|
|
5388
|
-
|
|
5389
|
-
axis.updateNames();
|
|
5390
|
-
// Disable axis animation on init
|
|
5391
|
-
objectEach(axis.ticks, function (tick) {
|
|
5392
|
-
tick.isNew = true;
|
|
5393
|
-
tick.isNewLabel = true;
|
|
5394
|
-
});
|
|
5636
|
+
if (index > lines[actualLine].step) {
|
|
5637
|
+
actualLine++;
|
|
5395
5638
|
}
|
|
5639
|
+
item.legendGroup.attr({
|
|
5640
|
+
translateY: Math.round(orgTranslateY + lines[actualLine].height / 2)
|
|
5641
|
+
});
|
|
5642
|
+
item._legendItemPos[1] = orgTranslateY +
|
|
5643
|
+
lines[actualLine].height / 2;
|
|
5396
5644
|
});
|
|
5397
|
-
bubbleLegendOptions.placed = true;
|
|
5398
|
-
// After recalculate axes, calculate margins again.
|
|
5399
|
-
chart.getMargins();
|
|
5400
|
-
// Call default 'drawChartBox' method.
|
|
5401
|
-
proceed.call(chart, options, callback);
|
|
5402
|
-
// Check bubble legend sizes and correct them if necessary.
|
|
5403
|
-
legend.bubbleLegend.correctSizes();
|
|
5404
|
-
// Correct items positions with different dimensions in legend.
|
|
5405
|
-
legend.retranslateItems(legend.getLinesHeights());
|
|
5406
5645
|
}
|
|
5407
|
-
|
|
5408
|
-
|
|
5409
|
-
|
|
5410
|
-
|
|
5411
|
-
|
|
5412
|
-
|
|
5413
|
-
|
|
5646
|
+
/* eslint-disable valid-jsdoc */
|
|
5647
|
+
})(BubbleLegendComposition || (BubbleLegendComposition = {}));
|
|
5648
|
+
/* *
|
|
5649
|
+
*
|
|
5650
|
+
* Default Export
|
|
5651
|
+
*
|
|
5652
|
+
* */
|
|
5653
|
+
|
|
5654
|
+
return BubbleLegendComposition;
|
|
5655
|
+
});
|
|
5656
|
+
_registerModule(_modules, 'Series/Bubble/BubblePoint.js', [_modules['Core/Series/Point.js'], _modules['Core/Series/SeriesRegistry.js'], _modules['Core/Utilities.js']], function (Point, SeriesRegistry, U) {
|
|
5657
|
+
/* *
|
|
5658
|
+
*
|
|
5659
|
+
* (c) 2010-2021 Torstein Honsi
|
|
5660
|
+
*
|
|
5661
|
+
* License: www.highcharts.com/license
|
|
5662
|
+
*
|
|
5663
|
+
* !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
|
|
5664
|
+
*
|
|
5665
|
+
* */
|
|
5666
|
+
var __extends = (this && this.__extends) || (function () {
|
|
5667
|
+
var extendStatics = function (d,
|
|
5668
|
+
b) {
|
|
5669
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5670
|
+
({ __proto__: [] } instanceof Array && function (d,
|
|
5671
|
+
b) { d.__proto__ = b; }) ||
|
|
5672
|
+
function (d,
|
|
5673
|
+
b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
5674
|
+
return extendStatics(d, b);
|
|
5675
|
+
};
|
|
5676
|
+
return function (d, b) {
|
|
5677
|
+
extendStatics(d, b);
|
|
5678
|
+
function __() { this.constructor = d; }
|
|
5679
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
5680
|
+
};
|
|
5681
|
+
})();
|
|
5682
|
+
var ScatterPoint = SeriesRegistry.seriesTypes.scatter.prototype.pointClass;
|
|
5683
|
+
var extend = U.extend;
|
|
5684
|
+
/* *
|
|
5685
|
+
*
|
|
5686
|
+
* Class
|
|
5687
|
+
*
|
|
5688
|
+
* */
|
|
5689
|
+
var BubblePoint = /** @class */ (function (_super) {
|
|
5690
|
+
__extends(BubblePoint, _super);
|
|
5691
|
+
function BubblePoint() {
|
|
5692
|
+
/* *
|
|
5693
|
+
*
|
|
5694
|
+
* Properties
|
|
5695
|
+
*
|
|
5696
|
+
* */
|
|
5697
|
+
var _this = _super !== null && _super.apply(this,
|
|
5698
|
+
arguments) || this;
|
|
5699
|
+
_this.options = void 0;
|
|
5700
|
+
_this.series = void 0;
|
|
5701
|
+
return _this;
|
|
5702
|
+
/* eslint-enable valid-jsdoc */
|
|
5414
5703
|
}
|
|
5704
|
+
/* *
|
|
5705
|
+
*
|
|
5706
|
+
* Functions
|
|
5707
|
+
*
|
|
5708
|
+
* */
|
|
5709
|
+
/* eslint-disable valid-jsdoc */
|
|
5710
|
+
/**
|
|
5711
|
+
* @private
|
|
5712
|
+
*/
|
|
5713
|
+
BubblePoint.prototype.haloPath = function (size) {
|
|
5714
|
+
return Point.prototype.haloPath.call(this,
|
|
5715
|
+
// #6067
|
|
5716
|
+
size === 0 ? 0 : (this.marker ? this.marker.radius || 0 : 0) + size);
|
|
5717
|
+
};
|
|
5718
|
+
return BubblePoint;
|
|
5719
|
+
}(ScatterPoint));
|
|
5720
|
+
extend(BubblePoint.prototype, {
|
|
5721
|
+
ttBelow: false
|
|
5415
5722
|
});
|
|
5416
|
-
|
|
5723
|
+
/* *
|
|
5724
|
+
*
|
|
5725
|
+
* Default Export
|
|
5726
|
+
*
|
|
5727
|
+
* */
|
|
5417
5728
|
|
|
5418
|
-
return
|
|
5729
|
+
return BubblePoint;
|
|
5419
5730
|
});
|
|
5420
|
-
_registerModule(_modules, 'Series/Bubble/BubbleSeries.js', [_modules['Core/Axis/Axis.js'], _modules['Series/Bubble/BubblePoint.js'], _modules['Core/Color/Color.js'], _modules['Core/Globals.js'], _modules['Core/Series/Series.js'], _modules['Core/Series/SeriesRegistry.js'], _modules['Core/Utilities.js']], function (Axis, BubblePoint, Color, H, Series, SeriesRegistry, U) {
|
|
5731
|
+
_registerModule(_modules, 'Series/Bubble/BubbleSeries.js', [_modules['Core/Axis/Axis.js'], _modules['Series/Bubble/BubbleLegendComposition.js'], _modules['Series/Bubble/BubblePoint.js'], _modules['Core/Color/Color.js'], _modules['Core/Globals.js'], _modules['Core/Series/Series.js'], _modules['Core/Series/SeriesRegistry.js'], _modules['Core/Utilities.js']], function (Axis, BubbleLegendComposition, BubblePoint, Color, H, Series, SeriesRegistry, U) {
|
|
5421
5732
|
/* *
|
|
5422
5733
|
*
|
|
5423
5734
|
* (c) 2010-2021 Torstein Honsi
|
|
@@ -5641,6 +5952,7 @@
|
|
|
5641
5952
|
}
|
|
5642
5953
|
}
|
|
5643
5954
|
};
|
|
5955
|
+
BubbleSeries.compose = BubbleLegendComposition.compose;
|
|
5644
5956
|
/**
|
|
5645
5957
|
* A bubble series is a three dimensional series type where each point
|
|
5646
5958
|
* renders an X, Y and Z value. Each points is drawn as a bubble where the
|
|
@@ -5659,7 +5971,9 @@
|
|
|
5659
5971
|
BubbleSeries.defaultOptions = merge(ScatterSeries.defaultOptions, {
|
|
5660
5972
|
dataLabels: {
|
|
5661
5973
|
formatter: function () {
|
|
5662
|
-
|
|
5974
|
+
var numberFormatter = this.series.chart.numberFormatter;
|
|
5975
|
+
var z = this.point.z;
|
|
5976
|
+
return isNumber(z) ? numberFormatter(z, -1) : '';
|
|
5663
5977
|
},
|
|
5664
5978
|
inside: true,
|
|
5665
5979
|
verticalAlign: 'middle'
|
|
@@ -6217,11 +6531,6 @@
|
|
|
6217
6531
|
var MapBubbleSeries = /** @class */ (function (_super) {
|
|
6218
6532
|
__extends(MapBubbleSeries, _super);
|
|
6219
6533
|
function MapBubbleSeries() {
|
|
6220
|
-
/* *
|
|
6221
|
-
*
|
|
6222
|
-
* Static Properties
|
|
6223
|
-
*
|
|
6224
|
-
* */
|
|
6225
6534
|
var _this = _super !== null && _super.apply(this,
|
|
6226
6535
|
arguments) || this;
|
|
6227
6536
|
/* *
|
|
@@ -6234,6 +6543,12 @@
|
|
|
6234
6543
|
_this.points = void 0;
|
|
6235
6544
|
return _this;
|
|
6236
6545
|
}
|
|
6546
|
+
/* *
|
|
6547
|
+
*
|
|
6548
|
+
* Static Properties
|
|
6549
|
+
*
|
|
6550
|
+
* */
|
|
6551
|
+
MapBubbleSeries.compose = BubbleSeries.compose;
|
|
6237
6552
|
/**
|
|
6238
6553
|
* A map bubble series is a bubble series laid out on top of a map
|
|
6239
6554
|
* series, where each bubble is tied to a specific map area.
|
|
@@ -6627,7 +6942,7 @@
|
|
|
6627
6942
|
|
|
6628
6943
|
return HeatmapPoint;
|
|
6629
6944
|
});
|
|
6630
|
-
_registerModule(_modules, 'Series/Heatmap/HeatmapSeries.js', [_modules['Core/Color/Color.js'], _modules['Mixins/ColorMapSeries.js'], _modules['Series/Heatmap/HeatmapPoint.js'], _modules['
|
|
6945
|
+
_registerModule(_modules, 'Series/Heatmap/HeatmapSeries.js', [_modules['Core/Color/Color.js'], _modules['Mixins/ColorMapSeries.js'], _modules['Series/Heatmap/HeatmapPoint.js'], _modules['Core/Legend/LegendSymbol.js'], _modules['Core/Color/Palette.js'], _modules['Core/Series/SeriesRegistry.js'], _modules['Core/Renderer/SVG/SVGRenderer.js'], _modules['Core/Utilities.js']], function (Color, ColorMapMixin, HeatmapPoint, LegendSymbol, palette, SeriesRegistry, SVGRenderer, U) {
|
|
6631
6946
|
/* *
|
|
6632
6947
|
*
|
|
6633
6948
|
* (c) 2010-2021 Torstein Honsi
|
|
@@ -6834,10 +7149,12 @@
|
|
|
6834
7149
|
stateOptions,
|
|
6835
7150
|
brightness,
|
|
6836
7151
|
// Get old properties in order to keep backward compatibility
|
|
6837
|
-
borderColor =
|
|
7152
|
+
borderColor = (point && point.options.borderColor) ||
|
|
7153
|
+
seriesOptions.borderColor ||
|
|
6838
7154
|
heatmapPlotOptions.borderColor ||
|
|
6839
7155
|
seriesPlotOptions.borderColor,
|
|
6840
|
-
borderWidth =
|
|
7156
|
+
borderWidth = (point && point.options.borderWidth) ||
|
|
7157
|
+
seriesOptions.borderWidth ||
|
|
6841
7158
|
heatmapPlotOptions.borderWidth ||
|
|
6842
7159
|
seriesPlotOptions.borderWidth ||
|
|
6843
7160
|
attr['stroke-width'];
|
|
@@ -7020,7 +7337,9 @@
|
|
|
7020
7337
|
nullColor: palette.neutralColor3,
|
|
7021
7338
|
dataLabels: {
|
|
7022
7339
|
formatter: function () {
|
|
7023
|
-
|
|
7340
|
+
var numberFormatter = this.series.chart.numberFormatter;
|
|
7341
|
+
var value = this.point.value;
|
|
7342
|
+
return isNumber(value) ? numberFormatter(value, -1) : '';
|
|
7024
7343
|
},
|
|
7025
7344
|
inside: true,
|
|
7026
7345
|
verticalAlign: 'middle',
|
|
@@ -7207,7 +7526,7 @@
|
|
|
7207
7526
|
/**
|
|
7208
7527
|
* @private
|
|
7209
7528
|
*/
|
|
7210
|
-
drawLegendSymbol:
|
|
7529
|
+
drawLegendSymbol: LegendSymbol.drawRectangle,
|
|
7211
7530
|
getExtremesFromAll: true,
|
|
7212
7531
|
getSymbol: Series.prototype.getSymbol,
|
|
7213
7532
|
parallelArrays: colorMapSeriesMixin.parallelArrays,
|
|
@@ -8072,11 +8391,15 @@
|
|
|
8072
8391
|
});
|
|
8073
8392
|
|
|
8074
8393
|
});
|
|
8075
|
-
_registerModule(_modules, 'masters/modules/map.src.js', [_modules['Core/Globals.js'], _modules['Core/Chart/MapChart.js']], function (Highcharts, MapChart) {
|
|
8394
|
+
_registerModule(_modules, 'masters/modules/map.src.js', [_modules['Core/Globals.js'], _modules['Core/Axis/Color/ColorAxis.js'], _modules['Series/MapBubble/MapBubbleSeries.js'], _modules['Core/Chart/MapChart.js']], function (Highcharts, ColorAxis, MapBubbleSeries, MapChart) {
|
|
8076
8395
|
|
|
8077
|
-
|
|
8078
|
-
|
|
8079
|
-
|
|
8396
|
+
var G = Highcharts;
|
|
8397
|
+
G.ColorAxis = ColorAxis;
|
|
8398
|
+
G.MapChart = MapChart;
|
|
8399
|
+
G.mapChart = G.Map = MapChart.mapChart;
|
|
8400
|
+
G.maps = MapChart.maps;
|
|
8401
|
+
ColorAxis.compose(G.Chart, G.Fx, G.Legend, G.Series);
|
|
8402
|
+
MapBubbleSeries.compose(G.Chart, G.Legend, G.Series);
|
|
8080
8403
|
|
|
8081
8404
|
});
|
|
8082
8405
|
}));
|