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
|
@@ -8,761 +8,36 @@
|
|
|
8
8
|
*
|
|
9
9
|
* */
|
|
10
10
|
'use strict';
|
|
11
|
-
import Axis from './Axis.js';
|
|
12
11
|
import AxisDefaults from './AxisDefaults.js';
|
|
13
|
-
import
|
|
14
|
-
|
|
12
|
+
import D from '../DefaultOptions.js';
|
|
13
|
+
var defaultOptions = D.defaultOptions;
|
|
14
|
+
import H from '../Globals.js';
|
|
15
|
+
var noop = H.noop;
|
|
15
16
|
import U from '../Utilities.js';
|
|
16
17
|
var addEvent = U.addEvent, correctFloat = U.correctFloat, defined = U.defined, extend = U.extend, fireEvent = U.fireEvent, merge = U.merge, pick = U.pick, relativeLength = U.relativeLength, wrap = U.wrap;
|
|
17
|
-
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
/* *
|
|
19
|
+
*
|
|
20
|
+
* Composition
|
|
21
|
+
*
|
|
22
|
+
* */
|
|
23
|
+
var RadialAxis;
|
|
24
|
+
(function (RadialAxis) {
|
|
24
25
|
/* *
|
|
25
26
|
*
|
|
26
|
-
*
|
|
27
|
+
* Declarations
|
|
27
28
|
*
|
|
28
29
|
* */
|
|
29
|
-
RadialAxis.init = function (axis) {
|
|
30
|
-
var axisProto = Axis.prototype;
|
|
31
|
-
// Merge and set options.
|
|
32
|
-
axis.setOptions = function (userOptions) {
|
|
33
|
-
var options = this.options = merge(axis.constructor.defaultOptions, this.defaultPolarOptions, userOptions);
|
|
34
|
-
// Make sure the plotBands array is instanciated for each Axis
|
|
35
|
-
// (#2649)
|
|
36
|
-
if (!options.plotBands) {
|
|
37
|
-
options.plotBands = [];
|
|
38
|
-
}
|
|
39
|
-
fireEvent(this, 'afterSetOptions');
|
|
40
|
-
};
|
|
41
|
-
// Wrap the getOffset method to return zero offset for title or labels
|
|
42
|
-
// in a radial axis.
|
|
43
|
-
axis.getOffset = function () {
|
|
44
|
-
// Call the Axis prototype method (the method we're in now is on the
|
|
45
|
-
// instance)
|
|
46
|
-
axisProto.getOffset.call(this);
|
|
47
|
-
// Title or label offsets are not counted
|
|
48
|
-
this.chart.axisOffset[this.side] = 0;
|
|
49
|
-
};
|
|
50
|
-
/**
|
|
51
|
-
* Get the path for the axis line. This method is also referenced in the
|
|
52
|
-
* getPlotLinePath method.
|
|
53
|
-
*
|
|
54
|
-
* @private
|
|
55
|
-
*
|
|
56
|
-
* @param {number} _lineWidth
|
|
57
|
-
* Line width is not used.
|
|
58
|
-
*
|
|
59
|
-
* @param {number} [radius]
|
|
60
|
-
* Radius of radial path.
|
|
61
|
-
*
|
|
62
|
-
* @param {number} [innerRadius]
|
|
63
|
-
* Inner radius of radial path.
|
|
64
|
-
*
|
|
65
|
-
* @return {RadialAxisPath}
|
|
66
|
-
*/
|
|
67
|
-
axis.getLinePath = function (_lineWidth, radius, innerRadius) {
|
|
68
|
-
var center = this.pane.center, end, chart = this.chart, r = pick(radius, center[2] / 2 - this.offset), left = this.left || 0, top = this.top || 0, path;
|
|
69
|
-
if (typeof innerRadius === 'undefined') {
|
|
70
|
-
innerRadius = this.horiz ? 0 : this.center && -this.center[3] / 2;
|
|
71
|
-
}
|
|
72
|
-
// In case when innerSize of pane is set, it must be included
|
|
73
|
-
if (innerRadius) {
|
|
74
|
-
r += innerRadius;
|
|
75
|
-
}
|
|
76
|
-
if (this.isCircular || typeof radius !== 'undefined') {
|
|
77
|
-
path = this.chart.renderer.symbols.arc(left + center[0], top + center[1], r, r, {
|
|
78
|
-
start: this.startAngleRad,
|
|
79
|
-
end: this.endAngleRad,
|
|
80
|
-
open: true,
|
|
81
|
-
innerR: 0
|
|
82
|
-
});
|
|
83
|
-
// Bounds used to position the plotLine label next to the line
|
|
84
|
-
// (#7117)
|
|
85
|
-
path.xBounds = [left + center[0]];
|
|
86
|
-
path.yBounds = [top + center[1] - r];
|
|
87
|
-
}
|
|
88
|
-
else {
|
|
89
|
-
end = this.postTranslate(this.angleRad, r);
|
|
90
|
-
path = [
|
|
91
|
-
['M', this.center[0] + chart.plotLeft, this.center[1] + chart.plotTop],
|
|
92
|
-
['L', end.x, end.y]
|
|
93
|
-
];
|
|
94
|
-
}
|
|
95
|
-
return path;
|
|
96
|
-
};
|
|
97
|
-
/**
|
|
98
|
-
* Override setAxisTranslation by setting the translation to the
|
|
99
|
-
* difference in rotation. This allows the translate method to return
|
|
100
|
-
* angle for any given value.
|
|
101
|
-
*
|
|
102
|
-
* @private
|
|
103
|
-
*/
|
|
104
|
-
axis.setAxisTranslation = function () {
|
|
105
|
-
// Call uber method
|
|
106
|
-
axisProto.setAxisTranslation.call(this);
|
|
107
|
-
// Set transA and minPixelPadding
|
|
108
|
-
if (this.center) { // it's not defined the first time
|
|
109
|
-
if (this.isCircular) {
|
|
110
|
-
this.transA = (this.endAngleRad - this.startAngleRad) /
|
|
111
|
-
((this.max - this.min) || 1);
|
|
112
|
-
}
|
|
113
|
-
else {
|
|
114
|
-
// The transA here is the length of the axis, so in case
|
|
115
|
-
// of inner radius, the length must be decreased by it
|
|
116
|
-
this.transA = ((this.center[2] - this.center[3]) / 2) /
|
|
117
|
-
((this.max - this.min) || 1);
|
|
118
|
-
}
|
|
119
|
-
if (this.isXAxis) {
|
|
120
|
-
this.minPixelPadding = this.transA * this.minPointOffset;
|
|
121
|
-
}
|
|
122
|
-
else {
|
|
123
|
-
// This is a workaround for regression #2593, but categories
|
|
124
|
-
// still don't position correctly.
|
|
125
|
-
this.minPixelPadding = 0;
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
};
|
|
129
|
-
/**
|
|
130
|
-
* In case of auto connect, add one closestPointRange to the max value
|
|
131
|
-
* right before tickPositions are computed, so that ticks will extend
|
|
132
|
-
* passed the real max.
|
|
133
|
-
* @private
|
|
134
|
-
*/
|
|
135
|
-
axis.beforeSetTickPositions = function () {
|
|
136
|
-
// If autoConnect is true, polygonal grid lines are connected, and
|
|
137
|
-
// one closestPointRange is added to the X axis to prevent the last
|
|
138
|
-
// point from overlapping the first.
|
|
139
|
-
this.autoConnect = (this.isCircular &&
|
|
140
|
-
typeof pick(this.userMax, this.options.max) === 'undefined' &&
|
|
141
|
-
correctFloat(this.endAngleRad - this.startAngleRad) ===
|
|
142
|
-
correctFloat(2 * Math.PI));
|
|
143
|
-
// This will lead to add an extra tick to xAxis in order to display
|
|
144
|
-
// a correct range on inverted polar
|
|
145
|
-
if (!this.isCircular && this.chart.inverted) {
|
|
146
|
-
this.max++;
|
|
147
|
-
}
|
|
148
|
-
if (this.autoConnect) {
|
|
149
|
-
this.max += ((this.categories && 1) ||
|
|
150
|
-
this.pointRange ||
|
|
151
|
-
this.closestPointRange ||
|
|
152
|
-
0); // #1197, #2260
|
|
153
|
-
}
|
|
154
|
-
};
|
|
155
|
-
/**
|
|
156
|
-
* Override the setAxisSize method to use the arc's circumference as
|
|
157
|
-
* length. This allows tickPixelInterval to apply to pixel lengths along
|
|
158
|
-
* the perimeter.
|
|
159
|
-
* @private
|
|
160
|
-
*/
|
|
161
|
-
axis.setAxisSize = function () {
|
|
162
|
-
var center, start;
|
|
163
|
-
axisProto.setAxisSize.call(this);
|
|
164
|
-
if (this.isRadial) {
|
|
165
|
-
// Set the center array
|
|
166
|
-
this.pane.updateCenter(this);
|
|
167
|
-
// In case when the innerSize is set in a polar chart, the axis'
|
|
168
|
-
// center cannot be a reference to pane's center
|
|
169
|
-
center = this.center = this.pane.center.slice();
|
|
170
|
-
// The sector is used in Axis.translate to compute the
|
|
171
|
-
// translation of reversed axis points (#2570)
|
|
172
|
-
if (this.isCircular) {
|
|
173
|
-
this.sector = this.endAngleRad - this.startAngleRad;
|
|
174
|
-
}
|
|
175
|
-
else {
|
|
176
|
-
// When the pane's startAngle or the axis' angle is set then
|
|
177
|
-
// new x and y values for vertical axis' center must be
|
|
178
|
-
// calulated
|
|
179
|
-
start = this.postTranslate(this.angleRad, center[3] / 2);
|
|
180
|
-
center[0] = start.x - this.chart.plotLeft;
|
|
181
|
-
center[1] = start.y - this.chart.plotTop;
|
|
182
|
-
}
|
|
183
|
-
// Axis len is used to lay out the ticks
|
|
184
|
-
this.len = this.width = this.height =
|
|
185
|
-
(center[2] - center[3]) * pick(this.sector, 1) / 2;
|
|
186
|
-
}
|
|
187
|
-
};
|
|
188
|
-
/**
|
|
189
|
-
* Returns the x, y coordinate of a point given by a value and a pixel
|
|
190
|
-
* distance from center.
|
|
191
|
-
*
|
|
192
|
-
* @private
|
|
193
|
-
*
|
|
194
|
-
* @param {number} value
|
|
195
|
-
* Point value.
|
|
196
|
-
*
|
|
197
|
-
* @param {number} [length]
|
|
198
|
-
* Distance from center.
|
|
199
|
-
*
|
|
200
|
-
* @return {Highcharts.PositionObject}
|
|
201
|
-
*/
|
|
202
|
-
axis.getPosition = function (value, length) {
|
|
203
|
-
var translatedVal = this.translate(value);
|
|
204
|
-
return this.postTranslate(this.isCircular ? translatedVal : this.angleRad, // #2848
|
|
205
|
-
// In case when translatedVal is negative, the 0 value must be
|
|
206
|
-
// used instead, in order to deal with lines and labels that
|
|
207
|
-
// fall out of the visible range near the center of a pane
|
|
208
|
-
pick(this.isCircular ?
|
|
209
|
-
length :
|
|
210
|
-
(translatedVal < 0 ? 0 : translatedVal), this.center[2] / 2) - this.offset);
|
|
211
|
-
};
|
|
212
|
-
/**
|
|
213
|
-
* Translate from intermediate plotX (angle), plotY (axis.len - radius)
|
|
214
|
-
* to final chart coordinates.
|
|
215
|
-
*
|
|
216
|
-
* @private
|
|
217
|
-
*
|
|
218
|
-
* @param {number} angle
|
|
219
|
-
* Translation angle.
|
|
220
|
-
*
|
|
221
|
-
* @param {number} radius
|
|
222
|
-
* Translation radius.
|
|
223
|
-
*
|
|
224
|
-
* @return {Highcharts.PositionObject}
|
|
225
|
-
*/
|
|
226
|
-
axis.postTranslate = function (angle, radius) {
|
|
227
|
-
var chart = this.chart, center = this.center;
|
|
228
|
-
angle = this.startAngleRad + angle;
|
|
229
|
-
return {
|
|
230
|
-
x: chart.plotLeft + center[0] + Math.cos(angle) * radius,
|
|
231
|
-
y: chart.plotTop + center[1] + Math.sin(angle) * radius
|
|
232
|
-
};
|
|
233
|
-
};
|
|
234
|
-
/**
|
|
235
|
-
* Find the path for plot bands along the radial axis.
|
|
236
|
-
*
|
|
237
|
-
* @private
|
|
238
|
-
*
|
|
239
|
-
* @param {number} from
|
|
240
|
-
* From value.
|
|
241
|
-
*
|
|
242
|
-
* @param {number} to
|
|
243
|
-
* To value.
|
|
244
|
-
*
|
|
245
|
-
* @param {Highcharts.AxisPlotBandsOptions} options
|
|
246
|
-
* Band options.
|
|
247
|
-
*
|
|
248
|
-
* @return {RadialAxisPath}
|
|
249
|
-
*/
|
|
250
|
-
axis.getPlotBandPath = function (from, to, options) {
|
|
251
|
-
var radiusToPixels = function (radius) {
|
|
252
|
-
if (typeof radius === 'string') {
|
|
253
|
-
var r = parseInt(radius, 10);
|
|
254
|
-
if (percentRegex.test(radius)) {
|
|
255
|
-
r = (r * fullRadius) / 100;
|
|
256
|
-
}
|
|
257
|
-
return r;
|
|
258
|
-
}
|
|
259
|
-
return radius;
|
|
260
|
-
};
|
|
261
|
-
var center = this.center, startAngleRad = this.startAngleRad, fullRadius = center[2] / 2, offset = Math.min(this.offset, 0), left = this.left || 0, top = this.top || 0, percentRegex = /%$/, start, end, angle, xOnPerimeter, open, isCircular = this.isCircular, // X axis in a polar chart
|
|
262
|
-
path, outerRadius = pick(radiusToPixels(options.outerRadius), fullRadius), innerRadius = radiusToPixels(options.innerRadius), thickness = pick(radiusToPixels(options.thickness), 10);
|
|
263
|
-
// Polygonal plot bands
|
|
264
|
-
if (this.options.gridLineInterpolation === 'polygon') {
|
|
265
|
-
path = this.getPlotLinePath({ value: from }).concat(this.getPlotLinePath({ value: to, reverse: true }));
|
|
266
|
-
// Circular grid bands
|
|
267
|
-
}
|
|
268
|
-
else {
|
|
269
|
-
// Keep within bounds
|
|
270
|
-
from = Math.max(from, this.min);
|
|
271
|
-
to = Math.min(to, this.max);
|
|
272
|
-
var transFrom = this.translate(from);
|
|
273
|
-
var transTo = this.translate(to);
|
|
274
|
-
// Plot bands on Y axis (radial axis) - inner and outer
|
|
275
|
-
// radius depend on to and from
|
|
276
|
-
if (!isCircular) {
|
|
277
|
-
outerRadius = transFrom || 0;
|
|
278
|
-
innerRadius = transTo || 0;
|
|
279
|
-
}
|
|
280
|
-
// Handle full circle
|
|
281
|
-
if (options.shape === 'circle' || !isCircular) {
|
|
282
|
-
start = -Math.PI / 2;
|
|
283
|
-
end = Math.PI * 1.5;
|
|
284
|
-
open = true;
|
|
285
|
-
}
|
|
286
|
-
else {
|
|
287
|
-
start = startAngleRad + (transFrom || 0);
|
|
288
|
-
end = startAngleRad + (transTo || 0);
|
|
289
|
-
}
|
|
290
|
-
outerRadius -= offset; // #5283
|
|
291
|
-
thickness -= offset; // #5283
|
|
292
|
-
path = this.chart.renderer.symbols.arc(left + center[0], top + center[1], outerRadius, outerRadius, {
|
|
293
|
-
// Math is for reversed yAxis (#3606)
|
|
294
|
-
start: Math.min(start, end),
|
|
295
|
-
end: Math.max(start, end),
|
|
296
|
-
innerR: pick(innerRadius, outerRadius - thickness),
|
|
297
|
-
open: open
|
|
298
|
-
});
|
|
299
|
-
// Provide positioning boxes for the label (#6406)
|
|
300
|
-
if (isCircular) {
|
|
301
|
-
angle = (end + start) / 2;
|
|
302
|
-
xOnPerimeter = (left +
|
|
303
|
-
center[0] +
|
|
304
|
-
(center[2] / 2) * Math.cos(angle));
|
|
305
|
-
path.xBounds = angle > -Math.PI / 2 && angle < Math.PI / 2 ?
|
|
306
|
-
// Right hemisphere
|
|
307
|
-
[xOnPerimeter, this.chart.plotWidth] :
|
|
308
|
-
// Left hemisphere
|
|
309
|
-
[0, xOnPerimeter];
|
|
310
|
-
path.yBounds = [
|
|
311
|
-
top + center[1] + (center[2] / 2) * Math.sin(angle)
|
|
312
|
-
];
|
|
313
|
-
// Shift up or down to get the label clear of the perimeter
|
|
314
|
-
path.yBounds[0] += ((angle > -Math.PI && angle < 0) ||
|
|
315
|
-
(angle > Math.PI)) ? -10 : 10;
|
|
316
|
-
}
|
|
317
|
-
}
|
|
318
|
-
return path;
|
|
319
|
-
};
|
|
320
|
-
// Find the correct end values of crosshair in polar.
|
|
321
|
-
axis.getCrosshairPosition = function (options, x1, y1) {
|
|
322
|
-
var axis = this, value = options.value, center = axis.pane.center, shapeArgs, end, x2, y2;
|
|
323
|
-
if (axis.isCircular) {
|
|
324
|
-
if (!defined(value)) {
|
|
325
|
-
// When the snap is set to false
|
|
326
|
-
x2 = options.chartX || 0;
|
|
327
|
-
y2 = options.chartY || 0;
|
|
328
|
-
value = axis.translate(Math.atan2(y2 - y1, x2 - x1) - axis.startAngleRad, true);
|
|
329
|
-
}
|
|
330
|
-
else if (options.point) {
|
|
331
|
-
// When the snap is set to true
|
|
332
|
-
shapeArgs = options.point.shapeArgs || {};
|
|
333
|
-
if (shapeArgs.start) {
|
|
334
|
-
// Find a true value of the point based on the
|
|
335
|
-
// angle
|
|
336
|
-
value = axis.chart.inverted ?
|
|
337
|
-
axis.translate(options.point.rectPlotY, true) :
|
|
338
|
-
options.point.x;
|
|
339
|
-
}
|
|
340
|
-
}
|
|
341
|
-
end = axis.getPosition(value);
|
|
342
|
-
x2 = end.x;
|
|
343
|
-
y2 = end.y;
|
|
344
|
-
}
|
|
345
|
-
else {
|
|
346
|
-
if (!defined(value)) {
|
|
347
|
-
x2 = options.chartX;
|
|
348
|
-
y2 = options.chartY;
|
|
349
|
-
}
|
|
350
|
-
if (defined(x2) && defined(y2)) {
|
|
351
|
-
// Calculate radius of non-circular axis' crosshair
|
|
352
|
-
y1 = center[1] + axis.chart.plotTop;
|
|
353
|
-
value = axis.translate(Math.min(Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2)), center[2] / 2) - center[3] / 2, true);
|
|
354
|
-
}
|
|
355
|
-
}
|
|
356
|
-
return [value, x2 || 0, y2 || 0];
|
|
357
|
-
};
|
|
358
|
-
// Find the path for plot lines perpendicular to the radial axis.
|
|
359
|
-
axis.getPlotLinePath = function (options) {
|
|
360
|
-
var axis = this, center = axis.pane.center, chart = axis.chart, inverted = chart.inverted, value = options.value, reverse = options.reverse, end = axis.getPosition(value), background = axis.pane.options.background ?
|
|
361
|
-
(axis.pane.options.background[0] ||
|
|
362
|
-
axis.pane.options.background) :
|
|
363
|
-
{}, innerRadius = background.innerRadius || '0%', outerRadius = background.outerRadius || '100%', x1 = center[0] + chart.plotLeft, y1 = center[1] + chart.plotTop, x2 = end.x, y2 = end.y, height = axis.height, isCrosshair = options.isCrosshair, paneInnerR = center[3] / 2, innerRatio, distance, a, b, otherAxis, xy, tickPositions, crossPos, path;
|
|
364
|
-
// Crosshair logic
|
|
365
|
-
if (isCrosshair) {
|
|
366
|
-
// Find crosshair's position and perform destructuring
|
|
367
|
-
// assignment
|
|
368
|
-
crossPos = this.getCrosshairPosition(options, x1, y1);
|
|
369
|
-
value = crossPos[0];
|
|
370
|
-
x2 = crossPos[1];
|
|
371
|
-
y2 = crossPos[2];
|
|
372
|
-
}
|
|
373
|
-
// Spokes
|
|
374
|
-
if (axis.isCircular) {
|
|
375
|
-
distance =
|
|
376
|
-
Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2));
|
|
377
|
-
a = (typeof innerRadius === 'string') ?
|
|
378
|
-
relativeLength(innerRadius, 1) : (innerRadius / distance);
|
|
379
|
-
b = (typeof outerRadius === 'string') ?
|
|
380
|
-
relativeLength(outerRadius, 1) : (outerRadius / distance);
|
|
381
|
-
// To ensure that gridlines won't be displayed in area
|
|
382
|
-
// defined by innerSize in case of custom radiuses of pane's
|
|
383
|
-
// background
|
|
384
|
-
if (center && paneInnerR) {
|
|
385
|
-
innerRatio = paneInnerR / distance;
|
|
386
|
-
if (a < innerRatio) {
|
|
387
|
-
a = innerRatio;
|
|
388
|
-
}
|
|
389
|
-
if (b < innerRatio) {
|
|
390
|
-
b = innerRatio;
|
|
391
|
-
}
|
|
392
|
-
}
|
|
393
|
-
path = [
|
|
394
|
-
['M', x1 + a * (x2 - x1), y1 - a * (y1 - y2)],
|
|
395
|
-
['L', x2 - (1 - b) * (x2 - x1), y2 + (1 - b) * (y1 - y2)]
|
|
396
|
-
];
|
|
397
|
-
// Concentric circles
|
|
398
|
-
}
|
|
399
|
-
else {
|
|
400
|
-
// Pick the right values depending if it is grid line or
|
|
401
|
-
// crosshair
|
|
402
|
-
value = axis.translate(value);
|
|
403
|
-
// This is required in case when xAxis is non-circular to
|
|
404
|
-
// prevent grid lines (or crosshairs, if enabled) from
|
|
405
|
-
// rendering above the center after they supposed to be
|
|
406
|
-
// displayed below the center point
|
|
407
|
-
if (value) {
|
|
408
|
-
if (value < 0 || value > height) {
|
|
409
|
-
value = 0;
|
|
410
|
-
}
|
|
411
|
-
}
|
|
412
|
-
if (axis.options.gridLineInterpolation === 'circle') {
|
|
413
|
-
// A value of 0 is in the center, so it won't be
|
|
414
|
-
// visible, but draw it anyway for update and animation
|
|
415
|
-
// (#2366)
|
|
416
|
-
path = axis.getLinePath(0, value, paneInnerR);
|
|
417
|
-
// Concentric polygons
|
|
418
|
-
}
|
|
419
|
-
else {
|
|
420
|
-
path = [];
|
|
421
|
-
// Find the other axis (a circular one) in the same pane
|
|
422
|
-
chart[inverted ? 'yAxis' : 'xAxis'].forEach(function (a) {
|
|
423
|
-
if (a.pane === axis.pane) {
|
|
424
|
-
otherAxis = a;
|
|
425
|
-
}
|
|
426
|
-
});
|
|
427
|
-
if (otherAxis) {
|
|
428
|
-
tickPositions = otherAxis.tickPositions;
|
|
429
|
-
if (otherAxis.autoConnect) {
|
|
430
|
-
tickPositions =
|
|
431
|
-
tickPositions.concat([tickPositions[0]]);
|
|
432
|
-
}
|
|
433
|
-
// Reverse the positions for concatenation of polygonal
|
|
434
|
-
// plot bands
|
|
435
|
-
if (reverse) {
|
|
436
|
-
tickPositions = tickPositions.slice().reverse();
|
|
437
|
-
}
|
|
438
|
-
if (value) {
|
|
439
|
-
value += paneInnerR;
|
|
440
|
-
}
|
|
441
|
-
for (var i = 0; i < tickPositions.length; i++) {
|
|
442
|
-
xy = otherAxis.getPosition(tickPositions[i], value);
|
|
443
|
-
path.push(i ? ['L', xy.x, xy.y] : ['M', xy.x, xy.y]);
|
|
444
|
-
}
|
|
445
|
-
}
|
|
446
|
-
}
|
|
447
|
-
}
|
|
448
|
-
return path;
|
|
449
|
-
};
|
|
450
|
-
// Find the position for the axis title, by default inside the gauge.
|
|
451
|
-
axis.getTitlePosition = function () {
|
|
452
|
-
var center = this.center, chart = this.chart, titleOptions = this.options.title;
|
|
453
|
-
return {
|
|
454
|
-
x: chart.plotLeft + center[0] + (titleOptions.x || 0),
|
|
455
|
-
y: (chart.plotTop +
|
|
456
|
-
center[1] -
|
|
457
|
-
({
|
|
458
|
-
high: 0.5,
|
|
459
|
-
middle: 0.25,
|
|
460
|
-
low: 0
|
|
461
|
-
}[titleOptions.align] *
|
|
462
|
-
center[2]) +
|
|
463
|
-
(titleOptions.y || 0))
|
|
464
|
-
};
|
|
465
|
-
};
|
|
466
|
-
/**
|
|
467
|
-
* Attach and return collecting function for labels in radial axis for
|
|
468
|
-
* anti-collision.
|
|
469
|
-
*
|
|
470
|
-
* @private
|
|
471
|
-
*
|
|
472
|
-
* @return {Highcharts.ChartLabelCollectorFunction}
|
|
473
|
-
*/
|
|
474
|
-
axis.createLabelCollector = function () {
|
|
475
|
-
var axis = this;
|
|
476
|
-
return function () {
|
|
477
|
-
if (axis.isRadial &&
|
|
478
|
-
axis.tickPositions &&
|
|
479
|
-
// undocumented option for now, but working
|
|
480
|
-
axis.options.labels &&
|
|
481
|
-
axis.options.labels.allowOverlap !== true) {
|
|
482
|
-
return axis.tickPositions
|
|
483
|
-
.map(function (pos) {
|
|
484
|
-
return axis.ticks[pos] && axis.ticks[pos].label;
|
|
485
|
-
})
|
|
486
|
-
.filter(function (label) {
|
|
487
|
-
return Boolean(label);
|
|
488
|
-
});
|
|
489
|
-
}
|
|
490
|
-
};
|
|
491
|
-
};
|
|
492
|
-
};
|
|
493
|
-
/**
|
|
494
|
-
* Augments methods for the value axis.
|
|
495
|
-
*
|
|
496
|
-
* @private
|
|
497
|
-
*
|
|
498
|
-
* @param {Highcharts.Axis} AxisClass
|
|
499
|
-
* Axis class to extend.
|
|
500
|
-
*
|
|
501
|
-
* @param {Highcharts.Tick} TickClass
|
|
502
|
-
* Tick class to use.
|
|
503
|
-
*/
|
|
504
|
-
RadialAxis.compose = function (AxisClass, TickClass) {
|
|
505
|
-
/* eslint-disable no-invalid-this */
|
|
506
|
-
// Actions before axis init.
|
|
507
|
-
addEvent(AxisClass, 'init', function (e) {
|
|
508
|
-
var axis = this, chart = axis.chart;
|
|
509
|
-
var inverted = chart.inverted, angular = chart.angular, polar = chart.polar, isX = axis.isXAxis, coll = axis.coll, isHidden = angular && isX, isCircular, chartOptions = chart.options, paneIndex = e.userOptions.pane || 0, pane = axis.pane = chart.pane && chart.pane[paneIndex];
|
|
510
|
-
// Prevent changes for colorAxis
|
|
511
|
-
if (coll === 'colorAxis') {
|
|
512
|
-
this.isRadial = false;
|
|
513
|
-
return;
|
|
514
|
-
}
|
|
515
|
-
// Before prototype.init
|
|
516
|
-
if (angular) {
|
|
517
|
-
if (isHidden) {
|
|
518
|
-
HiddenAxis.init(axis);
|
|
519
|
-
}
|
|
520
|
-
else {
|
|
521
|
-
RadialAxis.init(axis);
|
|
522
|
-
}
|
|
523
|
-
isCircular = !isX;
|
|
524
|
-
if (isCircular) {
|
|
525
|
-
axis.defaultPolarOptions = RadialAxis.defaultRadialGaugeOptions;
|
|
526
|
-
}
|
|
527
|
-
}
|
|
528
|
-
else if (polar) {
|
|
529
|
-
RadialAxis.init(axis);
|
|
530
|
-
// Check which axis is circular
|
|
531
|
-
isCircular = axis.horiz;
|
|
532
|
-
axis.defaultPolarOptions = isCircular ?
|
|
533
|
-
RadialAxis.defaultCircularOptions :
|
|
534
|
-
merge(coll === 'xAxis' ?
|
|
535
|
-
AxisDefaults.defaultXAxisOptions :
|
|
536
|
-
AxisDefaults.defaultYAxisOptions, RadialAxis.defaultRadialOptions);
|
|
537
|
-
// Apply the stack labels for yAxis in case of inverted chart
|
|
538
|
-
if (inverted && coll === 'yAxis') {
|
|
539
|
-
axis.defaultPolarOptions.stackLabels = AxisDefaults.defaultYAxisOptions.stackLabels;
|
|
540
|
-
axis.defaultPolarOptions.reversedStacks = true;
|
|
541
|
-
}
|
|
542
|
-
}
|
|
543
|
-
// Disable certain features on angular and polar axes
|
|
544
|
-
if (angular || polar) {
|
|
545
|
-
axis.isRadial = true;
|
|
546
|
-
chartOptions.chart.zoomType = null;
|
|
547
|
-
if (!axis.labelCollector) {
|
|
548
|
-
axis.labelCollector = axis.createLabelCollector();
|
|
549
|
-
}
|
|
550
|
-
if (axis.labelCollector) {
|
|
551
|
-
// Prevent overlapping axis labels (#9761)
|
|
552
|
-
chart.labelCollectors.push(axis.labelCollector);
|
|
553
|
-
}
|
|
554
|
-
}
|
|
555
|
-
else {
|
|
556
|
-
this.isRadial = false;
|
|
557
|
-
}
|
|
558
|
-
// A pointer back to this axis to borrow geometry
|
|
559
|
-
if (pane && isCircular) {
|
|
560
|
-
pane.axis = axis;
|
|
561
|
-
}
|
|
562
|
-
axis.isCircular = isCircular;
|
|
563
|
-
});
|
|
564
|
-
addEvent(AxisClass, 'afterInit', function () {
|
|
565
|
-
var axis = this;
|
|
566
|
-
var chart = axis.chart, options = axis.options, isHidden = chart.angular && axis.isXAxis, pane = axis.pane, paneOptions = pane && pane.options;
|
|
567
|
-
if (!isHidden && pane && (chart.angular || chart.polar)) {
|
|
568
|
-
// Start and end angle options are given in degrees relative to
|
|
569
|
-
// top, while internal computations are in radians relative to
|
|
570
|
-
// right (like SVG).
|
|
571
|
-
// Y axis in polar charts
|
|
572
|
-
axis.angleRad = (options.angle || 0) * Math.PI / 180;
|
|
573
|
-
// Gauges
|
|
574
|
-
axis.startAngleRad =
|
|
575
|
-
(paneOptions.startAngle - 90) * Math.PI / 180;
|
|
576
|
-
axis.endAngleRad = (pick(paneOptions.endAngle, paneOptions.startAngle + 360) - 90) * Math.PI / 180; // Gauges
|
|
577
|
-
axis.offset = options.offset || 0;
|
|
578
|
-
}
|
|
579
|
-
});
|
|
580
|
-
// Wrap auto label align to avoid setting axis-wide rotation on radial
|
|
581
|
-
// axes. (#4920)
|
|
582
|
-
addEvent(AxisClass, 'autoLabelAlign', function (e) {
|
|
583
|
-
if (this.isRadial) {
|
|
584
|
-
e.align = void 0;
|
|
585
|
-
e.preventDefault();
|
|
586
|
-
}
|
|
587
|
-
});
|
|
588
|
-
// Remove label collector function on axis remove/update
|
|
589
|
-
addEvent(AxisClass, 'destroy', function () {
|
|
590
|
-
var axis = this;
|
|
591
|
-
if (axis.chart &&
|
|
592
|
-
axis.chart.labelCollectors) {
|
|
593
|
-
var index = (axis.labelCollector ?
|
|
594
|
-
axis.chart.labelCollectors.indexOf(axis.labelCollector) :
|
|
595
|
-
-1);
|
|
596
|
-
if (index >= 0) {
|
|
597
|
-
axis.chart.labelCollectors.splice(index, 1);
|
|
598
|
-
}
|
|
599
|
-
}
|
|
600
|
-
});
|
|
601
|
-
addEvent(AxisClass, 'initialAxisTranslation', function () {
|
|
602
|
-
var axis = this;
|
|
603
|
-
if (axis.isRadial) {
|
|
604
|
-
axis.beforeSetTickPositions();
|
|
605
|
-
}
|
|
606
|
-
});
|
|
607
|
-
// Add special cases within the Tick class' methods for radial axes.
|
|
608
|
-
addEvent(TickClass, 'afterGetPosition', function (e) {
|
|
609
|
-
var tick = this;
|
|
610
|
-
if (tick.axis.getPosition) {
|
|
611
|
-
extend(e.pos, tick.axis.getPosition(this.pos));
|
|
612
|
-
}
|
|
613
|
-
});
|
|
614
|
-
// Find the center position of the label based on the distance option.
|
|
615
|
-
addEvent(TickClass, 'afterGetLabelPosition', function (e) {
|
|
616
|
-
var tick = this, axis = tick.axis, label = tick.label;
|
|
617
|
-
if (!label) {
|
|
618
|
-
return;
|
|
619
|
-
}
|
|
620
|
-
var labelBBox = label.getBBox(), labelOptions = axis.options.labels, optionsY = labelOptions.y, ret, centerSlot = 20, // 20 degrees to each side at the top and bottom
|
|
621
|
-
align = labelOptions.align, angle = ((axis.translate(this.pos) + axis.startAngleRad +
|
|
622
|
-
Math.PI / 2) / Math.PI * 180) % 360, correctAngle = Math.round(angle), labelDir = 'end', // Direction of the label 'start' or 'end'
|
|
623
|
-
reducedAngle1 = correctAngle < 0 ?
|
|
624
|
-
correctAngle + 360 : correctAngle, reducedAngle2 = reducedAngle1, translateY = 0, translateX = 0, labelYPosCorrection = !defined(optionsY) ? -labelBBox.height * 0.3 : 0;
|
|
625
|
-
if (axis.isRadial) { // Both X and Y axes in a polar chart
|
|
626
|
-
ret = axis.getPosition(this.pos, (axis.center[2] / 2) +
|
|
627
|
-
relativeLength(pick(labelOptions.distance, -25), axis.center[2] / 2, -axis.center[2] / 2));
|
|
628
|
-
// Automatically rotated
|
|
629
|
-
if (labelOptions.rotation === 'auto') {
|
|
630
|
-
label.attr({
|
|
631
|
-
rotation: angle
|
|
632
|
-
});
|
|
633
|
-
// Vertically centered
|
|
634
|
-
}
|
|
635
|
-
else if (!defined(optionsY)) {
|
|
636
|
-
optionsY = (axis.chart.renderer
|
|
637
|
-
.fontMetrics(label.styles && label.styles.fontSize).b -
|
|
638
|
-
labelBBox.height / 2);
|
|
639
|
-
}
|
|
640
|
-
// Automatic alignment
|
|
641
|
-
if (!defined(align)) {
|
|
642
|
-
if (axis.isCircular) { // Y axis
|
|
643
|
-
if (labelBBox.width >
|
|
644
|
-
axis.len * axis.tickInterval / (axis.max - axis.min)) { // #3506
|
|
645
|
-
centerSlot = 0;
|
|
646
|
-
}
|
|
647
|
-
if (angle > centerSlot && angle < 180 - centerSlot) {
|
|
648
|
-
align = 'left'; // right hemisphere
|
|
649
|
-
}
|
|
650
|
-
else if (angle > 180 + centerSlot &&
|
|
651
|
-
angle < 360 - centerSlot) {
|
|
652
|
-
align = 'right'; // left hemisphere
|
|
653
|
-
}
|
|
654
|
-
else {
|
|
655
|
-
align = 'center'; // top or bottom
|
|
656
|
-
}
|
|
657
|
-
}
|
|
658
|
-
else {
|
|
659
|
-
align = 'center';
|
|
660
|
-
}
|
|
661
|
-
label.attr({
|
|
662
|
-
align: align
|
|
663
|
-
});
|
|
664
|
-
}
|
|
665
|
-
// Auto alignment for solid-gauges with two labels (#10635)
|
|
666
|
-
if (align === 'auto' &&
|
|
667
|
-
axis.tickPositions.length === 2 &&
|
|
668
|
-
axis.isCircular) {
|
|
669
|
-
// Angles reduced to 0 - 90 or 180 - 270
|
|
670
|
-
if (reducedAngle1 > 90 && reducedAngle1 < 180) {
|
|
671
|
-
reducedAngle1 = 180 - reducedAngle1;
|
|
672
|
-
}
|
|
673
|
-
else if (reducedAngle1 > 270 && reducedAngle1 <= 360) {
|
|
674
|
-
reducedAngle1 = 540 - reducedAngle1;
|
|
675
|
-
}
|
|
676
|
-
// Angles reduced to 0 - 180
|
|
677
|
-
if (reducedAngle2 > 180 && reducedAngle2 <= 360) {
|
|
678
|
-
reducedAngle2 = 360 - reducedAngle2;
|
|
679
|
-
}
|
|
680
|
-
if ((axis.pane.options.startAngle === correctAngle) ||
|
|
681
|
-
(axis.pane.options.startAngle === correctAngle + 360) ||
|
|
682
|
-
(axis.pane.options.startAngle === correctAngle - 360)) {
|
|
683
|
-
labelDir = 'start';
|
|
684
|
-
}
|
|
685
|
-
if ((correctAngle >= -90 && correctAngle <= 90) ||
|
|
686
|
-
(correctAngle >= -360 && correctAngle <= -270) ||
|
|
687
|
-
(correctAngle >= 270 && correctAngle <= 360)) {
|
|
688
|
-
align = (labelDir === 'start') ? 'right' : 'left';
|
|
689
|
-
}
|
|
690
|
-
else {
|
|
691
|
-
align = (labelDir === 'start') ? 'left' : 'right';
|
|
692
|
-
}
|
|
693
|
-
// For angles beetwen (90 + n * 180) +- 20
|
|
694
|
-
if (reducedAngle2 > 70 && reducedAngle2 < 110) {
|
|
695
|
-
align = 'center';
|
|
696
|
-
}
|
|
697
|
-
// auto Y translation
|
|
698
|
-
if (reducedAngle1 < 15 ||
|
|
699
|
-
(reducedAngle1 >= 180 && reducedAngle1 < 195)) {
|
|
700
|
-
translateY = labelBBox.height * 0.3;
|
|
701
|
-
}
|
|
702
|
-
else if (reducedAngle1 >= 15 && reducedAngle1 <= 35) {
|
|
703
|
-
translateY = labelDir === 'start' ?
|
|
704
|
-
0 : labelBBox.height * 0.75;
|
|
705
|
-
}
|
|
706
|
-
else if (reducedAngle1 >= 195 && reducedAngle1 <= 215) {
|
|
707
|
-
translateY = labelDir === 'start' ?
|
|
708
|
-
labelBBox.height * 0.75 : 0;
|
|
709
|
-
}
|
|
710
|
-
else if (reducedAngle1 > 35 && reducedAngle1 <= 90) {
|
|
711
|
-
translateY = labelDir === 'start' ?
|
|
712
|
-
-labelBBox.height * 0.25 : labelBBox.height;
|
|
713
|
-
}
|
|
714
|
-
else if (reducedAngle1 > 215 && reducedAngle1 <= 270) {
|
|
715
|
-
translateY = labelDir === 'start' ?
|
|
716
|
-
labelBBox.height : -labelBBox.height * 0.25;
|
|
717
|
-
}
|
|
718
|
-
// auto X translation
|
|
719
|
-
if (reducedAngle2 < 15) {
|
|
720
|
-
translateX = labelDir === 'start' ?
|
|
721
|
-
-labelBBox.height * 0.15 : labelBBox.height * 0.15;
|
|
722
|
-
}
|
|
723
|
-
else if (reducedAngle2 > 165 && reducedAngle2 <= 180) {
|
|
724
|
-
translateX = labelDir === 'start' ?
|
|
725
|
-
labelBBox.height * 0.15 : -labelBBox.height * 0.15;
|
|
726
|
-
}
|
|
727
|
-
label.attr({ align: align });
|
|
728
|
-
label.translate(translateX, translateY + labelYPosCorrection);
|
|
729
|
-
}
|
|
730
|
-
e.pos.x = ret.x + (labelOptions.x || 0);
|
|
731
|
-
e.pos.y = ret.y + (optionsY || 0);
|
|
732
|
-
}
|
|
733
|
-
});
|
|
734
|
-
// Wrap the getMarkPath function to return the path of the radial marker
|
|
735
|
-
wrap(TickClass.prototype, 'getMarkPath', function (proceed, x, y, tickLength, tickWidth, horiz, renderer) {
|
|
736
|
-
var tick = this;
|
|
737
|
-
var axis = tick.axis;
|
|
738
|
-
var endPoint, ret;
|
|
739
|
-
if (axis.isRadial) {
|
|
740
|
-
endPoint = axis.getPosition(this.pos, axis.center[2] / 2 + tickLength);
|
|
741
|
-
ret = [
|
|
742
|
-
'M',
|
|
743
|
-
x,
|
|
744
|
-
y,
|
|
745
|
-
'L',
|
|
746
|
-
endPoint.x,
|
|
747
|
-
endPoint.y
|
|
748
|
-
];
|
|
749
|
-
}
|
|
750
|
-
else {
|
|
751
|
-
ret = proceed.call(this, x, y, tickLength, tickWidth, horiz, renderer);
|
|
752
|
-
}
|
|
753
|
-
return ret;
|
|
754
|
-
});
|
|
755
|
-
};
|
|
756
30
|
/* *
|
|
757
31
|
*
|
|
758
|
-
*
|
|
32
|
+
* Constants
|
|
759
33
|
*
|
|
760
34
|
* */
|
|
35
|
+
var composedClasses = [];
|
|
761
36
|
/**
|
|
762
37
|
* Circular axis around the perimeter of a polar chart.
|
|
763
38
|
* @private
|
|
764
39
|
*/
|
|
765
|
-
|
|
40
|
+
var defaultCircularOptions = {
|
|
766
41
|
gridLineWidth: 1,
|
|
767
42
|
labels: {
|
|
768
43
|
align: void 0,
|
|
@@ -782,7 +57,7 @@ var RadialAxis = /** @class */ (function () {
|
|
|
782
57
|
* The default options extend defaultYAxisOptions.
|
|
783
58
|
* @private
|
|
784
59
|
*/
|
|
785
|
-
|
|
60
|
+
var defaultRadialGaugeOptions = {
|
|
786
61
|
labels: {
|
|
787
62
|
align: 'center',
|
|
788
63
|
x: 0,
|
|
@@ -805,7 +80,7 @@ var RadialAxis = /** @class */ (function () {
|
|
|
805
80
|
* Radial axis, like a spoke in a polar chart.
|
|
806
81
|
* @private
|
|
807
82
|
*/
|
|
808
|
-
|
|
83
|
+
var defaultRadialOptions = {
|
|
809
84
|
/**
|
|
810
85
|
* In a polar chart, this is the angle of the Y axis in degrees, where
|
|
811
86
|
* 0 is up and 90 is right. The angle determines the position of the
|
|
@@ -856,7 +131,845 @@ var RadialAxis = /** @class */ (function () {
|
|
|
856
131
|
rotation: 90
|
|
857
132
|
}
|
|
858
133
|
};
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
134
|
+
/* *
|
|
135
|
+
*
|
|
136
|
+
* Functions
|
|
137
|
+
*
|
|
138
|
+
* */
|
|
139
|
+
/* eslint-disable valid-jsdoc */
|
|
140
|
+
/**
|
|
141
|
+
* In case of auto connect, add one closestPointRange to the max value
|
|
142
|
+
* right before tickPositions are computed, so that ticks will extend
|
|
143
|
+
* passed the real max.
|
|
144
|
+
* @private
|
|
145
|
+
*/
|
|
146
|
+
function beforeSetTickPositions() {
|
|
147
|
+
// If autoConnect is true, polygonal grid lines are connected, and
|
|
148
|
+
// one closestPointRange is added to the X axis to prevent the last
|
|
149
|
+
// point from overlapping the first.
|
|
150
|
+
this.autoConnect = (this.isCircular &&
|
|
151
|
+
typeof pick(this.userMax, this.options.max) === 'undefined' &&
|
|
152
|
+
correctFloat(this.endAngleRad - this.startAngleRad) ===
|
|
153
|
+
correctFloat(2 * Math.PI));
|
|
154
|
+
// This will lead to add an extra tick to xAxis in order to display
|
|
155
|
+
// a correct range on inverted polar
|
|
156
|
+
if (!this.isCircular && this.chart.inverted) {
|
|
157
|
+
this.max++;
|
|
158
|
+
}
|
|
159
|
+
if (this.autoConnect) {
|
|
160
|
+
this.max += ((this.categories && 1) ||
|
|
161
|
+
this.pointRange ||
|
|
162
|
+
this.closestPointRange ||
|
|
163
|
+
0); // #1197, #2260
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Augments methods for the value axis.
|
|
168
|
+
*
|
|
169
|
+
* @private
|
|
170
|
+
*
|
|
171
|
+
* @param {Highcharts.Axis} AxisClass
|
|
172
|
+
* Axis class to extend.
|
|
173
|
+
*
|
|
174
|
+
* @param {Highcharts.Tick} TickClass
|
|
175
|
+
* Tick class to use.
|
|
176
|
+
*
|
|
177
|
+
* @return {Highcharts.Axis}
|
|
178
|
+
* Axis composition.
|
|
179
|
+
*/
|
|
180
|
+
function compose(AxisClass, TickClass) {
|
|
181
|
+
if (composedClasses.indexOf(AxisClass) === -1) {
|
|
182
|
+
composedClasses.push(AxisClass);
|
|
183
|
+
addEvent(AxisClass, 'afterInit', onAxisAfterInit);
|
|
184
|
+
addEvent(AxisClass, 'autoLabelAlign', onAxisAutoLabelAlign);
|
|
185
|
+
addEvent(AxisClass, 'destroy', onAxisDestroy);
|
|
186
|
+
addEvent(AxisClass, 'init', onAxisInit);
|
|
187
|
+
addEvent(AxisClass, 'initialAxisTranslation', onAxisInitialAxisTranslation);
|
|
188
|
+
}
|
|
189
|
+
if (composedClasses.indexOf(TickClass) === -1) {
|
|
190
|
+
composedClasses.push(TickClass);
|
|
191
|
+
addEvent(TickClass, 'afterGetLabelPosition', onTickAfterGetLabelPosition);
|
|
192
|
+
addEvent(TickClass, 'afterGetPosition', onTickAfterGetPosition);
|
|
193
|
+
wrap(TickClass.prototype, 'getMarkPath', wrapTickGetMarkPath);
|
|
194
|
+
}
|
|
195
|
+
return AxisClass;
|
|
196
|
+
}
|
|
197
|
+
RadialAxis.compose = compose;
|
|
198
|
+
/**
|
|
199
|
+
* Attach and return collecting function for labels in radial axis for
|
|
200
|
+
* anti-collision.
|
|
201
|
+
*
|
|
202
|
+
* @private
|
|
203
|
+
*
|
|
204
|
+
* @return {Highcharts.ChartLabelCollectorFunction}
|
|
205
|
+
*/
|
|
206
|
+
function createLabelCollector() {
|
|
207
|
+
var _this = this;
|
|
208
|
+
return function () {
|
|
209
|
+
if (_this.isRadial &&
|
|
210
|
+
_this.tickPositions &&
|
|
211
|
+
// undocumented option for now, but working
|
|
212
|
+
_this.options.labels &&
|
|
213
|
+
_this.options.labels.allowOverlap !== true) {
|
|
214
|
+
return _this.tickPositions
|
|
215
|
+
.map(function (pos) {
|
|
216
|
+
return _this.ticks[pos] && _this.ticks[pos].label;
|
|
217
|
+
})
|
|
218
|
+
.filter(function (label) {
|
|
219
|
+
return Boolean(label);
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* Creates an empty collector function.
|
|
226
|
+
* @private
|
|
227
|
+
*/
|
|
228
|
+
function createLabelCollectorHidden() {
|
|
229
|
+
return noop;
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
232
|
+
* Find the correct end values of crosshair in polar.
|
|
233
|
+
* @private
|
|
234
|
+
*/
|
|
235
|
+
function getCrosshairPosition(options, x1, y1) {
|
|
236
|
+
var center = this.pane.center;
|
|
237
|
+
var value = options.value, shapeArgs, end, x2, y2;
|
|
238
|
+
if (this.isCircular) {
|
|
239
|
+
if (!defined(value)) {
|
|
240
|
+
// When the snap is set to false
|
|
241
|
+
x2 = options.chartX || 0;
|
|
242
|
+
y2 = options.chartY || 0;
|
|
243
|
+
value = this.translate(Math.atan2(y2 - y1, x2 - x1) - this.startAngleRad, true);
|
|
244
|
+
}
|
|
245
|
+
else if (options.point) {
|
|
246
|
+
// When the snap is set to true
|
|
247
|
+
shapeArgs = options.point.shapeArgs || {};
|
|
248
|
+
if (shapeArgs.start) {
|
|
249
|
+
// Find a true value of the point based on the
|
|
250
|
+
// angle
|
|
251
|
+
value = this.chart.inverted ?
|
|
252
|
+
this.translate(options.point.rectPlotY, true) :
|
|
253
|
+
options.point.x;
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
end = this.getPosition(value);
|
|
257
|
+
x2 = end.x;
|
|
258
|
+
y2 = end.y;
|
|
259
|
+
}
|
|
260
|
+
else {
|
|
261
|
+
if (!defined(value)) {
|
|
262
|
+
x2 = options.chartX;
|
|
263
|
+
y2 = options.chartY;
|
|
264
|
+
}
|
|
265
|
+
if (defined(x2) && defined(y2)) {
|
|
266
|
+
// Calculate radius of non-circular axis' crosshair
|
|
267
|
+
y1 = center[1] + this.chart.plotTop;
|
|
268
|
+
value = this.translate(Math.min(Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2)), center[2] / 2) - center[3] / 2, true);
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
return [value, x2 || 0, y2 || 0];
|
|
272
|
+
}
|
|
273
|
+
/**
|
|
274
|
+
* Get the path for the axis line. This method is also referenced in the
|
|
275
|
+
* getPlotLinePath method.
|
|
276
|
+
*
|
|
277
|
+
* @private
|
|
278
|
+
*
|
|
279
|
+
* @param {number} _lineWidth
|
|
280
|
+
* Line width is not used.
|
|
281
|
+
*
|
|
282
|
+
* @param {number} [radius]
|
|
283
|
+
* Radius of radial path.
|
|
284
|
+
*
|
|
285
|
+
* @param {number} [innerRadius]
|
|
286
|
+
* Inner radius of radial path.
|
|
287
|
+
*
|
|
288
|
+
* @return {Highcharts.RadialAxisPath}
|
|
289
|
+
*/
|
|
290
|
+
function getLinePath(_lineWidth, radius, innerRadius) {
|
|
291
|
+
var center = this.pane.center, chart = this.chart, left = this.left || 0, top = this.top || 0;
|
|
292
|
+
var end, r = pick(radius, center[2] / 2 - this.offset), path;
|
|
293
|
+
if (typeof innerRadius === 'undefined') {
|
|
294
|
+
innerRadius = this.horiz ? 0 : this.center && -this.center[3] / 2;
|
|
295
|
+
}
|
|
296
|
+
// In case when innerSize of pane is set, it must be included
|
|
297
|
+
if (innerRadius) {
|
|
298
|
+
r += innerRadius;
|
|
299
|
+
}
|
|
300
|
+
if (this.isCircular || typeof radius !== 'undefined') {
|
|
301
|
+
path = this.chart.renderer.symbols.arc(left + center[0], top + center[1], r, r, {
|
|
302
|
+
start: this.startAngleRad,
|
|
303
|
+
end: this.endAngleRad,
|
|
304
|
+
open: true,
|
|
305
|
+
innerR: 0
|
|
306
|
+
});
|
|
307
|
+
// Bounds used to position the plotLine label next to the line
|
|
308
|
+
// (#7117)
|
|
309
|
+
path.xBounds = [left + center[0]];
|
|
310
|
+
path.yBounds = [top + center[1] - r];
|
|
311
|
+
}
|
|
312
|
+
else {
|
|
313
|
+
end = this.postTranslate(this.angleRad, r);
|
|
314
|
+
path = [
|
|
315
|
+
['M', this.center[0] + chart.plotLeft, this.center[1] + chart.plotTop],
|
|
316
|
+
['L', end.x, end.y]
|
|
317
|
+
];
|
|
318
|
+
}
|
|
319
|
+
return path;
|
|
320
|
+
}
|
|
321
|
+
/**
|
|
322
|
+
* Wrap the getOffset method to return zero offset for title or labels
|
|
323
|
+
* in a radial axis.
|
|
324
|
+
*/
|
|
325
|
+
function getOffset() {
|
|
326
|
+
var axisProto = this.constructor.prototype;
|
|
327
|
+
// Call the Axis prototype method (the method we're in now is on the
|
|
328
|
+
// instance)
|
|
329
|
+
axisProto.getOffset.call(this);
|
|
330
|
+
// Title or label offsets are not counted
|
|
331
|
+
this.chart.axisOffset[this.side] = 0;
|
|
332
|
+
}
|
|
333
|
+
/**
|
|
334
|
+
* Find the path for plot bands along the radial axis.
|
|
335
|
+
*
|
|
336
|
+
* @private
|
|
337
|
+
*
|
|
338
|
+
* @param {number} from
|
|
339
|
+
* From value.
|
|
340
|
+
*
|
|
341
|
+
* @param {number} to
|
|
342
|
+
* To value.
|
|
343
|
+
*
|
|
344
|
+
* @param {Highcharts.AxisPlotBandsOptions} options
|
|
345
|
+
* Band options.
|
|
346
|
+
*
|
|
347
|
+
* @return {Highcharts.RadialAxisPath}
|
|
348
|
+
*/
|
|
349
|
+
function getPlotBandPath(from, to, options) {
|
|
350
|
+
var chart = this.chart, radiusToPixels = function (radius) {
|
|
351
|
+
if (typeof radius === 'string') {
|
|
352
|
+
var r = parseInt(radius, 10);
|
|
353
|
+
if (percentRegex.test(radius)) {
|
|
354
|
+
r = (r * fullRadius) / 100;
|
|
355
|
+
}
|
|
356
|
+
return r;
|
|
357
|
+
}
|
|
358
|
+
return radius;
|
|
359
|
+
}, center = this.center, startAngleRad = this.startAngleRad, fullRadius = center[2] / 2, offset = Math.min(this.offset, 0), left = this.left || 0, top = this.top || 0, percentRegex = /%$/, isCircular = this.isCircular; // X axis in a polar chart
|
|
360
|
+
var start, end, angle, xOnPerimeter, open, path, outerRadius = pick(radiusToPixels(options.outerRadius), fullRadius), innerRadius = radiusToPixels(options.innerRadius), thickness = pick(radiusToPixels(options.thickness), 10);
|
|
361
|
+
// Polygonal plot bands
|
|
362
|
+
if (this.options.gridLineInterpolation === 'polygon') {
|
|
363
|
+
path = this.getPlotLinePath({ value: from }).concat(this.getPlotLinePath({ value: to, reverse: true }));
|
|
364
|
+
// Circular grid bands
|
|
365
|
+
}
|
|
366
|
+
else {
|
|
367
|
+
// Keep within bounds
|
|
368
|
+
from = Math.max(from, this.min);
|
|
369
|
+
to = Math.min(to, this.max);
|
|
370
|
+
var transFrom = this.translate(from), transTo = this.translate(to);
|
|
371
|
+
// Plot bands on Y axis (radial axis) - inner and outer
|
|
372
|
+
// radius depend on to and from
|
|
373
|
+
if (!isCircular) {
|
|
374
|
+
outerRadius = transFrom || 0;
|
|
375
|
+
innerRadius = transTo || 0;
|
|
376
|
+
}
|
|
377
|
+
// Handle full circle
|
|
378
|
+
if (options.shape === 'circle' || !isCircular) {
|
|
379
|
+
start = -Math.PI / 2;
|
|
380
|
+
end = Math.PI * 1.5;
|
|
381
|
+
open = true;
|
|
382
|
+
}
|
|
383
|
+
else {
|
|
384
|
+
start = startAngleRad + (transFrom || 0);
|
|
385
|
+
end = startAngleRad + (transTo || 0);
|
|
386
|
+
}
|
|
387
|
+
outerRadius -= offset; // #5283
|
|
388
|
+
thickness -= offset; // #5283
|
|
389
|
+
path = chart.renderer.symbols.arc(left + center[0], top + center[1], outerRadius, outerRadius, {
|
|
390
|
+
// Math is for reversed yAxis (#3606)
|
|
391
|
+
start: Math.min(start, end),
|
|
392
|
+
end: Math.max(start, end),
|
|
393
|
+
innerR: pick(innerRadius, outerRadius - thickness),
|
|
394
|
+
open: open
|
|
395
|
+
});
|
|
396
|
+
// Provide positioning boxes for the label (#6406)
|
|
397
|
+
if (isCircular) {
|
|
398
|
+
angle = (end + start) / 2;
|
|
399
|
+
xOnPerimeter = (left +
|
|
400
|
+
center[0] +
|
|
401
|
+
(center[2] / 2) * Math.cos(angle));
|
|
402
|
+
path.xBounds = angle > -Math.PI / 2 && angle < Math.PI / 2 ?
|
|
403
|
+
// Right hemisphere
|
|
404
|
+
[xOnPerimeter, chart.plotWidth] :
|
|
405
|
+
// Left hemisphere
|
|
406
|
+
[0, xOnPerimeter];
|
|
407
|
+
path.yBounds = [
|
|
408
|
+
top + center[1] + (center[2] / 2) * Math.sin(angle)
|
|
409
|
+
];
|
|
410
|
+
// Shift up or down to get the label clear of the perimeter
|
|
411
|
+
path.yBounds[0] += ((angle > -Math.PI && angle < 0) ||
|
|
412
|
+
(angle > Math.PI)) ? -10 : 10;
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
return path;
|
|
416
|
+
}
|
|
417
|
+
/**
|
|
418
|
+
* Find the path for plot lines perpendicular to the radial axis.
|
|
419
|
+
*/
|
|
420
|
+
function getPlotLinePath(options) {
|
|
421
|
+
var _this = this;
|
|
422
|
+
var center = this.pane.center, chart = this.chart, inverted = chart.inverted, reverse = options.reverse, background = this.pane.options.background ?
|
|
423
|
+
(this.pane.options.background[0] ||
|
|
424
|
+
this.pane.options.background) :
|
|
425
|
+
{}, innerRadius = background.innerRadius || '0%', outerRadius = background.outerRadius || '100%', x1 = center[0] + chart.plotLeft, y1 = center[1] + chart.plotTop, height = this.height, isCrosshair = options.isCrosshair, paneInnerR = center[3] / 2;
|
|
426
|
+
var value = options.value, innerRatio, distance, a, b, otherAxis, xy, tickPositions, crossPos, path;
|
|
427
|
+
var end = this.getPosition(value);
|
|
428
|
+
var x2 = end.x, y2 = end.y;
|
|
429
|
+
// Crosshair logic
|
|
430
|
+
if (isCrosshair) {
|
|
431
|
+
// Find crosshair's position and perform destructuring
|
|
432
|
+
// assignment
|
|
433
|
+
crossPos = this.getCrosshairPosition(options, x1, y1);
|
|
434
|
+
value = crossPos[0];
|
|
435
|
+
x2 = crossPos[1];
|
|
436
|
+
y2 = crossPos[2];
|
|
437
|
+
}
|
|
438
|
+
// Spokes
|
|
439
|
+
if (this.isCircular) {
|
|
440
|
+
distance = Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2));
|
|
441
|
+
a = (typeof innerRadius === 'string') ?
|
|
442
|
+
relativeLength(innerRadius, 1) :
|
|
443
|
+
(innerRadius / distance);
|
|
444
|
+
b = (typeof outerRadius === 'string') ?
|
|
445
|
+
relativeLength(outerRadius, 1) :
|
|
446
|
+
(outerRadius / distance);
|
|
447
|
+
// To ensure that gridlines won't be displayed in area
|
|
448
|
+
// defined by innerSize in case of custom radiuses of pane's
|
|
449
|
+
// background
|
|
450
|
+
if (center && paneInnerR) {
|
|
451
|
+
innerRatio = paneInnerR / distance;
|
|
452
|
+
if (a < innerRatio) {
|
|
453
|
+
a = innerRatio;
|
|
454
|
+
}
|
|
455
|
+
if (b < innerRatio) {
|
|
456
|
+
b = innerRatio;
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
path = [
|
|
460
|
+
['M', x1 + a * (x2 - x1), y1 - a * (y1 - y2)],
|
|
461
|
+
['L', x2 - (1 - b) * (x2 - x1), y2 + (1 - b) * (y1 - y2)]
|
|
462
|
+
];
|
|
463
|
+
// Concentric circles
|
|
464
|
+
}
|
|
465
|
+
else {
|
|
466
|
+
// Pick the right values depending if it is grid line or
|
|
467
|
+
// crosshair
|
|
468
|
+
value = this.translate(value);
|
|
469
|
+
// This is required in case when xAxis is non-circular to
|
|
470
|
+
// prevent grid lines (or crosshairs, if enabled) from
|
|
471
|
+
// rendering above the center after they supposed to be
|
|
472
|
+
// displayed below the center point
|
|
473
|
+
if (value) {
|
|
474
|
+
if (value < 0 || value > height) {
|
|
475
|
+
value = 0;
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
if (this.options.gridLineInterpolation === 'circle') {
|
|
479
|
+
// A value of 0 is in the center, so it won't be
|
|
480
|
+
// visible, but draw it anyway for update and animation
|
|
481
|
+
// (#2366)
|
|
482
|
+
path = this.getLinePath(0, value, paneInnerR);
|
|
483
|
+
// Concentric polygons
|
|
484
|
+
}
|
|
485
|
+
else {
|
|
486
|
+
path = [];
|
|
487
|
+
// Find the other axis (a circular one) in the same pane
|
|
488
|
+
chart[inverted ? 'yAxis' : 'xAxis'].forEach(function (a) {
|
|
489
|
+
if (a.pane === _this.pane) {
|
|
490
|
+
otherAxis = a;
|
|
491
|
+
}
|
|
492
|
+
});
|
|
493
|
+
if (otherAxis) {
|
|
494
|
+
tickPositions = otherAxis.tickPositions;
|
|
495
|
+
if (otherAxis.autoConnect) {
|
|
496
|
+
tickPositions =
|
|
497
|
+
tickPositions.concat([tickPositions[0]]);
|
|
498
|
+
}
|
|
499
|
+
// Reverse the positions for concatenation of polygonal
|
|
500
|
+
// plot bands
|
|
501
|
+
if (reverse) {
|
|
502
|
+
tickPositions = tickPositions.slice().reverse();
|
|
503
|
+
}
|
|
504
|
+
if (value) {
|
|
505
|
+
value += paneInnerR;
|
|
506
|
+
}
|
|
507
|
+
for (var i = 0; i < tickPositions.length; i++) {
|
|
508
|
+
xy = otherAxis.getPosition(tickPositions[i], value);
|
|
509
|
+
path.push(i ? ['L', xy.x, xy.y] : ['M', xy.x, xy.y]);
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
return path;
|
|
515
|
+
}
|
|
516
|
+
/**
|
|
517
|
+
* Returns the x, y coordinate of a point given by a value and a pixel
|
|
518
|
+
* distance from center.
|
|
519
|
+
*
|
|
520
|
+
* @private
|
|
521
|
+
*
|
|
522
|
+
* @param {number} value
|
|
523
|
+
* Point value.
|
|
524
|
+
*
|
|
525
|
+
* @param {number} [length]
|
|
526
|
+
* Distance from center.
|
|
527
|
+
*
|
|
528
|
+
* @return {Highcharts.PositionObject}
|
|
529
|
+
*/
|
|
530
|
+
function getPosition(value, length) {
|
|
531
|
+
var translatedVal = this.translate(value);
|
|
532
|
+
return this.postTranslate(this.isCircular ? translatedVal : this.angleRad, // #2848
|
|
533
|
+
// In case when translatedVal is negative, the 0 value must be
|
|
534
|
+
// used instead, in order to deal with lines and labels that
|
|
535
|
+
// fall out of the visible range near the center of a pane
|
|
536
|
+
pick(this.isCircular ?
|
|
537
|
+
length :
|
|
538
|
+
(translatedVal < 0 ? 0 : translatedVal), this.center[2] / 2) - this.offset);
|
|
539
|
+
}
|
|
540
|
+
/**
|
|
541
|
+
* Find the position for the axis title, by default inside the gauge.
|
|
542
|
+
*/
|
|
543
|
+
function getTitlePosition() {
|
|
544
|
+
var center = this.center, chart = this.chart, titleOptions = this.options.title;
|
|
545
|
+
return {
|
|
546
|
+
x: chart.plotLeft + center[0] + (titleOptions.x || 0),
|
|
547
|
+
y: (chart.plotTop +
|
|
548
|
+
center[1] -
|
|
549
|
+
({
|
|
550
|
+
high: 0.5,
|
|
551
|
+
middle: 0.25,
|
|
552
|
+
low: 0
|
|
553
|
+
}[titleOptions.align] *
|
|
554
|
+
center[2]) +
|
|
555
|
+
(titleOptions.y || 0))
|
|
556
|
+
};
|
|
557
|
+
}
|
|
558
|
+
/**
|
|
559
|
+
* Modify radial axis.
|
|
560
|
+
* @private
|
|
561
|
+
*
|
|
562
|
+
* @param {Highcharts.Axis} radialAxis
|
|
563
|
+
* Radial axis to modify.
|
|
564
|
+
*/
|
|
565
|
+
function modify(axis) {
|
|
566
|
+
axis.beforeSetTickPositions = beforeSetTickPositions;
|
|
567
|
+
axis.createLabelCollector = createLabelCollector;
|
|
568
|
+
axis.getCrosshairPosition = getCrosshairPosition;
|
|
569
|
+
axis.getLinePath = getLinePath;
|
|
570
|
+
axis.getOffset = getOffset;
|
|
571
|
+
axis.getPlotBandPath = getPlotBandPath;
|
|
572
|
+
axis.getPlotLinePath = getPlotLinePath;
|
|
573
|
+
axis.getPosition = getPosition;
|
|
574
|
+
axis.getTitlePosition = getTitlePosition;
|
|
575
|
+
axis.postTranslate = postTranslate;
|
|
576
|
+
axis.setAxisSize = setAxisSize;
|
|
577
|
+
axis.setAxisTranslation = setAxisTranslation;
|
|
578
|
+
axis.setOptions = setOptions;
|
|
579
|
+
}
|
|
580
|
+
/**
|
|
581
|
+
* Modify radial axis as hidden.
|
|
582
|
+
* @private
|
|
583
|
+
*
|
|
584
|
+
* @param {Highcharts.Axis} radialAxis
|
|
585
|
+
* Radial axis to modify.
|
|
586
|
+
*/
|
|
587
|
+
function modifyAsHidden(radialAxis) {
|
|
588
|
+
radialAxis.isHidden = true;
|
|
589
|
+
radialAxis.createLabelCollector = createLabelCollectorHidden;
|
|
590
|
+
radialAxis.getOffset = noop;
|
|
591
|
+
radialAxis.redraw = renderHidden;
|
|
592
|
+
radialAxis.render = renderHidden;
|
|
593
|
+
radialAxis.setScale = noop;
|
|
594
|
+
radialAxis.setCategories = noop;
|
|
595
|
+
radialAxis.setTitle = noop;
|
|
596
|
+
}
|
|
597
|
+
/**
|
|
598
|
+
* Finalize modification of axis instance with radial logic.
|
|
599
|
+
*/
|
|
600
|
+
function onAxisAfterInit() {
|
|
601
|
+
var chart = this.chart, options = this.options, isHidden = chart.angular && this.isXAxis, pane = this.pane, paneOptions = pane && pane.options;
|
|
602
|
+
if (!isHidden && pane && (chart.angular || chart.polar)) {
|
|
603
|
+
// Start and end angle options are given in degrees relative to
|
|
604
|
+
// top, while internal computations are in radians relative to
|
|
605
|
+
// right (like SVG).
|
|
606
|
+
// Y axis in polar charts
|
|
607
|
+
this.angleRad = (options.angle || 0) * Math.PI / 180;
|
|
608
|
+
// Gauges
|
|
609
|
+
this.startAngleRad =
|
|
610
|
+
(paneOptions.startAngle - 90) * Math.PI / 180;
|
|
611
|
+
this.endAngleRad = (pick(paneOptions.endAngle, paneOptions.startAngle + 360) - 90) * Math.PI / 180; // Gauges
|
|
612
|
+
this.offset = options.offset || 0;
|
|
613
|
+
}
|
|
614
|
+
}
|
|
615
|
+
/**
|
|
616
|
+
* Wrap auto label align to avoid setting axis-wide rotation on radial axes.
|
|
617
|
+
* (#4920)
|
|
618
|
+
*/
|
|
619
|
+
function onAxisAutoLabelAlign(e) {
|
|
620
|
+
if (this.isRadial) {
|
|
621
|
+
e.align = void 0;
|
|
622
|
+
e.preventDefault();
|
|
623
|
+
}
|
|
624
|
+
}
|
|
625
|
+
/**
|
|
626
|
+
* Remove label collector function on axis remove/update.
|
|
627
|
+
*/
|
|
628
|
+
function onAxisDestroy() {
|
|
629
|
+
if (this.chart &&
|
|
630
|
+
this.chart.labelCollectors) {
|
|
631
|
+
var index = (this.labelCollector ?
|
|
632
|
+
this.chart.labelCollectors.indexOf(this.labelCollector) :
|
|
633
|
+
-1);
|
|
634
|
+
if (index >= 0) {
|
|
635
|
+
this.chart.labelCollectors.splice(index, 1);
|
|
636
|
+
}
|
|
637
|
+
}
|
|
638
|
+
}
|
|
639
|
+
/**
|
|
640
|
+
* Modify axis instance with radial logic before common axis init.
|
|
641
|
+
*/
|
|
642
|
+
function onAxisInit(e) {
|
|
643
|
+
var chart = this.chart, inverted = chart.inverted, angular = chart.angular, polar = chart.polar, isX = this.isXAxis, coll = this.coll, isHidden = angular && isX, chartOptions = chart.options, paneIndex = e.userOptions.pane || 0, pane = this.pane = chart.pane && chart.pane[paneIndex];
|
|
644
|
+
var isCircular;
|
|
645
|
+
// Prevent changes for colorAxis
|
|
646
|
+
if (coll === 'colorAxis') {
|
|
647
|
+
this.isRadial = false;
|
|
648
|
+
return;
|
|
649
|
+
}
|
|
650
|
+
// Before prototype.init
|
|
651
|
+
if (angular) {
|
|
652
|
+
if (isHidden) {
|
|
653
|
+
modifyAsHidden(this);
|
|
654
|
+
}
|
|
655
|
+
else {
|
|
656
|
+
modify(this);
|
|
657
|
+
}
|
|
658
|
+
isCircular = !isX;
|
|
659
|
+
if (isCircular) {
|
|
660
|
+
this.defaultPolarOptions = defaultRadialGaugeOptions;
|
|
661
|
+
}
|
|
662
|
+
}
|
|
663
|
+
else if (polar) {
|
|
664
|
+
modify(this);
|
|
665
|
+
// Check which axis is circular
|
|
666
|
+
isCircular = this.horiz;
|
|
667
|
+
this.defaultPolarOptions = isCircular ?
|
|
668
|
+
defaultCircularOptions :
|
|
669
|
+
merge(coll === 'xAxis' ?
|
|
670
|
+
AxisDefaults.defaultXAxisOptions :
|
|
671
|
+
AxisDefaults.defaultYAxisOptions, defaultRadialOptions);
|
|
672
|
+
// Apply the stack labels for yAxis in case of inverted chart
|
|
673
|
+
if (inverted && coll === 'yAxis') {
|
|
674
|
+
this.defaultPolarOptions.stackLabels = AxisDefaults.defaultYAxisOptions.stackLabels;
|
|
675
|
+
this.defaultPolarOptions.reversedStacks = true;
|
|
676
|
+
}
|
|
677
|
+
}
|
|
678
|
+
// Disable certain features on angular and polar axes
|
|
679
|
+
if (angular || polar) {
|
|
680
|
+
this.isRadial = true;
|
|
681
|
+
chartOptions.chart.zoomType = null;
|
|
682
|
+
if (!this.labelCollector) {
|
|
683
|
+
this.labelCollector = this.createLabelCollector();
|
|
684
|
+
}
|
|
685
|
+
if (this.labelCollector) {
|
|
686
|
+
// Prevent overlapping axis labels (#9761)
|
|
687
|
+
chart.labelCollectors.push(this.labelCollector);
|
|
688
|
+
}
|
|
689
|
+
}
|
|
690
|
+
else {
|
|
691
|
+
this.isRadial = false;
|
|
692
|
+
}
|
|
693
|
+
// A pointer back to this axis to borrow geometry
|
|
694
|
+
if (pane && isCircular) {
|
|
695
|
+
pane.axis = this;
|
|
696
|
+
}
|
|
697
|
+
this.isCircular = isCircular;
|
|
698
|
+
}
|
|
699
|
+
/**
|
|
700
|
+
* Prepare axis translation.
|
|
701
|
+
*/
|
|
702
|
+
function onAxisInitialAxisTranslation() {
|
|
703
|
+
if (this.isRadial) {
|
|
704
|
+
this.beforeSetTickPositions();
|
|
705
|
+
}
|
|
706
|
+
}
|
|
707
|
+
/**
|
|
708
|
+
* Find the center position of the label based on the distance option.
|
|
709
|
+
*/
|
|
710
|
+
function onTickAfterGetLabelPosition(e) {
|
|
711
|
+
var label = this.label;
|
|
712
|
+
if (!label) {
|
|
713
|
+
return;
|
|
714
|
+
}
|
|
715
|
+
var axis = this.axis, labelBBox = label.getBBox(), labelOptions = axis.options.labels, angle = ((axis.translate(this.pos) + axis.startAngleRad +
|
|
716
|
+
Math.PI / 2) / Math.PI * 180) % 360, correctAngle = Math.round(angle), labelYPosCorrection = !defined(labelOptions.y) ? -labelBBox.height * 0.3 : 0;
|
|
717
|
+
var optionsY = labelOptions.y, ret, centerSlot = 20, // 20 degrees to each side at the top and bottom
|
|
718
|
+
align = labelOptions.align, labelDir = 'end', // Direction of the label 'start' or 'end'
|
|
719
|
+
reducedAngle1 = correctAngle < 0 ?
|
|
720
|
+
correctAngle + 360 : correctAngle, reducedAngle2 = reducedAngle1, translateY = 0, translateX = 0;
|
|
721
|
+
if (axis.isRadial) { // Both X and Y axes in a polar chart
|
|
722
|
+
ret = axis.getPosition(this.pos, (axis.center[2] / 2) +
|
|
723
|
+
relativeLength(pick(labelOptions.distance, -25), axis.center[2] / 2, -axis.center[2] / 2));
|
|
724
|
+
// Automatically rotated
|
|
725
|
+
if (labelOptions.rotation === 'auto') {
|
|
726
|
+
label.attr({
|
|
727
|
+
rotation: angle
|
|
728
|
+
});
|
|
729
|
+
// Vertically centered
|
|
730
|
+
}
|
|
731
|
+
else if (!defined(optionsY)) {
|
|
732
|
+
optionsY = (axis.chart.renderer
|
|
733
|
+
.fontMetrics(label.styles && label.styles.fontSize).b -
|
|
734
|
+
labelBBox.height / 2);
|
|
735
|
+
}
|
|
736
|
+
// Automatic alignment
|
|
737
|
+
if (!defined(align)) {
|
|
738
|
+
if (axis.isCircular) { // Y axis
|
|
739
|
+
if (labelBBox.width >
|
|
740
|
+
axis.len * axis.tickInterval / (axis.max - axis.min)) { // #3506
|
|
741
|
+
centerSlot = 0;
|
|
742
|
+
}
|
|
743
|
+
if (angle > centerSlot && angle < 180 - centerSlot) {
|
|
744
|
+
align = 'left'; // right hemisphere
|
|
745
|
+
}
|
|
746
|
+
else if (angle > 180 + centerSlot &&
|
|
747
|
+
angle < 360 - centerSlot) {
|
|
748
|
+
align = 'right'; // left hemisphere
|
|
749
|
+
}
|
|
750
|
+
else {
|
|
751
|
+
align = 'center'; // top or bottom
|
|
752
|
+
}
|
|
753
|
+
}
|
|
754
|
+
else {
|
|
755
|
+
align = 'center';
|
|
756
|
+
}
|
|
757
|
+
label.attr({
|
|
758
|
+
align: align
|
|
759
|
+
});
|
|
760
|
+
}
|
|
761
|
+
// Auto alignment for solid-gauges with two labels (#10635)
|
|
762
|
+
if (align === 'auto' &&
|
|
763
|
+
axis.tickPositions.length === 2 &&
|
|
764
|
+
axis.isCircular) {
|
|
765
|
+
// Angles reduced to 0 - 90 or 180 - 270
|
|
766
|
+
if (reducedAngle1 > 90 && reducedAngle1 < 180) {
|
|
767
|
+
reducedAngle1 = 180 - reducedAngle1;
|
|
768
|
+
}
|
|
769
|
+
else if (reducedAngle1 > 270 && reducedAngle1 <= 360) {
|
|
770
|
+
reducedAngle1 = 540 - reducedAngle1;
|
|
771
|
+
}
|
|
772
|
+
// Angles reduced to 0 - 180
|
|
773
|
+
if (reducedAngle2 > 180 && reducedAngle2 <= 360) {
|
|
774
|
+
reducedAngle2 = 360 - reducedAngle2;
|
|
775
|
+
}
|
|
776
|
+
if ((axis.pane.options.startAngle === correctAngle) ||
|
|
777
|
+
(axis.pane.options.startAngle === correctAngle + 360) ||
|
|
778
|
+
(axis.pane.options.startAngle === correctAngle - 360)) {
|
|
779
|
+
labelDir = 'start';
|
|
780
|
+
}
|
|
781
|
+
if ((correctAngle >= -90 && correctAngle <= 90) ||
|
|
782
|
+
(correctAngle >= -360 && correctAngle <= -270) ||
|
|
783
|
+
(correctAngle >= 270 && correctAngle <= 360)) {
|
|
784
|
+
align = (labelDir === 'start') ? 'right' : 'left';
|
|
785
|
+
}
|
|
786
|
+
else {
|
|
787
|
+
align = (labelDir === 'start') ? 'left' : 'right';
|
|
788
|
+
}
|
|
789
|
+
// For angles beetwen (90 + n * 180) +- 20
|
|
790
|
+
if (reducedAngle2 > 70 && reducedAngle2 < 110) {
|
|
791
|
+
align = 'center';
|
|
792
|
+
}
|
|
793
|
+
// auto Y translation
|
|
794
|
+
if (reducedAngle1 < 15 ||
|
|
795
|
+
(reducedAngle1 >= 180 && reducedAngle1 < 195)) {
|
|
796
|
+
translateY = labelBBox.height * 0.3;
|
|
797
|
+
}
|
|
798
|
+
else if (reducedAngle1 >= 15 && reducedAngle1 <= 35) {
|
|
799
|
+
translateY = labelDir === 'start' ?
|
|
800
|
+
0 : labelBBox.height * 0.75;
|
|
801
|
+
}
|
|
802
|
+
else if (reducedAngle1 >= 195 && reducedAngle1 <= 215) {
|
|
803
|
+
translateY = labelDir === 'start' ?
|
|
804
|
+
labelBBox.height * 0.75 : 0;
|
|
805
|
+
}
|
|
806
|
+
else if (reducedAngle1 > 35 && reducedAngle1 <= 90) {
|
|
807
|
+
translateY = labelDir === 'start' ?
|
|
808
|
+
-labelBBox.height * 0.25 : labelBBox.height;
|
|
809
|
+
}
|
|
810
|
+
else if (reducedAngle1 > 215 && reducedAngle1 <= 270) {
|
|
811
|
+
translateY = labelDir === 'start' ?
|
|
812
|
+
labelBBox.height : -labelBBox.height * 0.25;
|
|
813
|
+
}
|
|
814
|
+
// auto X translation
|
|
815
|
+
if (reducedAngle2 < 15) {
|
|
816
|
+
translateX = labelDir === 'start' ?
|
|
817
|
+
-labelBBox.height * 0.15 : labelBBox.height * 0.15;
|
|
818
|
+
}
|
|
819
|
+
else if (reducedAngle2 > 165 && reducedAngle2 <= 180) {
|
|
820
|
+
translateX = labelDir === 'start' ?
|
|
821
|
+
labelBBox.height * 0.15 : -labelBBox.height * 0.15;
|
|
822
|
+
}
|
|
823
|
+
label.attr({ align: align });
|
|
824
|
+
label.translate(translateX, translateY + labelYPosCorrection);
|
|
825
|
+
}
|
|
826
|
+
e.pos.x = ret.x + (labelOptions.x || 0);
|
|
827
|
+
e.pos.y = ret.y + (optionsY || 0);
|
|
828
|
+
}
|
|
829
|
+
}
|
|
830
|
+
/**
|
|
831
|
+
* Add special cases within the Tick class' methods for radial axes.
|
|
832
|
+
*/
|
|
833
|
+
function onTickAfterGetPosition(e) {
|
|
834
|
+
if (this.axis.getPosition) {
|
|
835
|
+
extend(e.pos, this.axis.getPosition(this.pos));
|
|
836
|
+
}
|
|
837
|
+
}
|
|
838
|
+
/**
|
|
839
|
+
* Translate from intermediate plotX (angle), plotY (axis.len - radius)
|
|
840
|
+
* to final chart coordinates.
|
|
841
|
+
*
|
|
842
|
+
* @private
|
|
843
|
+
*
|
|
844
|
+
* @param {number} angle
|
|
845
|
+
* Translation angle.
|
|
846
|
+
*
|
|
847
|
+
* @param {number} radius
|
|
848
|
+
* Translation radius.
|
|
849
|
+
*
|
|
850
|
+
* @return {Highcharts.PositionObject}
|
|
851
|
+
*/
|
|
852
|
+
function postTranslate(angle, radius) {
|
|
853
|
+
var chart = this.chart, center = this.center;
|
|
854
|
+
angle = this.startAngleRad + angle;
|
|
855
|
+
return {
|
|
856
|
+
x: chart.plotLeft + center[0] + Math.cos(angle) * radius,
|
|
857
|
+
y: chart.plotTop + center[1] + Math.sin(angle) * radius
|
|
858
|
+
};
|
|
859
|
+
}
|
|
860
|
+
/**
|
|
861
|
+
* Prevent setting Y axis dirty.
|
|
862
|
+
*/
|
|
863
|
+
function renderHidden() {
|
|
864
|
+
this.isDirty = false;
|
|
865
|
+
}
|
|
866
|
+
/**
|
|
867
|
+
* Override the setAxisSize method to use the arc's circumference as
|
|
868
|
+
* length. This allows tickPixelInterval to apply to pixel lengths along
|
|
869
|
+
* the perimeter.
|
|
870
|
+
* @private
|
|
871
|
+
*/
|
|
872
|
+
function setAxisSize() {
|
|
873
|
+
var axisProto = this.constructor.prototype;
|
|
874
|
+
var center, start;
|
|
875
|
+
axisProto.setAxisSize.call(this);
|
|
876
|
+
if (this.isRadial) {
|
|
877
|
+
// Set the center array
|
|
878
|
+
this.pane.updateCenter(this);
|
|
879
|
+
// In case when the innerSize is set in a polar chart, the axis'
|
|
880
|
+
// center cannot be a reference to pane's center
|
|
881
|
+
center = this.center = this.pane.center.slice();
|
|
882
|
+
// The sector is used in Axis.translate to compute the
|
|
883
|
+
// translation of reversed axis points (#2570)
|
|
884
|
+
if (this.isCircular) {
|
|
885
|
+
this.sector = this.endAngleRad - this.startAngleRad;
|
|
886
|
+
}
|
|
887
|
+
else {
|
|
888
|
+
// When the pane's startAngle or the axis' angle is set then
|
|
889
|
+
// new x and y values for vertical axis' center must be
|
|
890
|
+
// calulated
|
|
891
|
+
start = this.postTranslate(this.angleRad, center[3] / 2);
|
|
892
|
+
center[0] = start.x - this.chart.plotLeft;
|
|
893
|
+
center[1] = start.y - this.chart.plotTop;
|
|
894
|
+
}
|
|
895
|
+
// Axis len is used to lay out the ticks
|
|
896
|
+
this.len = this.width = this.height =
|
|
897
|
+
(center[2] - center[3]) * pick(this.sector, 1) / 2;
|
|
898
|
+
}
|
|
899
|
+
}
|
|
900
|
+
/**
|
|
901
|
+
* Override setAxisTranslation by setting the translation to the
|
|
902
|
+
* difference in rotation. This allows the translate method to return
|
|
903
|
+
* angle for any given value.
|
|
904
|
+
*
|
|
905
|
+
* @private
|
|
906
|
+
*/
|
|
907
|
+
function setAxisTranslation() {
|
|
908
|
+
var axisProto = this.constructor.prototype;
|
|
909
|
+
// Call uber method
|
|
910
|
+
axisProto.setAxisTranslation.call(this);
|
|
911
|
+
// Set transA and minPixelPadding
|
|
912
|
+
if (this.center) { // it's not defined the first time
|
|
913
|
+
if (this.isCircular) {
|
|
914
|
+
this.transA = (this.endAngleRad - this.startAngleRad) /
|
|
915
|
+
((this.max - this.min) || 1);
|
|
916
|
+
}
|
|
917
|
+
else {
|
|
918
|
+
// The transA here is the length of the axis, so in case
|
|
919
|
+
// of inner radius, the length must be decreased by it
|
|
920
|
+
this.transA = ((this.center[2] - this.center[3]) / 2) /
|
|
921
|
+
((this.max - this.min) || 1);
|
|
922
|
+
}
|
|
923
|
+
if (this.isXAxis) {
|
|
924
|
+
this.minPixelPadding = this.transA * this.minPointOffset;
|
|
925
|
+
}
|
|
926
|
+
else {
|
|
927
|
+
// This is a workaround for regression #2593, but categories
|
|
928
|
+
// still don't position correctly.
|
|
929
|
+
this.minPixelPadding = 0;
|
|
930
|
+
}
|
|
931
|
+
}
|
|
932
|
+
}
|
|
933
|
+
/**
|
|
934
|
+
* Merge and set options.
|
|
935
|
+
*/
|
|
936
|
+
function setOptions(userOptions) {
|
|
937
|
+
var options = this.options = merge(this.constructor.defaultOptions, this.defaultPolarOptions, defaultOptions[this.coll], // #16112
|
|
938
|
+
userOptions);
|
|
939
|
+
// Make sure the plotBands array is instanciated for each Axis
|
|
940
|
+
// (#2649)
|
|
941
|
+
if (!options.plotBands) {
|
|
942
|
+
options.plotBands = [];
|
|
943
|
+
}
|
|
944
|
+
fireEvent(this, 'afterSetOptions');
|
|
945
|
+
}
|
|
946
|
+
/**
|
|
947
|
+
* Wrap the getMarkPath function to return the path of the radial marker.
|
|
948
|
+
*/
|
|
949
|
+
function wrapTickGetMarkPath(proceed, x, y, tickLength, tickWidth, horiz, renderer) {
|
|
950
|
+
var axis = this.axis;
|
|
951
|
+
var endPoint, ret;
|
|
952
|
+
if (axis.isRadial) {
|
|
953
|
+
endPoint = axis.getPosition(this.pos, axis.center[2] / 2 + tickLength);
|
|
954
|
+
ret = [
|
|
955
|
+
'M',
|
|
956
|
+
x,
|
|
957
|
+
y,
|
|
958
|
+
'L',
|
|
959
|
+
endPoint.x,
|
|
960
|
+
endPoint.y
|
|
961
|
+
];
|
|
962
|
+
}
|
|
963
|
+
else {
|
|
964
|
+
ret = proceed.call(this, x, y, tickLength, tickWidth, horiz, renderer);
|
|
965
|
+
}
|
|
966
|
+
return ret;
|
|
967
|
+
}
|
|
968
|
+
/* eslint-enable valid-jsdoc */
|
|
969
|
+
})(RadialAxis || (RadialAxis = {}));
|
|
970
|
+
/* *
|
|
971
|
+
*
|
|
972
|
+
* Default Export
|
|
973
|
+
*
|
|
974
|
+
* */
|
|
862
975
|
export default RadialAxis;
|