highcharts 6.1.1 → 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 +29 -0
- package/css/highcharts.scss +25 -1
- package/css/themes/dark-unica.css +29 -0
- package/css/themes/grid-light.css +29 -0
- package/css/themes/sand-signika.css +29 -0
- package/es-modules/indicators/accumulation-distribution.src.js +1 -1
- package/es-modules/indicators/atr.src.js +1 -1
- package/es-modules/indicators/bollinger-bands.src.js +2 -2
- package/es-modules/indicators/cci.src.js +1 -1
- package/es-modules/indicators/cmf.src.js +1 -1
- package/es-modules/indicators/ema.src.js +1 -1
- package/es-modules/indicators/ichimoku-kinko-hyo.src.js +1 -1
- package/es-modules/indicators/indicators.src.js +29 -14
- package/es-modules/indicators/macd.src.js +4 -4
- package/es-modules/indicators/mfi.src.js +1 -1
- package/es-modules/indicators/momentum.src.js +2 -2
- package/es-modules/indicators/pivot-points.src.js +7 -2
- package/es-modules/indicators/price-envelopes.src.js +2 -2
- package/es-modules/indicators/psar.src.js +1 -1
- package/es-modules/indicators/roc.src.js +1 -1
- package/es-modules/indicators/rsi.src.js +1 -1
- package/es-modules/indicators/stochastic.src.js +9 -7
- package/es-modules/indicators/volume-by-price.src.js +1 -1
- package/es-modules/indicators/vwap.src.js +1 -1
- package/es-modules/indicators/wma.src.js +1 -1
- package/es-modules/indicators/zigzag.src.js +1 -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 +36 -5
- package/es-modules/mixins/on-series.js +1 -1
- package/es-modules/mixins/polygon.js +4 -4
- package/es-modules/modules/annotations.src.js +2 -2
- package/es-modules/modules/boost-canvas.src.js +19 -8
- package/es-modules/modules/boost.src.js +300 -137
- package/es-modules/modules/broken-axis.src.js +169 -134
- package/es-modules/modules/bullet.src.js +2 -2
- package/es-modules/modules/data.src.js +8 -6
- package/es-modules/modules/draggable-points.src.js +2257 -0
- package/es-modules/modules/drilldown.src.js +4 -2
- package/es-modules/modules/export-data.src.js +11 -1
- package/es-modules/modules/exporting.src.js +62 -36
- package/es-modules/modules/funnel.src.js +5 -5
- package/es-modules/modules/histogram.src.js +30 -28
- package/es-modules/modules/item-series.src.js +36 -11
- package/es-modules/modules/keyboard-navigation.src.js +81 -44
- package/es-modules/modules/no-data-to-display.src.js +5 -5
- package/es-modules/modules/oldie.src.js +14 -9
- package/es-modules/modules/overlapping-datalabels.src.js +45 -21
- package/es-modules/modules/parallel-coordinates.src.js +4 -3
- package/es-modules/modules/pareto.src.js +1 -1
- package/es-modules/modules/sankey.src.js +28 -10
- package/es-modules/modules/series-label.src.js +6 -6
- package/es-modules/modules/solid-gauge.src.js +10 -7
- package/es-modules/modules/static-scale.src.js +67 -28
- package/es-modules/modules/streamgraph.src.js +4 -4
- package/es-modules/modules/sunburst.src.js +4 -4
- package/es-modules/modules/tilemap.src.js +231 -134
- package/es-modules/modules/treemap.src.js +30 -27
- package/es-modules/modules/variable-pie.src.js +3 -3
- package/es-modules/modules/variwide.src.js +36 -24
- package/es-modules/modules/vector.src.js +98 -28
- package/es-modules/modules/windbarb.src.js +4 -4
- package/es-modules/modules/wordcloud.src.js +133 -48
- package/es-modules/modules/xrange.src.js +258 -78
- package/es-modules/parts/AreaSeries.js +83 -50
- package/es-modules/parts/AreaSplineSeries.js +66 -29
- package/es-modules/parts/Axis.js +2184 -745
- package/es-modules/parts/BarSeries.js +70 -53
- package/es-modules/parts/CandlestickSeries.js +20 -10
- package/es-modules/parts/Chart.js +349 -157
- package/es-modules/parts/Color.js +74 -25
- package/es-modules/parts/ColumnSeries.js +274 -147
- package/es-modules/parts/DataGrouping.js +36 -3
- package/es-modules/parts/DataLabels.js +318 -144
- package/es-modules/parts/DateTimeAxis.js +27 -5
- package/es-modules/parts/Dynamics.js +236 -144
- package/es-modules/parts/FlagsSeries.js +49 -7
- package/es-modules/parts/Globals.js +4 -3
- package/es-modules/parts/Html.js +82 -16
- package/es-modules/parts/Interaction.js +198 -65
- package/es-modules/parts/Legend.js +181 -31
- package/es-modules/parts/LogarithmicAxis.js +36 -3
- package/es-modules/parts/MSPointer.js +31 -4
- package/es-modules/parts/Navigator.js +479 -187
- package/es-modules/parts/OHLCSeries.js +11 -5
- package/es-modules/parts/Options.js +1052 -686
- package/es-modules/parts/OrdinalAxis.js +20 -6
- package/es-modules/parts/PieSeries.js +258 -142
- package/es-modules/parts/PlotBandSeries.experimental.js +2 -2
- package/es-modules/parts/PlotLineOrBand.js +671 -35
- package/es-modules/parts/Point.js +189 -73
- package/es-modules/parts/Pointer.js +263 -62
- package/es-modules/parts/RangeSelector.js +601 -91
- package/es-modules/parts/Responsive.js +82 -36
- package/es-modules/parts/ScatterSeries.js +59 -27
- package/es-modules/parts/ScrollablePlotArea.js +30 -9
- package/es-modules/parts/Scrollbar.js +284 -113
- package/es-modules/parts/Series.js +1105 -836
- package/es-modules/parts/SplineSeries.js +53 -31
- package/es-modules/parts/Stacking.js +108 -7
- package/es-modules/parts/StockChart.js +26 -8
- package/es-modules/parts/SvgRenderer.js +1251 -613
- package/es-modules/parts/Tick.js +164 -30
- package/es-modules/parts/Time.js +171 -71
- package/es-modules/parts/Tooltip.js +271 -49
- package/es-modules/parts/TouchPointer.js +70 -3
- package/es-modules/parts/Utilities.js +1024 -429
- package/es-modules/parts-3d/Axis.js +4 -3
- package/es-modules/parts-3d/Chart.js +8 -9
- 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 +13 -10
- package/es-modules/parts-3d/Scatter.js +4 -4
- 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 +4 -5
- package/es-modules/parts-map/ColorSeriesMixin.js +3 -1
- package/es-modules/parts-map/GeoJSON.js +1 -1
- package/es-modules/parts-map/HeatmapSeries.js +126 -55
- package/es-modules/parts-map/Map.js +144 -51
- package/es-modules/parts-map/MapAxis.js +1 -1
- package/es-modules/parts-map/MapBubbleSeries.js +6 -5
- package/es-modules/parts-map/MapLineSeries.js +4 -4
- package/es-modules/parts-map/MapNavigation.js +50 -12
- package/es-modules/parts-map/MapPointSeries.js +3 -3
- package/es-modules/parts-map/MapPointer.js +1 -1
- package/es-modules/parts-map/MapSeries.js +7 -7
- package/es-modules/parts-more/AreaRangeSeries.js +82 -40
- package/es-modules/parts-more/AreaSplineRangeSeries.js +3 -3
- package/es-modules/parts-more/BoxPlotSeries.js +3 -3
- package/es-modules/parts-more/BubbleSeries.js +9 -4
- package/es-modules/parts-more/ColumnRangeSeries.js +3 -3
- package/es-modules/parts-more/ErrorBarSeries.js +6 -4
- package/es-modules/parts-more/GaugeSeries.js +3 -3
- package/es-modules/parts-more/Pane.js +3 -2
- package/es-modules/parts-more/Polar.js +1 -1
- package/es-modules/parts-more/PolygonSeries.js +3 -3
- package/es-modules/parts-more/RadialAxis.js +5 -4
- package/es-modules/parts-more/WaterfallSeries.js +9 -4
- 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 +77 -75
- package/highcharts-3d.js.map +1 -8
- package/highcharts-3d.src.js +39 -32
- package/highcharts-gantt.js +503 -0
- package/highcharts-gantt.js.map +1 -0
- package/highcharts-gantt.src.js +49289 -0
- package/highcharts-more.js +66 -64
- package/highcharts-more.js.map +1 -8
- package/highcharts-more.src.js +135 -75
- package/highcharts.js +413 -403
- package/highcharts.js.map +1 -8
- package/highcharts.src.js +11114 -4781
- package/highmaps.js +442 -433
- package/highmaps.js.map +1 -8
- package/highmaps.src.js +10740 -4598
- package/highstock.js +553 -540
- package/highstock.js.map +1 -8
- package/highstock.src.js +12807 -5343
- package/indicators/accumulation-distribution.js +4 -3
- package/indicators/accumulation-distribution.js.map +1 -8
- package/indicators/accumulation-distribution.src.js +6 -2
- package/indicators/atr.js +4 -3
- package/indicators/atr.js.map +1 -8
- package/indicators/atr.src.js +6 -2
- package/indicators/bollinger-bands.js +7 -6
- package/indicators/bollinger-bands.js.map +1 -8
- package/indicators/bollinger-bands.src.js +7 -3
- package/indicators/cci.js +4 -3
- package/indicators/cci.js.map +1 -8
- package/indicators/cci.src.js +6 -2
- package/indicators/cmf.js +5 -4
- package/indicators/cmf.js.map +1 -8
- package/indicators/cmf.src.js +6 -2
- package/indicators/ema.js +4 -3
- package/indicators/ema.js.map +1 -8
- package/indicators/ema.src.js +6 -2
- package/indicators/ichimoku-kinko-hyo.js +10 -9
- package/indicators/ichimoku-kinko-hyo.js.map +1 -8
- package/indicators/ichimoku-kinko-hyo.src.js +6 -2
- package/indicators/indicators.js +6 -5
- package/indicators/indicators.js.map +1 -8
- package/indicators/indicators.src.js +34 -15
- package/indicators/macd.js +11 -10
- package/indicators/macd.js.map +1 -8
- package/indicators/macd.src.js +10 -6
- package/indicators/mfi.js +5 -3
- package/indicators/mfi.js.map +1 -8
- package/indicators/mfi.src.js +6 -2
- package/indicators/momentum.js +4 -3
- package/indicators/momentum.js.map +1 -8
- package/indicators/momentum.src.js +7 -3
- package/indicators/pivot-points.js +8 -7
- package/indicators/pivot-points.js.map +1 -8
- package/indicators/pivot-points.src.js +12 -3
- package/indicators/price-envelopes.js +7 -6
- package/indicators/price-envelopes.js.map +1 -8
- package/indicators/price-envelopes.src.js +7 -3
- package/indicators/psar.js +5 -4
- package/indicators/psar.js.map +1 -8
- package/indicators/psar.src.js +6 -2
- package/indicators/roc.js +4 -3
- package/indicators/roc.js.map +1 -8
- package/indicators/roc.src.js +6 -2
- package/indicators/rsi.js +4 -3
- package/indicators/rsi.js.map +1 -8
- package/indicators/rsi.src.js +6 -2
- package/indicators/stochastic.js +7 -5
- package/indicators/stochastic.js.map +1 -8
- package/indicators/stochastic.src.js +14 -8
- package/indicators/volume-by-price.js +13 -12
- package/indicators/volume-by-price.js.map +1 -8
- package/indicators/volume-by-price.src.js +6 -2
- package/indicators/vwap.js +4 -3
- package/indicators/vwap.js.map +1 -8
- package/indicators/vwap.src.js +6 -2
- package/indicators/wma.js +4 -3
- package/indicators/wma.js.map +1 -8
- package/indicators/wma.src.js +6 -2
- package/indicators/zigzag.js +5 -3
- package/indicators/zigzag.js.map +1 -8
- package/indicators/zigzag.src.js +6 -2
- package/js/es-modules/indicators/accumulation-distribution.src.js +1 -1
- package/js/es-modules/indicators/atr.src.js +1 -1
- package/js/es-modules/indicators/bollinger-bands.src.js +2 -2
- package/js/es-modules/indicators/cci.src.js +1 -1
- package/js/es-modules/indicators/cmf.src.js +1 -1
- package/js/es-modules/indicators/ema.src.js +1 -1
- package/js/es-modules/indicators/ichimoku-kinko-hyo.src.js +1 -1
- package/js/es-modules/indicators/indicators.src.js +29 -14
- package/js/es-modules/indicators/macd.src.js +4 -4
- package/js/es-modules/indicators/mfi.src.js +1 -1
- package/js/es-modules/indicators/momentum.src.js +2 -2
- package/js/es-modules/indicators/pivot-points.src.js +7 -2
- package/js/es-modules/indicators/price-envelopes.src.js +2 -2
- package/js/es-modules/indicators/psar.src.js +1 -1
- package/js/es-modules/indicators/roc.src.js +1 -1
- package/js/es-modules/indicators/rsi.src.js +1 -1
- package/js/es-modules/indicators/stochastic.src.js +9 -7
- package/js/es-modules/indicators/volume-by-price.src.js +1 -1
- package/js/es-modules/indicators/vwap.src.js +1 -1
- package/js/es-modules/indicators/wma.src.js +1 -1
- package/js/es-modules/indicators/zigzag.src.js +1 -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 +36 -5
- package/js/es-modules/mixins/on-series.js +1 -1
- package/js/es-modules/mixins/polygon.js +4 -4
- package/js/es-modules/modules/annotations.src.js +2 -2
- package/js/es-modules/modules/boost-canvas.src.js +19 -8
- package/js/es-modules/modules/boost.src.js +300 -137
- package/js/es-modules/modules/broken-axis.src.js +169 -134
- package/js/es-modules/modules/bullet.src.js +2 -2
- package/js/es-modules/modules/data.src.js +8 -6
- package/js/es-modules/modules/draggable-points.src.js +2257 -0
- package/js/es-modules/modules/drilldown.src.js +4 -2
- package/js/es-modules/modules/export-data.src.js +11 -1
- package/js/es-modules/modules/exporting.src.js +62 -36
- package/js/es-modules/modules/funnel.src.js +5 -5
- package/js/es-modules/modules/histogram.src.js +30 -28
- package/js/es-modules/modules/item-series.src.js +36 -11
- package/js/es-modules/modules/keyboard-navigation.src.js +81 -44
- package/js/es-modules/modules/no-data-to-display.src.js +5 -5
- package/js/es-modules/modules/oldie.src.js +14 -9
- package/js/es-modules/modules/overlapping-datalabels.src.js +45 -21
- package/js/es-modules/modules/parallel-coordinates.src.js +4 -3
- package/js/es-modules/modules/pareto.src.js +1 -1
- package/js/es-modules/modules/sankey.src.js +23 -7
- package/js/es-modules/modules/series-label.src.js +6 -6
- package/js/es-modules/modules/solid-gauge.src.js +8 -5
- package/js/es-modules/modules/static-scale.src.js +67 -28
- package/js/es-modules/modules/streamgraph.src.js +4 -4
- package/js/es-modules/modules/sunburst.src.js +4 -4
- package/js/es-modules/modules/tilemap.src.js +231 -134
- package/js/es-modules/modules/treemap.src.js +29 -26
- package/js/es-modules/modules/variable-pie.src.js +3 -3
- package/js/es-modules/modules/variwide.src.js +36 -24
- package/js/es-modules/modules/vector.src.js +98 -28
- package/js/es-modules/modules/windbarb.src.js +4 -4
- package/js/es-modules/modules/wordcloud.src.js +133 -48
- package/js/es-modules/modules/xrange.src.js +256 -69
- package/js/es-modules/parts/AreaSeries.js +83 -50
- package/js/es-modules/parts/AreaSplineSeries.js +66 -29
- package/js/es-modules/parts/Axis.js +2089 -694
- package/js/es-modules/parts/BarSeries.js +70 -53
- package/js/es-modules/parts/CandlestickSeries.js +20 -10
- package/js/es-modules/parts/Chart.js +349 -157
- package/js/es-modules/parts/Color.js +74 -25
- package/js/es-modules/parts/ColumnSeries.js +241 -128
- package/js/es-modules/parts/DataGrouping.js +36 -3
- package/js/es-modules/parts/DataLabels.js +287 -116
- package/js/es-modules/parts/DateTimeAxis.js +27 -5
- package/js/es-modules/parts/Dynamics.js +236 -144
- package/js/es-modules/parts/FlagsSeries.js +49 -7
- package/js/es-modules/parts/Globals.js +4 -3
- package/js/es-modules/parts/Html.js +82 -16
- package/js/es-modules/parts/Interaction.js +187 -67
- package/js/es-modules/parts/Legend.js +181 -31
- package/js/es-modules/parts/LogarithmicAxis.js +36 -3
- package/js/es-modules/parts/MSPointer.js +31 -4
- package/js/es-modules/parts/Navigator.js +432 -162
- package/js/es-modules/parts/OHLCSeries.js +5 -5
- package/js/es-modules/parts/Options.js +855 -592
- package/js/es-modules/parts/OrdinalAxis.js +20 -6
- package/js/es-modules/parts/PieSeries.js +247 -134
- package/js/es-modules/parts/PlotBandSeries.experimental.js +2 -2
- package/js/es-modules/parts/PlotLineOrBand.js +671 -35
- package/js/es-modules/parts/Point.js +182 -70
- package/js/es-modules/parts/Pointer.js +263 -62
- package/js/es-modules/parts/RangeSelector.js +579 -91
- package/js/es-modules/parts/Responsive.js +82 -36
- package/js/es-modules/parts/ScatterSeries.js +58 -27
- package/js/es-modules/parts/ScrollablePlotArea.js +30 -9
- package/js/es-modules/parts/Scrollbar.js +201 -71
- package/js/es-modules/parts/Series.js +995 -745
- package/js/es-modules/parts/SplineSeries.js +53 -31
- package/js/es-modules/parts/Stacking.js +108 -7
- package/js/es-modules/parts/StockChart.js +26 -8
- package/js/es-modules/parts/SvgRenderer.js +1208 -598
- package/js/es-modules/parts/Tick.js +164 -30
- package/js/es-modules/parts/Time.js +171 -71
- package/js/es-modules/parts/Tooltip.js +276 -49
- package/js/es-modules/parts/TouchPointer.js +70 -3
- package/js/es-modules/parts/Utilities.js +1024 -429
- package/js/es-modules/parts-3d/Axis.js +4 -3
- package/js/es-modules/parts-3d/Chart.js +8 -9
- 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 +13 -10
- package/js/es-modules/parts-3d/Scatter.js +4 -4
- 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 +4 -5
- package/js/es-modules/parts-map/ColorSeriesMixin.js +3 -1
- package/js/es-modules/parts-map/GeoJSON.js +1 -1
- package/js/es-modules/parts-map/HeatmapSeries.js +124 -54
- package/js/es-modules/parts-map/Map.js +136 -47
- package/js/es-modules/parts-map/MapAxis.js +1 -1
- package/js/es-modules/parts-map/MapBubbleSeries.js +6 -5
- package/js/es-modules/parts-map/MapLineSeries.js +4 -4
- package/js/es-modules/parts-map/MapNavigation.js +50 -12
- package/js/es-modules/parts-map/MapPointSeries.js +3 -3
- package/js/es-modules/parts-map/MapPointer.js +1 -1
- package/js/es-modules/parts-map/MapSeries.js +5 -5
- package/js/es-modules/parts-more/AreaRangeSeries.js +82 -40
- package/js/es-modules/parts-more/AreaSplineRangeSeries.js +3 -3
- package/js/es-modules/parts-more/BoxPlotSeries.js +3 -3
- package/js/es-modules/parts-more/BubbleSeries.js +9 -4
- package/js/es-modules/parts-more/ColumnRangeSeries.js +3 -3
- package/js/es-modules/parts-more/ErrorBarSeries.js +6 -4
- package/js/es-modules/parts-more/GaugeSeries.js +3 -3
- package/js/es-modules/parts-more/Pane.js +3 -2
- package/js/es-modules/parts-more/Polar.js +1 -1
- package/js/es-modules/parts-more/PolygonSeries.js +3 -3
- package/js/es-modules/parts-more/RadialAxis.js +5 -4
- package/js/es-modules/parts-more/WaterfallSeries.js +9 -4
- 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 +75 -74
- package/js/highcharts-3d.js.map +1 -8
- package/js/highcharts-3d.src.js +39 -32
- 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 +63 -61
- package/js/highcharts-more.js.map +1 -8
- package/js/highcharts-more.src.js +135 -75
- package/js/highcharts.js +396 -387
- package/js/highcharts.js.map +1 -8
- package/js/highcharts.src.js +10765 -4659
- package/js/highmaps.js +419 -411
- package/js/highmaps.js.map +1 -8
- package/js/highmaps.src.js +10198 -4285
- package/js/highstock.js +529 -516
- package/js/highstock.js.map +1 -8
- package/js/highstock.src.js +12108 -4962
- package/js/indicators/accumulation-distribution.js +4 -3
- package/js/indicators/accumulation-distribution.js.map +1 -8
- package/js/indicators/accumulation-distribution.src.js +6 -2
- package/js/indicators/atr.js +4 -3
- package/js/indicators/atr.js.map +1 -8
- package/js/indicators/atr.src.js +6 -2
- package/js/indicators/bollinger-bands.js +7 -6
- package/js/indicators/bollinger-bands.js.map +1 -8
- package/js/indicators/bollinger-bands.src.js +7 -3
- package/js/indicators/cci.js +4 -3
- package/js/indicators/cci.js.map +1 -8
- package/js/indicators/cci.src.js +6 -2
- package/js/indicators/cmf.js +5 -4
- package/js/indicators/cmf.js.map +1 -8
- package/js/indicators/cmf.src.js +6 -2
- package/js/indicators/ema.js +4 -3
- package/js/indicators/ema.js.map +1 -8
- package/js/indicators/ema.src.js +6 -2
- package/js/indicators/ichimoku-kinko-hyo.js +10 -9
- package/js/indicators/ichimoku-kinko-hyo.js.map +1 -8
- package/js/indicators/ichimoku-kinko-hyo.src.js +6 -2
- package/js/indicators/indicators.js +6 -5
- package/js/indicators/indicators.js.map +1 -8
- package/js/indicators/indicators.src.js +34 -15
- package/js/indicators/macd.js +11 -10
- package/js/indicators/macd.js.map +1 -8
- package/js/indicators/macd.src.js +10 -6
- package/js/indicators/mfi.js +5 -3
- package/js/indicators/mfi.js.map +1 -8
- package/js/indicators/mfi.src.js +6 -2
- package/js/indicators/momentum.js +4 -3
- package/js/indicators/momentum.js.map +1 -8
- package/js/indicators/momentum.src.js +7 -3
- package/js/indicators/pivot-points.js +8 -7
- package/js/indicators/pivot-points.js.map +1 -8
- package/js/indicators/pivot-points.src.js +12 -3
- package/js/indicators/price-envelopes.js +7 -6
- package/js/indicators/price-envelopes.js.map +1 -8
- package/js/indicators/price-envelopes.src.js +7 -3
- package/js/indicators/psar.js +5 -4
- package/js/indicators/psar.js.map +1 -8
- package/js/indicators/psar.src.js +6 -2
- package/js/indicators/roc.js +4 -3
- package/js/indicators/roc.js.map +1 -8
- package/js/indicators/roc.src.js +6 -2
- package/js/indicators/rsi.js +4 -3
- package/js/indicators/rsi.js.map +1 -8
- package/js/indicators/rsi.src.js +6 -2
- package/js/indicators/stochastic.js +7 -5
- package/js/indicators/stochastic.js.map +1 -8
- package/js/indicators/stochastic.src.js +14 -8
- package/js/indicators/volume-by-price.js +13 -12
- package/js/indicators/volume-by-price.js.map +1 -8
- package/js/indicators/volume-by-price.src.js +6 -2
- package/js/indicators/vwap.js +4 -3
- package/js/indicators/vwap.js.map +1 -8
- package/js/indicators/vwap.src.js +6 -2
- package/js/indicators/wma.js +4 -3
- package/js/indicators/wma.js.map +1 -8
- package/js/indicators/wma.src.js +6 -2
- package/js/indicators/zigzag.js +5 -3
- package/js/indicators/zigzag.js.map +1 -8
- package/js/indicators/zigzag.src.js +6 -2
- package/js/modules/accessibility.js +52 -51
- package/js/modules/accessibility.js.map +1 -8
- package/js/modules/accessibility.src.js +86 -45
- package/js/modules/annotations.js +22 -21
- package/js/modules/annotations.js.map +1 -8
- package/js/modules/annotations.src.js +8 -4
- 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 +15 -13
- package/js/modules/boost-canvas.js.map +1 -8
- package/js/modules/boost-canvas.src.js +24 -9
- package/js/modules/boost.js +57 -52
- package/js/modules/boost.js.map +1 -8
- package/js/modules/boost.src.js +305 -138
- package/js/modules/broken-axis.js +12 -10
- package/js/modules/broken-axis.js.map +1 -8
- package/js/modules/broken-axis.src.js +175 -136
- package/js/modules/bullet.js +3 -2
- package/js/modules/bullet.js.map +1 -8
- package/js/modules/bullet.src.js +7 -3
- 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 +25 -24
- package/js/modules/data.js.map +1 -8
- package/js/modules/data.src.js +14 -8
- package/js/modules/drag-panes.js +9 -8
- package/js/modules/drag-panes.js.map +1 -8
- package/js/modules/drag-panes.src.js +5 -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 +20 -19
- package/js/modules/drilldown.js.map +1 -8
- package/js/modules/drilldown.src.js +9 -3
- package/js/modules/export-data.js +20 -19
- package/js/modules/export-data.js.map +1 -8
- package/js/modules/export-data.src.js +17 -3
- package/js/modules/exporting.js +24 -23
- package/js/modules/exporting.js.map +1 -8
- package/js/modules/exporting.src.js +68 -38
- package/js/modules/funnel.js +8 -6
- package/js/modules/funnel.js.map +1 -8
- package/js/modules/funnel.src.js +11 -7
- package/js/modules/gantt.js +81 -18
- package/js/modules/gantt.js.map +1 -8
- package/js/modules/gantt.src.js +5494 -372
- package/js/modules/grid-axis.js +16 -10
- package/js/modules/grid-axis.js.map +1 -8
- package/js/modules/grid-axis.src.js +735 -293
- package/js/modules/heatmap.js +22 -21
- package/js/modules/heatmap.js.map +1 -8
- package/js/modules/heatmap.src.js +137 -62
- package/js/modules/histogram-bellcurve.js +9 -8
- package/js/modules/histogram-bellcurve.js.map +1 -8
- package/js/modules/histogram-bellcurve.src.js +35 -29
- package/js/modules/item-series.js +6 -4
- package/js/modules/item-series.js.map +1 -8
- package/js/modules/item-series.src.js +42 -13
- package/js/modules/map.js +63 -62
- package/js/modules/map.js.map +1 -8
- package/js/modules/map.src.js +353 -145
- package/js/modules/no-data-to-display.js +5 -4
- package/js/modules/no-data-to-display.js.map +1 -8
- package/js/modules/no-data-to-display.src.js +10 -6
- package/js/modules/offline-exporting.js +14 -13
- package/js/modules/offline-exporting.js.map +1 -8
- package/js/modules/offline-exporting.src.js +6 -2
- package/js/modules/oldie.js +29 -27
- package/js/modules/oldie.js.map +1 -8
- package/js/modules/oldie.src.js +20 -11
- package/js/modules/overlapping-datalabels.js +4 -3
- package/js/modules/overlapping-datalabels.js.map +1 -8
- package/js/modules/overlapping-datalabels.src.js +6 -2
- package/js/modules/parallel-coordinates.js +10 -9
- package/js/modules/parallel-coordinates.js.map +1 -8
- package/js/modules/parallel-coordinates.src.js +9 -4
- package/js/modules/pareto.js +5 -4
- package/js/modules/pareto.js.map +1 -8
- package/js/modules/pareto.src.js +6 -2
- 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 +13 -12
- package/js/modules/pattern-fill.js.map +1 -8
- package/js/modules/pattern-fill.src.js +5 -1
- package/js/modules/sankey.js +13 -12
- package/js/modules/sankey.js.map +1 -8
- package/js/modules/sankey.src.js +29 -9
- package/js/modules/series-label.js +17 -15
- package/js/modules/series-label.js.map +1 -8
- package/js/modules/series-label.src.js +12 -8
- package/js/modules/solid-gauge.js +9 -8
- package/js/modules/solid-gauge.js.map +1 -8
- package/js/modules/solid-gauge.src.js +14 -7
- package/js/modules/static-scale.js +4 -3
- package/js/modules/static-scale.js.map +1 -8
- package/js/modules/static-scale.src.js +69 -26
- package/js/modules/stock.js +136 -132
- package/js/modules/stock.js.map +1 -8
- package/js/modules/stock.src.js +1543 -499
- package/js/modules/streamgraph.js +4 -3
- package/js/modules/streamgraph.js.map +1 -8
- package/js/modules/streamgraph.src.js +10 -6
- package/js/modules/sunburst.js +40 -39
- package/js/modules/sunburst.js.map +1 -8
- package/js/modules/sunburst.src.js +38 -31
- package/js/modules/tilemap.js +19 -18
- package/js/modules/tilemap.js.map +1 -8
- package/js/modules/tilemap.src.js +363 -190
- 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 +27 -26
- package/js/modules/treemap.js.map +1 -8
- package/js/modules/treemap.src.js +34 -27
- package/js/modules/variable-pie.js +8 -7
- package/js/modules/variable-pie.js.map +1 -8
- package/js/modules/variable-pie.src.js +8 -4
- package/js/modules/variwide.js +8 -7
- package/js/modules/variwide.js.map +1 -8
- package/js/modules/variwide.src.js +42 -26
- package/js/modules/vector.js +7 -6
- package/js/modules/vector.js.map +1 -8
- package/js/modules/vector.src.js +104 -30
- package/js/modules/windbarb.js +11 -10
- package/js/modules/windbarb.js.map +1 -8
- package/js/modules/windbarb.src.js +11 -7
- package/js/modules/wordcloud.js +18 -15
- package/js/modules/wordcloud.js.map +1 -8
- package/js/modules/wordcloud.src.js +142 -53
- package/js/modules/xrange.js +12 -10
- package/js/modules/xrange.js.map +1 -8
- package/js/modules/xrange.src.js +262 -71
- package/js/themes/avocado.js +3 -2
- package/js/themes/avocado.js.map +1 -8
- package/js/themes/avocado.src.js +5 -1
- package/js/themes/dark-blue.js +9 -8
- package/js/themes/dark-blue.js.map +1 -8
- package/js/themes/dark-blue.src.js +7 -3
- package/js/themes/dark-green.js +9 -8
- package/js/themes/dark-green.js.map +1 -8
- package/js/themes/dark-green.src.js +7 -3
- package/js/themes/dark-unica.js +9 -7
- package/js/themes/dark-unica.js.map +1 -8
- package/js/themes/dark-unica.src.js +7 -3
- package/js/themes/gray.js +10 -8
- package/js/themes/gray.js.map +1 -8
- package/js/themes/gray.src.js +7 -3
- package/js/themes/grid-light.js +5 -4
- package/js/themes/grid-light.js.map +1 -8
- package/js/themes/grid-light.src.js +7 -3
- package/js/themes/grid.js +6 -5
- package/js/themes/grid.js.map +1 -8
- package/js/themes/grid.src.js +7 -3
- package/js/themes/sand-signika.js +6 -5
- package/js/themes/sand-signika.js.map +1 -8
- package/js/themes/sand-signika.src.js +7 -3
- package/js/themes/skies.js +6 -5
- package/js/themes/skies.js.map +1 -8
- package/js/themes/skies.src.js +7 -3
- package/js/themes/sunset.js +3 -2
- package/js/themes/sunset.js.map +1 -8
- package/js/themes/sunset.src.js +5 -1
- package/modules/accessibility.js +53 -51
- package/modules/accessibility.js.map +1 -8
- package/modules/accessibility.src.js +86 -45
- package/modules/annotations.js +24 -22
- package/modules/annotations.js.map +1 -8
- package/modules/annotations.src.js +8 -4
- 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 +15 -13
- package/modules/boost-canvas.js.map +1 -8
- package/modules/boost-canvas.src.js +24 -9
- package/modules/boost.js +57 -52
- package/modules/boost.js.map +1 -8
- package/modules/boost.src.js +305 -138
- package/modules/broken-axis.js +12 -10
- package/modules/broken-axis.js.map +1 -8
- package/modules/broken-axis.src.js +175 -136
- package/modules/bullet.js +6 -5
- package/modules/bullet.js.map +1 -8
- package/modules/bullet.src.js +7 -3
- 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 +25 -24
- package/modules/data.js.map +1 -8
- package/modules/data.src.js +14 -8
- package/modules/drag-panes.js +9 -8
- package/modules/drag-panes.js.map +1 -8
- package/modules/drag-panes.src.js +5 -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 +16 -15
- package/modules/drilldown.js.map +1 -8
- package/modules/drilldown.src.js +9 -3
- package/modules/export-data.js +20 -19
- package/modules/export-data.js.map +1 -8
- package/modules/export-data.src.js +17 -3
- package/modules/exporting.js +23 -21
- package/modules/exporting.js.map +1 -8
- package/modules/exporting.src.js +68 -38
- package/modules/funnel.js +8 -7
- package/modules/funnel.js.map +1 -8
- package/modules/funnel.src.js +11 -7
- package/modules/gantt.js +84 -19
- package/modules/gantt.js.map +1 -8
- package/modules/gantt.src.js +5557 -379
- package/modules/grid-axis.js +17 -10
- package/modules/grid-axis.js.map +1 -8
- package/modules/grid-axis.src.js +736 -293
- package/modules/heatmap.js +22 -21
- package/modules/heatmap.js.map +1 -8
- package/modules/heatmap.src.js +139 -63
- package/modules/histogram-bellcurve.js +9 -8
- package/modules/histogram-bellcurve.js.map +1 -8
- package/modules/histogram-bellcurve.src.js +35 -29
- package/modules/item-series.js +6 -4
- package/modules/item-series.js.map +1 -8
- package/modules/item-series.src.js +42 -13
- package/modules/map.js +65 -64
- package/modules/map.js.map +1 -8
- package/modules/map.src.js +365 -152
- package/modules/no-data-to-display.js +5 -4
- package/modules/no-data-to-display.js.map +1 -8
- package/modules/no-data-to-display.src.js +10 -6
- package/modules/offline-exporting.js +14 -12
- package/modules/offline-exporting.js.map +1 -8
- package/modules/offline-exporting.src.js +6 -2
- package/modules/oldie.js +29 -27
- package/modules/oldie.js.map +1 -8
- package/modules/oldie.src.js +20 -11
- package/modules/overlapping-datalabels.js +4 -3
- package/modules/overlapping-datalabels.js.map +1 -8
- package/modules/overlapping-datalabels.src.js +6 -2
- package/modules/parallel-coordinates.js +10 -9
- package/modules/parallel-coordinates.js.map +1 -8
- package/modules/parallel-coordinates.src.js +9 -4
- package/modules/pareto.js +5 -4
- package/modules/pareto.js.map +1 -8
- package/modules/pareto.src.js +6 -2
- 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 +13 -12
- package/modules/pattern-fill.js.map +1 -8
- package/modules/pattern-fill.src.js +5 -1
- package/modules/sankey.js +13 -12
- package/modules/sankey.js.map +1 -8
- package/modules/sankey.src.js +34 -12
- package/modules/series-label.js +17 -15
- package/modules/series-label.js.map +1 -8
- package/modules/series-label.src.js +12 -8
- package/modules/solid-gauge.js +9 -8
- package/modules/solid-gauge.js.map +1 -8
- package/modules/solid-gauge.src.js +16 -9
- package/modules/static-scale.js +4 -3
- package/modules/static-scale.js.map +1 -8
- package/modules/static-scale.src.js +69 -26
- package/modules/stock.js +143 -139
- package/modules/stock.js.map +1 -8
- package/modules/stock.src.js +1701 -566
- package/modules/streamgraph.js +4 -3
- package/modules/streamgraph.js.map +1 -8
- package/modules/streamgraph.src.js +10 -6
- package/modules/sunburst.js +42 -41
- package/modules/sunburst.js.map +1 -8
- package/modules/sunburst.src.js +39 -32
- package/modules/tilemap.js +18 -17
- package/modules/tilemap.js.map +1 -8
- package/modules/tilemap.src.js +365 -191
- package/modules/treegrid.js +52 -0
- package/modules/treegrid.js.map +1 -0
- package/modules/treegrid.src.js +2797 -0
- package/modules/treemap.js +29 -28
- package/modules/treemap.js.map +1 -8
- package/modules/treemap.src.js +35 -28
- package/modules/variable-pie.js +8 -7
- package/modules/variable-pie.js.map +1 -8
- package/modules/variable-pie.src.js +8 -4
- package/modules/variwide.js +8 -7
- package/modules/variwide.js.map +1 -8
- package/modules/variwide.src.js +42 -26
- package/modules/vector.js +7 -6
- package/modules/vector.js.map +1 -8
- package/modules/vector.src.js +104 -30
- package/modules/windbarb.js +11 -10
- package/modules/windbarb.js.map +1 -8
- package/modules/windbarb.src.js +11 -7
- package/modules/wordcloud.js +18 -15
- package/modules/wordcloud.js.map +1 -8
- package/modules/wordcloud.src.js +142 -53
- package/modules/xrange.js +13 -11
- package/modules/xrange.js.map +1 -8
- package/modules/xrange.src.js +264 -80
- package/package.json +1 -1
- package/themes/avocado.js +3 -2
- package/themes/avocado.js.map +1 -8
- package/themes/avocado.src.js +5 -1
- package/themes/dark-blue.js +9 -8
- package/themes/dark-blue.js.map +1 -8
- package/themes/dark-blue.src.js +7 -3
- package/themes/dark-green.js +9 -8
- package/themes/dark-green.js.map +1 -8
- package/themes/dark-green.src.js +7 -3
- package/themes/dark-unica.js +9 -7
- package/themes/dark-unica.js.map +1 -8
- package/themes/dark-unica.src.js +7 -3
- package/themes/gray.js +10 -8
- package/themes/gray.js.map +1 -8
- package/themes/gray.src.js +7 -3
- package/themes/grid-light.js +5 -4
- package/themes/grid-light.js.map +1 -8
- package/themes/grid-light.src.js +7 -3
- package/themes/grid.js +6 -5
- package/themes/grid.js.map +1 -8
- package/themes/grid.src.js +7 -3
- package/themes/sand-signika.js +6 -5
- package/themes/sand-signika.js.map +1 -8
- package/themes/sand-signika.src.js +7 -3
- package/themes/skies.js +6 -5
- package/themes/skies.js.map +1 -8
- package/themes/skies.src.js +7 -3
- package/themes/sunset.js +3 -2
- package/themes/sunset.js.map +1 -8
- package/themes/sunset.src.js +5 -1
|
@@ -1,13 +1,261 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* (c) 2010-
|
|
2
|
+
* (c) 2010-2018 Torstein Honsi
|
|
3
3
|
*
|
|
4
4
|
* License: www.highcharts.com/license
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
+
/**
|
|
8
|
+
* Options to align the element relative to the chart or another box.
|
|
9
|
+
*
|
|
10
|
+
* @typedef Highcharts.AlignObject
|
|
11
|
+
*
|
|
12
|
+
* @property {string} [align='left']
|
|
13
|
+
* Horizontal alignment. Can be one of `left`, `center` and
|
|
14
|
+
* `right`.
|
|
15
|
+
*
|
|
16
|
+
* @property {string} [verticalAlign='top']
|
|
17
|
+
* Vertical alignment. Can be one of `top`, `middle` and `bottom`.
|
|
18
|
+
*
|
|
19
|
+
* @property {number} [x=0]
|
|
20
|
+
* Horizontal pixel offset from alignment.
|
|
21
|
+
*
|
|
22
|
+
* @property {number} [y=0]
|
|
23
|
+
* Vertical pixel offset from alignment.
|
|
24
|
+
*
|
|
25
|
+
* @property {boolean} [alignByTranslate=false]
|
|
26
|
+
* Use the `transform` attribute with translateX and translateY
|
|
27
|
+
* custom attributes to align this elements rather than `x` and
|
|
28
|
+
* `y` attributes.
|
|
29
|
+
*/
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Bounding box of an element.
|
|
33
|
+
*
|
|
34
|
+
* @typedef Highcharts.BBoxObject
|
|
35
|
+
*
|
|
36
|
+
* @property {number} height
|
|
37
|
+
* Height of the bounding box.
|
|
38
|
+
*
|
|
39
|
+
* @property {number} width
|
|
40
|
+
* Width of the bounding box.
|
|
41
|
+
*
|
|
42
|
+
* @property {number} x
|
|
43
|
+
* Horizontal position of the bounding box.
|
|
44
|
+
*
|
|
45
|
+
* @property {number} y
|
|
46
|
+
* Vertical position of the bounding box.
|
|
47
|
+
*/
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* A clipping rectangle that can be applied to one or more
|
|
51
|
+
* {@link SVGElement} instances. It is instanciated with the
|
|
52
|
+
* {@link SVGRenderer#clipRect} function and applied with the
|
|
53
|
+
* {@link SVGElement#clip} function.
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* var circle = renderer.circle(100, 100, 100)
|
|
57
|
+
* .attr({ fill: 'red' })
|
|
58
|
+
* .add();
|
|
59
|
+
* var clipRect = renderer.clipRect(100, 100, 100, 100);
|
|
60
|
+
*
|
|
61
|
+
* // Leave only the lower right quarter visible
|
|
62
|
+
* circle.clip(clipRect);
|
|
63
|
+
*
|
|
64
|
+
* @typedef {Highcharts.SVGElement} Highcharts.ClipRectElement
|
|
65
|
+
*/
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* The font metrics.
|
|
69
|
+
*
|
|
70
|
+
* @typedef Highcharts.FontMetricsObject
|
|
71
|
+
*
|
|
72
|
+
* @property {number} b
|
|
73
|
+
* The baseline relative to the top of the box.
|
|
74
|
+
*
|
|
75
|
+
* @property {number} h
|
|
76
|
+
* The line height.
|
|
77
|
+
*
|
|
78
|
+
* @property {number} f
|
|
79
|
+
* The font size.
|
|
80
|
+
*/
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Gradient options instead of a solid color.
|
|
84
|
+
*
|
|
85
|
+
* @example
|
|
86
|
+
* // Linear gradient used as a color option
|
|
87
|
+
* color: {
|
|
88
|
+
* linearGradient: { x1: 0, x2: 0, y1: 0, y2: 1 },
|
|
89
|
+
* stops: [
|
|
90
|
+
* [0, '#003399'], // start
|
|
91
|
+
* [0.5, '#ffffff'], // middle
|
|
92
|
+
* [1, '#3366AA'] // end
|
|
93
|
+
* ]
|
|
94
|
+
* }
|
|
95
|
+
* }
|
|
96
|
+
*
|
|
97
|
+
* @private
|
|
98
|
+
* @typedef Highcharts.GradientColorObject
|
|
99
|
+
*
|
|
100
|
+
* @property {Highcharts.LinearGradientColorObject} linearGradient
|
|
101
|
+
* Holds an object that defines the start position and the end
|
|
102
|
+
* position relative to the shape.
|
|
103
|
+
*
|
|
104
|
+
* @property {Highcharts.RadialGradientColorObject} radialGradient
|
|
105
|
+
* Holds an object that defines the center position and the
|
|
106
|
+
* radius.
|
|
107
|
+
*
|
|
108
|
+
* @property {Array<Array<number|string>>} stops
|
|
109
|
+
* The first item in each tuple is the position in the gradient,
|
|
110
|
+
* where 0 is the start of the gradient and 1 is the end of the
|
|
111
|
+
* gradient. Multiple stops can be applied. The second item is the
|
|
112
|
+
* color for each stop. This color can also be given in the rgba
|
|
113
|
+
* format.
|
|
114
|
+
*/
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Defines the start position and the end position for a gradient relative
|
|
118
|
+
* to the shape.
|
|
119
|
+
*
|
|
120
|
+
* @private
|
|
121
|
+
* @typedef Highcharts.LinearGradientColorObject
|
|
122
|
+
*
|
|
123
|
+
* @property {number} x1
|
|
124
|
+
* Start horizontal position of the gradient. Ranges 0-1.
|
|
125
|
+
*
|
|
126
|
+
* @property {number} x2
|
|
127
|
+
* End horizontal position of the gradient. Ranges 0-1.
|
|
128
|
+
*
|
|
129
|
+
* @property {number} y1
|
|
130
|
+
* Start vertical position of the gradient. Ranges 0-1.
|
|
131
|
+
*
|
|
132
|
+
* @property {number} y2
|
|
133
|
+
* End vertical position of the gradient. Ranges 0-1.
|
|
134
|
+
*/
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Defines the center position and the radius for a gradient.
|
|
138
|
+
*
|
|
139
|
+
* @private
|
|
140
|
+
* @typedef Highcharts.RadialGradientColorObject
|
|
141
|
+
*
|
|
142
|
+
* @property {number} cx
|
|
143
|
+
* Center horizontal position relative to the shape. Ranges 0-1.
|
|
144
|
+
*
|
|
145
|
+
* @property {number} cy
|
|
146
|
+
* Center vertical position relative to the shape. Ranges 0-1.
|
|
147
|
+
*
|
|
148
|
+
* @property {number} r
|
|
149
|
+
* Radius relative to the shape. Ranges 0-1.
|
|
150
|
+
*/
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* A rectangle.
|
|
154
|
+
*
|
|
155
|
+
* @typedef Highcharts.RectangleObject
|
|
156
|
+
*
|
|
157
|
+
* @property {number} height
|
|
158
|
+
* Height of the rectangle.
|
|
159
|
+
*
|
|
160
|
+
* @property {number} width
|
|
161
|
+
* Width of the rectangle.
|
|
162
|
+
*
|
|
163
|
+
* @property {number} x
|
|
164
|
+
* Horizontal position of the rectangle.
|
|
165
|
+
*
|
|
166
|
+
* @property {number} y
|
|
167
|
+
* Vertical position of the rectangle.
|
|
168
|
+
*/
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* The shadow options.
|
|
172
|
+
*
|
|
173
|
+
* @typedef Highcharts.ShadowOptionsObject
|
|
174
|
+
*
|
|
175
|
+
* @property {string} [color=#000000]
|
|
176
|
+
* The shadow color.
|
|
177
|
+
*
|
|
178
|
+
* @property {number} [offsetX=1]
|
|
179
|
+
* The horizontal offset from the element.
|
|
180
|
+
*
|
|
181
|
+
* @property {number} [offsetY=1]
|
|
182
|
+
* The vertical offset from the element.
|
|
183
|
+
*
|
|
184
|
+
* @property {number} [opacity=0.15]
|
|
185
|
+
* The shadow opacity.
|
|
186
|
+
*
|
|
187
|
+
* @property {number} [width=3]
|
|
188
|
+
* The shadow width or distance from the element.
|
|
189
|
+
*/
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* Serialized form of an SVG definition, including children. Some key
|
|
193
|
+
* property names are reserved: tagName, textContent, and children.
|
|
194
|
+
*
|
|
195
|
+
* @typedef Highcharts.SVGDefinitionObject
|
|
196
|
+
*
|
|
197
|
+
* @property {number|string|Array<Highcharts.SVGDefinitionObject>|undefined} [key:string]
|
|
198
|
+
*
|
|
199
|
+
* @property {Array<Highcharts.SVGDefinitionObject>} [children]
|
|
200
|
+
*
|
|
201
|
+
* @property {string} [tagName]
|
|
202
|
+
*
|
|
203
|
+
* @property {string} [textContent]
|
|
204
|
+
*/
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* An extendable collection of functions for defining symbol paths.
|
|
208
|
+
*
|
|
209
|
+
* @typedef Highcharts.SymbolDictionary
|
|
210
|
+
*
|
|
211
|
+
* @property {Function} [key:Highcharts.SymbolKey]
|
|
212
|
+
*/
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* Can be one of `arc`, `callout`, `circle`, `diamond`, `square`,
|
|
216
|
+
* `triangle`, `triangle-down`. Symbols are used internally for point
|
|
217
|
+
* markers, button and label borders and backgrounds, or custom shapes.
|
|
218
|
+
* Extendable by adding to {@link SVGRenderer#symbols}.
|
|
219
|
+
*
|
|
220
|
+
* @typedef {string} Highcharts.SymbolKey
|
|
221
|
+
*
|
|
222
|
+
* @validvalue ["arc", "callout", "circle", "diamond", "square", "triangle",
|
|
223
|
+
* "triangle-down"]
|
|
224
|
+
*/
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* Additional options, depending on the actual symbol drawn.
|
|
228
|
+
*
|
|
229
|
+
* @typedef Highcharts.SymbolOptionsObject
|
|
230
|
+
*
|
|
231
|
+
* @property {number} anchorX
|
|
232
|
+
* The anchor X position for the `callout` symbol. This is where
|
|
233
|
+
* the chevron points to.
|
|
234
|
+
*
|
|
235
|
+
* @property {number} anchorY
|
|
236
|
+
* The anchor Y position for the `callout` symbol. This is where
|
|
237
|
+
* the chevron points to.
|
|
238
|
+
*
|
|
239
|
+
* @property {number} end
|
|
240
|
+
* The end angle of an `arc` symbol.
|
|
241
|
+
*
|
|
242
|
+
* @property {boolean} open
|
|
243
|
+
* Whether to draw `arc` symbol open or closed.
|
|
244
|
+
*
|
|
245
|
+
* @property {number} r
|
|
246
|
+
* The radius of an `arc` symbol, or the border radius for the
|
|
247
|
+
* `callout` symbol.
|
|
248
|
+
*
|
|
249
|
+
* @property {number} start
|
|
250
|
+
* The start angle of an `arc` symbol.
|
|
251
|
+
*/
|
|
252
|
+
|
|
7
253
|
'use strict';
|
|
254
|
+
|
|
8
255
|
import H from './Globals.js';
|
|
9
256
|
import './Utilities.js';
|
|
10
257
|
import './Color.js';
|
|
258
|
+
|
|
11
259
|
var SVGElement,
|
|
12
260
|
SVGRenderer,
|
|
13
261
|
|
|
@@ -47,9 +295,6 @@ var SVGElement,
|
|
|
47
295
|
symbolSizes = H.symbolSizes,
|
|
48
296
|
win = H.win;
|
|
49
297
|
|
|
50
|
-
/**
|
|
51
|
-
* @typedef {Object} SVGDOMElement - An SVG DOM element.
|
|
52
|
-
*/
|
|
53
298
|
/**
|
|
54
299
|
* The SVGElement prototype is a JavaScript wrapper for SVG elements used in the
|
|
55
300
|
* rendering layer of Highcharts. Combined with the {@link
|
|
@@ -65,7 +310,8 @@ var SVGElement,
|
|
|
65
310
|
* [label]{@link Highcharts.SVGRenderer#label}, [g]{@link
|
|
66
311
|
* Highcharts.SVGRenderer#g} and more.
|
|
67
312
|
*
|
|
68
|
-
* @class
|
|
313
|
+
* @class
|
|
314
|
+
* @name Highcharts.SVGElement
|
|
69
315
|
*/
|
|
70
316
|
SVGElement = H.SVGElement = function () {
|
|
71
317
|
return this;
|
|
@@ -80,21 +326,24 @@ extend(SVGElement.prototype, /** @lends Highcharts.SVGElement.prototype */ {
|
|
|
80
326
|
* For labels, these CSS properties are applied to the `text` node directly.
|
|
81
327
|
*
|
|
82
328
|
* @private
|
|
83
|
-
* @
|
|
329
|
+
* @name Highcharts.SVGElement#textProps
|
|
330
|
+
* @type {Array<string>}
|
|
84
331
|
*/
|
|
85
332
|
textProps: ['direction', 'fontSize', 'fontWeight', 'fontFamily',
|
|
86
333
|
'fontStyle', 'color', 'lineHeight', 'width', 'textAlign',
|
|
87
|
-
'textDecoration', 'textOverflow', 'textOutline'],
|
|
334
|
+
'textDecoration', 'textOverflow', 'textOutline', 'cursor'],
|
|
88
335
|
|
|
89
336
|
/**
|
|
90
337
|
* Initialize the SVG element. This function only exists to make the
|
|
91
338
|
* initiation process overridable. It should not be called directly.
|
|
92
339
|
*
|
|
93
|
-
* @
|
|
94
|
-
*
|
|
95
|
-
* @param
|
|
96
|
-
*
|
|
340
|
+
* @function Highcharts.SVGElement#init
|
|
341
|
+
*
|
|
342
|
+
* @param {Highcharts.SVGRenderer} renderer
|
|
343
|
+
* The SVGRenderer instance to initialize to.
|
|
97
344
|
*
|
|
345
|
+
* @param {string} nodeName
|
|
346
|
+
* The SVG node name.
|
|
98
347
|
*/
|
|
99
348
|
init: function (renderer, nodeName) {
|
|
100
349
|
|
|
@@ -102,9 +351,8 @@ extend(SVGElement.prototype, /** @lends Highcharts.SVGElement.prototype */ {
|
|
|
102
351
|
* The primary DOM node. Each `SVGElement` instance wraps a main DOM
|
|
103
352
|
* node, but may also represent more nodes.
|
|
104
353
|
*
|
|
105
|
-
* @name
|
|
106
|
-
* @
|
|
107
|
-
* @type {SVGDOMNode|HTMLDOMNode}
|
|
354
|
+
* @name Highcharts.SVGElement#element
|
|
355
|
+
* @type {Highcharts.SVGDOMElement|Highcharts.HTMLDOMElement}
|
|
108
356
|
*/
|
|
109
357
|
this.element = nodeName === 'span' ?
|
|
110
358
|
createElement(nodeName) :
|
|
@@ -113,9 +361,8 @@ extend(SVGElement.prototype, /** @lends Highcharts.SVGElement.prototype */ {
|
|
|
113
361
|
/**
|
|
114
362
|
* The renderer that the SVGElement belongs to.
|
|
115
363
|
*
|
|
116
|
-
* @name renderer
|
|
117
|
-
* @
|
|
118
|
-
* @type {SVGRenderer}
|
|
364
|
+
* @name Highcharts.SVGElement#renderer
|
|
365
|
+
* @type {Highcharts.SVGRenderer}
|
|
119
366
|
*/
|
|
120
367
|
this.renderer = renderer;
|
|
121
368
|
},
|
|
@@ -123,14 +370,22 @@ extend(SVGElement.prototype, /** @lends Highcharts.SVGElement.prototype */ {
|
|
|
123
370
|
/**
|
|
124
371
|
* Animate to given attributes or CSS properties.
|
|
125
372
|
*
|
|
126
|
-
* @param {SVGAttributes} params SVG attributes or CSS to animate.
|
|
127
|
-
* @param {AnimationOptions} [options] Animation options.
|
|
128
|
-
* @param {Function} [complete] Function to perform at the end of animation.
|
|
129
|
-
*
|
|
130
373
|
* @sample highcharts/members/element-on/
|
|
131
374
|
* Setting some attributes by animation
|
|
132
375
|
*
|
|
133
|
-
* @
|
|
376
|
+
* @function Highcharts.SVGElement#animate
|
|
377
|
+
*
|
|
378
|
+
* @param {Highcharts.SVGAttributes} params
|
|
379
|
+
* SVG attributes or CSS to animate.
|
|
380
|
+
*
|
|
381
|
+
* @param {Highcharts.AnimationOptionsObject} [options]
|
|
382
|
+
* Animation options.
|
|
383
|
+
*
|
|
384
|
+
* @param {Function} [complete]
|
|
385
|
+
* Function to perform at the end of animation.
|
|
386
|
+
*
|
|
387
|
+
* @return {Highcharts.SVGElement}
|
|
388
|
+
* Returns the SVGElement for chaining.
|
|
134
389
|
*/
|
|
135
390
|
animate: function (params, options, complete) {
|
|
136
391
|
var animOptions = H.animObject(
|
|
@@ -152,54 +407,22 @@ extend(SVGElement.prototype, /** @lends Highcharts.SVGElement.prototype */ {
|
|
|
152
407
|
return this;
|
|
153
408
|
},
|
|
154
409
|
|
|
155
|
-
/**
|
|
156
|
-
* @typedef {Object} GradientOptions
|
|
157
|
-
* @property {Object} linearGradient Holds an object that defines the start
|
|
158
|
-
* position and the end position relative to the shape.
|
|
159
|
-
* @property {Number} linearGradient.x1 Start horizontal position of the
|
|
160
|
-
* gradient. Ranges 0-1.
|
|
161
|
-
* @property {Number} linearGradient.x2 End horizontal position of the
|
|
162
|
-
* gradient. Ranges 0-1.
|
|
163
|
-
* @property {Number} linearGradient.y1 Start vertical position of the
|
|
164
|
-
* gradient. Ranges 0-1.
|
|
165
|
-
* @property {Number} linearGradient.y2 End vertical position of the
|
|
166
|
-
* gradient. Ranges 0-1.
|
|
167
|
-
* @property {Object} radialGradient Holds an object that defines the center
|
|
168
|
-
* position and the radius.
|
|
169
|
-
* @property {Number} radialGradient.cx Center horizontal position relative
|
|
170
|
-
* to the shape. Ranges 0-1.
|
|
171
|
-
* @property {Number} radialGradient.cy Center vertical position relative
|
|
172
|
-
* to the shape. Ranges 0-1.
|
|
173
|
-
* @property {Number} radialGradient.r Radius relative to the shape. Ranges
|
|
174
|
-
* 0-1.
|
|
175
|
-
* @property {Array<Array<Number|String>>} stops The first item in each
|
|
176
|
-
* tuple is the position in the gradient, where 0 is the start of the
|
|
177
|
-
* gradient and 1 is the end of the gradient. Multiple stops can be
|
|
178
|
-
* applied. The second item is the color for each stop. This color can
|
|
179
|
-
* also be given in the rgba format.
|
|
180
|
-
*
|
|
181
|
-
* @example
|
|
182
|
-
* // Linear gradient used as a color option
|
|
183
|
-
* color: {
|
|
184
|
-
* linearGradient: { x1: 0, x2: 0, y1: 0, y2: 1 },
|
|
185
|
-
* stops: [
|
|
186
|
-
* [0, '#003399'], // start
|
|
187
|
-
* [0.5, '#ffffff'], // middle
|
|
188
|
-
* [1, '#3366AA'] // end
|
|
189
|
-
* ]
|
|
190
|
-
* }
|
|
191
|
-
* }
|
|
192
|
-
*/
|
|
193
410
|
/**
|
|
194
411
|
* Build and apply an SVG gradient out of a common JavaScript configuration
|
|
195
412
|
* object. This function is called from the attribute setters. An event
|
|
196
413
|
* hook is added for supporting other complex color types.
|
|
197
414
|
*
|
|
198
415
|
* @private
|
|
199
|
-
* @
|
|
200
|
-
*
|
|
201
|
-
*
|
|
202
|
-
*
|
|
416
|
+
* @function Highcharts.SVGElement#complexColor
|
|
417
|
+
*
|
|
418
|
+
* @param {Highcharts.GradientColorObject} color
|
|
419
|
+
* The gradient options structure.
|
|
420
|
+
*
|
|
421
|
+
* @param {string} prop
|
|
422
|
+
* The property to apply, can either be `fill` or `stroke`.
|
|
423
|
+
*
|
|
424
|
+
* @param {Highcharts.SVGDOMElement} elem
|
|
425
|
+
* SVG DOM element to apply the gradient on.
|
|
203
426
|
*/
|
|
204
427
|
complexColor: function (color, prop, elem) {
|
|
205
428
|
var renderer = this.renderer,
|
|
@@ -327,12 +550,9 @@ extend(SVGElement.prototype, /** @lends Highcharts.SVGElement.prototype */ {
|
|
|
327
550
|
|
|
328
551
|
/**
|
|
329
552
|
* Apply a text outline through a custom CSS property, by copying the text
|
|
330
|
-
* element and apply stroke to the copy. Used internally. Contrast checks
|
|
331
|
-
*
|
|
553
|
+
* element and apply stroke to the copy. Used internally. Contrast checks at
|
|
554
|
+
* {@link https://jsfiddle.net/highcharts/43soe9m1/2/}.
|
|
332
555
|
*
|
|
333
|
-
* @private
|
|
334
|
-
* @param {String} textOutline A custom CSS `text-outline` setting, defined
|
|
335
|
-
* by `width color`.
|
|
336
556
|
* @example
|
|
337
557
|
* // Specific color
|
|
338
558
|
* text.css({
|
|
@@ -343,6 +563,12 @@ extend(SVGElement.prototype, /** @lends Highcharts.SVGElement.prototype */ {
|
|
|
343
563
|
* color: '#000000', // black text
|
|
344
564
|
* textOutline: '1px contrast' // => white outline
|
|
345
565
|
* });
|
|
566
|
+
*
|
|
567
|
+
* @private
|
|
568
|
+
* @function Highcharts.SVGElement#applyTextOutline
|
|
569
|
+
*
|
|
570
|
+
* @param {string} textOutline
|
|
571
|
+
* A custom CSS `text-outline` setting, defined by `width color`.
|
|
346
572
|
*/
|
|
347
573
|
applyTextOutline: function (textOutline) {
|
|
348
574
|
var elem = this.element,
|
|
@@ -429,23 +655,6 @@ extend(SVGElement.prototype, /** @lends Highcharts.SVGElement.prototype */ {
|
|
|
429
655
|
}
|
|
430
656
|
},
|
|
431
657
|
|
|
432
|
-
/**
|
|
433
|
-
*
|
|
434
|
-
* @typedef {Object} SVGAttributes An object of key-value pairs for SVG
|
|
435
|
-
* attributes. Attributes in Highcharts elements for the most parts
|
|
436
|
-
* correspond to SVG, but some are specific to Highcharts, like `zIndex`,
|
|
437
|
-
* `rotation`, `rotationOriginX`, `rotationOriginY`, `translateX`,
|
|
438
|
-
* `translateY`, `scaleX` and `scaleY`. SVG attributes containing a hyphen
|
|
439
|
-
* are _not_ camel-cased, they should be quoted to preserve the hyphen.
|
|
440
|
-
*
|
|
441
|
-
* @example
|
|
442
|
-
* {
|
|
443
|
-
* 'stroke': '#ff0000', // basic
|
|
444
|
-
* 'stroke-width': 2, // hyphenated
|
|
445
|
-
* 'rotation': 45 // custom
|
|
446
|
-
* 'd': ['M', 10, 10, 'L', 30, 30, 'z'] // path definition, note format
|
|
447
|
-
* }
|
|
448
|
-
*/
|
|
449
658
|
/**
|
|
450
659
|
* Apply native and custom attributes to the SVG elements.
|
|
451
660
|
*
|
|
@@ -456,24 +665,6 @@ extend(SVGElement.prototype, /** @lends Highcharts.SVGElement.prototype */ {
|
|
|
456
665
|
* Attributes frequently used in Highcharts are `fill`, `stroke`,
|
|
457
666
|
* `stroke-width`.
|
|
458
667
|
*
|
|
459
|
-
* @param {SVGAttributes|String} hash - The native and custom SVG
|
|
460
|
-
* attributes.
|
|
461
|
-
* @param {string} [val] - If the type of the first argument is `string`,
|
|
462
|
-
* the second can be a value, which will serve as a single attribute
|
|
463
|
-
* setter. If the first argument is a string and the second is undefined,
|
|
464
|
-
* the function serves as a getter and the current value of the property
|
|
465
|
-
* is returned.
|
|
466
|
-
* @param {Function} [complete] - A callback function to execute after
|
|
467
|
-
* setting the attributes. This makes the function compliant and
|
|
468
|
-
* interchangeable with the {@link SVGElement#animate} function.
|
|
469
|
-
* @param {boolean} [continueAnimation=true] Used internally when `.attr` is
|
|
470
|
-
* called as part of an animation step. Otherwise, calling `.attr` for an
|
|
471
|
-
* attribute will stop animation for that attribute.
|
|
472
|
-
*
|
|
473
|
-
* @returns {SVGElement|string|number} If used as a setter, it returns the
|
|
474
|
-
* current {@link SVGElement} so the calls can be chained. If used as a
|
|
475
|
-
* getter, the current value of the attribute is returned.
|
|
476
|
-
*
|
|
477
668
|
* @sample highcharts/members/renderer-rect/
|
|
478
669
|
* Setting some attributes
|
|
479
670
|
*
|
|
@@ -492,6 +683,32 @@ extend(SVGElement.prototype, /** @lends Highcharts.SVGElement.prototype */ {
|
|
|
492
683
|
* // Get an attribute
|
|
493
684
|
* element.attr('stroke'); // => 'red'
|
|
494
685
|
*
|
|
686
|
+
* @function Highcharts.SVGElement#attr
|
|
687
|
+
*
|
|
688
|
+
* @param {string|Highcharts.SVGAttributes} [hash]
|
|
689
|
+
* The native and custom SVG attributes.
|
|
690
|
+
*
|
|
691
|
+
* @param {string} [val]
|
|
692
|
+
* If the type of the first argument is `string`, the second can be a
|
|
693
|
+
* value, which will serve as a single attribute setter. If the first
|
|
694
|
+
* argument is a string and the second is undefined, the function
|
|
695
|
+
* serves as a getter and the current value of the property is
|
|
696
|
+
* returned.
|
|
697
|
+
*
|
|
698
|
+
* @param {Function} [complete]
|
|
699
|
+
* A callback function to execute after setting the attributes. This
|
|
700
|
+
* makes the function compliant and interchangeable with the
|
|
701
|
+
* {@link SVGElement#animate} function.
|
|
702
|
+
*
|
|
703
|
+
* @param {boolean} [continueAnimation=true]
|
|
704
|
+
* Used internally when `.attr` is called as part of an animation
|
|
705
|
+
* step. Otherwise, calling `.attr` for an attribute will stop
|
|
706
|
+
* animation for that attribute.
|
|
707
|
+
*
|
|
708
|
+
* @return {number|string|Highcharts.SVGElement}
|
|
709
|
+
* If used as a setter, it returns the current
|
|
710
|
+
* {@link Highcharts.SVGElement} so the calls can be chained. If
|
|
711
|
+
* used as a getter, the current value of the attribute is returned.
|
|
495
712
|
*/
|
|
496
713
|
attr: function (hash, val, complete, continueAnimation) {
|
|
497
714
|
var key,
|
|
@@ -580,6 +797,7 @@ extend(SVGElement.prototype, /** @lends Highcharts.SVGElement.prototype */ {
|
|
|
580
797
|
* scale are merged in one "transform" attribute in the SVG node.
|
|
581
798
|
*
|
|
582
799
|
* @private
|
|
800
|
+
* @function Highcharts.SVGElement#afterSetters
|
|
583
801
|
*/
|
|
584
802
|
afterSetters: function () {
|
|
585
803
|
// Update transform. Do this outside the loop to prevent redundant
|
|
@@ -595,11 +813,16 @@ extend(SVGElement.prototype, /** @lends Highcharts.SVGElement.prototype */ {
|
|
|
595
813
|
* Update the shadow elements with new attributes.
|
|
596
814
|
*
|
|
597
815
|
* @private
|
|
598
|
-
* @
|
|
599
|
-
*
|
|
600
|
-
* @param {
|
|
601
|
-
*
|
|
816
|
+
* @function Highcharts.SVGElement#updateShadows
|
|
817
|
+
*
|
|
818
|
+
* @param {string} key
|
|
819
|
+
* The attribute name.
|
|
602
820
|
*
|
|
821
|
+
* @param {string|number} value
|
|
822
|
+
* The value of the attribute.
|
|
823
|
+
*
|
|
824
|
+
* @param {Function} setter
|
|
825
|
+
* The setter function, inherited from the parent wrapper.
|
|
603
826
|
*/
|
|
604
827
|
updateShadows: function (key, value, setter) {
|
|
605
828
|
var shadows = this.shadows,
|
|
@@ -621,11 +844,17 @@ extend(SVGElement.prototype, /** @lends Highcharts.SVGElement.prototype */ {
|
|
|
621
844
|
/**
|
|
622
845
|
* Add a class name to an element.
|
|
623
846
|
*
|
|
624
|
-
* @
|
|
625
|
-
*
|
|
626
|
-
*
|
|
627
|
-
*
|
|
628
|
-
*
|
|
847
|
+
* @function Highcharts.SVGElement#addClass
|
|
848
|
+
*
|
|
849
|
+
* @param {string} className
|
|
850
|
+
* The new class name to add.
|
|
851
|
+
*
|
|
852
|
+
* @param {boolean} [replace=false]
|
|
853
|
+
* When true, the existing class name(s) will be overwritten with
|
|
854
|
+
* the new one. When false, the new one is added.
|
|
855
|
+
*
|
|
856
|
+
* @return {Highcharts.SVGElement}
|
|
857
|
+
* Return the SVG element for chainability.
|
|
629
858
|
*/
|
|
630
859
|
addClass: function (className, replace) {
|
|
631
860
|
var currentClassName = this.attr('class') || '';
|
|
@@ -643,9 +872,13 @@ extend(SVGElement.prototype, /** @lends Highcharts.SVGElement.prototype */ {
|
|
|
643
872
|
|
|
644
873
|
/**
|
|
645
874
|
* Check if an element has the given class name.
|
|
646
|
-
*
|
|
647
|
-
*
|
|
648
|
-
*
|
|
875
|
+
*
|
|
876
|
+
* @function Highcharts.SVGElement#hasClass
|
|
877
|
+
*
|
|
878
|
+
* @param {string} className
|
|
879
|
+
* The class name to check for.
|
|
880
|
+
*
|
|
881
|
+
* @return {boolean}
|
|
649
882
|
* Whether the class name is found.
|
|
650
883
|
*/
|
|
651
884
|
hasClass: function (className) {
|
|
@@ -657,8 +890,13 @@ extend(SVGElement.prototype, /** @lends Highcharts.SVGElement.prototype */ {
|
|
|
657
890
|
|
|
658
891
|
/**
|
|
659
892
|
* Remove a class name from the element.
|
|
660
|
-
*
|
|
661
|
-
* @
|
|
893
|
+
*
|
|
894
|
+
* @function Highcharts.SVGElement#removeClass
|
|
895
|
+
*
|
|
896
|
+
* @param {string|RegExp} className
|
|
897
|
+
* The class name to remove.
|
|
898
|
+
*
|
|
899
|
+
* @return {Highcharts.SVGElement} Returns the SVG element for chainability.
|
|
662
900
|
*/
|
|
663
901
|
removeClass: function (className) {
|
|
664
902
|
return this.attr(
|
|
@@ -671,8 +909,12 @@ extend(SVGElement.prototype, /** @lends Highcharts.SVGElement.prototype */ {
|
|
|
671
909
|
* If one of the symbol size affecting parameters are changed,
|
|
672
910
|
* check all the others only once for each call to an element's
|
|
673
911
|
* .attr() method
|
|
674
|
-
*
|
|
912
|
+
*
|
|
675
913
|
* @private
|
|
914
|
+
* @function Highcharts.SVGElement#symbolAttr
|
|
915
|
+
*
|
|
916
|
+
* @param {Highcharts.Dictionary<number|string>} hash
|
|
917
|
+
* The attributes to set.
|
|
676
918
|
*/
|
|
677
919
|
symbolAttr: function (hash) {
|
|
678
920
|
var wrapper = this;
|
|
@@ -706,9 +948,13 @@ extend(SVGElement.prototype, /** @lends Highcharts.SVGElement.prototype */ {
|
|
|
706
948
|
/**
|
|
707
949
|
* Apply a clipping rectangle to this element.
|
|
708
950
|
*
|
|
709
|
-
* @
|
|
710
|
-
*
|
|
711
|
-
* @
|
|
951
|
+
* @function Highcharts.SVGElement#clip
|
|
952
|
+
*
|
|
953
|
+
* @param {Highcharts.ClipRectElement} [clipRect]
|
|
954
|
+
* The clipping rectangle. If skipped, the current clip is removed.
|
|
955
|
+
*
|
|
956
|
+
* @return {Highcharts.SVGElement}
|
|
957
|
+
* Returns the SVG element to allow chaining.
|
|
712
958
|
*/
|
|
713
959
|
clip: function (clipRect) {
|
|
714
960
|
return this.attr(
|
|
@@ -723,17 +969,17 @@ extend(SVGElement.prototype, /** @lends Highcharts.SVGElement.prototype */ {
|
|
|
723
969
|
* Calculate the coordinates needed for drawing a rectangle crisply and
|
|
724
970
|
* return the calculated attributes.
|
|
725
971
|
*
|
|
726
|
-
* @
|
|
727
|
-
*
|
|
728
|
-
* @param {
|
|
729
|
-
*
|
|
730
|
-
*
|
|
731
|
-
* @param {number} [strokeWidth]
|
|
732
|
-
*
|
|
733
|
-
*
|
|
734
|
-
*
|
|
735
|
-
* @
|
|
736
|
-
*
|
|
972
|
+
* @function Highcharts.SVGElement#crisp
|
|
973
|
+
*
|
|
974
|
+
* @param {Highcharts.RectangleObject} rect
|
|
975
|
+
* Rectangle to crisp.
|
|
976
|
+
*
|
|
977
|
+
* @param {number} [strokeWidth]
|
|
978
|
+
* The stroke width to consider when computing crisp positioning. It
|
|
979
|
+
* can also be set directly on the rect parameter.
|
|
980
|
+
*
|
|
981
|
+
* @return {Highcharts.RectangleObject}
|
|
982
|
+
* The modified rectangle arguments.
|
|
737
983
|
*/
|
|
738
984
|
crisp: function (rect, strokeWidth) {
|
|
739
985
|
|
|
@@ -764,11 +1010,17 @@ extend(SVGElement.prototype, /** @lends Highcharts.SVGElement.prototype */ {
|
|
|
764
1010
|
* native SVG and HTML elements, there are also some custom made for
|
|
765
1011
|
* Highcharts, like `width`, `ellipsis` and `textOverflow` for SVG text
|
|
766
1012
|
* elements.
|
|
767
|
-
* @param {CSSObject} styles The new CSS styles.
|
|
768
|
-
* @returns {SVGElement} Return the SVG element for chaining.
|
|
769
1013
|
*
|
|
770
1014
|
* @sample highcharts/members/renderer-text-on-chart/
|
|
771
1015
|
* Styled text
|
|
1016
|
+
*
|
|
1017
|
+
* @function Highcharts.SVGElement#css
|
|
1018
|
+
*
|
|
1019
|
+
* @param {Highcharts.CSSObject} styles
|
|
1020
|
+
* The new CSS styles.
|
|
1021
|
+
*
|
|
1022
|
+
* @return {Highcharts.SVGElement}
|
|
1023
|
+
* Return the SVG element for chaining.
|
|
772
1024
|
*/
|
|
773
1025
|
css: function (styles) {
|
|
774
1026
|
var oldStyles = this.styles,
|
|
@@ -872,8 +1124,12 @@ extend(SVGElement.prototype, /** @lends Highcharts.SVGElement.prototype */ {
|
|
|
872
1124
|
/**
|
|
873
1125
|
* Get the current stroke width. In classic mode, the setter registers it
|
|
874
1126
|
* directly on the element.
|
|
875
|
-
*
|
|
1127
|
+
*
|
|
876
1128
|
* @ignore
|
|
1129
|
+
* @function Highcharts.SVGElement#strokeWidth
|
|
1130
|
+
*
|
|
1131
|
+
* @return {number}
|
|
1132
|
+
* The stroke width in pixels.
|
|
877
1133
|
*/
|
|
878
1134
|
strokeWidth: function () {
|
|
879
1135
|
return this['stroke-width'] || 0;
|
|
@@ -884,15 +1140,22 @@ extend(SVGElement.prototype, /** @lends Highcharts.SVGElement.prototype */ {
|
|
|
884
1140
|
* Add an event listener. This is a simple setter that replaces all other
|
|
885
1141
|
* events of the same type, opposed to the {@link Highcharts#addEvent}
|
|
886
1142
|
* function.
|
|
887
|
-
* @param {string} eventType - The event type. If the type is `click`,
|
|
888
|
-
* Highcharts will internally translate it to a `touchstart` event on
|
|
889
|
-
* touch devices, to prevent the browser from waiting for a click event
|
|
890
|
-
* from firing.
|
|
891
|
-
* @param {Function} handler - The handler callback.
|
|
892
|
-
* @returns {SVGElement} The SVGElement for chaining.
|
|
893
1143
|
*
|
|
894
1144
|
* @sample highcharts/members/element-on/
|
|
895
1145
|
* A clickable rectangle
|
|
1146
|
+
*
|
|
1147
|
+
* @function Highcharts.SVGElement#on
|
|
1148
|
+
*
|
|
1149
|
+
* @param {string} eventType
|
|
1150
|
+
* The event type. If the type is `click`, Highcharts will internally
|
|
1151
|
+
* translate it to a `touchstart` event on touch devices, to prevent
|
|
1152
|
+
* the browser from waiting for a click event from firing.
|
|
1153
|
+
*
|
|
1154
|
+
* @param {Function} handler
|
|
1155
|
+
* The handler callback.
|
|
1156
|
+
*
|
|
1157
|
+
* @return {Highcharts.SVGElement}
|
|
1158
|
+
* The SVGElement for chaining.
|
|
896
1159
|
*/
|
|
897
1160
|
on: function (eventType, handler) {
|
|
898
1161
|
var svgElement = this,
|
|
@@ -923,9 +1186,14 @@ extend(SVGElement.prototype, /** @lends Highcharts.SVGElement.prototype */ {
|
|
|
923
1186
|
* a shape regardless of positioning inside the chart. Used on pie slices
|
|
924
1187
|
* to make all the slices have the same radial reference point.
|
|
925
1188
|
*
|
|
926
|
-
* @
|
|
927
|
-
*
|
|
928
|
-
* @
|
|
1189
|
+
* @function Highcharts.SVGElement#setRadialReference
|
|
1190
|
+
*
|
|
1191
|
+
* @param {Array<number>} coordinates
|
|
1192
|
+
* The center reference. The format is `[centerX, centerY, diameter]`
|
|
1193
|
+
* in pixels.
|
|
1194
|
+
*
|
|
1195
|
+
* @return {Highcharts.SVGElement}
|
|
1196
|
+
* Returns the SVGElement for chaining.
|
|
929
1197
|
*/
|
|
930
1198
|
setRadialReference: function (coordinates) {
|
|
931
1199
|
var existingGradient = this.renderer.gradients[this.element.gradient];
|
|
@@ -949,8 +1217,13 @@ extend(SVGElement.prototype, /** @lends Highcharts.SVGElement.prototype */ {
|
|
|
949
1217
|
/**
|
|
950
1218
|
* Move an object and its children by x and y values.
|
|
951
1219
|
*
|
|
952
|
-
* @
|
|
953
|
-
*
|
|
1220
|
+
* @function Highcharts.SVGElement#translate
|
|
1221
|
+
*
|
|
1222
|
+
* @param {number} x
|
|
1223
|
+
* The x value.
|
|
1224
|
+
*
|
|
1225
|
+
* @param {number} y
|
|
1226
|
+
* The y value.
|
|
954
1227
|
*/
|
|
955
1228
|
translate: function (x, y) {
|
|
956
1229
|
return this.attr({
|
|
@@ -964,10 +1237,13 @@ extend(SVGElement.prototype, /** @lends Highcharts.SVGElement.prototype */ {
|
|
|
964
1237
|
* charts, where the points and graphs are drawn as if not inverted, then
|
|
965
1238
|
* the series group elements are inverted.
|
|
966
1239
|
*
|
|
967
|
-
* @
|
|
968
|
-
*
|
|
969
|
-
*
|
|
970
|
-
*
|
|
1240
|
+
* @function Highcharts.SVGElement#invert
|
|
1241
|
+
*
|
|
1242
|
+
* @param {boolean} inverted
|
|
1243
|
+
* Whether to invert or not. An inverted shape can be un-inverted by
|
|
1244
|
+
* setting it to false.
|
|
1245
|
+
*
|
|
1246
|
+
* @return {Highcharts.SVGElement}
|
|
971
1247
|
* Return the SVGElement for chaining.
|
|
972
1248
|
*/
|
|
973
1249
|
invert: function (inverted) {
|
|
@@ -981,8 +1257,9 @@ extend(SVGElement.prototype, /** @lends Highcharts.SVGElement.prototype */ {
|
|
|
981
1257
|
* Update the transform attribute based on internal properties. Deals with
|
|
982
1258
|
* the custom `translateX`, `translateY`, `rotation`, `scaleX` and `scaleY`
|
|
983
1259
|
* attributes and updates the SVG `transform` attribute.
|
|
984
|
-
* @private
|
|
985
1260
|
*
|
|
1261
|
+
* @private
|
|
1262
|
+
* @function Highcharts.SVGElement#updateTransform
|
|
986
1263
|
*/
|
|
987
1264
|
updateTransform: function () {
|
|
988
1265
|
var wrapper = this,
|
|
@@ -1042,10 +1319,13 @@ extend(SVGElement.prototype, /** @lends Highcharts.SVGElement.prototype */ {
|
|
|
1042
1319
|
/**
|
|
1043
1320
|
* Bring the element to the front. Alternatively, a new zIndex can be set.
|
|
1044
1321
|
*
|
|
1045
|
-
* @returns {SVGElement} Returns the SVGElement for chaining.
|
|
1046
|
-
*
|
|
1047
1322
|
* @sample highcharts/members/element-tofront/
|
|
1048
1323
|
* Click an element to bring it to front
|
|
1324
|
+
*
|
|
1325
|
+
* @function Highcharts.SVGElement#toFront
|
|
1326
|
+
*
|
|
1327
|
+
* @return {Highcharts.SVGElement}
|
|
1328
|
+
* Returns the SVGElement for chaining.
|
|
1049
1329
|
*/
|
|
1050
1330
|
toFront: function () {
|
|
1051
1331
|
var element = this.element;
|
|
@@ -1057,24 +1337,23 @@ extend(SVGElement.prototype, /** @lends Highcharts.SVGElement.prototype */ {
|
|
|
1057
1337
|
/**
|
|
1058
1338
|
* Align the element relative to the chart or another box.
|
|
1059
1339
|
*
|
|
1060
|
-
* @
|
|
1061
|
-
*
|
|
1062
|
-
*
|
|
1063
|
-
*
|
|
1064
|
-
*
|
|
1065
|
-
*
|
|
1066
|
-
*
|
|
1067
|
-
* @param {
|
|
1068
|
-
*
|
|
1069
|
-
*
|
|
1070
|
-
* @param {
|
|
1071
|
-
*
|
|
1072
|
-
*
|
|
1073
|
-
*
|
|
1074
|
-
*
|
|
1075
|
-
*
|
|
1076
|
-
*
|
|
1077
|
-
* @returns {SVGElement} Returns the SVGElement for chaining.
|
|
1340
|
+
* @function Highcharts.SVGElement#align
|
|
1341
|
+
*
|
|
1342
|
+
* @param {Highcharts.AlignObject} [alignOptions]
|
|
1343
|
+
* The alignment options. The function can be called without this
|
|
1344
|
+
* parameter in order to re-align an element after the box has been
|
|
1345
|
+
* updated.
|
|
1346
|
+
*
|
|
1347
|
+
* @param {boolean} [alignByTranslate]
|
|
1348
|
+
* Align element by translation.
|
|
1349
|
+
*
|
|
1350
|
+
* @param {string|Highcharts.BBoxObject} [box]
|
|
1351
|
+
* The box to align to, needs a width and height. When the box is a
|
|
1352
|
+
* string, it refers to an object in the Renderer. For example, when
|
|
1353
|
+
* box is `spacingBox`, it refers to `Renderer.spacingBox` which
|
|
1354
|
+
* holds `width`, `height`, `x` and `y` properties.
|
|
1355
|
+
*
|
|
1356
|
+
* @return {Highcharts.SVGElement} Returns the SVGElement for chaining.
|
|
1078
1357
|
*/
|
|
1079
1358
|
align: function (alignOptions, alignByTranslate, box) {
|
|
1080
1359
|
var align,
|
|
@@ -1154,16 +1433,21 @@ extend(SVGElement.prototype, /** @lends Highcharts.SVGElement.prototype */ {
|
|
|
1154
1433
|
* a single text line of rotation 90 will report a greater height, and a
|
|
1155
1434
|
* width corresponding to the line-height.
|
|
1156
1435
|
*
|
|
1157
|
-
* @param {boolean} [reload] Skip the cache and get the updated DOM bouding
|
|
1158
|
-
* box.
|
|
1159
|
-
* @param {number} [rot] Override the element's rotation. This is internally
|
|
1160
|
-
* used on axis labels with a value of 0 to find out what the bounding box
|
|
1161
|
-
* would be have been if it were not rotated.
|
|
1162
|
-
* @returns {Object} The bounding box with `x`, `y`, `width` and `height`
|
|
1163
|
-
* properties.
|
|
1164
|
-
*
|
|
1165
1436
|
* @sample highcharts/members/renderer-on-chart/
|
|
1166
1437
|
* Draw a rectangle based on a text's bounding box
|
|
1438
|
+
*
|
|
1439
|
+
* @function Highcharts.SVGElement#getBBox
|
|
1440
|
+
*
|
|
1441
|
+
* @param {boolean} [reload]
|
|
1442
|
+
* Skip the cache and get the updated DOM bouding box.
|
|
1443
|
+
*
|
|
1444
|
+
* @param {number} [rot]
|
|
1445
|
+
* Override the element's rotation. This is internally used on axis
|
|
1446
|
+
* labels with a value of 0 to find out what the bounding box would
|
|
1447
|
+
* be have been if it were not rotated.
|
|
1448
|
+
*
|
|
1449
|
+
* @return {Highcharts.BBoxObject}
|
|
1450
|
+
* The bounding box with `x`, `y`, `width` and `height` properties.
|
|
1167
1451
|
*/
|
|
1168
1452
|
getBBox: function (reload, rot) {
|
|
1169
1453
|
var wrapper = this,
|
|
@@ -1180,6 +1464,7 @@ extend(SVGElement.prototype, /** @lends Highcharts.SVGElement.prototype */ {
|
|
|
1180
1464
|
toggleTextShadowShim,
|
|
1181
1465
|
cache = renderer.cache,
|
|
1182
1466
|
cacheKeys = renderer.cacheKeys,
|
|
1467
|
+
isSVG = element.namespaceURI === wrapper.SVG_NS,
|
|
1183
1468
|
cacheKey;
|
|
1184
1469
|
|
|
1185
1470
|
rotation = pick(rot, wrapper.rotation);
|
|
@@ -1222,7 +1507,7 @@ extend(SVGElement.prototype, /** @lends Highcharts.SVGElement.prototype */ {
|
|
|
1222
1507
|
if (!bBox) {
|
|
1223
1508
|
|
|
1224
1509
|
// SVG elements
|
|
1225
|
-
if (
|
|
1510
|
+
if (isSVG || renderer.forExport) {
|
|
1226
1511
|
try { // Fails in Firefox if the container has display: none.
|
|
1227
1512
|
|
|
1228
1513
|
// When the text shadow shim is used, we need to hide the
|
|
@@ -1287,14 +1572,18 @@ extend(SVGElement.prototype, /** @lends Highcharts.SVGElement.prototype */ {
|
|
|
1287
1572
|
// stands uncorrected, it results in more padding added below
|
|
1288
1573
|
// the text than above when adding a label border or background.
|
|
1289
1574
|
// Also vertical positioning is affected.
|
|
1290
|
-
//
|
|
1575
|
+
// https://jsfiddle.net/highcharts/em37nvuj/
|
|
1291
1576
|
// (#1101, #1505, #1669, #2568, #6213).
|
|
1292
|
-
if (
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1577
|
+
if (isSVG) {
|
|
1578
|
+
bBox.height = height = (
|
|
1579
|
+
{
|
|
1580
|
+
'11px,17': 14,
|
|
1581
|
+
'13px,20': 16
|
|
1582
|
+
}[
|
|
1583
|
+
styles && styles.fontSize + ',' + Math.round(height)
|
|
1584
|
+
] ||
|
|
1585
|
+
height
|
|
1586
|
+
);
|
|
1298
1587
|
}
|
|
1299
1588
|
|
|
1300
1589
|
// Adjust for rotated text
|
|
@@ -1327,11 +1616,15 @@ extend(SVGElement.prototype, /** @lends Highcharts.SVGElement.prototype */ {
|
|
|
1327
1616
|
/**
|
|
1328
1617
|
* Show the element after it has been hidden.
|
|
1329
1618
|
*
|
|
1330
|
-
* @
|
|
1331
|
-
*
|
|
1332
|
-
*
|
|
1619
|
+
* @function Highcharts.SVGElement#show
|
|
1620
|
+
*
|
|
1621
|
+
* @param {boolean} [inherit=false]
|
|
1622
|
+
* Set the visibility attribute to `inherit` rather than `visible`.
|
|
1623
|
+
* The difference is that an element with `visibility="visible"`
|
|
1624
|
+
* will be visible even if the parent is hidden.
|
|
1333
1625
|
*
|
|
1334
|
-
* @
|
|
1626
|
+
* @return {Highcharts.SVGElement}
|
|
1627
|
+
* Returns the SVGElement for chaining.
|
|
1335
1628
|
*/
|
|
1336
1629
|
show: function (inherit) {
|
|
1337
1630
|
return this.attr({ visibility: inherit ? 'inherit' : 'visible' });
|
|
@@ -1341,7 +1634,10 @@ extend(SVGElement.prototype, /** @lends Highcharts.SVGElement.prototype */ {
|
|
|
1341
1634
|
* Hide the element, equivalent to setting the `visibility` attribute to
|
|
1342
1635
|
* `hidden`.
|
|
1343
1636
|
*
|
|
1344
|
-
* @
|
|
1637
|
+
* @function Highcharts.SVGElement#hide
|
|
1638
|
+
*
|
|
1639
|
+
* @return {Highcharts.SVGElement}
|
|
1640
|
+
* Returns the SVGElement for chaining.
|
|
1345
1641
|
*/
|
|
1346
1642
|
hide: function () {
|
|
1347
1643
|
return this.attr({ visibility: 'hidden' });
|
|
@@ -1351,7 +1647,10 @@ extend(SVGElement.prototype, /** @lends Highcharts.SVGElement.prototype */ {
|
|
|
1351
1647
|
* Fade out an element by animating its opacity down to 0, and hide it on
|
|
1352
1648
|
* complete. Used internally for the tooltip.
|
|
1353
1649
|
*
|
|
1354
|
-
* @
|
|
1650
|
+
* @function Highcharts.SVGElement#fadeOut
|
|
1651
|
+
*
|
|
1652
|
+
* @param {number} [duration=150]
|
|
1653
|
+
* The fade duration in milliseconds.
|
|
1355
1654
|
*/
|
|
1356
1655
|
fadeOut: function (duration) {
|
|
1357
1656
|
var elemWrapper = this;
|
|
@@ -1369,13 +1668,17 @@ extend(SVGElement.prototype, /** @lends Highcharts.SVGElement.prototype */ {
|
|
|
1369
1668
|
/**
|
|
1370
1669
|
* Add the element to the DOM. All elements must be added this way.
|
|
1371
1670
|
*
|
|
1372
|
-
* @
|
|
1373
|
-
*
|
|
1374
|
-
* Highcharts.SVGRenderer.box}.
|
|
1671
|
+
* @sample highcharts/members/renderer-g
|
|
1672
|
+
* Elements added to a group
|
|
1375
1673
|
*
|
|
1376
|
-
* @
|
|
1674
|
+
* @function Highcharts.SVGElement#add
|
|
1377
1675
|
*
|
|
1378
|
-
* @
|
|
1676
|
+
* @param {Highcharts.SVGElement|Highcharts.SVGDOMElement} [parent]
|
|
1677
|
+
* The parent item to add it to. If undefined, the element is added
|
|
1678
|
+
* to the {@link Highcharts.SVGRenderer.box}.
|
|
1679
|
+
*
|
|
1680
|
+
* @return {Highcharts.SVGElement}
|
|
1681
|
+
* Returns the SVGElement for chaining.
|
|
1379
1682
|
*/
|
|
1380
1683
|
add: function (parent) {
|
|
1381
1684
|
|
|
@@ -1421,7 +1724,10 @@ extend(SVGElement.prototype, /** @lends Highcharts.SVGElement.prototype */ {
|
|
|
1421
1724
|
* Removes an element from the DOM.
|
|
1422
1725
|
*
|
|
1423
1726
|
* @private
|
|
1424
|
-
* @
|
|
1727
|
+
* @function Highcharts.SVGElement#safeRemoveChild
|
|
1728
|
+
*
|
|
1729
|
+
* @param {Highcharts.SVGDOMElement|Highcharts.HTMLDOMElement} element
|
|
1730
|
+
* The DOM node to remove.
|
|
1425
1731
|
*/
|
|
1426
1732
|
safeRemoveChild: function (element) {
|
|
1427
1733
|
var parentNode = element.parentNode;
|
|
@@ -1434,7 +1740,7 @@ extend(SVGElement.prototype, /** @lends Highcharts.SVGElement.prototype */ {
|
|
|
1434
1740
|
* Destroy the element and element wrapper and clear up the DOM and event
|
|
1435
1741
|
* hooks.
|
|
1436
1742
|
*
|
|
1437
|
-
*
|
|
1743
|
+
* @function Highcharts.SVGElement#destroy
|
|
1438
1744
|
*/
|
|
1439
1745
|
destroy: function () {
|
|
1440
1746
|
var wrapper = this,
|
|
@@ -1517,35 +1823,34 @@ extend(SVGElement.prototype, /** @lends Highcharts.SVGElement.prototype */ {
|
|
|
1517
1823
|
},
|
|
1518
1824
|
|
|
1519
1825
|
|
|
1520
|
-
|
|
1521
|
-
* @typedef {Object} ShadowOptions
|
|
1522
|
-
* @property {string} [color=#000000] The shadow color.
|
|
1523
|
-
* @property {number} [offsetX=1] The horizontal offset from the element.
|
|
1524
|
-
* @property {number} [offsetY=1] The vertical offset from the element.
|
|
1525
|
-
* @property {number} [opacity=0.15] The shadow opacity.
|
|
1526
|
-
* @property {number} [width=3] The shadow width or distance from the
|
|
1527
|
-
* element.
|
|
1528
|
-
*/
|
|
1826
|
+
|
|
1529
1827
|
/**
|
|
1530
1828
|
* Add a shadow to the element. Must be called after the element is added to
|
|
1531
1829
|
* the DOM. In styled mode, this method is not used, instead use `defs` and
|
|
1532
1830
|
* filters.
|
|
1533
1831
|
*
|
|
1534
|
-
* @param {boolean|ShadowOptions} shadowOptions The shadow options. If
|
|
1535
|
-
* `true`, the default options are applied. If `false`, the current
|
|
1536
|
-
* shadow will be removed.
|
|
1537
|
-
* @param {SVGElement} [group] The SVG group element where the shadows will
|
|
1538
|
-
* be applied. The default is to add it to the same parent as the current
|
|
1539
|
-
* element. Internally, this is ised for pie slices, where all the
|
|
1540
|
-
* shadows are added to an element behind all the slices.
|
|
1541
|
-
* @param {boolean} [cutOff] Used internally for column shadows.
|
|
1542
|
-
*
|
|
1543
|
-
* @returns {SVGElement} Returns the SVGElement for chaining.
|
|
1544
|
-
*
|
|
1545
1832
|
* @example
|
|
1546
1833
|
* renderer.rect(10, 100, 100, 100)
|
|
1547
1834
|
* .attr({ fill: 'red' })
|
|
1548
1835
|
* .shadow(true);
|
|
1836
|
+
*
|
|
1837
|
+
* @function Highcharts.SVGElement#shadow
|
|
1838
|
+
*
|
|
1839
|
+
* @param {boolean|Highcharts.ShadowOptionsObject} shadowOptions
|
|
1840
|
+
* The shadow options. If `true`, the default options are applied. If
|
|
1841
|
+
* `false`, the current shadow will be removed.
|
|
1842
|
+
*
|
|
1843
|
+
* @param {Highcharts.SVGElement} [group]
|
|
1844
|
+
* The SVG group element where the shadows will be applied. The
|
|
1845
|
+
* default is to add it to the same parent as the current element.
|
|
1846
|
+
* Internally, this is ised for pie slices, where all the shadows are
|
|
1847
|
+
* added to an element behind all the slices.
|
|
1848
|
+
*
|
|
1849
|
+
* @param {boolean} [cutOff]
|
|
1850
|
+
* Used internally for column shadows.
|
|
1851
|
+
*
|
|
1852
|
+
* @return {Highcharts.SVGElement}
|
|
1853
|
+
* Returns the SVGElement for chaining.
|
|
1549
1854
|
*/
|
|
1550
1855
|
shadow: function (shadowOptions, group, cutOff) {
|
|
1551
1856
|
var shadows = [],
|
|
@@ -1574,7 +1879,6 @@ extend(SVGElement.prototype, /** @lends Highcharts.SVGElement.prototype */ {
|
|
|
1574
1879
|
shadow = element.cloneNode(0);
|
|
1575
1880
|
strokeWidth = (shadowWidth * 2) + 1 - (2 * i);
|
|
1576
1881
|
attr(shadow, {
|
|
1577
|
-
'isShadow': 'true',
|
|
1578
1882
|
'stroke':
|
|
1579
1883
|
shadowOptions.color || '#000000',
|
|
1580
1884
|
'stroke-opacity': shadowElementOpacity * i,
|
|
@@ -1582,6 +1886,10 @@ extend(SVGElement.prototype, /** @lends Highcharts.SVGElement.prototype */ {
|
|
|
1582
1886
|
'transform': 'translate' + transform,
|
|
1583
1887
|
'fill': 'none'
|
|
1584
1888
|
});
|
|
1889
|
+
shadow.setAttribute(
|
|
1890
|
+
'class',
|
|
1891
|
+
(shadow.getAttribute('class') || '') + ' highcharts-shadow'
|
|
1892
|
+
);
|
|
1585
1893
|
if (cutOff) {
|
|
1586
1894
|
attr(
|
|
1587
1895
|
shadow,
|
|
@@ -1608,7 +1916,9 @@ extend(SVGElement.prototype, /** @lends Highcharts.SVGElement.prototype */ {
|
|
|
1608
1916
|
|
|
1609
1917
|
/**
|
|
1610
1918
|
* Destroy shadows on the element.
|
|
1919
|
+
*
|
|
1611
1920
|
* @private
|
|
1921
|
+
* @function Highcharts.SVGElement#destroyShadows
|
|
1612
1922
|
*/
|
|
1613
1923
|
destroyShadows: function () {
|
|
1614
1924
|
each(this.shadows || [], function (shadow) {
|
|
@@ -1619,6 +1929,14 @@ extend(SVGElement.prototype, /** @lends Highcharts.SVGElement.prototype */ {
|
|
|
1619
1929
|
|
|
1620
1930
|
|
|
1621
1931
|
|
|
1932
|
+
/**
|
|
1933
|
+
* @private
|
|
1934
|
+
* @function Highcharts.SVGElement#xGetter
|
|
1935
|
+
*
|
|
1936
|
+
* @param {string} key
|
|
1937
|
+
*
|
|
1938
|
+
* @return {number|string|null}
|
|
1939
|
+
*/
|
|
1622
1940
|
xGetter: function (key) {
|
|
1623
1941
|
if (this.element.nodeName === 'circle') {
|
|
1624
1942
|
if (key === 'x') {
|
|
@@ -1631,12 +1949,18 @@ extend(SVGElement.prototype, /** @lends Highcharts.SVGElement.prototype */ {
|
|
|
1631
1949
|
},
|
|
1632
1950
|
|
|
1633
1951
|
/**
|
|
1634
|
-
* Get the current value of an attribute or pseudo attribute,
|
|
1635
|
-
* for animation. Called internally from
|
|
1636
|
-
* Highcharts.SVGRenderer#attr}
|
|
1637
|
-
* function.
|
|
1952
|
+
* Get the current value of an attribute or pseudo attribute,
|
|
1953
|
+
* used mainly for animation. Called internally from
|
|
1954
|
+
* the {@link Highcharts.SVGRenderer#attr} function.
|
|
1638
1955
|
*
|
|
1639
1956
|
* @private
|
|
1957
|
+
* @function Highcharts.SVGElement#_defaultGetter
|
|
1958
|
+
*
|
|
1959
|
+
* @param {string} key
|
|
1960
|
+
* Property key.
|
|
1961
|
+
*
|
|
1962
|
+
* @return {number|string|null}
|
|
1963
|
+
* Property value.
|
|
1640
1964
|
*/
|
|
1641
1965
|
_defaultGetter: function (key) {
|
|
1642
1966
|
var ret = pick(
|
|
@@ -1652,7 +1976,16 @@ extend(SVGElement.prototype, /** @lends Highcharts.SVGElement.prototype */ {
|
|
|
1652
1976
|
return ret;
|
|
1653
1977
|
},
|
|
1654
1978
|
|
|
1655
|
-
|
|
1979
|
+
/**
|
|
1980
|
+
* @private
|
|
1981
|
+
* @function Highcharts.SVGElement#dSettter
|
|
1982
|
+
*
|
|
1983
|
+
* @param {number|string|Highcharts.SVGPathArray} value
|
|
1984
|
+
*
|
|
1985
|
+
* @param {string} key
|
|
1986
|
+
*
|
|
1987
|
+
* @param {Highcharts.SVGDOMElement} element
|
|
1988
|
+
*/
|
|
1656
1989
|
dSetter: function (value, key, element) {
|
|
1657
1990
|
if (value && value.join) { // join path
|
|
1658
1991
|
value = value.join(' ');
|
|
@@ -1670,7 +2003,15 @@ extend(SVGElement.prototype, /** @lends Highcharts.SVGElement.prototype */ {
|
|
|
1670
2003
|
}
|
|
1671
2004
|
|
|
1672
2005
|
},
|
|
2006
|
+
|
|
1673
2007
|
|
|
2008
|
+
|
|
2009
|
+
/**
|
|
2010
|
+
* @private
|
|
2011
|
+
* @function Highcharts.SVGElement#dashstyleSetter
|
|
2012
|
+
*
|
|
2013
|
+
* @param {string} value
|
|
2014
|
+
*/
|
|
1674
2015
|
dashstyleSetter: function (value) {
|
|
1675
2016
|
var i,
|
|
1676
2017
|
strokeWidth = this['stroke-width'];
|
|
@@ -1702,16 +2043,40 @@ extend(SVGElement.prototype, /** @lends Highcharts.SVGElement.prototype */ {
|
|
|
1702
2043
|
this.element.setAttribute('stroke-dasharray', value);
|
|
1703
2044
|
}
|
|
1704
2045
|
},
|
|
2046
|
+
|
|
1705
2047
|
|
|
2048
|
+
|
|
2049
|
+
/**
|
|
2050
|
+
* @private
|
|
2051
|
+
* @function Highcharts.SVGElement#alignSetter
|
|
2052
|
+
*
|
|
2053
|
+
* @param {"start"|"middle"|"end"} value
|
|
2054
|
+
*/
|
|
1706
2055
|
alignSetter: function (value) {
|
|
1707
2056
|
var convert = { left: 'start', center: 'middle', right: 'end' };
|
|
1708
2057
|
this.alignValue = value;
|
|
1709
2058
|
this.element.setAttribute('text-anchor', convert[value]);
|
|
1710
2059
|
},
|
|
2060
|
+
/**
|
|
2061
|
+
* @private
|
|
2062
|
+
* @function Highcharts.SVGElement#opacitySetter
|
|
2063
|
+
*
|
|
2064
|
+
* @param {string} value
|
|
2065
|
+
*
|
|
2066
|
+
* @param {string} key
|
|
2067
|
+
*
|
|
2068
|
+
* @param {Highcharts.SVGDOMElement} element
|
|
2069
|
+
*/
|
|
1711
2070
|
opacitySetter: function (value, key, element) {
|
|
1712
2071
|
this[key] = value;
|
|
1713
2072
|
element.setAttribute(key, value);
|
|
1714
2073
|
},
|
|
2074
|
+
/**
|
|
2075
|
+
* @private
|
|
2076
|
+
* @function Highcharts.SVGElement#titleSetter
|
|
2077
|
+
*
|
|
2078
|
+
* @param {string} value
|
|
2079
|
+
*/
|
|
1715
2080
|
titleSetter: function (value) {
|
|
1716
2081
|
var titleNode = this.element.getElementsByTagName('title')[0];
|
|
1717
2082
|
if (!titleNode) {
|
|
@@ -1734,6 +2099,12 @@ extend(SVGElement.prototype, /** @lends Highcharts.SVGElement.prototype */ {
|
|
|
1734
2099
|
)
|
|
1735
2100
|
);
|
|
1736
2101
|
},
|
|
2102
|
+
/**
|
|
2103
|
+
* @private
|
|
2104
|
+
* @function Highcharts.SVGElement#textSetter
|
|
2105
|
+
*
|
|
2106
|
+
* @param {string} value
|
|
2107
|
+
*/
|
|
1737
2108
|
textSetter: function (value) {
|
|
1738
2109
|
if (value !== this.textStr) {
|
|
1739
2110
|
// Delete bBox memo when the text changes
|
|
@@ -1745,6 +2116,16 @@ extend(SVGElement.prototype, /** @lends Highcharts.SVGElement.prototype */ {
|
|
|
1745
2116
|
}
|
|
1746
2117
|
}
|
|
1747
2118
|
},
|
|
2119
|
+
/**
|
|
2120
|
+
* @private
|
|
2121
|
+
* @function Highcharts.SVGElement#fillSetter
|
|
2122
|
+
*
|
|
2123
|
+
* @param {Highcharts.Color|Highcharts.ColorString} value
|
|
2124
|
+
*
|
|
2125
|
+
* @param {string} key
|
|
2126
|
+
*
|
|
2127
|
+
* @param {Highcharts.SVGDOMElement} element
|
|
2128
|
+
*/
|
|
1748
2129
|
fillSetter: function (value, key, element) {
|
|
1749
2130
|
if (typeof value === 'string') {
|
|
1750
2131
|
element.setAttribute(key, value);
|
|
@@ -1752,6 +2133,16 @@ extend(SVGElement.prototype, /** @lends Highcharts.SVGElement.prototype */ {
|
|
|
1752
2133
|
this.complexColor(value, key, element);
|
|
1753
2134
|
}
|
|
1754
2135
|
},
|
|
2136
|
+
/**
|
|
2137
|
+
* @private
|
|
2138
|
+
* @function Highcharts.SVGElement#visibilitySetter
|
|
2139
|
+
*
|
|
2140
|
+
* @param {string} value
|
|
2141
|
+
*
|
|
2142
|
+
* @param {string} key
|
|
2143
|
+
*
|
|
2144
|
+
* @param {Highcharts.SVGDOMElement} element
|
|
2145
|
+
*/
|
|
1755
2146
|
visibilitySetter: function (value, key, element) {
|
|
1756
2147
|
// IE9-11 doesn't handle visibilty:inherit well, so we remove the
|
|
1757
2148
|
// attribute instead (#2881, #3909)
|
|
@@ -1762,6 +2153,16 @@ extend(SVGElement.prototype, /** @lends Highcharts.SVGElement.prototype */ {
|
|
|
1762
2153
|
}
|
|
1763
2154
|
this[key] = value;
|
|
1764
2155
|
},
|
|
2156
|
+
/**
|
|
2157
|
+
* @private
|
|
2158
|
+
* @function Highcharts.SVGElement#zIndexSetter
|
|
2159
|
+
*
|
|
2160
|
+
* @param {string} value
|
|
2161
|
+
*
|
|
2162
|
+
* @param {string} key
|
|
2163
|
+
*
|
|
2164
|
+
* @return {boolean}
|
|
2165
|
+
*/
|
|
1765
2166
|
zIndexSetter: function (value, key) {
|
|
1766
2167
|
var renderer = this.renderer,
|
|
1767
2168
|
parentGroup = this.parentGroup,
|
|
@@ -1846,6 +2247,16 @@ extend(SVGElement.prototype, /** @lends Highcharts.SVGElement.prototype */ {
|
|
|
1846
2247
|
}
|
|
1847
2248
|
return inserted;
|
|
1848
2249
|
},
|
|
2250
|
+
/**
|
|
2251
|
+
* @private
|
|
2252
|
+
* @function Highcharts.SVGElement#_defaultSetter
|
|
2253
|
+
*
|
|
2254
|
+
* @param {string} value
|
|
2255
|
+
*
|
|
2256
|
+
* @param {string} key
|
|
2257
|
+
*
|
|
2258
|
+
* @param {Highcharts.SVGDOMElement} element
|
|
2259
|
+
*/
|
|
1849
2260
|
_defaultSetter: function (value, key, element) {
|
|
1850
2261
|
element.setAttribute(key, value);
|
|
1851
2262
|
}
|
|
@@ -1871,6 +2282,16 @@ SVGElement.prototype.matrixSetter = function (value, key) {
|
|
|
1871
2282
|
// WebKit and Batik have problems with a stroke-width of zero, so in this case
|
|
1872
2283
|
// we remove the stroke attribute altogether. #1270, #1369, #3065, #3072.
|
|
1873
2284
|
SVGElement.prototype['stroke-widthSetter'] =
|
|
2285
|
+
/**
|
|
2286
|
+
* @private
|
|
2287
|
+
* @function Highcharts.SVGElement#strokeSetter
|
|
2288
|
+
*
|
|
2289
|
+
* @param {number|string} value
|
|
2290
|
+
*
|
|
2291
|
+
* @param {string} key
|
|
2292
|
+
*
|
|
2293
|
+
* @param {Highcharts.SVGDOMElement} element
|
|
2294
|
+
*/
|
|
1874
2295
|
SVGElement.prototype.strokeSetter = function (value, key, element) {
|
|
1875
2296
|
this[key] = value;
|
|
1876
2297
|
// Only apply the stroke attribute if the stroke width is defined and larger
|
|
@@ -1903,24 +2324,33 @@ SVGElement.prototype.strokeSetter = function (value, key, element) {
|
|
|
1903
2324
|
* An existing chart's renderer can be accessed through {@link Chart.renderer}.
|
|
1904
2325
|
* The renderer can also be used completely decoupled from a chart.
|
|
1905
2326
|
*
|
|
1906
|
-
* @
|
|
1907
|
-
*
|
|
1908
|
-
* @
|
|
1909
|
-
*
|
|
1910
|
-
* for export.
|
|
1911
|
-
* @param {boolean} [allowHTML=true] - Whether the renderer is allowed to
|
|
1912
|
-
* include HTML text, which will be projected on top of the SVG.
|
|
2327
|
+
* @sample highcharts/members/renderer-on-chart
|
|
2328
|
+
* Annotating a chart programmatically.
|
|
2329
|
+
* @sample highcharts/members/renderer-basic
|
|
2330
|
+
* Independent SVG drawing.
|
|
1913
2331
|
*
|
|
1914
2332
|
* @example
|
|
1915
2333
|
* // Use directly without a chart object.
|
|
1916
2334
|
* var renderer = new Highcharts.Renderer(parentNode, 600, 400);
|
|
1917
2335
|
*
|
|
1918
|
-
* @
|
|
1919
|
-
*
|
|
1920
|
-
*
|
|
1921
|
-
*
|
|
2336
|
+
* @class
|
|
2337
|
+
* @name Highcharts.SVGRenderer
|
|
2338
|
+
*
|
|
2339
|
+
* @param {Highcharts.HTMLDOMElement} container
|
|
2340
|
+
* Where to put the SVG in the web page.
|
|
2341
|
+
*
|
|
2342
|
+
* @param {number} width
|
|
2343
|
+
* The width of the SVG.
|
|
2344
|
+
*
|
|
2345
|
+
* @param {number} height
|
|
2346
|
+
* The height of the SVG.
|
|
1922
2347
|
*
|
|
1923
|
-
* @
|
|
2348
|
+
* @param {boolean} [forExport=false]
|
|
2349
|
+
* Whether the rendered content is intended for export.
|
|
2350
|
+
*
|
|
2351
|
+
* @param {boolean} [allowHTML=true]
|
|
2352
|
+
* Whether the renderer is allowed to include HTML text, which will be
|
|
2353
|
+
* projected on top of the SVG.
|
|
1924
2354
|
*/
|
|
1925
2355
|
SVGRenderer = H.SVGRenderer = function () {
|
|
1926
2356
|
this.init.apply(this, arguments);
|
|
@@ -1929,13 +2359,35 @@ extend(SVGRenderer.prototype, /** @lends Highcharts.SVGRenderer.prototype */ {
|
|
|
1929
2359
|
/**
|
|
1930
2360
|
* A pointer to the renderer's associated Element class. The VMLRenderer
|
|
1931
2361
|
* will have a pointer to VMLElement here.
|
|
1932
|
-
*
|
|
2362
|
+
*
|
|
2363
|
+
* @name Highcharts.SVGRenderer#Element
|
|
2364
|
+
* @type {Highcharts.SVGElement}
|
|
1933
2365
|
*/
|
|
1934
2366
|
Element: SVGElement,
|
|
2367
|
+
|
|
1935
2368
|
SVG_NS: SVG_NS,
|
|
2369
|
+
|
|
1936
2370
|
/**
|
|
1937
2371
|
* Initialize the SVGRenderer. Overridable initiator function that takes
|
|
1938
2372
|
* the same parameters as the constructor.
|
|
2373
|
+
*
|
|
2374
|
+
* @function Highcharts.SVGRenderer#init
|
|
2375
|
+
*
|
|
2376
|
+
* @param {Highcharts.HTMLDOMElement} container
|
|
2377
|
+
* Where to put the SVG in the web page.
|
|
2378
|
+
*
|
|
2379
|
+
* @param {number} width
|
|
2380
|
+
* The width of the SVG.
|
|
2381
|
+
*
|
|
2382
|
+
* @param {number} height
|
|
2383
|
+
* The height of the SVG.
|
|
2384
|
+
*
|
|
2385
|
+
* @param {boolean} [forExport=false]
|
|
2386
|
+
* Whether the rendered content is intended for export.
|
|
2387
|
+
*
|
|
2388
|
+
* @param {boolean} [allowHTML=true]
|
|
2389
|
+
* Whether the renderer is allowed to include HTML text, which will
|
|
2390
|
+
* be projected on top of the SVG.
|
|
1939
2391
|
*/
|
|
1940
2392
|
init: function (container, width, height, style, forExport, allowHTML) {
|
|
1941
2393
|
var renderer = this,
|
|
@@ -1968,23 +2420,25 @@ extend(SVGRenderer.prototype, /** @lends Highcharts.SVGRenderer.prototype */ {
|
|
|
1968
2420
|
|
|
1969
2421
|
/**
|
|
1970
2422
|
* The root `svg` node of the renderer.
|
|
1971
|
-
*
|
|
1972
|
-
* @
|
|
1973
|
-
* @type {SVGDOMElement}
|
|
2423
|
+
*
|
|
2424
|
+
* @name Highcharts.SVGRenderer#box
|
|
2425
|
+
* @type {Highcharts.SVGDOMElement}
|
|
1974
2426
|
*/
|
|
1975
2427
|
this.box = element;
|
|
1976
2428
|
/**
|
|
1977
2429
|
* The wrapper for the root `svg` node of the renderer.
|
|
1978
2430
|
*
|
|
1979
|
-
* @name boxWrapper
|
|
1980
|
-
* @
|
|
1981
|
-
* @type {SVGElement}
|
|
2431
|
+
* @name Highcharts.SVGRenderer#boxWrapper
|
|
2432
|
+
* @type {Highcharts.SVGElement}
|
|
1982
2433
|
*/
|
|
1983
2434
|
this.boxWrapper = boxWrapper;
|
|
1984
2435
|
renderer.alignedObjects = [];
|
|
1985
2436
|
|
|
1986
2437
|
/**
|
|
1987
2438
|
* Page url used for internal references.
|
|
2439
|
+
*
|
|
2440
|
+
* @private
|
|
2441
|
+
* @name Highcharts.SVGRenderer#url
|
|
1988
2442
|
* @type {string}
|
|
1989
2443
|
*/
|
|
1990
2444
|
// #24, #672, #1070
|
|
@@ -1993,7 +2447,7 @@ extend(SVGRenderer.prototype, /** @lends Highcharts.SVGRenderer.prototype */ {
|
|
|
1993
2447
|
doc.getElementsByTagName('base').length
|
|
1994
2448
|
) ?
|
|
1995
2449
|
win.location.href
|
|
1996
|
-
.
|
|
2450
|
+
.split('#')[0] // remove the hash
|
|
1997
2451
|
.replace(/<[^>]*>/g, '') // wing cut HTML
|
|
1998
2452
|
// escape parantheses and quotes
|
|
1999
2453
|
.replace(/([\('\)])/g, '\\$1')
|
|
@@ -2009,9 +2463,9 @@ extend(SVGRenderer.prototype, /** @lends Highcharts.SVGRenderer.prototype */ {
|
|
|
2009
2463
|
|
|
2010
2464
|
/**
|
|
2011
2465
|
* A pointer to the `defs` node of the root SVG.
|
|
2012
|
-
*
|
|
2013
|
-
* @name defs
|
|
2014
|
-
* @
|
|
2466
|
+
*
|
|
2467
|
+
* @name Highcharts.SVGRenderer#defs
|
|
2468
|
+
* @type {Highcharts.SVGElement}
|
|
2015
2469
|
*/
|
|
2016
2470
|
renderer.defs = this.createElement('defs').add();
|
|
2017
2471
|
renderer.allowHTML = allowHTML;
|
|
@@ -2050,14 +2504,22 @@ extend(SVGRenderer.prototype, /** @lends Highcharts.SVGRenderer.prototype */ {
|
|
|
2050
2504
|
renderer.unSubPixelFix = addEvent(win, 'resize', subPixelFix);
|
|
2051
2505
|
}
|
|
2052
2506
|
},
|
|
2507
|
+
|
|
2053
2508
|
|
|
2054
2509
|
|
|
2055
2510
|
|
|
2511
|
+
|
|
2056
2512
|
/**
|
|
2057
2513
|
* Get the global style setting for the renderer.
|
|
2514
|
+
*
|
|
2058
2515
|
* @private
|
|
2059
|
-
* @
|
|
2060
|
-
*
|
|
2516
|
+
* @function Highcharts.SVGRenderer#getStyle
|
|
2517
|
+
*
|
|
2518
|
+
* @param {Highcharts.CSSObject} style
|
|
2519
|
+
* Style settings.
|
|
2520
|
+
*
|
|
2521
|
+
* @return {Highcharts.CSSObject}
|
|
2522
|
+
* The style settings mixed with defaults.
|
|
2061
2523
|
*/
|
|
2062
2524
|
getStyle: function (style) {
|
|
2063
2525
|
this.style = extend({
|
|
@@ -2069,14 +2531,19 @@ extend(SVGRenderer.prototype, /** @lends Highcharts.SVGRenderer.prototype */ {
|
|
|
2069
2531
|
}, style);
|
|
2070
2532
|
return this.style;
|
|
2071
2533
|
},
|
|
2534
|
+
|
|
2072
2535
|
/**
|
|
2073
2536
|
* Apply the global style on the renderer, mixed with the default styles.
|
|
2074
2537
|
*
|
|
2075
|
-
* @
|
|
2538
|
+
* @function Highcharts.SVGRenderer#setStyle
|
|
2539
|
+
*
|
|
2540
|
+
* @param {Highcharts.CSSObject} style
|
|
2541
|
+
* CSS to apply.
|
|
2076
2542
|
*/
|
|
2077
2543
|
setStyle: function (style) {
|
|
2078
2544
|
this.boxWrapper.css(this.getStyle(style));
|
|
2079
2545
|
},
|
|
2546
|
+
|
|
2080
2547
|
|
|
2081
2548
|
|
|
2082
2549
|
/**
|
|
@@ -2085,7 +2552,10 @@ extend(SVGRenderer.prototype, /** @lends Highcharts.SVGRenderer.prototype */ {
|
|
|
2085
2552
|
* needto render preliminarily in another div to get the text bounding boxes
|
|
2086
2553
|
* right.
|
|
2087
2554
|
*
|
|
2088
|
-
* @
|
|
2555
|
+
* @function Highcharts.SVGRenderer#isHidden
|
|
2556
|
+
*
|
|
2557
|
+
* @return {boolean}
|
|
2558
|
+
* True if it is hidden.
|
|
2089
2559
|
*/
|
|
2090
2560
|
isHidden: function () { // #608
|
|
2091
2561
|
return !this.boxWrapper.getBBox().width;
|
|
@@ -2093,6 +2563,8 @@ extend(SVGRenderer.prototype, /** @lends Highcharts.SVGRenderer.prototype */ {
|
|
|
2093
2563
|
|
|
2094
2564
|
/**
|
|
2095
2565
|
* Destroys the renderer and its allocated members.
|
|
2566
|
+
*
|
|
2567
|
+
* @function Highcharts.SVGRenderer#destroy
|
|
2096
2568
|
*/
|
|
2097
2569
|
destroy: function () {
|
|
2098
2570
|
var renderer = this,
|
|
@@ -2126,8 +2598,13 @@ extend(SVGRenderer.prototype, /** @lends Highcharts.SVGRenderer.prototype */ {
|
|
|
2126
2598
|
* primitive factories like {@link SVGRenderer#path}, {@link
|
|
2127
2599
|
* SVGRenderer#rect} or {@link SVGRenderer#text}.
|
|
2128
2600
|
*
|
|
2129
|
-
* @
|
|
2130
|
-
*
|
|
2601
|
+
* @function Highcharts.SVGRenderer#createElement
|
|
2602
|
+
*
|
|
2603
|
+
* @param {string} nodeName
|
|
2604
|
+
* The node name, for example `rect`, `g` etc.
|
|
2605
|
+
*
|
|
2606
|
+
* @return {Highcharts.SVGElement}
|
|
2607
|
+
* The generated SVGElement.
|
|
2131
2608
|
*/
|
|
2132
2609
|
createElement: function (nodeName) {
|
|
2133
2610
|
var wrapper = new this.Element();
|
|
@@ -2138,7 +2615,9 @@ extend(SVGRenderer.prototype, /** @lends Highcharts.SVGRenderer.prototype */ {
|
|
|
2138
2615
|
/**
|
|
2139
2616
|
* Dummy function for plugins, called every time the renderer is updated.
|
|
2140
2617
|
* Prior to Highcharts 5, this was used for the canvg renderer.
|
|
2141
|
-
*
|
|
2618
|
+
*
|
|
2619
|
+
* @deprecated
|
|
2620
|
+
* @function Highcharts.SVGRenderer#draw
|
|
2142
2621
|
*/
|
|
2143
2622
|
draw: noop,
|
|
2144
2623
|
|
|
@@ -2148,6 +2627,13 @@ extend(SVGRenderer.prototype, /** @lends Highcharts.SVGRenderer.prototype */ {
|
|
|
2148
2627
|
* function.
|
|
2149
2628
|
*
|
|
2150
2629
|
* @private
|
|
2630
|
+
* @function Highcharts.SVGRenderer#getRadialAttr
|
|
2631
|
+
*
|
|
2632
|
+
* @param {Array<number>} radialReference
|
|
2633
|
+
*
|
|
2634
|
+
* @param {Highcharts.SVGAttributes} gradAttr
|
|
2635
|
+
*
|
|
2636
|
+
* @return {Highcharts.SVGAttributes}
|
|
2151
2637
|
*/
|
|
2152
2638
|
getRadialAttr: function (radialReference, gradAttr) {
|
|
2153
2639
|
return {
|
|
@@ -2160,38 +2646,107 @@ extend(SVGRenderer.prototype, /** @lends Highcharts.SVGRenderer.prototype */ {
|
|
|
2160
2646
|
},
|
|
2161
2647
|
|
|
2162
2648
|
/**
|
|
2163
|
-
*
|
|
2649
|
+
* Truncate the text node contents to a given length. Used when the css
|
|
2650
|
+
* width is set. If the `textOverflow` is `ellipsis`, the text is truncated
|
|
2651
|
+
* character by character to the given length. If not, the text is
|
|
2652
|
+
* word-wrapped line by line.
|
|
2164
2653
|
*
|
|
2165
2654
|
* @private
|
|
2655
|
+
* @function Highcharts.SVGRenderer#truncate
|
|
2656
|
+
*
|
|
2657
|
+
* @param {Highcharts.SVGElement} wrapper
|
|
2658
|
+
*
|
|
2659
|
+
* @param {Highcharts.SVGDOMElement} tspan
|
|
2660
|
+
*
|
|
2661
|
+
* @param {string} text
|
|
2662
|
+
*
|
|
2663
|
+
* @param {Array.<string>} words
|
|
2664
|
+
*
|
|
2665
|
+
* @param {number} width
|
|
2666
|
+
*
|
|
2667
|
+
* @param {Function} getString
|
|
2668
|
+
*
|
|
2669
|
+
* @return {boolean}
|
|
2670
|
+
* True if tspan is too long.
|
|
2166
2671
|
*/
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2672
|
+
truncate: function (
|
|
2673
|
+
wrapper,
|
|
2674
|
+
tspan,
|
|
2675
|
+
text,
|
|
2676
|
+
words,
|
|
2677
|
+
startAt,
|
|
2678
|
+
width,
|
|
2679
|
+
getString
|
|
2680
|
+
) {
|
|
2172
2681
|
var renderer = this,
|
|
2173
2682
|
rotation = wrapper.rotation,
|
|
2174
|
-
str
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2683
|
+
str,
|
|
2684
|
+
// Word wrap can not be truncated to shorter than one word, ellipsis
|
|
2685
|
+
// text can be completely blank.
|
|
2686
|
+
minIndex = words ? 1 : 0,
|
|
2687
|
+
maxIndex = (text || words).length,
|
|
2688
|
+
currentIndex = maxIndex,
|
|
2689
|
+
// Cache the lengths to avoid checking the same twice
|
|
2690
|
+
lengths = [],
|
|
2178
2691
|
updateTSpan = function (s) {
|
|
2179
|
-
|
|
2692
|
+
if (tspan.firstChild) {
|
|
2693
|
+
tspan.removeChild(tspan.firstChild);
|
|
2694
|
+
}
|
|
2180
2695
|
if (s) {
|
|
2181
2696
|
tspan.appendChild(doc.createTextNode(s));
|
|
2182
2697
|
}
|
|
2183
2698
|
},
|
|
2699
|
+
getSubStringLength = function (charEnd, concatenatedEnd) {
|
|
2700
|
+
// charEnd is useed when finding the character-by-character
|
|
2701
|
+
// break for ellipsis, concatenatedEnd is used for word-by-word
|
|
2702
|
+
// break for word wrapping.
|
|
2703
|
+
var end = concatenatedEnd || charEnd;
|
|
2704
|
+
if (lengths[end] === undefined) {
|
|
2705
|
+
// Modern browsers
|
|
2706
|
+
if (tspan.getSubStringLength) {
|
|
2707
|
+
// Fails with DOM exception on unit-tests/legend/members
|
|
2708
|
+
// of unknown reason. Desired width is 0, text content
|
|
2709
|
+
// is "5" and end is 1.
|
|
2710
|
+
try {
|
|
2711
|
+
lengths[end] = startAt + tspan.getSubStringLength(
|
|
2712
|
+
0,
|
|
2713
|
+
words ? end + 1 : end
|
|
2714
|
+
);
|
|
2715
|
+
|
|
2716
|
+
} catch (e) {}
|
|
2717
|
+
|
|
2718
|
+
// Legacy
|
|
2719
|
+
} else if (renderer.getSpanWidth) { // #9058 jsdom
|
|
2720
|
+
updateTSpan(getString(text || words, charEnd));
|
|
2721
|
+
lengths[end] = startAt +
|
|
2722
|
+
renderer.getSpanWidth(wrapper, tspan);
|
|
2723
|
+
}
|
|
2724
|
+
}
|
|
2725
|
+
return lengths[end];
|
|
2726
|
+
},
|
|
2184
2727
|
actualWidth,
|
|
2185
|
-
|
|
2728
|
+
truncated;
|
|
2729
|
+
|
|
2186
2730
|
wrapper.rotation = 0; // discard rotation when computing box
|
|
2187
|
-
actualWidth =
|
|
2188
|
-
|
|
2189
|
-
if (
|
|
2731
|
+
actualWidth = getSubStringLength(tspan.textContent.length);
|
|
2732
|
+
truncated = startAt + actualWidth > width;
|
|
2733
|
+
if (truncated) {
|
|
2734
|
+
|
|
2735
|
+
// Do a binary search for the index where to truncate the text
|
|
2190
2736
|
while (minIndex <= maxIndex) {
|
|
2191
2737
|
currentIndex = Math.ceil((minIndex + maxIndex) / 2);
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2738
|
+
|
|
2739
|
+
// When checking words for word-wrap, we need to build the
|
|
2740
|
+
// string and measure the subStringLength at the concatenated
|
|
2741
|
+
// word length.
|
|
2742
|
+
if (words) {
|
|
2743
|
+
str = getString(words, currentIndex);
|
|
2744
|
+
}
|
|
2745
|
+
actualWidth = getSubStringLength(
|
|
2746
|
+
currentIndex,
|
|
2747
|
+
str && str.length - 1
|
|
2748
|
+
);
|
|
2749
|
+
|
|
2195
2750
|
if (minIndex === maxIndex) {
|
|
2196
2751
|
// Complete
|
|
2197
2752
|
minIndex = maxIndex + 1;
|
|
@@ -2203,14 +2758,29 @@ extend(SVGRenderer.prototype, /** @lends Highcharts.SVGRenderer.prototype */ {
|
|
|
2203
2758
|
minIndex = currentIndex;
|
|
2204
2759
|
}
|
|
2205
2760
|
}
|
|
2206
|
-
// If max index was 0 it means
|
|
2761
|
+
// If max index was 0 it means the shortest possible text was also
|
|
2762
|
+
// too large. For ellipsis that means only the ellipsis, while for
|
|
2763
|
+
// word wrap it means the whole first word.
|
|
2207
2764
|
if (maxIndex === 0) {
|
|
2208
|
-
// Remove
|
|
2765
|
+
// Remove ellipsis
|
|
2209
2766
|
updateTSpan('');
|
|
2767
|
+
|
|
2768
|
+
// If the new text length is one less than the original, we don't
|
|
2769
|
+
// need the ellipsis
|
|
2770
|
+
} else if (!(text && maxIndex === text.length - 1)) {
|
|
2771
|
+
updateTSpan(str || getString(text || words, currentIndex));
|
|
2210
2772
|
}
|
|
2211
2773
|
}
|
|
2774
|
+
|
|
2775
|
+
// When doing line wrapping, prepare for the next line by removing the
|
|
2776
|
+
// items from this line.
|
|
2777
|
+
if (words) {
|
|
2778
|
+
words.splice(0, currentIndex);
|
|
2779
|
+
}
|
|
2780
|
+
|
|
2781
|
+
wrapper.actualWidth = actualWidth;
|
|
2212
2782
|
wrapper.rotation = rotation; // Apply rotation again.
|
|
2213
|
-
return
|
|
2783
|
+
return truncated;
|
|
2214
2784
|
},
|
|
2215
2785
|
|
|
2216
2786
|
/**
|
|
@@ -2223,7 +2793,8 @@ extend(SVGRenderer.prototype, /** @lends Highcharts.SVGRenderer.prototype */ {
|
|
|
2223
2793
|
* // Add support for unescaping quotes
|
|
2224
2794
|
* Highcharts.SVGRenderer.prototype.escapes['"'] = '"';
|
|
2225
2795
|
*
|
|
2226
|
-
* @
|
|
2796
|
+
* @name Highcharts.SVGRenderer#escapes
|
|
2797
|
+
* @type {Highcharts.Dictionary<string>}
|
|
2227
2798
|
*/
|
|
2228
2799
|
escapes: {
|
|
2229
2800
|
'&': '&',
|
|
@@ -2235,11 +2806,15 @@ extend(SVGRenderer.prototype, /** @lends Highcharts.SVGRenderer.prototype */ {
|
|
|
2235
2806
|
|
|
2236
2807
|
/**
|
|
2237
2808
|
* Parse a simple HTML string into SVG tspans. Called internally when text
|
|
2238
|
-
*
|
|
2239
|
-
*
|
|
2240
|
-
*
|
|
2809
|
+
* is set on an SVGElement. The function supports a subset of HTML tags, CSS
|
|
2810
|
+
* text features like `width`, `text-overflow`, `white-space`, and also
|
|
2811
|
+
* attributes like `href` and `style`.
|
|
2812
|
+
*
|
|
2241
2813
|
* @private
|
|
2242
|
-
* @
|
|
2814
|
+
* @function Highcharts.SVGRenderer#buildText
|
|
2815
|
+
*
|
|
2816
|
+
* @param {Highcharts.SVGElement} wrapper
|
|
2817
|
+
* The parent SVGElement.
|
|
2243
2818
|
*/
|
|
2244
2819
|
buildText: function (wrapper) {
|
|
2245
2820
|
var textNode = wrapper.element,
|
|
@@ -2249,7 +2824,7 @@ extend(SVGRenderer.prototype, /** @lends Highcharts.SVGRenderer.prototype */ {
|
|
|
2249
2824
|
hasMarkup = textStr.indexOf('<') !== -1,
|
|
2250
2825
|
lines,
|
|
2251
2826
|
childNodes = textNode.childNodes,
|
|
2252
|
-
|
|
2827
|
+
truncated,
|
|
2253
2828
|
parentX = attr(textNode, 'x'),
|
|
2254
2829
|
textStyles = wrapper.styles,
|
|
2255
2830
|
width = wrapper.textWidth,
|
|
@@ -2371,7 +2946,8 @@ extend(SVGRenderer.prototype, /** @lends Highcharts.SVGRenderer.prototype */ {
|
|
|
2371
2946
|
// build the lines
|
|
2372
2947
|
each(lines, function buildTextLines(line, lineNo) {
|
|
2373
2948
|
var spans,
|
|
2374
|
-
spanNo = 0
|
|
2949
|
+
spanNo = 0,
|
|
2950
|
+
lineLength = 0;
|
|
2375
2951
|
line = line
|
|
2376
2952
|
// Trim to prevent useless/costly process on the spaces
|
|
2377
2953
|
// (#5258)
|
|
@@ -2465,88 +3041,55 @@ extend(SVGRenderer.prototype, /** @lends Highcharts.SVGRenderer.prototype */ {
|
|
|
2465
3041
|
);
|
|
2466
3042
|
}
|
|
2467
3043
|
|
|
2468
|
-
/*
|
|
2469
|
-
// Experimental text wrapping based on
|
|
2470
|
-
// getSubstringLength
|
|
2471
|
-
if (width) {
|
|
2472
|
-
var spans = renderer.breakText(wrapper, width);
|
|
2473
|
-
|
|
2474
|
-
each(spans, function (span) {
|
|
2475
|
-
|
|
2476
|
-
var dy = getLineHeight(tspan);
|
|
2477
|
-
tspan = doc.createElementNS(
|
|
2478
|
-
SVG_NS,
|
|
2479
|
-
'tspan'
|
|
2480
|
-
);
|
|
2481
|
-
tspan.appendChild(
|
|
2482
|
-
doc.createTextNode(span)
|
|
2483
|
-
);
|
|
2484
|
-
attr(tspan, {
|
|
2485
|
-
dy: dy,
|
|
2486
|
-
x: parentX
|
|
2487
|
-
});
|
|
2488
|
-
if (spanStyle) { // #390
|
|
2489
|
-
attr(tspan, 'style', spanStyle);
|
|
2490
|
-
}
|
|
2491
|
-
textNode.appendChild(tspan);
|
|
2492
|
-
});
|
|
2493
|
-
|
|
2494
|
-
}
|
|
2495
|
-
// */
|
|
2496
|
-
|
|
2497
3044
|
// Check width and apply soft breaks or ellipsis
|
|
2498
3045
|
if (width) {
|
|
2499
3046
|
var words = span.replace(
|
|
2500
3047
|
/([^\^])-/g,
|
|
2501
3048
|
'$1- '
|
|
2502
3049
|
).split(' '), // #1273
|
|
2503
|
-
hasWhiteSpace = (
|
|
3050
|
+
hasWhiteSpace = !noWrap && (
|
|
2504
3051
|
spans.length > 1 ||
|
|
2505
3052
|
lineNo ||
|
|
2506
|
-
|
|
3053
|
+
words.length > 1
|
|
2507
3054
|
),
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
actualWidth,
|
|
2511
|
-
dy = getLineHeight(tspan),
|
|
2512
|
-
rotation = wrapper.rotation;
|
|
3055
|
+
wrapLineNo = 0,
|
|
3056
|
+
dy = getLineHeight(tspan);
|
|
2513
3057
|
|
|
2514
3058
|
if (ellipsis) {
|
|
2515
|
-
|
|
3059
|
+
truncated = renderer.truncate(
|
|
2516
3060
|
wrapper,
|
|
2517
3061
|
tspan,
|
|
2518
3062
|
span,
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
|
|
2526
|
-
|
|
2527
|
-
|
|
2528
|
-
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
|
|
2532
|
-
|
|
3063
|
+
undefined,
|
|
3064
|
+
0,
|
|
3065
|
+
// Target width
|
|
3066
|
+
Math.max(
|
|
3067
|
+
0,
|
|
3068
|
+
// Substract the font face to make
|
|
3069
|
+
// room for the ellipsis itself
|
|
3070
|
+
width - parseInt(fontSize || 12, 10)
|
|
3071
|
+
),
|
|
3072
|
+
// Build the text to test for
|
|
3073
|
+
function (text, currentIndex) {
|
|
3074
|
+
return text.substring(
|
|
3075
|
+
0,
|
|
3076
|
+
currentIndex
|
|
3077
|
+
) + '\u2026';
|
|
3078
|
+
}
|
|
2533
3079
|
);
|
|
2534
|
-
|
|
3080
|
+
} else if (hasWhiteSpace) {
|
|
2535
3081
|
|
|
2536
|
-
|
|
2537
|
-
// correct string length
|
|
2538
|
-
if (wasTooLong === undefined) {
|
|
2539
|
-
wasTooLong = tooLong; // First time
|
|
2540
|
-
}
|
|
3082
|
+
while (words.length) {
|
|
2541
3083
|
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
|
|
3084
|
+
// For subsequent lines, create tspans
|
|
3085
|
+
// with the same style attributes as the
|
|
3086
|
+
// parent text node.
|
|
3087
|
+
if (
|
|
3088
|
+
words.length &&
|
|
3089
|
+
!noWrap &&
|
|
3090
|
+
wrapLineNo > 0
|
|
3091
|
+
) {
|
|
2548
3092
|
|
|
2549
|
-
if (words.length && !noWrap) {
|
|
2550
3093
|
tspan = doc.createElementNS(
|
|
2551
3094
|
SVG_NS,
|
|
2552
3095
|
'tspan'
|
|
@@ -2562,34 +3105,48 @@ extend(SVGRenderer.prototype, /** @lends Highcharts.SVGRenderer.prototype */ {
|
|
|
2562
3105
|
styleAttribute
|
|
2563
3106
|
);
|
|
2564
3107
|
}
|
|
3108
|
+
// Start by appending the full
|
|
3109
|
+
// remaining text
|
|
3110
|
+
tspan.appendChild(
|
|
3111
|
+
doc.createTextNode(
|
|
3112
|
+
words.join(' ')
|
|
3113
|
+
.replace(/- /g, '-')
|
|
3114
|
+
)
|
|
3115
|
+
);
|
|
2565
3116
|
textNode.appendChild(tspan);
|
|
2566
3117
|
}
|
|
2567
3118
|
|
|
2568
|
-
//
|
|
2569
|
-
|
|
2570
|
-
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
.
|
|
2582
|
-
|
|
3119
|
+
// For each line, truncate the remaining
|
|
3120
|
+
// words into the line length.
|
|
3121
|
+
renderer.truncate(
|
|
3122
|
+
wrapper,
|
|
3123
|
+
tspan,
|
|
3124
|
+
null,
|
|
3125
|
+
words,
|
|
3126
|
+
wrapLineNo === 0 ? lineLength : 0,
|
|
3127
|
+
width,
|
|
3128
|
+
// Build the text to test for
|
|
3129
|
+
function (text, currentIndex) {
|
|
3130
|
+
return words
|
|
3131
|
+
.slice(0, currentIndex)
|
|
3132
|
+
.join(' ')
|
|
3133
|
+
.replace(/- /g, '-');
|
|
3134
|
+
}
|
|
2583
3135
|
);
|
|
3136
|
+
|
|
3137
|
+
lineLength = wrapper.actualWidth;
|
|
3138
|
+
wrapLineNo++;
|
|
2584
3139
|
}
|
|
2585
3140
|
}
|
|
2586
|
-
wrapper.rotation = rotation;
|
|
2587
3141
|
}
|
|
2588
3142
|
|
|
2589
3143
|
spanNo++;
|
|
2590
3144
|
}
|
|
3145
|
+
|
|
2591
3146
|
}
|
|
3147
|
+
|
|
2592
3148
|
});
|
|
3149
|
+
|
|
2593
3150
|
// To avoid beginning lines that doesn't add to the textNode
|
|
2594
3151
|
// (#6144)
|
|
2595
3152
|
isSubsequentLine = (
|
|
@@ -2598,7 +3155,7 @@ extend(SVGRenderer.prototype, /** @lends Highcharts.SVGRenderer.prototype */ {
|
|
|
2598
3155
|
);
|
|
2599
3156
|
});
|
|
2600
3157
|
|
|
2601
|
-
if (ellipsis &&
|
|
3158
|
+
if (ellipsis && truncated) {
|
|
2602
3159
|
wrapper.attr(
|
|
2603
3160
|
'title',
|
|
2604
3161
|
unescapeEntities(wrapper.textStr, ['<', '>']) // #7179
|
|
@@ -2615,99 +3172,63 @@ extend(SVGRenderer.prototype, /** @lends Highcharts.SVGRenderer.prototype */ {
|
|
|
2615
3172
|
}
|
|
2616
3173
|
},
|
|
2617
3174
|
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
/*
|
|
2621
|
-
breakText: function (wrapper, width) {
|
|
2622
|
-
var bBox = wrapper.getBBox(),
|
|
2623
|
-
node = wrapper.element,
|
|
2624
|
-
charnum = node.textContent.length,
|
|
2625
|
-
stringWidth,
|
|
2626
|
-
// try this position first, based on average character width
|
|
2627
|
-
guessedLineCharLength = Math.round(width * charnum / bBox.width),
|
|
2628
|
-
pos = guessedLineCharLength,
|
|
2629
|
-
spans = [],
|
|
2630
|
-
increment = 0,
|
|
2631
|
-
startPos = 0,
|
|
2632
|
-
endPos,
|
|
2633
|
-
safe = 0;
|
|
2634
|
-
|
|
2635
|
-
if (bBox.width > width) {
|
|
2636
|
-
while (startPos < charnum && safe < 100) {
|
|
2637
|
-
|
|
2638
|
-
while (endPos === undefined && safe < 100) {
|
|
2639
|
-
stringWidth = node.getSubStringLength(
|
|
2640
|
-
startPos,
|
|
2641
|
-
pos - startPos
|
|
2642
|
-
);
|
|
2643
|
-
|
|
2644
|
-
if (stringWidth <= width) {
|
|
2645
|
-
if (increment === -1) {
|
|
2646
|
-
endPos = pos;
|
|
2647
|
-
} else {
|
|
2648
|
-
increment = 1;
|
|
2649
|
-
}
|
|
2650
|
-
} else {
|
|
2651
|
-
if (increment === 1) {
|
|
2652
|
-
endPos = pos - 1;
|
|
2653
|
-
} else {
|
|
2654
|
-
increment = -1;
|
|
2655
|
-
}
|
|
2656
|
-
}
|
|
2657
|
-
pos += increment;
|
|
2658
|
-
safe++;
|
|
2659
|
-
}
|
|
2660
|
-
|
|
2661
|
-
spans.push(
|
|
2662
|
-
node.textContent.substr(startPos, endPos - startPos)
|
|
2663
|
-
);
|
|
2664
|
-
|
|
2665
|
-
startPos = endPos;
|
|
2666
|
-
pos = startPos + guessedLineCharLength;
|
|
2667
|
-
endPos = undefined;
|
|
2668
|
-
}
|
|
2669
|
-
}
|
|
2670
|
-
|
|
2671
|
-
return spans;
|
|
2672
|
-
},
|
|
2673
|
-
// */
|
|
2674
|
-
|
|
2675
3175
|
/**
|
|
2676
3176
|
* Returns white for dark colors and black for bright colors.
|
|
2677
3177
|
*
|
|
2678
|
-
* @
|
|
2679
|
-
*
|
|
3178
|
+
* @function Highcharts.SVGRenderer#getContrast
|
|
3179
|
+
*
|
|
3180
|
+
* @param {Highcharts.ColorString} rgba
|
|
3181
|
+
* The color to get the contrast for.
|
|
3182
|
+
*
|
|
3183
|
+
* @return {string}
|
|
3184
|
+
* The contrast color, either `#000000` or `#FFFFFF`.
|
|
2680
3185
|
*/
|
|
2681
3186
|
getContrast: function (rgba) {
|
|
2682
3187
|
rgba = color(rgba).rgba;
|
|
2683
3188
|
|
|
2684
3189
|
// The threshold may be discussed. Here's a proposal for adding
|
|
2685
3190
|
// different weight to the color channels (#6216)
|
|
2686
|
-
/*
|
|
2687
3191
|
rgba[0] *= 1; // red
|
|
2688
3192
|
rgba[1] *= 1.2; // green
|
|
2689
|
-
rgba[2] *= 0.
|
|
2690
|
-
*/
|
|
3193
|
+
rgba[2] *= 0.5; // blue
|
|
2691
3194
|
|
|
2692
|
-
return rgba[0] + rgba[1] + rgba[2] >
|
|
3195
|
+
return rgba[0] + rgba[1] + rgba[2] > 1.8 * 255 ? '#000000' : '#FFFFFF';
|
|
2693
3196
|
},
|
|
2694
3197
|
|
|
2695
3198
|
/**
|
|
2696
3199
|
* Create a button with preset states.
|
|
2697
|
-
*
|
|
2698
|
-
* @
|
|
2699
|
-
*
|
|
2700
|
-
* @param {
|
|
2701
|
-
*
|
|
2702
|
-
*
|
|
2703
|
-
*
|
|
2704
|
-
*
|
|
2705
|
-
*
|
|
2706
|
-
*
|
|
2707
|
-
*
|
|
2708
|
-
*
|
|
2709
|
-
* @param {
|
|
2710
|
-
*
|
|
3200
|
+
*
|
|
3201
|
+
* @function Highcharts.SVGRenderer#button
|
|
3202
|
+
*
|
|
3203
|
+
* @param {string} text
|
|
3204
|
+
* The text or HTML to draw.
|
|
3205
|
+
*
|
|
3206
|
+
* @param {number} x
|
|
3207
|
+
* The x position of the button's left side.
|
|
3208
|
+
*
|
|
3209
|
+
* @param {number} y
|
|
3210
|
+
* The y position of the button's top side.
|
|
3211
|
+
*
|
|
3212
|
+
* @param {Function} callback
|
|
3213
|
+
* The function to execute on button click or touch.
|
|
3214
|
+
*
|
|
3215
|
+
* @param {Highcharts.SVGAttributes} [normalState]
|
|
3216
|
+
* SVG attributes for the normal state.
|
|
3217
|
+
*
|
|
3218
|
+
* @param {Highcharts.SVGAttributes} [hoverState]
|
|
3219
|
+
* SVG attributes for the hover state.
|
|
3220
|
+
*
|
|
3221
|
+
* @param {Highcharts.SVGAttributes} [pressedState]
|
|
3222
|
+
* SVG attributes for the pressed state.
|
|
3223
|
+
*
|
|
3224
|
+
* @param {Highcharts.SVGAttributes} [disabledState]
|
|
3225
|
+
* SVG attributes for the disabled state.
|
|
3226
|
+
*
|
|
3227
|
+
* @param {Highcharts.SymbolKey} [shape=rect]
|
|
3228
|
+
* The shape type.
|
|
3229
|
+
*
|
|
3230
|
+
* @return {Highcharts.SVGElement}
|
|
3231
|
+
* The button element.
|
|
2711
3232
|
*/
|
|
2712
3233
|
button: function (
|
|
2713
3234
|
text,
|
|
@@ -2850,11 +3371,16 @@ extend(SVGRenderer.prototype, /** @lends Highcharts.SVGRenderer.prototype */ {
|
|
|
2850
3371
|
/**
|
|
2851
3372
|
* Make a straight line crisper by not spilling out to neighbour pixels.
|
|
2852
3373
|
*
|
|
2853
|
-
* @
|
|
2854
|
-
*
|
|
2855
|
-
* @param {
|
|
2856
|
-
*
|
|
2857
|
-
*
|
|
3374
|
+
* @function Highcharts.SVGRenderer#crispLine
|
|
3375
|
+
*
|
|
3376
|
+
* @param {Highcharts.SVGPathArray} points
|
|
3377
|
+
* The original points on the format `['M', 0, 0, 'L', 100, 0]`.
|
|
3378
|
+
*
|
|
3379
|
+
* @param {number} width
|
|
3380
|
+
* The width of the line.
|
|
3381
|
+
*
|
|
3382
|
+
* @return {Highcharts.SVGPathArray}
|
|
3383
|
+
* The original points array, but modified to render crisply.
|
|
2858
3384
|
*/
|
|
2859
3385
|
crispLine: function (points, width) {
|
|
2860
3386
|
// normalize to a crisp line
|
|
@@ -2873,24 +3399,34 @@ extend(SVGRenderer.prototype, /** @lends Highcharts.SVGRenderer.prototype */ {
|
|
|
2873
3399
|
/**
|
|
2874
3400
|
* Draw a path, wraps the SVG `path` element.
|
|
2875
3401
|
*
|
|
2876
|
-
* @
|
|
3402
|
+
* @sample highcharts/members/renderer-path-on-chart/
|
|
3403
|
+
* Draw a path in a chart
|
|
3404
|
+
* @sample highcharts/members/renderer-path/
|
|
3405
|
+
* Draw a path independent from a chart
|
|
2877
3406
|
*
|
|
2878
3407
|
* @example
|
|
2879
3408
|
* var path = renderer.path(['M', 10, 10, 'L', 30, 30, 'z'])
|
|
2880
3409
|
* .attr({ stroke: '#ff00ff' })
|
|
2881
3410
|
* .add();
|
|
2882
|
-
* @returns {SVGElement} The generated wrapper element.
|
|
2883
3411
|
*
|
|
2884
|
-
* @
|
|
2885
|
-
*
|
|
2886
|
-
* @
|
|
2887
|
-
*
|
|
3412
|
+
* @function Highcharts.SVGRenderer#path
|
|
3413
|
+
*
|
|
3414
|
+
* @param {Highcharts.SVGPathArray} [path]
|
|
3415
|
+
* An SVG path definition in array form.
|
|
3416
|
+
*
|
|
3417
|
+
* @return {Highcharts.SVGElement}
|
|
3418
|
+
* The generated wrapper element.
|
|
2888
3419
|
*
|
|
2889
3420
|
*//**
|
|
2890
3421
|
* Draw a path, wraps the SVG `path` element.
|
|
2891
3422
|
*
|
|
2892
|
-
* @
|
|
2893
|
-
*
|
|
3423
|
+
* @function Highcharts.SVGRenderer#path
|
|
3424
|
+
*
|
|
3425
|
+
* @param {Highcharts.SVGAttributes} [attribs]
|
|
3426
|
+
* The initial attributes.
|
|
3427
|
+
*
|
|
3428
|
+
* @return {Highcharts.SVGElement}
|
|
3429
|
+
* The generated wrapper element.
|
|
2894
3430
|
*/
|
|
2895
3431
|
path: function (path) {
|
|
2896
3432
|
var attribs = {
|
|
@@ -2909,17 +3445,32 @@ extend(SVGRenderer.prototype, /** @lends Highcharts.SVGRenderer.prototype */ {
|
|
|
2909
3445
|
/**
|
|
2910
3446
|
* Draw a circle, wraps the SVG `circle` element.
|
|
2911
3447
|
*
|
|
2912
|
-
* @
|
|
2913
|
-
*
|
|
2914
|
-
*
|
|
2915
|
-
* @
|
|
3448
|
+
* @sample highcharts/members/renderer-circle/
|
|
3449
|
+
* Drawing a circle
|
|
3450
|
+
*
|
|
3451
|
+
* @function Highcharts.SVGRenderer#circle
|
|
2916
3452
|
*
|
|
2917
|
-
* @
|
|
3453
|
+
* @param {number} [x]
|
|
3454
|
+
* The center x position.
|
|
3455
|
+
*
|
|
3456
|
+
* @param {number} [y]
|
|
3457
|
+
* The center y position.
|
|
3458
|
+
*
|
|
3459
|
+
* @param {number} [r]
|
|
3460
|
+
* The radius.
|
|
3461
|
+
*
|
|
3462
|
+
* @return {Highcharts.SVGElement}
|
|
3463
|
+
* The generated wrapper element.
|
|
2918
3464
|
*//**
|
|
2919
3465
|
* Draw a circle, wraps the SVG `circle` element.
|
|
2920
3466
|
*
|
|
2921
|
-
* @
|
|
2922
|
-
*
|
|
3467
|
+
* @function Highcharts.SVGRenderer#circle
|
|
3468
|
+
*
|
|
3469
|
+
* @param {Highcharts.SVGAttributes} [attribs]
|
|
3470
|
+
* The initial attributes.
|
|
3471
|
+
*
|
|
3472
|
+
* @return {Highcharts.SVGElement}
|
|
3473
|
+
* The generated wrapper element.
|
|
2923
3474
|
*/
|
|
2924
3475
|
circle: function (x, y, r) {
|
|
2925
3476
|
var attribs = isObject(x) ? x : { x: x, y: y, r: r },
|
|
@@ -2935,22 +3486,44 @@ extend(SVGRenderer.prototype, /** @lends Highcharts.SVGRenderer.prototype */ {
|
|
|
2935
3486
|
|
|
2936
3487
|
/**
|
|
2937
3488
|
* Draw and return an arc.
|
|
2938
|
-
* @param {number} [x=0] Center X position.
|
|
2939
|
-
* @param {number} [y=0] Center Y position.
|
|
2940
|
-
* @param {number} [r=0] The outer radius of the arc.
|
|
2941
|
-
* @param {number} [innerR=0] Inner radius like used in donut charts.
|
|
2942
|
-
* @param {number} [start=0] The starting angle of the arc in radians, where
|
|
2943
|
-
* 0 is to the right and `-Math.PI/2` is up.
|
|
2944
|
-
* @param {number} [end=0] The ending angle of the arc in radians, where 0
|
|
2945
|
-
* is to the right and `-Math.PI/2` is up.
|
|
2946
|
-
* @returns {SVGElement} The generated wrapper element.
|
|
2947
3489
|
*
|
|
2948
3490
|
* @sample highcharts/members/renderer-arc/
|
|
2949
3491
|
* Drawing an arc
|
|
3492
|
+
*
|
|
3493
|
+
* @function Highcharts.SVGRenderer#arc
|
|
3494
|
+
*
|
|
3495
|
+
* @param {number} [x=0]
|
|
3496
|
+
* Center X position.
|
|
3497
|
+
*
|
|
3498
|
+
* @param {number} [y=0]
|
|
3499
|
+
* Center Y position.
|
|
3500
|
+
*
|
|
3501
|
+
* @param {number} [r=0]
|
|
3502
|
+
* The outer radius of the arc.
|
|
3503
|
+
*
|
|
3504
|
+
* @param {number} [innerR=0]
|
|
3505
|
+
* Inner radius like used in donut charts.
|
|
3506
|
+
*
|
|
3507
|
+
* @param {number} [start=0]
|
|
3508
|
+
* The starting angle of the arc in radians, where 0 is to the right
|
|
3509
|
+
* and `-Math.PI/2` is up.
|
|
3510
|
+
*
|
|
3511
|
+
* @param {number} [end=0]
|
|
3512
|
+
* The ending angle of the arc in radians, where 0 is to the right
|
|
3513
|
+
* and `-Math.PI/2` is up.
|
|
3514
|
+
*
|
|
3515
|
+
* @return {Highcharts.SVGElement}
|
|
3516
|
+
* The generated wrapper element.
|
|
2950
3517
|
*//**
|
|
2951
3518
|
* Draw and return an arc. Overloaded function that takes arguments object.
|
|
2952
|
-
*
|
|
2953
|
-
* @
|
|
3519
|
+
*
|
|
3520
|
+
* @function Highcharts.SVGRenderer#arc
|
|
3521
|
+
*
|
|
3522
|
+
* @param {Highcharts.SVGAttributes} attribs
|
|
3523
|
+
* Initial SVG attributes.
|
|
3524
|
+
*
|
|
3525
|
+
* @return {Highcharts.SVGElement}
|
|
3526
|
+
* The generated wrapper element.
|
|
2954
3527
|
*/
|
|
2955
3528
|
arc: function (x, y, r, innerR, start, end) {
|
|
2956
3529
|
var arc,
|
|
@@ -2981,25 +3554,44 @@ extend(SVGRenderer.prototype, /** @lends Highcharts.SVGRenderer.prototype */ {
|
|
|
2981
3554
|
|
|
2982
3555
|
/**
|
|
2983
3556
|
* Draw and return a rectangle.
|
|
2984
|
-
*
|
|
2985
|
-
* @
|
|
2986
|
-
*
|
|
2987
|
-
* @param {number} [
|
|
2988
|
-
*
|
|
2989
|
-
*
|
|
2990
|
-
*
|
|
2991
|
-
*
|
|
3557
|
+
*
|
|
3558
|
+
* @function Highcharts.SVGRenderer#rect
|
|
3559
|
+
*
|
|
3560
|
+
* @param {number} [x]
|
|
3561
|
+
* Left position.
|
|
3562
|
+
*
|
|
3563
|
+
* @param {number} [y]
|
|
3564
|
+
* Top position.
|
|
3565
|
+
*
|
|
3566
|
+
* @param {number} [width]
|
|
3567
|
+
* Width of the rectangle.
|
|
3568
|
+
*
|
|
3569
|
+
* @param {number} [height]
|
|
3570
|
+
* Height of the rectangle.
|
|
3571
|
+
*
|
|
3572
|
+
* @param {number} [r]
|
|
3573
|
+
* Border corner radius.
|
|
3574
|
+
*
|
|
3575
|
+
* @param {number} [strokeWidth]
|
|
3576
|
+
* A stroke width can be supplied to allow crisp drawing.
|
|
3577
|
+
*
|
|
3578
|
+
* @return {Highcharts.SVGElement}
|
|
3579
|
+
* The generated wrapper element.
|
|
2992
3580
|
*//**
|
|
2993
3581
|
* Draw and return a rectangle.
|
|
2994
|
-
* @param {SVGAttributes} [attributes]
|
|
2995
|
-
* General SVG attributes for the rectangle.
|
|
2996
|
-
* @return {SVGElement}
|
|
2997
|
-
* The generated wrapper element.
|
|
2998
3582
|
*
|
|
2999
3583
|
* @sample highcharts/members/renderer-rect-on-chart/
|
|
3000
3584
|
* Draw a rectangle in a chart
|
|
3001
3585
|
* @sample highcharts/members/renderer-rect/
|
|
3002
3586
|
* Draw a rectangle independent from a chart
|
|
3587
|
+
*
|
|
3588
|
+
* @function Highcharts.SVGRenderer#rect
|
|
3589
|
+
*
|
|
3590
|
+
* @param {Highcharts.SVGAttributes} [attributes]
|
|
3591
|
+
* General SVG attributes for the rectangle.
|
|
3592
|
+
*
|
|
3593
|
+
* @return {Highcharts.SVGElement}
|
|
3594
|
+
* The generated wrapper element.
|
|
3003
3595
|
*/
|
|
3004
3596
|
rect: function (x, y, width, height, r, strokeWidth) {
|
|
3005
3597
|
|
|
@@ -3038,12 +3630,20 @@ extend(SVGRenderer.prototype, /** @lends Highcharts.SVGRenderer.prototype */ {
|
|
|
3038
3630
|
/**
|
|
3039
3631
|
* Resize the {@link SVGRenderer#box} and re-align all aligned child
|
|
3040
3632
|
* elements.
|
|
3041
|
-
*
|
|
3042
|
-
*
|
|
3043
|
-
*
|
|
3044
|
-
*
|
|
3045
|
-
* @
|
|
3046
|
-
*
|
|
3633
|
+
*
|
|
3634
|
+
* @sample highcharts/members/renderer-g/
|
|
3635
|
+
* Show and hide grouped objects
|
|
3636
|
+
*
|
|
3637
|
+
* @function Highcharts.SVGRenderer#setSize
|
|
3638
|
+
*
|
|
3639
|
+
* @param {number} width
|
|
3640
|
+
* The new pixel width.
|
|
3641
|
+
*
|
|
3642
|
+
* @param {number} height
|
|
3643
|
+
* The new pixel height.
|
|
3644
|
+
*
|
|
3645
|
+
* @param {boolean|Highcharts.AnimationOptionsObject} [animate=true]
|
|
3646
|
+
* Whether and how to animate.
|
|
3047
3647
|
*/
|
|
3048
3648
|
setSize: function (width, height, animate) {
|
|
3049
3649
|
var renderer = this,
|
|
@@ -3074,15 +3674,16 @@ extend(SVGRenderer.prototype, /** @lends Highcharts.SVGRenderer.prototype */ {
|
|
|
3074
3674
|
/**
|
|
3075
3675
|
* Create and return an svg group element. Child
|
|
3076
3676
|
* {@link Highcharts.SVGElement} objects are added to the group by using the
|
|
3077
|
-
* group as the first parameter
|
|
3078
|
-
* in {@link Highcharts.SVGElement#add|add()}.
|
|
3677
|
+
* group as the first parameter in {@link Highcharts.SVGElement#add|add()}.
|
|
3079
3678
|
*
|
|
3080
|
-
* @
|
|
3081
|
-
* `highcharts-{name}`. This can be used for styling and scripting.
|
|
3082
|
-
* @returns {SVGElement} The generated wrapper element.
|
|
3679
|
+
* @function Highcharts.SVGRenderer#g
|
|
3083
3680
|
*
|
|
3084
|
-
* @
|
|
3085
|
-
*
|
|
3681
|
+
* @param {string} [name]
|
|
3682
|
+
* The group will be given a class name of `highcharts-{name}`. This
|
|
3683
|
+
* can be used for styling and scripting.
|
|
3684
|
+
*
|
|
3685
|
+
* @return {Highcharts.SVGElement}
|
|
3686
|
+
* The generated wrapper element.
|
|
3086
3687
|
*/
|
|
3087
3688
|
g: function (name) {
|
|
3088
3689
|
var elem = this.createElement('g');
|
|
@@ -3091,20 +3692,35 @@ extend(SVGRenderer.prototype, /** @lends Highcharts.SVGRenderer.prototype */ {
|
|
|
3091
3692
|
|
|
3092
3693
|
/**
|
|
3093
3694
|
* Display an image.
|
|
3094
|
-
* @param {string} src The image source.
|
|
3095
|
-
* @param {number} [x] The X position.
|
|
3096
|
-
* @param {number} [y] The Y position.
|
|
3097
|
-
* @param {number} [width] The image width. If omitted, it defaults to the
|
|
3098
|
-
* image file width.
|
|
3099
|
-
* @param {number} [height] The image height. If omitted it defaults to the
|
|
3100
|
-
* image file height.
|
|
3101
|
-
* @param {function} [onload] Event handler for image load.
|
|
3102
|
-
* @returns {SVGElement} The generated wrapper element.
|
|
3103
3695
|
*
|
|
3104
3696
|
* @sample highcharts/members/renderer-image-on-chart/
|
|
3105
3697
|
* Add an image in a chart
|
|
3106
3698
|
* @sample highcharts/members/renderer-image/
|
|
3107
3699
|
* Add an image independent of a chart
|
|
3700
|
+
*
|
|
3701
|
+
* @function Highcharts.SVGRenderer#image
|
|
3702
|
+
*
|
|
3703
|
+
* @param {string} src
|
|
3704
|
+
* The image source.
|
|
3705
|
+
*
|
|
3706
|
+
* @param {number} [x]
|
|
3707
|
+
* The X position.
|
|
3708
|
+
*
|
|
3709
|
+
* @param {number} [y]
|
|
3710
|
+
* The Y position.
|
|
3711
|
+
*
|
|
3712
|
+
* @param {number} [width]
|
|
3713
|
+
* The image width. If omitted, it defaults to the image file width.
|
|
3714
|
+
*
|
|
3715
|
+
* @param {number} [height]
|
|
3716
|
+
* The image height. If omitted it defaults to the image file
|
|
3717
|
+
* height.
|
|
3718
|
+
*
|
|
3719
|
+
* @param {Function} [onload]
|
|
3720
|
+
* Event handler for image load.
|
|
3721
|
+
*
|
|
3722
|
+
* @return {Highcharts.SVGElement}
|
|
3723
|
+
* The generated wrapper element.
|
|
3108
3724
|
*/
|
|
3109
3725
|
image: function (src, x, y, width, height, onload) {
|
|
3110
3726
|
var attribs = {
|
|
@@ -3170,23 +3786,27 @@ extend(SVGRenderer.prototype, /** @lends Highcharts.SVGRenderer.prototype */ {
|
|
|
3170
3786
|
* It is used in Highcharts for point makers, which cake a `symbol` option,
|
|
3171
3787
|
* and label and button backgrounds like in the tooltip and stock flags.
|
|
3172
3788
|
*
|
|
3173
|
-
* @
|
|
3174
|
-
*
|
|
3175
|
-
* @param {
|
|
3176
|
-
*
|
|
3177
|
-
*
|
|
3178
|
-
* @param {
|
|
3179
|
-
*
|
|
3180
|
-
*
|
|
3181
|
-
*
|
|
3182
|
-
*
|
|
3183
|
-
*
|
|
3184
|
-
* @param {number}
|
|
3185
|
-
*
|
|
3186
|
-
*
|
|
3187
|
-
* @param {number}
|
|
3188
|
-
*
|
|
3189
|
-
*
|
|
3789
|
+
* @function Highcharts.SVGRenderer#symbol
|
|
3790
|
+
*
|
|
3791
|
+
* @param {symbol} symbol
|
|
3792
|
+
* The symbol name.
|
|
3793
|
+
*
|
|
3794
|
+
* @param {number} x
|
|
3795
|
+
* The X coordinate for the top left position.
|
|
3796
|
+
*
|
|
3797
|
+
* @param {number} y
|
|
3798
|
+
* The Y coordinate for the top left position.
|
|
3799
|
+
*
|
|
3800
|
+
* @param {number} width
|
|
3801
|
+
* The pixel width.
|
|
3802
|
+
*
|
|
3803
|
+
* @param {number} height
|
|
3804
|
+
* The pixel height.
|
|
3805
|
+
*
|
|
3806
|
+
* @param {Highcharts.SymbolOptionsObject} [options]
|
|
3807
|
+
* Additional options, depending on the actual symbol drawn.
|
|
3808
|
+
*
|
|
3809
|
+
* @return {Highcharts.SVGElement}
|
|
3190
3810
|
*/
|
|
3191
3811
|
symbol: function (symbol, x, y, width, height, options) {
|
|
3192
3812
|
|
|
@@ -3351,16 +3971,11 @@ extend(SVGRenderer.prototype, /** @lends Highcharts.SVGRenderer.prototype */ {
|
|
|
3351
3971
|
return obj;
|
|
3352
3972
|
},
|
|
3353
3973
|
|
|
3354
|
-
/**
|
|
3355
|
-
* @typedef {string} Symbol
|
|
3356
|
-
*
|
|
3357
|
-
* Can be one of `arc`, `callout`, `circle`, `diamond`, `square`,
|
|
3358
|
-
* `triangle`, `triangle-down`. Symbols are used internally for point
|
|
3359
|
-
* markers, button and label borders and backgrounds, or custom shapes.
|
|
3360
|
-
* Extendable by adding to {@link SVGRenderer#symbols}.
|
|
3361
|
-
*/
|
|
3362
3974
|
/**
|
|
3363
3975
|
* An extendable collection of functions for defining symbol paths.
|
|
3976
|
+
*
|
|
3977
|
+
* @name Highcharts.SVGRenderer#symbols
|
|
3978
|
+
* @type {Highcharts.SymbolDictionary}
|
|
3364
3979
|
*/
|
|
3365
3980
|
symbols: {
|
|
3366
3981
|
'circle': function (x, y, w, h) {
|
|
@@ -3467,7 +4082,7 @@ extend(SVGRenderer.prototype, /** @lends Highcharts.SVGRenderer.prototype */ {
|
|
|
3467
4082
|
* Callout shape used for default tooltips, also used for rounded
|
|
3468
4083
|
* rectangles in VML
|
|
3469
4084
|
*/
|
|
3470
|
-
callout: function (x, y, w, h, options) {
|
|
4085
|
+
'callout': function (x, y, w, h, options) {
|
|
3471
4086
|
var arrowLength = 6,
|
|
3472
4087
|
halfDistance = 6,
|
|
3473
4088
|
r = Math.min((options && options.r) || 0, w, h),
|
|
@@ -3570,10 +4185,9 @@ extend(SVGRenderer.prototype, /** @lends Highcharts.SVGRenderer.prototype */ {
|
|
|
3570
4185
|
},
|
|
3571
4186
|
|
|
3572
4187
|
/**
|
|
3573
|
-
*
|
|
3574
|
-
* to
|
|
3575
|
-
*
|
|
3576
|
-
* SVGElement#clip} function.
|
|
4188
|
+
* Define a clipping rectangle. The clipping rectangle is later applied
|
|
4189
|
+
* to {@link SVGElement} objects through the {@link SVGElement#clip}
|
|
4190
|
+
* function.
|
|
3577
4191
|
*
|
|
3578
4192
|
* @example
|
|
3579
4193
|
* var circle = renderer.circle(100, 100, 100)
|
|
@@ -3583,27 +4197,21 @@ extend(SVGRenderer.prototype, /** @lends Highcharts.SVGRenderer.prototype */ {
|
|
|
3583
4197
|
*
|
|
3584
4198
|
* // Leave only the lower right quarter visible
|
|
3585
4199
|
* circle.clip(clipRect);
|
|
3586
|
-
*/
|
|
3587
|
-
/**
|
|
3588
|
-
* Define a clipping rectangle. The clipping rectangle is later applied
|
|
3589
|
-
* to {@link SVGElement} objects through the {@link SVGElement#clip}
|
|
3590
|
-
* function.
|
|
3591
4200
|
*
|
|
3592
|
-
* @
|
|
4201
|
+
* @function Highcharts.SVGRenderer#clipRect
|
|
4202
|
+
*
|
|
4203
|
+
* @param {string} id
|
|
4204
|
+
*
|
|
3593
4205
|
* @param {number} x
|
|
4206
|
+
*
|
|
3594
4207
|
* @param {number} y
|
|
4208
|
+
*
|
|
3595
4209
|
* @param {number} width
|
|
3596
|
-
* @param {number} height
|
|
3597
|
-
* @returns {ClipRect} A clipping rectangle.
|
|
3598
4210
|
*
|
|
3599
|
-
* @
|
|
3600
|
-
* var circle = renderer.circle(100, 100, 100)
|
|
3601
|
-
* .attr({ fill: 'red' })
|
|
3602
|
-
* .add();
|
|
3603
|
-
* var clipRect = renderer.clipRect(100, 100, 100, 100);
|
|
4211
|
+
* @param {number} height
|
|
3604
4212
|
*
|
|
3605
|
-
*
|
|
3606
|
-
*
|
|
4213
|
+
* @return {Highcharts.ClipRectElement}
|
|
4214
|
+
* A clipping rectangle.
|
|
3607
4215
|
*/
|
|
3608
4216
|
clipRect: function (x, y, width, height) {
|
|
3609
4217
|
var wrapper,
|
|
@@ -3630,16 +4238,6 @@ extend(SVGRenderer.prototype, /** @lends Highcharts.SVGRenderer.prototype */ {
|
|
|
3630
4238
|
* and some basic text styling of these. For more advanced features like
|
|
3631
4239
|
* border and background, use {@link Highcharts.SVGRenderer#label} instead.
|
|
3632
4240
|
* To update the text after render, run `text.attr({ text: 'New text' })`.
|
|
3633
|
-
* @param {String} str
|
|
3634
|
-
* The text of (subset) HTML to draw.
|
|
3635
|
-
* @param {number} x
|
|
3636
|
-
* The x position of the text's lower left corner.
|
|
3637
|
-
* @param {number} y
|
|
3638
|
-
* The y position of the text's lower left corner.
|
|
3639
|
-
* @param {Boolean} [useHTML=false]
|
|
3640
|
-
* Use HTML to render the text.
|
|
3641
|
-
*
|
|
3642
|
-
* @return {SVGElement} The text object.
|
|
3643
4241
|
*
|
|
3644
4242
|
* @sample highcharts/members/renderer-text-on-chart/
|
|
3645
4243
|
* Annotate the chart freely
|
|
@@ -3647,6 +4245,23 @@ extend(SVGRenderer.prototype, /** @lends Highcharts.SVGRenderer.prototype */ {
|
|
|
3647
4245
|
* Annotate with a border and in response to the data
|
|
3648
4246
|
* @sample highcharts/members/renderer-text/
|
|
3649
4247
|
* Formatted text
|
|
4248
|
+
*
|
|
4249
|
+
* @function Highcharts.SVGRenderer#text
|
|
4250
|
+
*
|
|
4251
|
+
* @param {string} str
|
|
4252
|
+
* The text of (subset) HTML to draw.
|
|
4253
|
+
*
|
|
4254
|
+
* @param {number} x
|
|
4255
|
+
* The x position of the text's lower left corner.
|
|
4256
|
+
*
|
|
4257
|
+
* @param {number} y
|
|
4258
|
+
* The y position of the text's lower left corner.
|
|
4259
|
+
*
|
|
4260
|
+
* @param {boolean} [useHTML=false]
|
|
4261
|
+
* Use HTML to render the text.
|
|
4262
|
+
*
|
|
4263
|
+
* @return {Highcharts.SVGElement}
|
|
4264
|
+
* The text object.
|
|
3650
4265
|
*/
|
|
3651
4266
|
text: function (str, x, y, useHTML) {
|
|
3652
4267
|
|
|
@@ -3663,7 +4278,7 @@ extend(SVGRenderer.prototype, /** @lends Highcharts.SVGRenderer.prototype */ {
|
|
|
3663
4278
|
if (y) {
|
|
3664
4279
|
attribs.y = Math.round(y);
|
|
3665
4280
|
}
|
|
3666
|
-
if (str
|
|
4281
|
+
if (defined(str)) {
|
|
3667
4282
|
attribs.text = str;
|
|
3668
4283
|
}
|
|
3669
4284
|
|
|
@@ -3695,12 +4310,17 @@ extend(SVGRenderer.prototype, /** @lends Highcharts.SVGRenderer.prototype */ {
|
|
|
3695
4310
|
* Utility to return the baseline offset and total line height from the font
|
|
3696
4311
|
* size.
|
|
3697
4312
|
*
|
|
3698
|
-
* @
|
|
3699
|
-
*
|
|
3700
|
-
* @param {
|
|
3701
|
-
*
|
|
3702
|
-
*
|
|
3703
|
-
*
|
|
4313
|
+
* @function Highcharts.SVGRenderer#fontMetrics
|
|
4314
|
+
*
|
|
4315
|
+
* @param {string} [fontSize]
|
|
4316
|
+
* The current font size to inspect. If not given, the font size
|
|
4317
|
+
* will be found from the DOM element.
|
|
4318
|
+
*
|
|
4319
|
+
* @param {Highcharts.SVGElement|Highcharts.SVGDOMElement} [elem]
|
|
4320
|
+
* The element to inspect for a current font size.
|
|
4321
|
+
*
|
|
4322
|
+
* @return {Highcharts.FontMetricsObject}
|
|
4323
|
+
* The font metrics.
|
|
3704
4324
|
*/
|
|
3705
4325
|
fontMetrics: function (fontSize, elem) {
|
|
3706
4326
|
var lineHeight,
|
|
@@ -3728,7 +4348,7 @@ extend(SVGRenderer.prototype, /** @lends Highcharts.SVGRenderer.prototype */ {
|
|
|
3728
4348
|
|
|
3729
4349
|
// Empirical values found by comparing font size and bounding box
|
|
3730
4350
|
// height. Applies to the default font family.
|
|
3731
|
-
//
|
|
4351
|
+
// https://jsfiddle.net/highcharts/7xvn7/
|
|
3732
4352
|
lineHeight = fontSize < 24 ? fontSize + 3 : Math.round(fontSize * 1.2);
|
|
3733
4353
|
baseline = Math.round(lineHeight * 0.8);
|
|
3734
4354
|
|
|
@@ -3743,6 +4363,13 @@ extend(SVGRenderer.prototype, /** @lends Highcharts.SVGRenderer.prototype */ {
|
|
|
3743
4363
|
* Correct X and Y positioning of a label for rotation (#1764).
|
|
3744
4364
|
*
|
|
3745
4365
|
* @private
|
|
4366
|
+
* @function Highcharts.SVGRenderer#rotCorr
|
|
4367
|
+
*
|
|
4368
|
+
* @param {number} baseline
|
|
4369
|
+
*
|
|
4370
|
+
* @param {number} rotation
|
|
4371
|
+
*
|
|
4372
|
+
* @param {boolean} alterY
|
|
3746
4373
|
*/
|
|
3747
4374
|
rotCorr: function (baseline, rotation, alterY) {
|
|
3748
4375
|
var y = baseline;
|
|
@@ -3763,35 +4390,52 @@ extend(SVGRenderer.prototype, /** @lends Highcharts.SVGRenderer.prototype */ {
|
|
|
3763
4390
|
* using the {@link Highcharts.SVGElement#attr|attr} method. To update the
|
|
3764
4391
|
* text after render, run `label.attr({ text: 'New text' })`.
|
|
3765
4392
|
*
|
|
3766
|
-
* @param {string} str
|
|
3767
|
-
* The initial text string or (subset) HTML to render.
|
|
3768
|
-
* @param {number} x
|
|
3769
|
-
* The x position of the label's left side.
|
|
3770
|
-
* @param {number} y
|
|
3771
|
-
* The y position of the label's top side or baseline, depending on
|
|
3772
|
-
* the `baseline` parameter.
|
|
3773
|
-
* @param {String} shape
|
|
3774
|
-
* The shape of the label's border/background, if any. Defaults to
|
|
3775
|
-
* `rect`. Other possible values are `callout` or other shapes
|
|
3776
|
-
* defined in {@link Highcharts.SVGRenderer#symbols}.
|
|
3777
|
-
* @param {number} anchorX
|
|
3778
|
-
* In case the `shape` has a pointer, like a flag, this is the
|
|
3779
|
-
* coordinates it should be pinned to.
|
|
3780
|
-
* @param {number} anchorY
|
|
3781
|
-
* In case the `shape` has a pointer, like a flag, this is the
|
|
3782
|
-
* coordinates it should be pinned to.
|
|
3783
|
-
* @param {Boolean} baseline
|
|
3784
|
-
* Whether to position the label relative to the text baseline,
|
|
3785
|
-
* like {@link Highcharts.SVGRenderer#text|renderer.text}, or to the
|
|
3786
|
-
* upper border of the rectangle.
|
|
3787
|
-
* @param {String} className
|
|
3788
|
-
* Class name for the group.
|
|
3789
|
-
*
|
|
3790
|
-
* @return {SVGElement}
|
|
3791
|
-
* The generated label.
|
|
3792
|
-
*
|
|
3793
4393
|
* @sample highcharts/members/renderer-label-on-chart/
|
|
3794
4394
|
* A label on the chart
|
|
4395
|
+
*
|
|
4396
|
+
* @function Highcharts.SVGRenderer#label
|
|
4397
|
+
*
|
|
4398
|
+
* @param {string} str
|
|
4399
|
+
* The initial text string or (subset) HTML to render.
|
|
4400
|
+
*
|
|
4401
|
+
* @param {number} x
|
|
4402
|
+
* The x position of the label's left side.
|
|
4403
|
+
*
|
|
4404
|
+
* @param {number} y
|
|
4405
|
+
* The y position of the label's top side or baseline, depending on
|
|
4406
|
+
* the `baseline` parameter.
|
|
4407
|
+
*
|
|
4408
|
+
* @param {string} [shape='rect']
|
|
4409
|
+
* The shape of the label's border/background, if any. Defaults to
|
|
4410
|
+
* `rect`. Other possible values are `callout` or other shapes
|
|
4411
|
+
* defined in {@link Highcharts.SVGRenderer#symbols}.
|
|
4412
|
+
*
|
|
4413
|
+
* @param {string} [shape='rect']
|
|
4414
|
+
* The shape of the label's border/background, if any. Defaults to
|
|
4415
|
+
* `rect`. Other possible values are `callout` or other shapes
|
|
4416
|
+
* defined in {@link Highcharts.SVGRenderer#symbols}.
|
|
4417
|
+
*
|
|
4418
|
+
* @param {number} [anchorX]
|
|
4419
|
+
* In case the `shape` has a pointer, like a flag, this is the
|
|
4420
|
+
* coordinates it should be pinned to.
|
|
4421
|
+
*
|
|
4422
|
+
* @param {number} [anchorY]
|
|
4423
|
+
* In case the `shape` has a pointer, like a flag, this is the
|
|
4424
|
+
* coordinates it should be pinned to.
|
|
4425
|
+
*
|
|
4426
|
+
* @param {boolean} [useHTML=false]
|
|
4427
|
+
* Wether to use HTML to render the label.
|
|
4428
|
+
*
|
|
4429
|
+
* @param {boolean} [baseline=false]
|
|
4430
|
+
* Whether to position the label relative to the text baseline,
|
|
4431
|
+
* like {@link Highcharts.SVGRenderer#text|renderer.text}, or to the
|
|
4432
|
+
* upper border of the rectangle.
|
|
4433
|
+
*
|
|
4434
|
+
* @param {string} [className]
|
|
4435
|
+
* Class name for the group.
|
|
4436
|
+
*
|
|
4437
|
+
* @return {Highcharts.SVGElement}
|
|
4438
|
+
* The generated label.
|
|
3795
4439
|
*/
|
|
3796
4440
|
label: function (
|
|
3797
4441
|
str,
|
|
@@ -3843,7 +4487,7 @@ extend(SVGRenderer.prototype, /** @lends Highcharts.SVGRenderer.prototype */ {
|
|
|
3843
4487
|
|
|
3844
4488
|
|
|
3845
4489
|
|
|
3846
|
-
|
|
4490
|
+
/*
|
|
3847
4491
|
* This function runs after the label is added to the DOM (when the
|
|
3848
4492
|
* bounding box is available), and after the text of the label is
|
|
3849
4493
|
* updated to detect the new bounding box and reflect it in the border
|
|
@@ -3901,9 +4545,9 @@ extend(SVGRenderer.prototype, /** @lends Highcharts.SVGRenderer.prototype */ {
|
|
|
3901
4545
|
}
|
|
3902
4546
|
};
|
|
3903
4547
|
|
|
3904
|
-
|
|
4548
|
+
/*
|
|
3905
4549
|
* This function runs after setting text or padding, but only if padding
|
|
3906
|
-
* is changed
|
|
4550
|
+
* is changed.
|
|
3907
4551
|
*/
|
|
3908
4552
|
updateTextPadding = function () {
|
|
3909
4553
|
var textX = paddingLeft + padding,
|
|
@@ -3941,10 +4585,8 @@ extend(SVGRenderer.prototype, /** @lends Highcharts.SVGRenderer.prototype */ {
|
|
|
3941
4585
|
text.y = textY;
|
|
3942
4586
|
};
|
|
3943
4587
|
|
|
3944
|
-
|
|
4588
|
+
/*
|
|
3945
4589
|
* Set a box attribute, or defer it if the box is not yet created
|
|
3946
|
-
* @param {Object} key
|
|
3947
|
-
* @param {Object} value
|
|
3948
4590
|
*/
|
|
3949
4591
|
boxAttr = function (key, value) {
|
|
3950
4592
|
if (box) {
|
|
@@ -3954,7 +4596,7 @@ extend(SVGRenderer.prototype, /** @lends Highcharts.SVGRenderer.prototype */ {
|
|
|
3954
4596
|
}
|
|
3955
4597
|
};
|
|
3956
4598
|
|
|
3957
|
-
|
|
4599
|
+
/*
|
|
3958
4600
|
* After the text element is added, get the desired size of the border
|
|
3959
4601
|
* box and add it before the text in the DOM.
|
|
3960
4602
|
*/
|
|
@@ -4076,10 +4718,9 @@ extend(SVGRenderer.prototype, /** @lends Highcharts.SVGRenderer.prototype */ {
|
|
|
4076
4718
|
// Redirect certain methods to either the box or the text
|
|
4077
4719
|
var baseCss = wrapper.css;
|
|
4078
4720
|
return extend(wrapper, {
|
|
4079
|
-
|
|
4721
|
+
/*
|
|
4080
4722
|
* Pick up some properties and apply them to the text instead of the
|
|
4081
4723
|
* wrapper.
|
|
4082
|
-
* @ignore
|
|
4083
4724
|
*/
|
|
4084
4725
|
css: function (styles) {
|
|
4085
4726
|
if (styles) {
|
|
@@ -4101,9 +4742,8 @@ extend(SVGRenderer.prototype, /** @lends Highcharts.SVGRenderer.prototype */ {
|
|
|
4101
4742
|
}
|
|
4102
4743
|
return baseCss.call(wrapper, styles);
|
|
4103
4744
|
},
|
|
4104
|
-
|
|
4745
|
+
/*
|
|
4105
4746
|
* Return the bounding box of the box, not the group.
|
|
4106
|
-
* @ignore
|
|
4107
4747
|
*/
|
|
4108
4748
|
getBBox: function () {
|
|
4109
4749
|
return {
|
|
@@ -4114,9 +4754,8 @@ extend(SVGRenderer.prototype, /** @lends Highcharts.SVGRenderer.prototype */ {
|
|
|
4114
4754
|
};
|
|
4115
4755
|
},
|
|
4116
4756
|
|
|
4117
|
-
|
|
4757
|
+
/*
|
|
4118
4758
|
* Apply the shadow to the box.
|
|
4119
|
-
* @ignore
|
|
4120
4759
|
*/
|
|
4121
4760
|
shadow: function (b) {
|
|
4122
4761
|
if (b) {
|
|
@@ -4128,9 +4767,8 @@ extend(SVGRenderer.prototype, /** @lends Highcharts.SVGRenderer.prototype */ {
|
|
|
4128
4767
|
return wrapper;
|
|
4129
4768
|
},
|
|
4130
4769
|
|
|
4131
|
-
|
|
4770
|
+
/*
|
|
4132
4771
|
* Destroy and release memory.
|
|
4133
|
-
* @ignore
|
|
4134
4772
|
*/
|
|
4135
4773
|
destroy: function () {
|
|
4136
4774
|
|