highcharts 6.1.4 → 6.2.0
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/highcharts.css +17 -0
- package/css/highcharts.scss +14 -0
- package/css/themes/dark-unica.css +17 -0
- package/css/themes/grid-light.css +17 -0
- package/css/themes/sand-signika.css +17 -0
- package/es-modules/indicators/momentum.src.js +1 -1
- package/es-modules/indicators/pivot-points.src.js +6 -1
- package/es-modules/masters/highcharts-gantt.src.js +11 -0
- package/es-modules/masters/modules/annotations.src.js +1 -1
- package/es-modules/masters/modules/arrow-symbols.src.js +12 -0
- package/es-modules/masters/modules/broken-axis.src.js +1 -1
- package/es-modules/masters/modules/current-date-indicator.src.js +12 -0
- package/es-modules/masters/modules/data.src.js +1 -1
- package/es-modules/masters/modules/draggable-points.src.js +9 -0
- package/es-modules/masters/modules/export-data.src.js +1 -1
- package/es-modules/masters/modules/exporting.src.js +1 -1
- package/es-modules/masters/modules/funnel.src.js +1 -1
- package/es-modules/masters/modules/gantt.src.js +2 -1
- package/es-modules/masters/modules/grid-axis.src.js +1 -1
- package/es-modules/masters/modules/heatmap.src.js +1 -1
- package/es-modules/masters/modules/item-series.src.js +1 -1
- package/es-modules/masters/modules/map.src.js +1 -1
- package/es-modules/masters/modules/overlapping-datalabels.src.js +1 -1
- package/es-modules/masters/modules/pathfinder.src.js +12 -0
- 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/stock.src.js +1 -1
- package/es-modules/masters/modules/streamgraph.src.js +1 -1
- package/es-modules/masters/modules/treegrid.src.js +12 -0
- 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/windbarb.src.js +1 -1
- package/es-modules/masters/modules/xrange.src.js +1 -1
- package/es-modules/masters/themes/dark-blue.src.js +1 -1
- package/es-modules/masters/themes/dark-green.src.js +1 -1
- package/es-modules/masters/themes/dark-unica.src.js +1 -1
- package/es-modules/masters/themes/gray.src.js +1 -1
- package/es-modules/masters/themes/grid-light.src.js +1 -1
- package/es-modules/masters/themes/grid.src.js +1 -1
- package/es-modules/masters/themes/sand-signika.src.js +1 -1
- package/es-modules/masters/themes/skies.src.js +1 -1
- package/es-modules/mixins/centered-series.js +1 -1
- package/es-modules/mixins/on-series.js +1 -1
- package/es-modules/modules/boost.src.js +22 -14
- package/es-modules/modules/broken-axis.src.js +169 -134
- package/es-modules/modules/data.src.js +2 -2
- package/es-modules/modules/draggable-points.src.js +2257 -0
- package/es-modules/modules/drilldown.src.js +1 -0
- package/es-modules/modules/export-data.src.js +1 -1
- package/es-modules/modules/exporting.src.js +1 -1
- package/es-modules/modules/funnel.src.js +1 -1
- package/es-modules/modules/item-series.src.js +1 -1
- package/es-modules/modules/no-data-to-display.src.js +5 -5
- package/es-modules/modules/oldie.src.js +1 -1
- package/es-modules/modules/overlapping-datalabels.src.js +38 -22
- package/es-modules/modules/parallel-coordinates.src.js +3 -2
- package/es-modules/modules/sankey.src.js +1 -1
- package/es-modules/modules/series-label.src.js +2 -2
- package/es-modules/modules/solid-gauge.src.js +1 -1
- package/es-modules/modules/static-scale.src.js +67 -28
- package/es-modules/modules/streamgraph.src.js +1 -1
- package/es-modules/modules/tilemap.src.js +231 -134
- package/es-modules/modules/variwide.src.js +1 -1
- package/es-modules/modules/vector.src.js +92 -22
- package/es-modules/modules/windbarb.src.js +1 -1
- package/es-modules/modules/xrange.src.js +257 -77
- package/es-modules/parts/AreaSeries.js +77 -77
- package/es-modules/parts/AreaSplineSeries.js +64 -27
- package/es-modules/parts/Axis.js +160 -67
- package/es-modules/parts/BarSeries.js +68 -51
- package/es-modules/parts/CandlestickSeries.js +1 -1
- package/es-modules/parts/Chart.js +31 -55
- package/es-modules/parts/Color.js +29 -18
- package/es-modules/parts/ColumnSeries.js +264 -142
- package/es-modules/parts/DataGrouping.js +9 -6
- package/es-modules/parts/DataLabels.js +261 -210
- package/es-modules/parts/DateTimeAxis.js +26 -7
- package/es-modules/parts/Dynamics.js +5 -2
- package/es-modules/parts/FlagsSeries.js +1 -1
- package/es-modules/parts/Globals.js +1 -1
- package/es-modules/parts/Html.js +64 -12
- package/es-modules/parts/Interaction.js +187 -63
- package/es-modules/parts/Legend.js +7 -3
- package/es-modules/parts/LogarithmicAxis.js +35 -4
- package/es-modules/parts/MSPointer.js +1 -1
- package/es-modules/parts/Navigator.js +27 -5
- package/es-modules/parts/OHLCSeries.js +1 -1
- package/es-modules/parts/Options.js +15 -13
- package/es-modules/parts/OrdinalAxis.js +1 -1
- package/es-modules/parts/PieSeries.js +256 -140
- package/es-modules/parts/PlotBandSeries.experimental.js +1 -1
- package/es-modules/parts/PlotLineOrBand.js +7 -40
- package/es-modules/parts/Point.js +28 -4
- package/es-modules/parts/Pointer.js +8 -6
- package/es-modules/parts/RangeSelector.js +1 -1
- package/es-modules/parts/Responsive.js +82 -36
- package/es-modules/parts/ScatterSeries.js +57 -25
- package/es-modules/parts/ScrollablePlotArea.js +17 -7
- package/es-modules/parts/Scrollbar.js +9 -2
- package/es-modules/parts/Series.js +22 -9
- package/es-modules/parts/SplineSeries.js +51 -29
- package/es-modules/parts/Stacking.js +100 -6
- package/es-modules/parts/StockChart.js +9 -3
- package/es-modules/parts/SvgRenderer.js +15 -10
- package/es-modules/parts/Tick.js +150 -30
- package/es-modules/parts/Time.js +23 -5
- package/es-modules/parts/Tooltip.js +2 -2
- package/es-modules/parts/TouchPointer.js +1 -1
- package/es-modules/parts/Utilities.js +16 -1
- package/es-modules/parts-3d/Axis.js +1 -1
- package/es-modules/parts-3d/Chart.js +1 -1
- package/es-modules/parts-3d/Column.js +1 -1
- package/es-modules/parts-3d/Math.js +1 -1
- package/es-modules/parts-3d/Pie.js +1 -1
- package/es-modules/parts-3d/SVGRenderer.js +1 -1
- package/es-modules/parts-3d/Scatter.js +1 -1
- package/es-modules/parts-3d/Series.js +1 -1
- package/es-modules/parts-3d/VMLRenderer.js +1 -1
- package/es-modules/parts-gantt/ArrowSymbols.js +110 -0
- package/es-modules/parts-gantt/CurrentDateIndicator.js +92 -0
- package/es-modules/parts-gantt/GanttChart.js +111 -0
- package/es-modules/parts-gantt/GanttSeries.js +376 -0
- package/es-modules/parts-gantt/GridAxis.js +965 -0
- package/es-modules/parts-gantt/Pathfinder.js +1247 -0
- package/es-modules/parts-gantt/PathfinderAlgorithms.js +746 -0
- package/es-modules/parts-gantt/Tree.js +146 -0
- package/es-modules/parts-gantt/TreeGrid.js +917 -0
- package/es-modules/parts-map/ColorAxis.js +1 -1
- package/es-modules/parts-map/ColorSeriesMixin.js +1 -1
- package/es-modules/parts-map/GeoJSON.js +1 -1
- package/es-modules/parts-map/HeatmapSeries.js +124 -53
- package/es-modules/parts-map/Map.js +1 -1
- package/es-modules/parts-map/MapAxis.js +1 -1
- package/es-modules/parts-map/MapBubbleSeries.js +1 -1
- package/es-modules/parts-map/MapLineSeries.js +1 -1
- package/es-modules/parts-map/MapNavigation.js +1 -1
- package/es-modules/parts-map/MapPointSeries.js +1 -1
- package/es-modules/parts-map/MapPointer.js +1 -1
- package/es-modules/parts-map/MapSeries.js +2 -2
- package/es-modules/parts-more/AreaRangeSeries.js +80 -38
- package/es-modules/parts-more/AreaSplineRangeSeries.js +1 -1
- package/es-modules/parts-more/BoxPlotSeries.js +1 -1
- package/es-modules/parts-more/BubbleSeries.js +1 -1
- package/es-modules/parts-more/ColumnRangeSeries.js +1 -1
- package/es-modules/parts-more/ErrorBarSeries.js +1 -1
- package/es-modules/parts-more/GaugeSeries.js +1 -1
- package/es-modules/parts-more/Pane.js +2 -1
- package/es-modules/parts-more/Polar.js +1 -1
- package/es-modules/parts-more/PolygonSeries.js +1 -1
- package/es-modules/parts-more/RadialAxis.js +5 -4
- package/es-modules/parts-more/WaterfallSeries.js +1 -1
- package/es-modules/supplemental.docs.js +0 -1955
- package/es-modules/themes/dark-blue.js +1 -1
- package/es-modules/themes/dark-green.js +1 -1
- package/es-modules/themes/dark-unica.js +1 -1
- package/es-modules/themes/gray.js +1 -1
- package/es-modules/themes/grid-light.js +1 -1
- package/es-modules/themes/grid.js +1 -1
- package/es-modules/themes/sand-signika.js +1 -1
- package/es-modules/themes/skies.js +1 -1
- package/highcharts-3d.js +1 -1
- package/highcharts-3d.src.js +10 -10
- package/highcharts-gantt.js +503 -0
- package/highcharts-gantt.js.map +1 -0
- package/highcharts-gantt.src.js +49289 -0
- package/highcharts-more.js +65 -64
- package/highcharts-more.js.map +1 -1
- package/highcharts-more.src.js +97 -53
- package/highcharts.js +415 -410
- package/highcharts.js.map +1 -1
- package/highcharts.src.js +2170 -1128
- package/highmaps.js +443 -438
- package/highmaps.js.map +1 -1
- package/highmaps.src.js +1647 -849
- package/highstock.js +553 -548
- package/highstock.js.map +1 -1
- package/highstock.src.js +2398 -1283
- package/indicators/accumulation-distribution.js +1 -1
- package/indicators/accumulation-distribution.src.js +1 -1
- package/indicators/atr.js +1 -1
- package/indicators/atr.src.js +1 -1
- package/indicators/bollinger-bands.js +1 -1
- package/indicators/bollinger-bands.src.js +1 -1
- package/indicators/cci.js +1 -1
- package/indicators/cci.src.js +1 -1
- package/indicators/cmf.js +1 -1
- package/indicators/cmf.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.js +1 -1
- package/indicators/indicators.src.js +1 -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 +2 -2
- package/indicators/pivot-points.js +4 -4
- package/indicators/pivot-points.js.map +1 -1
- package/indicators/pivot-points.src.js +7 -2
- 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/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/stochastic.js +1 -1
- package/indicators/stochastic.src.js +1 -1
- package/indicators/volume-by-price.js +1 -1
- package/indicators/volume-by-price.src.js +1 -1
- package/indicators/vwap.js +1 -1
- package/indicators/vwap.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/js/es-modules/indicators/momentum.src.js +1 -1
- package/js/es-modules/indicators/pivot-points.src.js +6 -1
- package/js/es-modules/masters/highcharts-gantt.src.js +11 -0
- package/js/es-modules/masters/modules/annotations.src.js +1 -1
- package/js/es-modules/masters/modules/arrow-symbols.src.js +12 -0
- package/js/es-modules/masters/modules/broken-axis.src.js +1 -1
- package/js/es-modules/masters/modules/current-date-indicator.src.js +12 -0
- package/js/es-modules/masters/modules/data.src.js +1 -1
- package/js/es-modules/masters/modules/draggable-points.src.js +9 -0
- package/js/es-modules/masters/modules/export-data.src.js +1 -1
- package/js/es-modules/masters/modules/exporting.src.js +1 -1
- package/js/es-modules/masters/modules/funnel.src.js +1 -1
- package/js/es-modules/masters/modules/gantt.src.js +2 -1
- package/js/es-modules/masters/modules/grid-axis.src.js +1 -1
- package/js/es-modules/masters/modules/heatmap.src.js +1 -1
- package/js/es-modules/masters/modules/item-series.src.js +1 -1
- package/js/es-modules/masters/modules/map.src.js +1 -1
- package/js/es-modules/masters/modules/overlapping-datalabels.src.js +1 -1
- package/js/es-modules/masters/modules/pathfinder.src.js +12 -0
- package/js/es-modules/masters/modules/sankey.src.js +1 -1
- package/js/es-modules/masters/modules/series-label.src.js +1 -1
- package/js/es-modules/masters/modules/solid-gauge.src.js +1 -1
- package/js/es-modules/masters/modules/stock.src.js +1 -1
- package/js/es-modules/masters/modules/streamgraph.src.js +1 -1
- package/js/es-modules/masters/modules/treegrid.src.js +12 -0
- package/js/es-modules/masters/modules/variwide.src.js +1 -1
- package/js/es-modules/masters/modules/vector.src.js +1 -1
- package/js/es-modules/masters/modules/windbarb.src.js +1 -1
- package/js/es-modules/masters/modules/xrange.src.js +1 -1
- package/js/es-modules/masters/themes/dark-blue.src.js +1 -1
- package/js/es-modules/masters/themes/dark-green.src.js +1 -1
- package/js/es-modules/masters/themes/dark-unica.src.js +1 -1
- package/js/es-modules/masters/themes/gray.src.js +1 -1
- package/js/es-modules/masters/themes/grid-light.src.js +1 -1
- package/js/es-modules/masters/themes/grid.src.js +1 -1
- package/js/es-modules/masters/themes/sand-signika.src.js +1 -1
- package/js/es-modules/masters/themes/skies.src.js +1 -1
- package/js/es-modules/mixins/centered-series.js +1 -1
- package/js/es-modules/mixins/on-series.js +1 -1
- package/js/es-modules/modules/boost.src.js +22 -14
- package/js/es-modules/modules/broken-axis.src.js +169 -134
- package/js/es-modules/modules/data.src.js +2 -2
- package/js/es-modules/modules/draggable-points.src.js +2257 -0
- package/js/es-modules/modules/drilldown.src.js +1 -0
- package/js/es-modules/modules/export-data.src.js +1 -1
- package/js/es-modules/modules/exporting.src.js +1 -1
- package/js/es-modules/modules/funnel.src.js +1 -1
- package/js/es-modules/modules/item-series.src.js +1 -1
- package/js/es-modules/modules/no-data-to-display.src.js +5 -5
- package/js/es-modules/modules/oldie.src.js +1 -1
- package/js/es-modules/modules/overlapping-datalabels.src.js +38 -22
- package/js/es-modules/modules/parallel-coordinates.src.js +3 -2
- package/js/es-modules/modules/sankey.src.js +1 -1
- package/js/es-modules/modules/series-label.src.js +2 -2
- package/js/es-modules/modules/solid-gauge.src.js +1 -1
- package/js/es-modules/modules/static-scale.src.js +67 -28
- package/js/es-modules/modules/streamgraph.src.js +1 -1
- package/js/es-modules/modules/tilemap.src.js +231 -134
- package/js/es-modules/modules/variwide.src.js +1 -1
- package/js/es-modules/modules/vector.src.js +92 -22
- package/js/es-modules/modules/windbarb.src.js +1 -1
- package/js/es-modules/modules/xrange.src.js +255 -68
- package/js/es-modules/parts/AreaSeries.js +77 -77
- package/js/es-modules/parts/AreaSplineSeries.js +64 -27
- package/js/es-modules/parts/Axis.js +160 -67
- package/js/es-modules/parts/BarSeries.js +68 -51
- package/js/es-modules/parts/CandlestickSeries.js +1 -1
- package/js/es-modules/parts/Chart.js +31 -55
- package/js/es-modules/parts/Color.js +29 -18
- package/js/es-modules/parts/ColumnSeries.js +231 -123
- package/js/es-modules/parts/DataGrouping.js +9 -6
- package/js/es-modules/parts/DataLabels.js +230 -182
- package/js/es-modules/parts/DateTimeAxis.js +26 -7
- package/js/es-modules/parts/Dynamics.js +5 -2
- package/js/es-modules/parts/FlagsSeries.js +1 -1
- package/js/es-modules/parts/Globals.js +1 -1
- package/js/es-modules/parts/Html.js +64 -12
- package/js/es-modules/parts/Interaction.js +178 -61
- package/js/es-modules/parts/Legend.js +7 -3
- package/js/es-modules/parts/LogarithmicAxis.js +35 -4
- package/js/es-modules/parts/MSPointer.js +1 -1
- package/js/es-modules/parts/Navigator.js +27 -5
- package/js/es-modules/parts/OHLCSeries.js +1 -1
- package/js/es-modules/parts/Options.js +13 -12
- package/js/es-modules/parts/OrdinalAxis.js +1 -1
- package/js/es-modules/parts/PieSeries.js +245 -132
- package/js/es-modules/parts/PlotBandSeries.experimental.js +1 -1
- package/js/es-modules/parts/PlotLineOrBand.js +7 -40
- package/js/es-modules/parts/Point.js +28 -4
- package/js/es-modules/parts/Pointer.js +8 -6
- package/js/es-modules/parts/RangeSelector.js +1 -1
- package/js/es-modules/parts/Responsive.js +82 -36
- package/js/es-modules/parts/ScatterSeries.js +56 -25
- package/js/es-modules/parts/ScrollablePlotArea.js +17 -7
- package/js/es-modules/parts/Scrollbar.js +9 -2
- package/js/es-modules/parts/Series.js +22 -9
- package/js/es-modules/parts/SplineSeries.js +51 -29
- package/js/es-modules/parts/Stacking.js +100 -6
- package/js/es-modules/parts/StockChart.js +9 -3
- package/js/es-modules/parts/SvgRenderer.js +15 -10
- package/js/es-modules/parts/Tick.js +150 -30
- package/js/es-modules/parts/Time.js +23 -5
- package/js/es-modules/parts/Tooltip.js +2 -2
- package/js/es-modules/parts/TouchPointer.js +1 -1
- package/js/es-modules/parts/Utilities.js +16 -1
- package/js/es-modules/parts-3d/Axis.js +1 -1
- package/js/es-modules/parts-3d/Chart.js +1 -1
- package/js/es-modules/parts-3d/Column.js +1 -1
- package/js/es-modules/parts-3d/Math.js +1 -1
- package/js/es-modules/parts-3d/Pie.js +1 -1
- package/js/es-modules/parts-3d/SVGRenderer.js +1 -1
- package/js/es-modules/parts-3d/Scatter.js +1 -1
- package/js/es-modules/parts-3d/Series.js +1 -1
- package/js/es-modules/parts-3d/VMLRenderer.js +1 -1
- package/js/es-modules/parts-gantt/ArrowSymbols.js +110 -0
- package/js/es-modules/parts-gantt/CurrentDateIndicator.js +92 -0
- package/js/es-modules/parts-gantt/GanttChart.js +111 -0
- package/js/es-modules/parts-gantt/GanttSeries.js +371 -0
- package/js/es-modules/parts-gantt/GridAxis.js +962 -0
- package/js/es-modules/parts-gantt/Pathfinder.js +1225 -0
- package/js/es-modules/parts-gantt/PathfinderAlgorithms.js +746 -0
- package/js/es-modules/parts-gantt/Tree.js +146 -0
- package/js/es-modules/parts-gantt/TreeGrid.js +891 -0
- package/js/es-modules/parts-map/ColorAxis.js +1 -1
- package/js/es-modules/parts-map/ColorSeriesMixin.js +1 -1
- package/js/es-modules/parts-map/GeoJSON.js +1 -1
- package/js/es-modules/parts-map/HeatmapSeries.js +122 -52
- package/js/es-modules/parts-map/Map.js +1 -1
- package/js/es-modules/parts-map/MapAxis.js +1 -1
- package/js/es-modules/parts-map/MapBubbleSeries.js +1 -1
- package/js/es-modules/parts-map/MapLineSeries.js +1 -1
- package/js/es-modules/parts-map/MapNavigation.js +1 -1
- package/js/es-modules/parts-map/MapPointSeries.js +1 -1
- package/js/es-modules/parts-map/MapPointer.js +1 -1
- package/js/es-modules/parts-map/MapSeries.js +2 -2
- package/js/es-modules/parts-more/AreaRangeSeries.js +80 -38
- package/js/es-modules/parts-more/AreaSplineRangeSeries.js +1 -1
- package/js/es-modules/parts-more/BoxPlotSeries.js +1 -1
- package/js/es-modules/parts-more/BubbleSeries.js +1 -1
- package/js/es-modules/parts-more/ColumnRangeSeries.js +1 -1
- package/js/es-modules/parts-more/ErrorBarSeries.js +1 -1
- package/js/es-modules/parts-more/GaugeSeries.js +1 -1
- package/js/es-modules/parts-more/Pane.js +2 -1
- package/js/es-modules/parts-more/Polar.js +1 -1
- package/js/es-modules/parts-more/PolygonSeries.js +1 -1
- package/js/es-modules/parts-more/RadialAxis.js +5 -4
- package/js/es-modules/parts-more/WaterfallSeries.js +1 -1
- package/js/es-modules/supplemental.docs.js +0 -1955
- package/js/es-modules/themes/dark-blue.js +1 -1
- package/js/es-modules/themes/dark-green.js +1 -1
- package/js/es-modules/themes/dark-unica.js +1 -1
- package/js/es-modules/themes/gray.js +1 -1
- package/js/es-modules/themes/grid-light.js +1 -1
- package/js/es-modules/themes/grid.js +1 -1
- package/js/es-modules/themes/sand-signika.js +1 -1
- package/js/es-modules/themes/skies.js +1 -1
- package/js/highcharts-3d.js +1 -1
- package/js/highcharts-3d.src.js +10 -10
- package/js/highcharts-gantt.js +480 -0
- package/js/highcharts-gantt.js.map +1 -0
- package/js/highcharts-gantt.src.js +47011 -0
- package/js/highcharts-more.js +62 -61
- package/js/highcharts-more.js.map +1 -1
- package/js/highcharts-more.src.js +97 -53
- package/js/highcharts.js +394 -390
- package/js/highcharts.js.map +1 -1
- package/js/highcharts.src.js +2083 -1070
- package/js/highmaps.js +420 -416
- package/js/highmaps.js.map +1 -1
- package/js/highmaps.src.js +1569 -798
- package/js/highstock.js +526 -520
- package/js/highstock.js.map +1 -1
- package/js/highstock.src.js +2311 -1225
- package/js/indicators/accumulation-distribution.js +1 -1
- package/js/indicators/accumulation-distribution.src.js +1 -1
- package/js/indicators/atr.js +1 -1
- package/js/indicators/atr.src.js +1 -1
- package/js/indicators/bollinger-bands.js +1 -1
- package/js/indicators/bollinger-bands.src.js +1 -1
- package/js/indicators/cci.js +1 -1
- package/js/indicators/cci.src.js +1 -1
- package/js/indicators/cmf.js +1 -1
- package/js/indicators/cmf.src.js +1 -1
- package/js/indicators/ema.js +1 -1
- package/js/indicators/ema.src.js +1 -1
- package/js/indicators/ichimoku-kinko-hyo.js +1 -1
- package/js/indicators/ichimoku-kinko-hyo.src.js +1 -1
- package/js/indicators/indicators.js +1 -1
- package/js/indicators/indicators.src.js +1 -1
- package/js/indicators/macd.js +1 -1
- package/js/indicators/macd.src.js +1 -1
- package/js/indicators/mfi.js +1 -1
- package/js/indicators/mfi.src.js +1 -1
- package/js/indicators/momentum.js +1 -1
- package/js/indicators/momentum.src.js +2 -2
- package/js/indicators/pivot-points.js +4 -4
- package/js/indicators/pivot-points.js.map +1 -1
- package/js/indicators/pivot-points.src.js +7 -2
- package/js/indicators/price-envelopes.js +1 -1
- package/js/indicators/price-envelopes.src.js +1 -1
- package/js/indicators/psar.js +1 -1
- package/js/indicators/psar.src.js +1 -1
- package/js/indicators/roc.js +1 -1
- package/js/indicators/roc.src.js +1 -1
- package/js/indicators/rsi.js +1 -1
- package/js/indicators/rsi.src.js +1 -1
- package/js/indicators/stochastic.js +1 -1
- package/js/indicators/stochastic.src.js +1 -1
- package/js/indicators/volume-by-price.js +1 -1
- package/js/indicators/volume-by-price.src.js +1 -1
- package/js/indicators/vwap.js +1 -1
- package/js/indicators/vwap.src.js +1 -1
- package/js/indicators/wma.js +1 -1
- package/js/indicators/wma.src.js +1 -1
- package/js/indicators/zigzag.js +1 -1
- package/js/indicators/zigzag.src.js +1 -1
- package/js/modules/accessibility.js +1 -1
- package/js/modules/accessibility.src.js +1 -1
- package/js/modules/annotations.js +2 -2
- package/js/modules/annotations.src.js +2 -2
- package/js/modules/arrow-symbols.js +13 -0
- package/js/modules/arrow-symbols.js.map +1 -0
- package/js/modules/arrow-symbols.src.js +138 -0
- package/js/modules/boost-canvas.js +1 -1
- package/js/modules/boost-canvas.src.js +1 -1
- package/js/modules/boost.js +43 -43
- package/js/modules/boost.js.map +1 -1
- package/js/modules/boost.src.js +23 -15
- package/js/modules/broken-axis.js +11 -10
- package/js/modules/broken-axis.js.map +1 -1
- package/js/modules/broken-axis.src.js +171 -136
- package/js/modules/bullet.js +1 -1
- package/js/modules/bullet.src.js +1 -1
- package/js/modules/current-date-indicator.js +13 -0
- package/js/modules/current-date-indicator.js.map +1 -0
- package/js/modules/current-date-indicator.src.js +120 -0
- package/js/modules/data.js +2 -2
- package/js/modules/data.src.js +4 -4
- package/js/modules/drag-panes.js +1 -1
- package/js/modules/drag-panes.src.js +1 -1
- package/js/modules/draggable-points.js +38 -0
- package/js/modules/draggable-points.js.map +1 -0
- package/js/modules/draggable-points.src.js +2281 -0
- package/js/modules/drilldown.js +1 -1
- package/js/modules/drilldown.js.map +1 -1
- package/js/modules/drilldown.src.js +2 -1
- package/js/modules/export-data.js +2 -2
- package/js/modules/export-data.src.js +3 -3
- package/js/modules/exporting.js +2 -2
- package/js/modules/exporting.src.js +3 -3
- package/js/modules/funnel.js +2 -2
- package/js/modules/funnel.src.js +3 -3
- package/js/modules/gantt.js +80 -18
- package/js/modules/gantt.js.map +1 -1
- package/js/modules/gantt.src.js +5490 -372
- package/js/modules/grid-axis.js +15 -11
- package/js/modules/grid-axis.js.map +1 -1
- package/js/modules/grid-axis.src.js +731 -293
- package/js/modules/heatmap.js +2 -2
- package/js/modules/heatmap.js.map +1 -1
- package/js/modules/heatmap.src.js +126 -56
- package/js/modules/histogram-bellcurve.js +1 -1
- package/js/modules/histogram-bellcurve.src.js +1 -1
- package/js/modules/item-series.js +2 -2
- package/js/modules/item-series.src.js +3 -3
- package/js/modules/map.js +2 -2
- package/js/modules/map.js.map +1 -1
- package/js/modules/map.src.js +137 -67
- package/js/modules/no-data-to-display.js +1 -1
- package/js/modules/no-data-to-display.src.js +6 -6
- package/js/modules/offline-exporting.js +2 -2
- package/js/modules/offline-exporting.src.js +2 -2
- package/js/modules/oldie.js +2 -2
- package/js/modules/oldie.src.js +3 -3
- package/js/modules/overlapping-datalabels.js +2 -2
- package/js/modules/overlapping-datalabels.src.js +2 -2
- package/js/modules/parallel-coordinates.js +9 -9
- package/js/modules/parallel-coordinates.js.map +1 -1
- package/js/modules/parallel-coordinates.src.js +4 -3
- package/js/modules/pareto.js +1 -1
- package/js/modules/pareto.src.js +1 -1
- package/js/modules/pathfinder.js +34 -0
- package/js/modules/pathfinder.js.map +1 -0
- package/js/modules/pathfinder.src.js +2106 -0
- package/js/modules/pattern-fill.js +1 -1
- package/js/modules/pattern-fill.src.js +1 -1
- package/js/modules/sankey.js +2 -2
- package/js/modules/sankey.src.js +3 -3
- package/js/modules/series-label.js +2 -2
- package/js/modules/series-label.src.js +4 -4
- package/js/modules/solid-gauge.js +2 -2
- package/js/modules/solid-gauge.src.js +3 -3
- package/js/modules/static-scale.js +3 -3
- package/js/modules/static-scale.js.map +1 -1
- package/js/modules/static-scale.src.js +65 -26
- package/js/modules/stock.js +135 -134
- package/js/modules/stock.js.map +1 -1
- package/js/modules/stock.src.js +230 -157
- package/js/modules/streamgraph.js +2 -2
- package/js/modules/streamgraph.src.js +3 -3
- package/js/modules/sunburst.js +1 -1
- package/js/modules/sunburst.src.js +1 -1
- package/js/modules/tilemap.js +1 -1
- package/js/modules/tilemap.js.map +1 -1
- package/js/modules/tilemap.src.js +355 -188
- package/js/modules/treegrid.js +51 -0
- package/js/modules/treegrid.js.map +1 -0
- package/js/modules/treegrid.src.js +2759 -0
- package/js/modules/treemap.js +1 -1
- package/js/modules/treemap.src.js +1 -1
- package/js/modules/variable-pie.js +1 -1
- package/js/modules/variable-pie.src.js +1 -1
- package/js/modules/variwide.js +2 -2
- package/js/modules/variwide.src.js +3 -3
- package/js/modules/vector.js +2 -2
- package/js/modules/vector.js.map +1 -1
- package/js/modules/vector.src.js +94 -24
- package/js/modules/windbarb.js +2 -2
- package/js/modules/windbarb.src.js +4 -4
- package/js/modules/wordcloud.js +1 -1
- package/js/modules/wordcloud.src.js +1 -1
- package/js/modules/xrange.js +11 -10
- package/js/modules/xrange.js.map +1 -1
- package/js/modules/xrange.src.js +257 -70
- package/js/themes/avocado.js +1 -1
- package/js/themes/avocado.src.js +1 -1
- package/js/themes/dark-blue.js +2 -2
- package/js/themes/dark-blue.src.js +3 -3
- package/js/themes/dark-green.js +2 -2
- package/js/themes/dark-green.src.js +3 -3
- package/js/themes/dark-unica.js +2 -2
- package/js/themes/dark-unica.src.js +3 -3
- package/js/themes/gray.js +2 -2
- package/js/themes/gray.src.js +3 -3
- package/js/themes/grid-light.js +2 -2
- package/js/themes/grid-light.src.js +3 -3
- package/js/themes/grid.js +2 -2
- package/js/themes/grid.src.js +3 -3
- package/js/themes/sand-signika.js +2 -2
- package/js/themes/sand-signika.src.js +3 -3
- package/js/themes/skies.js +2 -2
- package/js/themes/skies.src.js +3 -3
- package/js/themes/sunset.js +1 -1
- package/js/themes/sunset.src.js +1 -1
- package/modules/accessibility.js +1 -1
- package/modules/accessibility.src.js +1 -1
- package/modules/annotations.js +2 -2
- package/modules/annotations.src.js +2 -2
- package/modules/arrow-symbols.js +13 -0
- package/modules/arrow-symbols.js.map +1 -0
- package/modules/arrow-symbols.src.js +138 -0
- package/modules/boost-canvas.js +1 -1
- package/modules/boost-canvas.src.js +1 -1
- package/modules/boost.js +36 -36
- package/modules/boost.js.map +1 -1
- package/modules/boost.src.js +23 -15
- package/modules/broken-axis.js +11 -10
- package/modules/broken-axis.js.map +1 -1
- package/modules/broken-axis.src.js +171 -136
- package/modules/bullet.js +1 -1
- package/modules/bullet.src.js +1 -1
- package/modules/current-date-indicator.js +13 -0
- package/modules/current-date-indicator.js.map +1 -0
- package/modules/current-date-indicator.src.js +120 -0
- package/modules/data.js +2 -2
- package/modules/data.src.js +4 -4
- package/modules/drag-panes.js +1 -1
- package/modules/drag-panes.src.js +1 -1
- package/modules/draggable-points.js +38 -0
- package/modules/draggable-points.js.map +1 -0
- package/modules/draggable-points.src.js +2281 -0
- package/modules/drilldown.js +1 -1
- package/modules/drilldown.js.map +1 -1
- package/modules/drilldown.src.js +2 -1
- package/modules/export-data.js +2 -2
- package/modules/export-data.src.js +3 -3
- package/modules/exporting.js +2 -2
- package/modules/exporting.src.js +3 -3
- package/modules/funnel.js +2 -2
- package/modules/funnel.src.js +3 -3
- package/modules/gantt.js +83 -19
- package/modules/gantt.js.map +1 -1
- package/modules/gantt.src.js +5553 -379
- package/modules/grid-axis.js +16 -11
- package/modules/grid-axis.js.map +1 -1
- package/modules/grid-axis.src.js +732 -293
- package/modules/heatmap.js +2 -2
- package/modules/heatmap.js.map +1 -1
- package/modules/heatmap.src.js +128 -57
- package/modules/histogram-bellcurve.js +1 -1
- package/modules/histogram-bellcurve.src.js +1 -1
- package/modules/item-series.js +2 -2
- package/modules/item-series.src.js +3 -3
- package/modules/map.js +2 -2
- package/modules/map.js.map +1 -1
- package/modules/map.src.js +139 -68
- package/modules/no-data-to-display.js +1 -1
- package/modules/no-data-to-display.src.js +6 -6
- package/modules/offline-exporting.js +2 -2
- package/modules/offline-exporting.src.js +2 -2
- package/modules/oldie.js +2 -2
- package/modules/oldie.src.js +3 -3
- package/modules/overlapping-datalabels.js +2 -2
- package/modules/overlapping-datalabels.src.js +2 -2
- package/modules/parallel-coordinates.js +8 -8
- package/modules/parallel-coordinates.js.map +1 -1
- package/modules/parallel-coordinates.src.js +4 -3
- package/modules/pareto.js +1 -1
- package/modules/pareto.src.js +1 -1
- package/modules/pathfinder.js +35 -0
- package/modules/pathfinder.js.map +1 -0
- package/modules/pathfinder.src.js +2128 -0
- package/modules/pattern-fill.js +1 -1
- package/modules/pattern-fill.src.js +1 -1
- package/modules/sankey.js +2 -2
- package/modules/sankey.src.js +3 -3
- package/modules/series-label.js +2 -2
- package/modules/series-label.src.js +4 -4
- package/modules/solid-gauge.js +2 -2
- package/modules/solid-gauge.src.js +3 -3
- package/modules/static-scale.js +3 -3
- package/modules/static-scale.js.map +1 -1
- package/modules/static-scale.src.js +65 -26
- package/modules/stock.js +142 -142
- package/modules/stock.js.map +1 -1
- package/modules/stock.src.js +230 -157
- package/modules/streamgraph.js +2 -2
- package/modules/streamgraph.src.js +3 -3
- package/modules/sunburst.js +1 -1
- package/modules/sunburst.src.js +1 -1
- package/modules/tilemap.js +1 -1
- package/modules/tilemap.js.map +1 -1
- package/modules/tilemap.src.js +357 -189
- package/modules/treegrid.js +52 -0
- package/modules/treegrid.js.map +1 -0
- package/modules/treegrid.src.js +2797 -0
- package/modules/treemap.js +1 -1
- package/modules/treemap.src.js +1 -1
- package/modules/variable-pie.js +1 -1
- package/modules/variable-pie.src.js +1 -1
- package/modules/variwide.js +2 -2
- package/modules/variwide.src.js +3 -3
- package/modules/vector.js +2 -2
- package/modules/vector.js.map +1 -1
- package/modules/vector.src.js +94 -24
- package/modules/windbarb.js +2 -2
- package/modules/windbarb.src.js +4 -4
- package/modules/wordcloud.js +1 -1
- package/modules/wordcloud.src.js +1 -1
- package/modules/xrange.js +12 -11
- package/modules/xrange.js.map +1 -1
- package/modules/xrange.src.js +259 -79
- package/package.json +1 -1
- package/themes/avocado.js +1 -1
- package/themes/avocado.src.js +1 -1
- package/themes/dark-blue.js +2 -2
- package/themes/dark-blue.src.js +3 -3
- package/themes/dark-green.js +2 -2
- package/themes/dark-green.src.js +3 -3
- package/themes/dark-unica.js +2 -2
- package/themes/dark-unica.src.js +3 -3
- package/themes/gray.js +2 -2
- package/themes/gray.src.js +3 -3
- package/themes/grid-light.js +2 -2
- package/themes/grid-light.src.js +3 -3
- package/themes/grid.js +2 -2
- package/themes/grid.src.js +3 -3
- package/themes/sand-signika.js +2 -2
- package/themes/sand-signika.src.js +3 -3
- package/themes/skies.js +2 -2
- package/themes/skies.src.js +3 -3
- package/themes/sunset.js +1 -1
- package/themes/sunset.src.js +1 -1
|
@@ -0,0 +1,962 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* (c) 2016 Highsoft AS
|
|
3
|
+
* Authors: Lars A. V. Cabrera
|
|
4
|
+
*
|
|
5
|
+
* License: www.highcharts.com/license
|
|
6
|
+
*/
|
|
7
|
+
'use strict';
|
|
8
|
+
import H from '../parts/Globals.js';
|
|
9
|
+
|
|
10
|
+
var argsToArray = function (args) {
|
|
11
|
+
return Array.prototype.slice.call(args, 1);
|
|
12
|
+
},
|
|
13
|
+
dateFormat = H.dateFormat,
|
|
14
|
+
defined = H.defined,
|
|
15
|
+
each = H.each,
|
|
16
|
+
isArray = H.isArray,
|
|
17
|
+
isNumber = H.isNumber,
|
|
18
|
+
isObject = function (x) {
|
|
19
|
+
// Always use strict mode
|
|
20
|
+
return H.isObject(x, true);
|
|
21
|
+
},
|
|
22
|
+
merge = H.merge,
|
|
23
|
+
pick = H.pick,
|
|
24
|
+
wrap = H.wrap,
|
|
25
|
+
Axis = H.Axis,
|
|
26
|
+
Tick = H.Tick;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Set grid options for the axis labels. Requires Highcharts Gantt.
|
|
30
|
+
*
|
|
31
|
+
* @type {object}
|
|
32
|
+
* @since 6.2.0
|
|
33
|
+
* @product gantt
|
|
34
|
+
* @apioption xAxis.grid
|
|
35
|
+
*/
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Enable grid on the axis labels. Defaults to true for Gantt charts.
|
|
39
|
+
*
|
|
40
|
+
* @type {boolean}
|
|
41
|
+
* @since 6.2.0
|
|
42
|
+
* @default true
|
|
43
|
+
* @product gantt
|
|
44
|
+
* @apioption xAxis.grid.enabled
|
|
45
|
+
*/
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Set specific options for each column (or row for horizontal axes) in the
|
|
49
|
+
* grid. Each extra column/row is its own axis, and the axis options can be set
|
|
50
|
+
* here.
|
|
51
|
+
*
|
|
52
|
+
* @type {Array<object>}
|
|
53
|
+
* @sample gantt/demo/left-axis-table
|
|
54
|
+
* Left axis as a table
|
|
55
|
+
* @apioption xAxis.grid.columns
|
|
56
|
+
*/
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Set border color for the label grid lines.
|
|
60
|
+
*
|
|
61
|
+
* @type {Highcharts.ColorString}
|
|
62
|
+
* @apioption xAxis.grid.borderColor
|
|
63
|
+
*/
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Set border width of the label grid lines.
|
|
67
|
+
*
|
|
68
|
+
* @type {number}
|
|
69
|
+
* @default 1
|
|
70
|
+
* @apioption xAxis.grid.borderWidth
|
|
71
|
+
*/
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Set cell height for grid axis labels. By default this is calculated from font
|
|
75
|
+
* size.
|
|
76
|
+
*
|
|
77
|
+
* @type {number}
|
|
78
|
+
* @default null
|
|
79
|
+
* @apioption xAxis.grid.cellHeight
|
|
80
|
+
*/
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
// Enum for which side the axis is on.
|
|
84
|
+
// Maps to axis.side
|
|
85
|
+
var axisSide = {
|
|
86
|
+
top: 0,
|
|
87
|
+
right: 1,
|
|
88
|
+
bottom: 2,
|
|
89
|
+
left: 3,
|
|
90
|
+
0: 'top',
|
|
91
|
+
1: 'right',
|
|
92
|
+
2: 'bottom',
|
|
93
|
+
3: 'left'
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Checks if an axis is a navigator axis.
|
|
98
|
+
* @return {Boolean} true if axis is found in axis.chart.navigator
|
|
99
|
+
*/
|
|
100
|
+
Axis.prototype.isNavigatorAxis = function () {
|
|
101
|
+
return /highcharts-navigator-[xy]axis/.test(this.options.className);
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Checks if an axis is the outer axis in its dimension. Since
|
|
106
|
+
* axes are placed outwards in order, the axis with the highest
|
|
107
|
+
* index is the outermost axis.
|
|
108
|
+
*
|
|
109
|
+
* Example: If there are multiple x-axes at the top of the chart,
|
|
110
|
+
* this function returns true if the axis supplied is the last
|
|
111
|
+
* of the x-axes.
|
|
112
|
+
*
|
|
113
|
+
* @return true if the axis is the outermost axis in its dimension;
|
|
114
|
+
* false if not
|
|
115
|
+
*/
|
|
116
|
+
Axis.prototype.isOuterAxis = function () {
|
|
117
|
+
var axis = this,
|
|
118
|
+
chart = axis.chart,
|
|
119
|
+
thisIndex = -1,
|
|
120
|
+
isOuter = true;
|
|
121
|
+
|
|
122
|
+
each(chart.axes, function (otherAxis, index) {
|
|
123
|
+
if (otherAxis.side === axis.side && !otherAxis.isNavigatorAxis()) {
|
|
124
|
+
if (otherAxis === axis) {
|
|
125
|
+
// Get the index of the axis in question
|
|
126
|
+
thisIndex = index;
|
|
127
|
+
|
|
128
|
+
// Check thisIndex >= 0 in case thisIndex has
|
|
129
|
+
// not been found yet
|
|
130
|
+
} else if (thisIndex >= 0 && index > thisIndex) {
|
|
131
|
+
// There was an axis on the same side with a
|
|
132
|
+
// higher index.
|
|
133
|
+
isOuter = false;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
// There were either no other axes on the same side,
|
|
138
|
+
// or the other axes were not farther from the chart
|
|
139
|
+
return isOuter;
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* Get the largest label width and height.
|
|
144
|
+
* @param {object} ticks All the ticks on one axis.
|
|
145
|
+
* @param {array} tickPositions All the tick positions on one axis.
|
|
146
|
+
* @return {object} object containing the properties height and width.
|
|
147
|
+
*/
|
|
148
|
+
Axis.prototype.getMaxLabelDimensions = function (ticks, tickPositions) {
|
|
149
|
+
var dimensions = {
|
|
150
|
+
width: 0,
|
|
151
|
+
height: 0
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
each(tickPositions, function (pos) {
|
|
155
|
+
var tick = ticks[pos],
|
|
156
|
+
tickHeight = 0,
|
|
157
|
+
tickWidth = 0,
|
|
158
|
+
label;
|
|
159
|
+
|
|
160
|
+
if (isObject(tick)) {
|
|
161
|
+
label = isObject(tick.label) ? tick.label : {};
|
|
162
|
+
|
|
163
|
+
// Find width and height of tick
|
|
164
|
+
tickHeight = label.getBBox ? label.getBBox().height : 0;
|
|
165
|
+
tickWidth = isNumber(label.textPxLength) ? label.textPxLength : 0;
|
|
166
|
+
|
|
167
|
+
// Update the result if width and/or height are larger
|
|
168
|
+
dimensions.height = Math.max(tickHeight, dimensions.height);
|
|
169
|
+
dimensions.width = Math.max(tickWidth, dimensions.width);
|
|
170
|
+
}
|
|
171
|
+
});
|
|
172
|
+
|
|
173
|
+
return dimensions;
|
|
174
|
+
};
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* Add custom date formats
|
|
178
|
+
*/
|
|
179
|
+
H.dateFormats = {
|
|
180
|
+
// Week number
|
|
181
|
+
W: function (timestamp) {
|
|
182
|
+
var d = new Date(timestamp),
|
|
183
|
+
yearStart,
|
|
184
|
+
weekNo;
|
|
185
|
+
d.setHours(0, 0, 0, 0);
|
|
186
|
+
d.setDate(d.getDate() - (d.getDay() || 7));
|
|
187
|
+
yearStart = new Date(d.getFullYear(), 0, 1);
|
|
188
|
+
weekNo = Math.ceil((((d - yearStart) / 86400000) + 1) / 7);
|
|
189
|
+
return weekNo;
|
|
190
|
+
},
|
|
191
|
+
// First letter of the day of the week, e.g. 'M' for 'Monday'.
|
|
192
|
+
E: function (timestamp) {
|
|
193
|
+
return dateFormat('%a', timestamp, true).charAt(0);
|
|
194
|
+
}
|
|
195
|
+
};
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* If chart is stockChart, always return 'left' to avoid labels being placed
|
|
199
|
+
* inside chart. Stock charts place yAxis labels inside by default.
|
|
200
|
+
* @param {function} proceed - the original function
|
|
201
|
+
* @return {string} 'left' if stockChart, or auto calculated alignment
|
|
202
|
+
*/
|
|
203
|
+
wrap(Axis.prototype, 'autoLabelAlign', function (proceed) {
|
|
204
|
+
var axis = this,
|
|
205
|
+
retVal;
|
|
206
|
+
if (axis.chart.isStock) {
|
|
207
|
+
retVal = 'left';
|
|
208
|
+
} else {
|
|
209
|
+
retVal = proceed.apply(axis, argsToArray(arguments));
|
|
210
|
+
}
|
|
211
|
+
return retVal;
|
|
212
|
+
});
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* Center tick labels in cells.
|
|
216
|
+
*
|
|
217
|
+
* @param {function} proceed - the original function
|
|
218
|
+
*
|
|
219
|
+
* @return {object} object - an object containing x and y positions
|
|
220
|
+
* for the tick
|
|
221
|
+
*/
|
|
222
|
+
wrap(Tick.prototype, 'getLabelPosition', function (proceed, x, y, label, horiz,
|
|
223
|
+
labelOpts, tickmarkOffset, index) {
|
|
224
|
+
var tick = this,
|
|
225
|
+
axis = tick.axis,
|
|
226
|
+
reversed = axis.reversed,
|
|
227
|
+
chart = axis.chart,
|
|
228
|
+
options = axis.options,
|
|
229
|
+
gridOptions = (options && isObject(options.grid)) ? options.grid : {},
|
|
230
|
+
align = labelOpts.align,
|
|
231
|
+
// verticalAlign is currently not supported for axis.labels.
|
|
232
|
+
verticalAlign = 'middle', // labelOpts.verticalAlign,
|
|
233
|
+
side = axisSide[axis.side],
|
|
234
|
+
tickPositions = axis.tickPositions,
|
|
235
|
+
tickPos = tick.pos - tickmarkOffset,
|
|
236
|
+
nextTickPos = (
|
|
237
|
+
isNumber(tickPositions[index + 1]) ?
|
|
238
|
+
tickPositions[index + 1] - tickmarkOffset :
|
|
239
|
+
axis.max + tickmarkOffset
|
|
240
|
+
),
|
|
241
|
+
tickSize = axis.tickSize('tick', true),
|
|
242
|
+
tickWidth = isArray(tickSize) ? tickSize[0] : 0,
|
|
243
|
+
crispCorr = tickSize && tickSize[1] / 2,
|
|
244
|
+
labelHeight,
|
|
245
|
+
lblMetrics,
|
|
246
|
+
lines,
|
|
247
|
+
result,
|
|
248
|
+
bottom,
|
|
249
|
+
top,
|
|
250
|
+
left,
|
|
251
|
+
right;
|
|
252
|
+
|
|
253
|
+
// Only center tick labels in grid axes
|
|
254
|
+
if (gridOptions.enabled === true) {
|
|
255
|
+
/**
|
|
256
|
+
* Calculate top and bottom positions of the cell.
|
|
257
|
+
*/
|
|
258
|
+
if (side === 'top') {
|
|
259
|
+
bottom = axis.top + axis.offset;
|
|
260
|
+
top = bottom - tickWidth;
|
|
261
|
+
} else if (side === 'bottom') {
|
|
262
|
+
top = chart.chartHeight - axis.bottom + axis.offset;
|
|
263
|
+
bottom = top + tickWidth;
|
|
264
|
+
} else {
|
|
265
|
+
bottom = axis.top + axis.len - axis.translate(
|
|
266
|
+
reversed ? nextTickPos : tickPos
|
|
267
|
+
);
|
|
268
|
+
top = axis.top + axis.len - axis.translate(
|
|
269
|
+
reversed ? tickPos : nextTickPos
|
|
270
|
+
);
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
/**
|
|
274
|
+
* Calculate left and right positions of the cell.
|
|
275
|
+
*/
|
|
276
|
+
if (side === 'right') {
|
|
277
|
+
left = chart.chartWidth - axis.right + axis.offset;
|
|
278
|
+
right = left + tickWidth;
|
|
279
|
+
} else if (side === 'left') {
|
|
280
|
+
right = axis.left + axis.offset;
|
|
281
|
+
left = right - tickWidth;
|
|
282
|
+
} else {
|
|
283
|
+
left = Math.round(axis.left + axis.translate(
|
|
284
|
+
reversed ? nextTickPos : tickPos
|
|
285
|
+
)) - crispCorr;
|
|
286
|
+
right = Math.round(axis.left + axis.translate(
|
|
287
|
+
reversed ? tickPos : nextTickPos
|
|
288
|
+
)) - crispCorr;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
tick.slotWidth = right - left;
|
|
292
|
+
|
|
293
|
+
/**
|
|
294
|
+
* Calculate the positioning of the label based on alignment.
|
|
295
|
+
*/
|
|
296
|
+
result = {
|
|
297
|
+
x: (
|
|
298
|
+
align === 'left' ?
|
|
299
|
+
left :
|
|
300
|
+
align === 'right' ?
|
|
301
|
+
right :
|
|
302
|
+
left + ((right - left) / 2) // default to center
|
|
303
|
+
),
|
|
304
|
+
y: (
|
|
305
|
+
verticalAlign === 'top' ?
|
|
306
|
+
top :
|
|
307
|
+
verticalAlign === 'bottom' ?
|
|
308
|
+
bottom :
|
|
309
|
+
top + ((bottom - top) / 2) // default to middle
|
|
310
|
+
)
|
|
311
|
+
};
|
|
312
|
+
|
|
313
|
+
lblMetrics = chart.renderer.fontMetrics(
|
|
314
|
+
labelOpts.style.fontSize,
|
|
315
|
+
label.element
|
|
316
|
+
);
|
|
317
|
+
labelHeight = label.getBBox().height;
|
|
318
|
+
|
|
319
|
+
// Adjustment to y position to align the label correctly.
|
|
320
|
+
// Would be better to have a setter or similar for this.
|
|
321
|
+
if (!labelOpts.useHTML) {
|
|
322
|
+
lines = Math.round(labelHeight / lblMetrics.h);
|
|
323
|
+
result.y += (
|
|
324
|
+
// Center the label
|
|
325
|
+
// TODO: why does this actually center the label?
|
|
326
|
+
((lblMetrics.b - (lblMetrics.h - lblMetrics.f)) / 2) +
|
|
327
|
+
// Adjust for height of additional lines.
|
|
328
|
+
-(((lines - 1) * lblMetrics.h) / 2)
|
|
329
|
+
);
|
|
330
|
+
} else {
|
|
331
|
+
result.y += (
|
|
332
|
+
// Readjust yCorr in htmlUpdateTransform
|
|
333
|
+
lblMetrics.b +
|
|
334
|
+
// Adjust for height of html label
|
|
335
|
+
-(labelHeight / 2)
|
|
336
|
+
);
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
result.x += (axis.horiz && labelOpts.x || 0);
|
|
340
|
+
} else {
|
|
341
|
+
result = proceed.apply(tick, argsToArray(arguments));
|
|
342
|
+
}
|
|
343
|
+
return result;
|
|
344
|
+
});
|
|
345
|
+
|
|
346
|
+
/**
|
|
347
|
+
* Draw vertical axis ticks extra long to create cell floors and roofs.
|
|
348
|
+
* Overrides the tickLength for vertical axes.
|
|
349
|
+
*
|
|
350
|
+
* @param {function} proceed - the original function
|
|
351
|
+
* @returns {array} retVal -
|
|
352
|
+
*/
|
|
353
|
+
wrap(Axis.prototype, 'tickSize', function (proceed) {
|
|
354
|
+
var axis = this,
|
|
355
|
+
dimensions = axis.maxLabelDimensions,
|
|
356
|
+
options = axis.options,
|
|
357
|
+
gridOptions = (options && isObject(options.grid)) ? options.grid : {},
|
|
358
|
+
retVal = proceed.apply(axis, argsToArray(arguments)),
|
|
359
|
+
labelPadding,
|
|
360
|
+
distance;
|
|
361
|
+
|
|
362
|
+
if (gridOptions.enabled === true) {
|
|
363
|
+
labelPadding = (Math.abs(axis.defaultLeftAxisOptions.labels.x) * 2);
|
|
364
|
+
distance = labelPadding +
|
|
365
|
+
(axis.horiz ? dimensions.height : dimensions.width);
|
|
366
|
+
|
|
367
|
+
if (isArray(retVal)) {
|
|
368
|
+
retVal[0] = distance;
|
|
369
|
+
} else {
|
|
370
|
+
retVal = [distance];
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
return retVal;
|
|
374
|
+
});
|
|
375
|
+
|
|
376
|
+
wrap(Axis.prototype, 'getTitlePosition', function (proceed) {
|
|
377
|
+
var axis = this,
|
|
378
|
+
options = axis.options,
|
|
379
|
+
gridOptions = (options && isObject(options.grid)) ? options.grid : {};
|
|
380
|
+
|
|
381
|
+
if (gridOptions.enabled === true) {
|
|
382
|
+
// compute anchor points for each of the title align options
|
|
383
|
+
var title = axis.axisTitle,
|
|
384
|
+
titleWidth = title && title.getBBox().width,
|
|
385
|
+
horiz = axis.horiz,
|
|
386
|
+
axisLeft = axis.left,
|
|
387
|
+
axisTop = axis.top,
|
|
388
|
+
axisWidth = axis.width,
|
|
389
|
+
axisHeight = axis.height,
|
|
390
|
+
axisTitleOptions = options.title,
|
|
391
|
+
opposite = axis.opposite,
|
|
392
|
+
offset = axis.offset,
|
|
393
|
+
tickSize = axis.tickSize() || [0],
|
|
394
|
+
xOption = axisTitleOptions.x || 0,
|
|
395
|
+
yOption = axisTitleOptions.y || 0,
|
|
396
|
+
titleMargin = pick(axisTitleOptions.margin, horiz ? 5 : 10),
|
|
397
|
+
titleFontSize = axis.chart.renderer.fontMetrics(
|
|
398
|
+
axisTitleOptions.style && axisTitleOptions.style.fontSize,
|
|
399
|
+
title
|
|
400
|
+
).f,
|
|
401
|
+
// TODO account for alignment
|
|
402
|
+
// the position in the perpendicular direction of the axis
|
|
403
|
+
offAxis = (horiz ? axisTop + axisHeight : axisLeft) +
|
|
404
|
+
(horiz ? 1 : -1) * // horizontal axis reverses the margin
|
|
405
|
+
(opposite ? -1 : 1) * // so does opposite axes
|
|
406
|
+
(tickSize[0] / 2) +
|
|
407
|
+
(axis.side === axisSide.bottom ? titleFontSize : 0);
|
|
408
|
+
|
|
409
|
+
return {
|
|
410
|
+
x: horiz ?
|
|
411
|
+
axisLeft - titleWidth / 2 - titleMargin + xOption :
|
|
412
|
+
offAxis + (opposite ? axisWidth : 0) + offset + xOption,
|
|
413
|
+
y: horiz ?
|
|
414
|
+
(
|
|
415
|
+
offAxis -
|
|
416
|
+
(opposite ? axisHeight : 0) +
|
|
417
|
+
(opposite ? titleFontSize : -titleFontSize) / 2 +
|
|
418
|
+
offset +
|
|
419
|
+
yOption
|
|
420
|
+
) :
|
|
421
|
+
axisTop - titleMargin + yOption
|
|
422
|
+
};
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
return proceed.apply(this, argsToArray(arguments));
|
|
426
|
+
});
|
|
427
|
+
|
|
428
|
+
/**
|
|
429
|
+
* Avoid altering tickInterval when reserving space.
|
|
430
|
+
*/
|
|
431
|
+
wrap(Axis.prototype, 'unsquish', function (proceed) {
|
|
432
|
+
var axis = this,
|
|
433
|
+
options = axis.options,
|
|
434
|
+
gridOptions = (options && isObject(options.grid)) ? options.grid : {};
|
|
435
|
+
|
|
436
|
+
if (gridOptions.enabled === true && this.categories) {
|
|
437
|
+
return this.tickInterval;
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
return proceed.apply(this, argsToArray(arguments));
|
|
441
|
+
});
|
|
442
|
+
|
|
443
|
+
/**
|
|
444
|
+
* Creates a left and right wall on horizontal axes:
|
|
445
|
+
* - Places leftmost tick at the start of the axis, to create a left wall
|
|
446
|
+
* - Ensures that the rightmost tick is at the end of the axis, to create a
|
|
447
|
+
* right wall.
|
|
448
|
+
*
|
|
449
|
+
* @param {function} proceed - the original function
|
|
450
|
+
* @param {object} options - the pure axis options as input by the user
|
|
451
|
+
*/
|
|
452
|
+
H.addEvent(Axis, 'afterSetOptions', function (e) {
|
|
453
|
+
var options = this.options,
|
|
454
|
+
userOptions = e.userOptions,
|
|
455
|
+
gridAxisOptions,
|
|
456
|
+
gridOptions = (options && isObject(options.grid)) ? options.grid : {};
|
|
457
|
+
|
|
458
|
+
if (gridOptions.enabled === true) {
|
|
459
|
+
|
|
460
|
+
// Merge the user options into default grid axis options so that when a
|
|
461
|
+
// user option is set, it takes presedence.
|
|
462
|
+
gridAxisOptions = merge(true, {
|
|
463
|
+
|
|
464
|
+
className: 'highcharts-grid-axis ' + (userOptions.className || ''),
|
|
465
|
+
|
|
466
|
+
dateTimeLabelFormats: {
|
|
467
|
+
hour: {
|
|
468
|
+
list: ['%H:%M', '%H']
|
|
469
|
+
},
|
|
470
|
+
day: {
|
|
471
|
+
list: ['%A, %e. %B', '%a, %e. %b', '%E']
|
|
472
|
+
},
|
|
473
|
+
week: {
|
|
474
|
+
list: ['Week %W', 'W%W']
|
|
475
|
+
},
|
|
476
|
+
month: {
|
|
477
|
+
list: ['%B', '%b', '%o']
|
|
478
|
+
}
|
|
479
|
+
},
|
|
480
|
+
|
|
481
|
+
grid: {
|
|
482
|
+
borderWidth: 1
|
|
483
|
+
},
|
|
484
|
+
|
|
485
|
+
labels: {
|
|
486
|
+
padding: 2,
|
|
487
|
+
style: {
|
|
488
|
+
fontSize: '13px'
|
|
489
|
+
}
|
|
490
|
+
},
|
|
491
|
+
|
|
492
|
+
title: {
|
|
493
|
+
text: null,
|
|
494
|
+
reserveSpace: false,
|
|
495
|
+
rotation: 0
|
|
496
|
+
},
|
|
497
|
+
|
|
498
|
+
// In a grid axis, only allow one unit of certain types, for example
|
|
499
|
+
// we shouln't have one grid cell spanning two days.
|
|
500
|
+
units: [[
|
|
501
|
+
'millisecond', // unit name
|
|
502
|
+
[1, 10, 100]
|
|
503
|
+
], [
|
|
504
|
+
'second',
|
|
505
|
+
[1, 10]
|
|
506
|
+
], [
|
|
507
|
+
'minute',
|
|
508
|
+
[1, 5, 15]
|
|
509
|
+
], [
|
|
510
|
+
'hour',
|
|
511
|
+
[1, 6]
|
|
512
|
+
], [
|
|
513
|
+
'day',
|
|
514
|
+
[1]
|
|
515
|
+
], [
|
|
516
|
+
'week',
|
|
517
|
+
[1]
|
|
518
|
+
], [
|
|
519
|
+
'month',
|
|
520
|
+
[1]
|
|
521
|
+
], [
|
|
522
|
+
'year',
|
|
523
|
+
null
|
|
524
|
+
]]
|
|
525
|
+
}, userOptions);
|
|
526
|
+
|
|
527
|
+
// X-axis specific options
|
|
528
|
+
if (this.coll === 'xAxis') {
|
|
529
|
+
|
|
530
|
+
// For linked axes, tickPixelInterval is used only if the
|
|
531
|
+
// tickPositioner below doesn't run or returns undefined (like
|
|
532
|
+
// multiple years)
|
|
533
|
+
if (
|
|
534
|
+
defined(userOptions.linkedTo) &&
|
|
535
|
+
!defined(userOptions.tickPixelInterval)
|
|
536
|
+
) {
|
|
537
|
+
gridAxisOptions.tickPixelInterval = 350;
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
// For the secondary grid axis, use the primary axis' tick intervals
|
|
541
|
+
// and return ticks one level higher.
|
|
542
|
+
if (
|
|
543
|
+
// Check for tick pixel interval in options
|
|
544
|
+
!defined(userOptions.tickPixelInterval) &&
|
|
545
|
+
|
|
546
|
+
// Only for linked axes
|
|
547
|
+
defined(userOptions.linkedTo) &&
|
|
548
|
+
|
|
549
|
+
!defined(userOptions.tickPositioner) &&
|
|
550
|
+
!defined(userOptions.tickInterval)
|
|
551
|
+
) {
|
|
552
|
+
gridAxisOptions.tickPositioner = function (min, max) {
|
|
553
|
+
|
|
554
|
+
var parentInfo = (
|
|
555
|
+
this.linkedParent &&
|
|
556
|
+
this.linkedParent.tickPositions &&
|
|
557
|
+
this.linkedParent.tickPositions.info
|
|
558
|
+
);
|
|
559
|
+
|
|
560
|
+
if (parentInfo) {
|
|
561
|
+
|
|
562
|
+
var unitIdx,
|
|
563
|
+
count,
|
|
564
|
+
unitName,
|
|
565
|
+
i,
|
|
566
|
+
units = gridAxisOptions.units,
|
|
567
|
+
unitRange;
|
|
568
|
+
|
|
569
|
+
for (i = 0; i < units.length; i++) {
|
|
570
|
+
if (units[i][0] === parentInfo.unitName) {
|
|
571
|
+
unitIdx = i;
|
|
572
|
+
break;
|
|
573
|
+
}
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
// Spanning multiple years, go default
|
|
577
|
+
if (!units[unitIdx][1]) {
|
|
578
|
+
return;
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
// Get the first allowed count on the next unit.
|
|
582
|
+
if (units[unitIdx + 1]) {
|
|
583
|
+
unitName = units[unitIdx + 1][0];
|
|
584
|
+
count = (units[unitIdx + 1][1] || [1])[0];
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
unitRange = H.timeUnits[unitName];
|
|
588
|
+
this.tickInterval = unitRange * count;
|
|
589
|
+
return this.getTimeTicks(
|
|
590
|
+
{
|
|
591
|
+
unitRange: unitRange,
|
|
592
|
+
count: count,
|
|
593
|
+
unitName: unitName
|
|
594
|
+
},
|
|
595
|
+
min,
|
|
596
|
+
max,
|
|
597
|
+
this.options.startOfWeek
|
|
598
|
+
);
|
|
599
|
+
}
|
|
600
|
+
};
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
// Now merge the combined options into the axis options
|
|
606
|
+
merge(true, this.options, gridAxisOptions);
|
|
607
|
+
|
|
608
|
+
if (this.horiz) {
|
|
609
|
+
/** _________________________
|
|
610
|
+
* Make this: ___|_____|_____|_____|__|
|
|
611
|
+
* ^ ^
|
|
612
|
+
* _________________________
|
|
613
|
+
* Into this: |_____|_____|_____|_____|
|
|
614
|
+
* ^ ^
|
|
615
|
+
*/
|
|
616
|
+
options.minPadding = pick(userOptions.minPadding, 0);
|
|
617
|
+
options.maxPadding = pick(userOptions.maxPadding, 0);
|
|
618
|
+
}
|
|
619
|
+
|
|
620
|
+
// If borderWidth is set, then use its value for tick and line width.
|
|
621
|
+
if (isNumber(options.grid.borderWidth)) {
|
|
622
|
+
options.tickWidth = options.lineWidth = gridOptions.borderWidth;
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
}
|
|
626
|
+
});
|
|
627
|
+
|
|
628
|
+
/**
|
|
629
|
+
* Ensures a left wall on horizontal axes with series inheriting from column.
|
|
630
|
+
* ColumnSeries normally sets pointRange to null, resulting in Axis to select
|
|
631
|
+
* other values for point ranges. This enforces the above Axis.setOptions()
|
|
632
|
+
* override.
|
|
633
|
+
* _________________________
|
|
634
|
+
* Enforce this: ___|_____|_____|_____|__|
|
|
635
|
+
* ^
|
|
636
|
+
* _________________________
|
|
637
|
+
* To be this: |_____|_____|_____|_____|
|
|
638
|
+
* ^
|
|
639
|
+
*
|
|
640
|
+
* @param {function} proceed - the original function
|
|
641
|
+
* @param {object} options - the pure axis options as input by the user
|
|
642
|
+
*/
|
|
643
|
+
wrap(Axis.prototype, 'setAxisTranslation', function (proceed) {
|
|
644
|
+
var axis = this,
|
|
645
|
+
options = axis.options,
|
|
646
|
+
gridOptions = (options && isObject(options.grid)) ? options.grid : {},
|
|
647
|
+
tickInfo = this.tickPositions && this.tickPositions.info,
|
|
648
|
+
userLabels = this.userOptions.labels || {};
|
|
649
|
+
|
|
650
|
+
if (this.horiz) {
|
|
651
|
+
if (gridOptions.enabled === true) {
|
|
652
|
+
each(axis.series, function (series) {
|
|
653
|
+
series.options.pointRange = 0;
|
|
654
|
+
});
|
|
655
|
+
}
|
|
656
|
+
|
|
657
|
+
// Lower level time ticks, like hours or minutes, represent points in
|
|
658
|
+
// time and not ranges. These should be aligned left in the grid cell
|
|
659
|
+
// by default. The same applies to years of higher order.
|
|
660
|
+
if (
|
|
661
|
+
tickInfo &&
|
|
662
|
+
(
|
|
663
|
+
options.dateTimeLabelFormats[tickInfo.unitName]
|
|
664
|
+
.range === false ||
|
|
665
|
+
tickInfo.count > 1 // years
|
|
666
|
+
) &&
|
|
667
|
+
!defined(userLabels.align)
|
|
668
|
+
) {
|
|
669
|
+
options.labels.align = 'left';
|
|
670
|
+
|
|
671
|
+
if (!defined(userLabels.x)) {
|
|
672
|
+
options.labels.x = 3;
|
|
673
|
+
}
|
|
674
|
+
}
|
|
675
|
+
}
|
|
676
|
+
|
|
677
|
+
proceed.apply(axis, argsToArray(arguments));
|
|
678
|
+
});
|
|
679
|
+
|
|
680
|
+
// TODO: Does this function do what the drawing says? Seems to affect ticks and
|
|
681
|
+
// not the labels directly?
|
|
682
|
+
/**
|
|
683
|
+
* Makes tick labels which are usually ignored in a linked axis displayed if
|
|
684
|
+
* they are within range of linkedParent.min.
|
|
685
|
+
* _____________________________
|
|
686
|
+
* | | | | |
|
|
687
|
+
* Make this: | | 2 | 3 | 4 |
|
|
688
|
+
* |___|_______|_______|_______|
|
|
689
|
+
* ^
|
|
690
|
+
* _____________________________
|
|
691
|
+
* | | | | |
|
|
692
|
+
* Into this: | 1 | 2 | 3 | 4 |
|
|
693
|
+
* |___|_______|_______|_______|
|
|
694
|
+
* ^
|
|
695
|
+
* @param {function} proceed - the original function
|
|
696
|
+
*/
|
|
697
|
+
wrap(Axis.prototype, 'trimTicks', function (proceed) {
|
|
698
|
+
var axis = this,
|
|
699
|
+
options = axis.options,
|
|
700
|
+
gridOptions = (options && isObject(options.grid)) ? options.grid : {},
|
|
701
|
+
categoryAxis = axis.categories,
|
|
702
|
+
tickPositions = axis.tickPositions,
|
|
703
|
+
firstPos = tickPositions[0],
|
|
704
|
+
lastPos = tickPositions[tickPositions.length - 1],
|
|
705
|
+
linkedMin = axis.linkedParent && axis.linkedParent.min,
|
|
706
|
+
linkedMax = axis.linkedParent && axis.linkedParent.max,
|
|
707
|
+
min = linkedMin || axis.min,
|
|
708
|
+
max = linkedMax || axis.max,
|
|
709
|
+
tickInterval = axis.tickInterval,
|
|
710
|
+
moreThanMin = firstPos > min,
|
|
711
|
+
lessThanMax = lastPos < max,
|
|
712
|
+
endMoreThanMin = firstPos < min && firstPos + tickInterval > min,
|
|
713
|
+
startLessThanMax = lastPos > max && lastPos - tickInterval < max;
|
|
714
|
+
|
|
715
|
+
if (
|
|
716
|
+
gridOptions.enabled === true &&
|
|
717
|
+
!categoryAxis &&
|
|
718
|
+
(axis.horiz || axis.isLinked)
|
|
719
|
+
) {
|
|
720
|
+
if ((moreThanMin || endMoreThanMin) && !options.startOnTick) {
|
|
721
|
+
tickPositions[0] = min;
|
|
722
|
+
}
|
|
723
|
+
|
|
724
|
+
if ((lessThanMax || startLessThanMax) && !options.endOnTick) {
|
|
725
|
+
tickPositions[tickPositions.length - 1] = max;
|
|
726
|
+
}
|
|
727
|
+
}
|
|
728
|
+
|
|
729
|
+
proceed.apply(axis, argsToArray(arguments));
|
|
730
|
+
});
|
|
731
|
+
|
|
732
|
+
/**
|
|
733
|
+
* Draw an extra line on the far side of the outermost axis,
|
|
734
|
+
* creating floor/roof/wall of a grid. And some padding.
|
|
735
|
+
*
|
|
736
|
+
* Make this:
|
|
737
|
+
* (axis.min) __________________________ (axis.max)
|
|
738
|
+
* | | | | |
|
|
739
|
+
* Into this:
|
|
740
|
+
* (axis.min) __________________________ (axis.max)
|
|
741
|
+
* ___|____|____|____|____|__
|
|
742
|
+
*
|
|
743
|
+
* @param {function} proceed - the original function
|
|
744
|
+
*/
|
|
745
|
+
wrap(Axis.prototype, 'render', function (proceed) {
|
|
746
|
+
var axis = this,
|
|
747
|
+
options = axis.options,
|
|
748
|
+
gridOptions = (options && isObject(options.grid)) ? options.grid : {},
|
|
749
|
+
labelPadding,
|
|
750
|
+
distance,
|
|
751
|
+
lineWidth,
|
|
752
|
+
linePath,
|
|
753
|
+
yStartIndex,
|
|
754
|
+
yEndIndex,
|
|
755
|
+
xStartIndex,
|
|
756
|
+
xEndIndex,
|
|
757
|
+
renderer = axis.chart.renderer,
|
|
758
|
+
horiz = axis.horiz,
|
|
759
|
+
axisGroupBox;
|
|
760
|
+
|
|
761
|
+
if (gridOptions.enabled === true) {
|
|
762
|
+
// TODO acutual label padding (top, bottom, left, right)
|
|
763
|
+
// Label padding is needed to figure out where to draw the outer line.
|
|
764
|
+
labelPadding = (Math.abs(axis.defaultLeftAxisOptions.labels.x) * 2);
|
|
765
|
+
axis.maxLabelDimensions = axis.getMaxLabelDimensions(
|
|
766
|
+
axis.ticks,
|
|
767
|
+
axis.tickPositions
|
|
768
|
+
);
|
|
769
|
+
distance = axis.maxLabelDimensions.width + labelPadding;
|
|
770
|
+
lineWidth = options.lineWidth;
|
|
771
|
+
|
|
772
|
+
// Remove right wall before rendering if updating
|
|
773
|
+
if (axis.rightWall) {
|
|
774
|
+
axis.rightWall.destroy();
|
|
775
|
+
}
|
|
776
|
+
|
|
777
|
+
// Call original Axis.render() to obtain axis.axisLine and
|
|
778
|
+
// axis.axisGroup
|
|
779
|
+
proceed.apply(axis);
|
|
780
|
+
|
|
781
|
+
axisGroupBox = axis.axisGroup.getBBox();
|
|
782
|
+
|
|
783
|
+
/*
|
|
784
|
+
* Draw an extra axis line on outer axes
|
|
785
|
+
* >
|
|
786
|
+
* Make this: |______|______|______|___
|
|
787
|
+
*
|
|
788
|
+
* > _________________________
|
|
789
|
+
* Into this: |______|______|______|__|
|
|
790
|
+
*
|
|
791
|
+
*/
|
|
792
|
+
if (axis.isOuterAxis() && axis.axisLine) {
|
|
793
|
+
if (horiz) {
|
|
794
|
+
// -1 to avoid adding distance each time the chart updates
|
|
795
|
+
distance = axisGroupBox.height - 1;
|
|
796
|
+
}
|
|
797
|
+
|
|
798
|
+
if (lineWidth) {
|
|
799
|
+
linePath = axis.getLinePath(lineWidth);
|
|
800
|
+
xStartIndex = linePath.indexOf('M') + 1;
|
|
801
|
+
xEndIndex = linePath.indexOf('L') + 1;
|
|
802
|
+
yStartIndex = linePath.indexOf('M') + 2;
|
|
803
|
+
yEndIndex = linePath.indexOf('L') + 2;
|
|
804
|
+
|
|
805
|
+
// Negate distance if top or left axis
|
|
806
|
+
if (axis.side === axisSide.top || axis.side === axisSide.left) {
|
|
807
|
+
distance = -distance;
|
|
808
|
+
}
|
|
809
|
+
|
|
810
|
+
// If axis is horizontal, reposition line path vertically
|
|
811
|
+
if (horiz) {
|
|
812
|
+
linePath[yStartIndex] = linePath[yStartIndex] + distance;
|
|
813
|
+
linePath[yEndIndex] = linePath[yEndIndex] + distance;
|
|
814
|
+
} else {
|
|
815
|
+
// If axis is vertical, reposition line path horizontally
|
|
816
|
+
linePath[xStartIndex] = linePath[xStartIndex] + distance;
|
|
817
|
+
linePath[xEndIndex] = linePath[xEndIndex] + distance;
|
|
818
|
+
}
|
|
819
|
+
|
|
820
|
+
if (!axis.axisLineExtra) {
|
|
821
|
+
axis.axisLineExtra = renderer.path(linePath)
|
|
822
|
+
.attr({
|
|
823
|
+
|
|
824
|
+
zIndex: 7
|
|
825
|
+
})
|
|
826
|
+
.addClass('highcharts-axis-line')
|
|
827
|
+
.add(axis.axisGroup);
|
|
828
|
+
} else {
|
|
829
|
+
axis.axisLineExtra.animate({
|
|
830
|
+
d: linePath
|
|
831
|
+
});
|
|
832
|
+
}
|
|
833
|
+
|
|
834
|
+
// show or hide the line depending on options.showEmpty
|
|
835
|
+
axis.axisLine[axis.showAxis ? 'show' : 'hide'](true);
|
|
836
|
+
}
|
|
837
|
+
}
|
|
838
|
+
|
|
839
|
+
} else {
|
|
840
|
+
proceed.apply(axis);
|
|
841
|
+
}
|
|
842
|
+
});
|
|
843
|
+
|
|
844
|
+
/**
|
|
845
|
+
* Wraps axis init to draw cell walls on vertical axes.
|
|
846
|
+
*
|
|
847
|
+
* @param {function} proceed - the original function
|
|
848
|
+
*/
|
|
849
|
+
wrap(Axis.prototype, 'init', function (proceed, chart, userOptions) {
|
|
850
|
+
var axis = this,
|
|
851
|
+
gridOptions = (
|
|
852
|
+
(userOptions && isObject(userOptions.grid)) ?
|
|
853
|
+
userOptions.grid :
|
|
854
|
+
{}
|
|
855
|
+
),
|
|
856
|
+
columnOptions,
|
|
857
|
+
column,
|
|
858
|
+
columnIndex,
|
|
859
|
+
i;
|
|
860
|
+
function applyGridOptions(axis) {
|
|
861
|
+
var options = axis.options,
|
|
862
|
+
// TODO: Consider using cell margins defined in % of font size?
|
|
863
|
+
// 25 is optimal height for default fontSize (11px)
|
|
864
|
+
// 25 / 11 ≈ 2.28
|
|
865
|
+
fontSizeToCellHeightRatio = 25 / 11,
|
|
866
|
+
fontSize = options.labels.style.fontSize,
|
|
867
|
+
fontMetrics = axis.chart.renderer.fontMetrics(fontSize);
|
|
868
|
+
|
|
869
|
+
// Center-align by default
|
|
870
|
+
if (!options.labels) {
|
|
871
|
+
options.labels = {};
|
|
872
|
+
}
|
|
873
|
+
options.labels.align = pick(options.labels.align, 'center');
|
|
874
|
+
|
|
875
|
+
// TODO: Check against tickLabelPlacement between/on etc
|
|
876
|
+
/**
|
|
877
|
+
* Prevents adding the last tick label if the axis is not a category
|
|
878
|
+
* axis.
|
|
879
|
+
*
|
|
880
|
+
* Since numeric labels are normally placed at starts and ends of a
|
|
881
|
+
* range of value, and this module makes the label point at the value,
|
|
882
|
+
* an "extra" label would appear.
|
|
883
|
+
*/
|
|
884
|
+
if (!axis.categories) {
|
|
885
|
+
options.showLastLabel = false;
|
|
886
|
+
}
|
|
887
|
+
|
|
888
|
+
/**
|
|
889
|
+
* Make tick marks taller, creating cell walls of a grid.
|
|
890
|
+
* Use cellHeight axis option if set
|
|
891
|
+
*/
|
|
892
|
+
if (axis.horiz) {
|
|
893
|
+
options.tickLength = gridOptions.cellHeight ||
|
|
894
|
+
fontMetrics.h * fontSizeToCellHeightRatio;
|
|
895
|
+
}
|
|
896
|
+
|
|
897
|
+
/**
|
|
898
|
+
* Prevents rotation of labels when squished, as rotating them would not
|
|
899
|
+
* help.
|
|
900
|
+
*/
|
|
901
|
+
axis.labelRotation = 0;
|
|
902
|
+
options.labels.rotation = 0;
|
|
903
|
+
}
|
|
904
|
+
|
|
905
|
+
if (gridOptions.enabled) {
|
|
906
|
+
if (defined(gridOptions.borderColor)) {
|
|
907
|
+
userOptions.tickColor =
|
|
908
|
+
userOptions.lineColor = gridOptions.borderColor;
|
|
909
|
+
}
|
|
910
|
+
|
|
911
|
+
// Handle columns, each column is a grid axis
|
|
912
|
+
if (isArray(gridOptions.columns)) {
|
|
913
|
+
columnIndex = 0;
|
|
914
|
+
i = gridOptions.columns.length;
|
|
915
|
+
while (i--) {
|
|
916
|
+
columnOptions = merge(
|
|
917
|
+
userOptions,
|
|
918
|
+
gridOptions.columns[i],
|
|
919
|
+
{
|
|
920
|
+
// Force to behave like category axis
|
|
921
|
+
type: 'category'
|
|
922
|
+
}
|
|
923
|
+
);
|
|
924
|
+
|
|
925
|
+
delete columnOptions.grid.columns; // Prevent recursion
|
|
926
|
+
|
|
927
|
+
column = new Axis(chart, columnOptions);
|
|
928
|
+
column.isColumn = true;
|
|
929
|
+
column.columnIndex = columnIndex;
|
|
930
|
+
|
|
931
|
+
wrap(column, 'labelFormatter', function (proceed) {
|
|
932
|
+
var axis = this.axis,
|
|
933
|
+
tickPos = axis.tickPositions,
|
|
934
|
+
value = this.value,
|
|
935
|
+
series = axis.series[0],
|
|
936
|
+
isFirst = value === tickPos[0],
|
|
937
|
+
isLast = value === tickPos[tickPos.length - 1],
|
|
938
|
+
point = H.find(series.options.data, function (p) {
|
|
939
|
+
return p[axis.isXAxis ? 'x' : 'y'] === value;
|
|
940
|
+
});
|
|
941
|
+
|
|
942
|
+
// Make additional properties available for the formatter
|
|
943
|
+
this.isFirst = isFirst;
|
|
944
|
+
this.isLast = isLast;
|
|
945
|
+
this.point = point;
|
|
946
|
+
|
|
947
|
+
// Call original labelFormatter
|
|
948
|
+
return proceed.call(this);
|
|
949
|
+
});
|
|
950
|
+
|
|
951
|
+
columnIndex++;
|
|
952
|
+
}
|
|
953
|
+
} else {
|
|
954
|
+
// Call original Axis.init()
|
|
955
|
+
proceed.apply(axis, argsToArray(arguments));
|
|
956
|
+
applyGridOptions(axis);
|
|
957
|
+
}
|
|
958
|
+
} else {
|
|
959
|
+
// Call original Axis.init()
|
|
960
|
+
proceed.apply(axis, argsToArray(arguments));
|
|
961
|
+
}
|
|
962
|
+
});
|