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
|
-
* The SVGRenderer instance to initialize to.
|
|
95
|
-
* @param {String} nodeName
|
|
96
|
-
* The SVG node name.
|
|
340
|
+
* @function Highcharts.SVGElement#init
|
|
97
341
|
*
|
|
342
|
+
* @param {Highcharts.SVGRenderer} renderer
|
|
343
|
+
* The SVGRenderer instance to initialize to.
|
|
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,
|
|
@@ -571,6 +788,7 @@ extend(SVGElement.prototype, /** @lends Highcharts.SVGElement.prototype */ {
|
|
|
571
788
|
* scale are merged in one "transform" attribute in the SVG node.
|
|
572
789
|
*
|
|
573
790
|
* @private
|
|
791
|
+
* @function Highcharts.SVGElement#afterSetters
|
|
574
792
|
*/
|
|
575
793
|
afterSetters: function () {
|
|
576
794
|
// Update transform. Do this outside the loop to prevent redundant
|
|
@@ -586,11 +804,17 @@ extend(SVGElement.prototype, /** @lends Highcharts.SVGElement.prototype */ {
|
|
|
586
804
|
/**
|
|
587
805
|
* Add a class name to an element.
|
|
588
806
|
*
|
|
589
|
-
* @
|
|
590
|
-
*
|
|
591
|
-
*
|
|
592
|
-
*
|
|
593
|
-
*
|
|
807
|
+
* @function Highcharts.SVGElement#addClass
|
|
808
|
+
*
|
|
809
|
+
* @param {string} className
|
|
810
|
+
* The new class name to add.
|
|
811
|
+
*
|
|
812
|
+
* @param {boolean} [replace=false]
|
|
813
|
+
* When true, the existing class name(s) will be overwritten with
|
|
814
|
+
* the new one. When false, the new one is added.
|
|
815
|
+
*
|
|
816
|
+
* @return {Highcharts.SVGElement}
|
|
817
|
+
* Return the SVG element for chainability.
|
|
594
818
|
*/
|
|
595
819
|
addClass: function (className, replace) {
|
|
596
820
|
var currentClassName = this.attr('class') || '';
|
|
@@ -608,9 +832,13 @@ extend(SVGElement.prototype, /** @lends Highcharts.SVGElement.prototype */ {
|
|
|
608
832
|
|
|
609
833
|
/**
|
|
610
834
|
* Check if an element has the given class name.
|
|
611
|
-
*
|
|
612
|
-
*
|
|
613
|
-
*
|
|
835
|
+
*
|
|
836
|
+
* @function Highcharts.SVGElement#hasClass
|
|
837
|
+
*
|
|
838
|
+
* @param {string} className
|
|
839
|
+
* The class name to check for.
|
|
840
|
+
*
|
|
841
|
+
* @return {boolean}
|
|
614
842
|
* Whether the class name is found.
|
|
615
843
|
*/
|
|
616
844
|
hasClass: function (className) {
|
|
@@ -622,8 +850,13 @@ extend(SVGElement.prototype, /** @lends Highcharts.SVGElement.prototype */ {
|
|
|
622
850
|
|
|
623
851
|
/**
|
|
624
852
|
* Remove a class name from the element.
|
|
625
|
-
*
|
|
626
|
-
* @
|
|
853
|
+
*
|
|
854
|
+
* @function Highcharts.SVGElement#removeClass
|
|
855
|
+
*
|
|
856
|
+
* @param {string|RegExp} className
|
|
857
|
+
* The class name to remove.
|
|
858
|
+
*
|
|
859
|
+
* @return {Highcharts.SVGElement} Returns the SVG element for chainability.
|
|
627
860
|
*/
|
|
628
861
|
removeClass: function (className) {
|
|
629
862
|
return this.attr(
|
|
@@ -636,8 +869,12 @@ extend(SVGElement.prototype, /** @lends Highcharts.SVGElement.prototype */ {
|
|
|
636
869
|
* If one of the symbol size affecting parameters are changed,
|
|
637
870
|
* check all the others only once for each call to an element's
|
|
638
871
|
* .attr() method
|
|
639
|
-
*
|
|
872
|
+
*
|
|
640
873
|
* @private
|
|
874
|
+
* @function Highcharts.SVGElement#symbolAttr
|
|
875
|
+
*
|
|
876
|
+
* @param {Highcharts.Dictionary<number|string>} hash
|
|
877
|
+
* The attributes to set.
|
|
641
878
|
*/
|
|
642
879
|
symbolAttr: function (hash) {
|
|
643
880
|
var wrapper = this;
|
|
@@ -671,9 +908,13 @@ extend(SVGElement.prototype, /** @lends Highcharts.SVGElement.prototype */ {
|
|
|
671
908
|
/**
|
|
672
909
|
* Apply a clipping rectangle to this element.
|
|
673
910
|
*
|
|
674
|
-
* @
|
|
675
|
-
*
|
|
676
|
-
* @
|
|
911
|
+
* @function Highcharts.SVGElement#clip
|
|
912
|
+
*
|
|
913
|
+
* @param {Highcharts.ClipRectElement} [clipRect]
|
|
914
|
+
* The clipping rectangle. If skipped, the current clip is removed.
|
|
915
|
+
*
|
|
916
|
+
* @return {Highcharts.SVGElement}
|
|
917
|
+
* Returns the SVG element to allow chaining.
|
|
677
918
|
*/
|
|
678
919
|
clip: function (clipRect) {
|
|
679
920
|
return this.attr(
|
|
@@ -688,17 +929,17 @@ extend(SVGElement.prototype, /** @lends Highcharts.SVGElement.prototype */ {
|
|
|
688
929
|
* Calculate the coordinates needed for drawing a rectangle crisply and
|
|
689
930
|
* return the calculated attributes.
|
|
690
931
|
*
|
|
691
|
-
* @
|
|
692
|
-
*
|
|
693
|
-
* @param {
|
|
694
|
-
*
|
|
695
|
-
*
|
|
696
|
-
* @param {number} [strokeWidth]
|
|
697
|
-
*
|
|
698
|
-
*
|
|
932
|
+
* @function Highcharts.SVGElement#crisp
|
|
933
|
+
*
|
|
934
|
+
* @param {Highcharts.RectangleObject} rect
|
|
935
|
+
* Rectangle to crisp.
|
|
936
|
+
*
|
|
937
|
+
* @param {number} [strokeWidth]
|
|
938
|
+
* The stroke width to consider when computing crisp positioning. It
|
|
939
|
+
* can also be set directly on the rect parameter.
|
|
699
940
|
*
|
|
700
|
-
* @
|
|
701
|
-
*
|
|
941
|
+
* @return {Highcharts.RectangleObject}
|
|
942
|
+
* The modified rectangle arguments.
|
|
702
943
|
*/
|
|
703
944
|
crisp: function (rect, strokeWidth) {
|
|
704
945
|
|
|
@@ -729,11 +970,17 @@ extend(SVGElement.prototype, /** @lends Highcharts.SVGElement.prototype */ {
|
|
|
729
970
|
* native SVG and HTML elements, there are also some custom made for
|
|
730
971
|
* Highcharts, like `width`, `ellipsis` and `textOverflow` for SVG text
|
|
731
972
|
* elements.
|
|
732
|
-
* @param {CSSObject} styles The new CSS styles.
|
|
733
|
-
* @returns {SVGElement} Return the SVG element for chaining.
|
|
734
973
|
*
|
|
735
974
|
* @sample highcharts/members/renderer-text-on-chart/
|
|
736
975
|
* Styled text
|
|
976
|
+
*
|
|
977
|
+
* @function Highcharts.SVGElement#css
|
|
978
|
+
*
|
|
979
|
+
* @param {Highcharts.CSSObject} styles
|
|
980
|
+
* The new CSS styles.
|
|
981
|
+
*
|
|
982
|
+
* @return {Highcharts.SVGElement}
|
|
983
|
+
* Return the SVG element for chaining.
|
|
737
984
|
*/
|
|
738
985
|
css: function (styles) {
|
|
739
986
|
var oldStyles = this.styles,
|
|
@@ -836,10 +1083,17 @@ extend(SVGElement.prototype, /** @lends Highcharts.SVGElement.prototype */ {
|
|
|
836
1083
|
|
|
837
1084
|
/**
|
|
838
1085
|
* Get the computed style. Only in styled mode.
|
|
839
|
-
*
|
|
840
|
-
* @returns {string} The current computed value.
|
|
1086
|
+
*
|
|
841
1087
|
* @example
|
|
842
1088
|
* chart.series[0].points[0].graphic.getStyle('stroke-width'); // => '1px'
|
|
1089
|
+
*
|
|
1090
|
+
* @function Highcharts.SVGElement#getStyle
|
|
1091
|
+
*
|
|
1092
|
+
* @param {string} prop
|
|
1093
|
+
* The property name to check for.
|
|
1094
|
+
*
|
|
1095
|
+
* @return {string}
|
|
1096
|
+
* The current computed value.
|
|
843
1097
|
*/
|
|
844
1098
|
getStyle: function (prop) {
|
|
845
1099
|
return win.getComputedStyle(this.element || this, '')
|
|
@@ -855,15 +1109,18 @@ extend(SVGElement.prototype, /** @lends Highcharts.SVGElement.prototype */ {
|
|
|
855
1109
|
* things pixel-perfectly within the plot box.
|
|
856
1110
|
*
|
|
857
1111
|
* The common pattern when placing a shape is:
|
|
858
|
-
*
|
|
1112
|
+
* - Create the SVGElement and add it to the DOM. In styled mode, it will
|
|
859
1113
|
* now receive a stroke width from the style sheet. In classic mode we
|
|
860
1114
|
* will add the `stroke-width` attribute.
|
|
861
|
-
*
|
|
862
|
-
*
|
|
1115
|
+
* - Read the computed `elem.strokeWidth()`.
|
|
1116
|
+
* - Place it based on the stroke width.
|
|
863
1117
|
*
|
|
864
|
-
* @
|
|
865
|
-
*
|
|
866
|
-
*
|
|
1118
|
+
* @function Highcharts.SVGElement#strokeWidth
|
|
1119
|
+
*
|
|
1120
|
+
* @return {number}
|
|
1121
|
+
* The stroke width in pixels. Even if the given stroke widtch (in
|
|
1122
|
+
* CSS or by attributes) is based on `em` or other units, the pixel
|
|
1123
|
+
* size is returned.
|
|
867
1124
|
*/
|
|
868
1125
|
strokeWidth: function () {
|
|
869
1126
|
var val = this.getStyle('stroke-width'),
|
|
@@ -892,15 +1149,22 @@ extend(SVGElement.prototype, /** @lends Highcharts.SVGElement.prototype */ {
|
|
|
892
1149
|
* Add an event listener. This is a simple setter that replaces all other
|
|
893
1150
|
* events of the same type, opposed to the {@link Highcharts#addEvent}
|
|
894
1151
|
* function.
|
|
895
|
-
* @param {string} eventType - The event type. If the type is `click`,
|
|
896
|
-
* Highcharts will internally translate it to a `touchstart` event on
|
|
897
|
-
* touch devices, to prevent the browser from waiting for a click event
|
|
898
|
-
* from firing.
|
|
899
|
-
* @param {Function} handler - The handler callback.
|
|
900
|
-
* @returns {SVGElement} The SVGElement for chaining.
|
|
901
1152
|
*
|
|
902
1153
|
* @sample highcharts/members/element-on/
|
|
903
1154
|
* A clickable rectangle
|
|
1155
|
+
*
|
|
1156
|
+
* @function Highcharts.SVGElement#on
|
|
1157
|
+
*
|
|
1158
|
+
* @param {string} eventType
|
|
1159
|
+
* The event type. If the type is `click`, Highcharts will internally
|
|
1160
|
+
* translate it to a `touchstart` event on touch devices, to prevent
|
|
1161
|
+
* the browser from waiting for a click event from firing.
|
|
1162
|
+
*
|
|
1163
|
+
* @param {Function} handler
|
|
1164
|
+
* The handler callback.
|
|
1165
|
+
*
|
|
1166
|
+
* @return {Highcharts.SVGElement}
|
|
1167
|
+
* The SVGElement for chaining.
|
|
904
1168
|
*/
|
|
905
1169
|
on: function (eventType, handler) {
|
|
906
1170
|
var svgElement = this,
|
|
@@ -931,9 +1195,14 @@ extend(SVGElement.prototype, /** @lends Highcharts.SVGElement.prototype */ {
|
|
|
931
1195
|
* a shape regardless of positioning inside the chart. Used on pie slices
|
|
932
1196
|
* to make all the slices have the same radial reference point.
|
|
933
1197
|
*
|
|
934
|
-
* @
|
|
935
|
-
*
|
|
936
|
-
* @
|
|
1198
|
+
* @function Highcharts.SVGElement#setRadialReference
|
|
1199
|
+
*
|
|
1200
|
+
* @param {Array<number>} coordinates
|
|
1201
|
+
* The center reference. The format is `[centerX, centerY, diameter]`
|
|
1202
|
+
* in pixels.
|
|
1203
|
+
*
|
|
1204
|
+
* @return {Highcharts.SVGElement}
|
|
1205
|
+
* Returns the SVGElement for chaining.
|
|
937
1206
|
*/
|
|
938
1207
|
setRadialReference: function (coordinates) {
|
|
939
1208
|
var existingGradient = this.renderer.gradients[this.element.gradient];
|
|
@@ -957,8 +1226,13 @@ extend(SVGElement.prototype, /** @lends Highcharts.SVGElement.prototype */ {
|
|
|
957
1226
|
/**
|
|
958
1227
|
* Move an object and its children by x and y values.
|
|
959
1228
|
*
|
|
960
|
-
* @
|
|
961
|
-
*
|
|
1229
|
+
* @function Highcharts.SVGElement#translate
|
|
1230
|
+
*
|
|
1231
|
+
* @param {number} x
|
|
1232
|
+
* The x value.
|
|
1233
|
+
*
|
|
1234
|
+
* @param {number} y
|
|
1235
|
+
* The y value.
|
|
962
1236
|
*/
|
|
963
1237
|
translate: function (x, y) {
|
|
964
1238
|
return this.attr({
|
|
@@ -972,10 +1246,13 @@ extend(SVGElement.prototype, /** @lends Highcharts.SVGElement.prototype */ {
|
|
|
972
1246
|
* charts, where the points and graphs are drawn as if not inverted, then
|
|
973
1247
|
* the series group elements are inverted.
|
|
974
1248
|
*
|
|
975
|
-
* @
|
|
976
|
-
*
|
|
977
|
-
*
|
|
978
|
-
*
|
|
1249
|
+
* @function Highcharts.SVGElement#invert
|
|
1250
|
+
*
|
|
1251
|
+
* @param {boolean} inverted
|
|
1252
|
+
* Whether to invert or not. An inverted shape can be un-inverted by
|
|
1253
|
+
* setting it to false.
|
|
1254
|
+
*
|
|
1255
|
+
* @return {Highcharts.SVGElement}
|
|
979
1256
|
* Return the SVGElement for chaining.
|
|
980
1257
|
*/
|
|
981
1258
|
invert: function (inverted) {
|
|
@@ -989,8 +1266,9 @@ extend(SVGElement.prototype, /** @lends Highcharts.SVGElement.prototype */ {
|
|
|
989
1266
|
* Update the transform attribute based on internal properties. Deals with
|
|
990
1267
|
* the custom `translateX`, `translateY`, `rotation`, `scaleX` and `scaleY`
|
|
991
1268
|
* attributes and updates the SVG `transform` attribute.
|
|
992
|
-
* @private
|
|
993
1269
|
*
|
|
1270
|
+
* @private
|
|
1271
|
+
* @function Highcharts.SVGElement#updateTransform
|
|
994
1272
|
*/
|
|
995
1273
|
updateTransform: function () {
|
|
996
1274
|
var wrapper = this,
|
|
@@ -1050,10 +1328,13 @@ extend(SVGElement.prototype, /** @lends Highcharts.SVGElement.prototype */ {
|
|
|
1050
1328
|
/**
|
|
1051
1329
|
* Bring the element to the front. Alternatively, a new zIndex can be set.
|
|
1052
1330
|
*
|
|
1053
|
-
* @returns {SVGElement} Returns the SVGElement for chaining.
|
|
1054
|
-
*
|
|
1055
1331
|
* @sample highcharts/members/element-tofront/
|
|
1056
1332
|
* Click an element to bring it to front
|
|
1333
|
+
*
|
|
1334
|
+
* @function Highcharts.SVGElement#toFront
|
|
1335
|
+
*
|
|
1336
|
+
* @return {Highcharts.SVGElement}
|
|
1337
|
+
* Returns the SVGElement for chaining.
|
|
1057
1338
|
*/
|
|
1058
1339
|
toFront: function () {
|
|
1059
1340
|
var element = this.element;
|
|
@@ -1065,24 +1346,23 @@ extend(SVGElement.prototype, /** @lends Highcharts.SVGElement.prototype */ {
|
|
|
1065
1346
|
/**
|
|
1066
1347
|
* Align the element relative to the chart or another box.
|
|
1067
1348
|
*
|
|
1068
|
-
* @
|
|
1069
|
-
*
|
|
1070
|
-
*
|
|
1071
|
-
*
|
|
1072
|
-
*
|
|
1073
|
-
*
|
|
1074
|
-
*
|
|
1075
|
-
* @param {
|
|
1076
|
-
*
|
|
1077
|
-
*
|
|
1078
|
-
* @param {
|
|
1079
|
-
*
|
|
1080
|
-
*
|
|
1081
|
-
*
|
|
1082
|
-
*
|
|
1083
|
-
*
|
|
1084
|
-
*
|
|
1085
|
-
* @returns {SVGElement} Returns the SVGElement for chaining.
|
|
1349
|
+
* @function Highcharts.SVGElement#align
|
|
1350
|
+
*
|
|
1351
|
+
* @param {Highcharts.AlignObject} [alignOptions]
|
|
1352
|
+
* The alignment options. The function can be called without this
|
|
1353
|
+
* parameter in order to re-align an element after the box has been
|
|
1354
|
+
* updated.
|
|
1355
|
+
*
|
|
1356
|
+
* @param {boolean} [alignByTranslate]
|
|
1357
|
+
* Align element by translation.
|
|
1358
|
+
*
|
|
1359
|
+
* @param {string|Highcharts.BBoxObject} [box]
|
|
1360
|
+
* The box to align to, needs a width and height. When the box is a
|
|
1361
|
+
* string, it refers to an object in the Renderer. For example, when
|
|
1362
|
+
* box is `spacingBox`, it refers to `Renderer.spacingBox` which
|
|
1363
|
+
* holds `width`, `height`, `x` and `y` properties.
|
|
1364
|
+
*
|
|
1365
|
+
* @return {Highcharts.SVGElement} Returns the SVGElement for chaining.
|
|
1086
1366
|
*/
|
|
1087
1367
|
align: function (alignOptions, alignByTranslate, box) {
|
|
1088
1368
|
var align,
|
|
@@ -1162,16 +1442,21 @@ extend(SVGElement.prototype, /** @lends Highcharts.SVGElement.prototype */ {
|
|
|
1162
1442
|
* a single text line of rotation 90 will report a greater height, and a
|
|
1163
1443
|
* width corresponding to the line-height.
|
|
1164
1444
|
*
|
|
1165
|
-
* @param {boolean} [reload] Skip the cache and get the updated DOM bouding
|
|
1166
|
-
* box.
|
|
1167
|
-
* @param {number} [rot] Override the element's rotation. This is internally
|
|
1168
|
-
* used on axis labels with a value of 0 to find out what the bounding box
|
|
1169
|
-
* would be have been if it were not rotated.
|
|
1170
|
-
* @returns {Object} The bounding box with `x`, `y`, `width` and `height`
|
|
1171
|
-
* properties.
|
|
1172
|
-
*
|
|
1173
1445
|
* @sample highcharts/members/renderer-on-chart/
|
|
1174
1446
|
* Draw a rectangle based on a text's bounding box
|
|
1447
|
+
*
|
|
1448
|
+
* @function Highcharts.SVGElement#getBBox
|
|
1449
|
+
*
|
|
1450
|
+
* @param {boolean} [reload]
|
|
1451
|
+
* Skip the cache and get the updated DOM bouding box.
|
|
1452
|
+
*
|
|
1453
|
+
* @param {number} [rot]
|
|
1454
|
+
* Override the element's rotation. This is internally used on axis
|
|
1455
|
+
* labels with a value of 0 to find out what the bounding box would
|
|
1456
|
+
* be have been if it were not rotated.
|
|
1457
|
+
*
|
|
1458
|
+
* @return {Highcharts.BBoxObject}
|
|
1459
|
+
* The bounding box with `x`, `y`, `width` and `height` properties.
|
|
1175
1460
|
*/
|
|
1176
1461
|
getBBox: function (reload, rot) {
|
|
1177
1462
|
var wrapper = this,
|
|
@@ -1188,6 +1473,7 @@ extend(SVGElement.prototype, /** @lends Highcharts.SVGElement.prototype */ {
|
|
|
1188
1473
|
toggleTextShadowShim,
|
|
1189
1474
|
cache = renderer.cache,
|
|
1190
1475
|
cacheKeys = renderer.cacheKeys,
|
|
1476
|
+
isSVG = element.namespaceURI === wrapper.SVG_NS,
|
|
1191
1477
|
cacheKey;
|
|
1192
1478
|
|
|
1193
1479
|
rotation = pick(rot, wrapper.rotation);
|
|
@@ -1231,7 +1517,7 @@ extend(SVGElement.prototype, /** @lends Highcharts.SVGElement.prototype */ {
|
|
|
1231
1517
|
if (!bBox) {
|
|
1232
1518
|
|
|
1233
1519
|
// SVG elements
|
|
1234
|
-
if (
|
|
1520
|
+
if (isSVG || renderer.forExport) {
|
|
1235
1521
|
try { // Fails in Firefox if the container has display: none.
|
|
1236
1522
|
|
|
1237
1523
|
// When the text shadow shim is used, we need to hide the
|
|
@@ -1296,14 +1582,18 @@ extend(SVGElement.prototype, /** @lends Highcharts.SVGElement.prototype */ {
|
|
|
1296
1582
|
// stands uncorrected, it results in more padding added below
|
|
1297
1583
|
// the text than above when adding a label border or background.
|
|
1298
1584
|
// Also vertical positioning is affected.
|
|
1299
|
-
//
|
|
1585
|
+
// https://jsfiddle.net/highcharts/em37nvuj/
|
|
1300
1586
|
// (#1101, #1505, #1669, #2568, #6213).
|
|
1301
|
-
if (
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1587
|
+
if (isSVG) {
|
|
1588
|
+
bBox.height = height = (
|
|
1589
|
+
{
|
|
1590
|
+
'11px,17': 14,
|
|
1591
|
+
'13px,20': 16
|
|
1592
|
+
}[
|
|
1593
|
+
styles && styles.fontSize + ',' + Math.round(height)
|
|
1594
|
+
] ||
|
|
1595
|
+
height
|
|
1596
|
+
);
|
|
1307
1597
|
}
|
|
1308
1598
|
|
|
1309
1599
|
// Adjust for rotated text
|
|
@@ -1336,11 +1626,15 @@ extend(SVGElement.prototype, /** @lends Highcharts.SVGElement.prototype */ {
|
|
|
1336
1626
|
/**
|
|
1337
1627
|
* Show the element after it has been hidden.
|
|
1338
1628
|
*
|
|
1339
|
-
* @
|
|
1340
|
-
* `inherit` rather than `visible`. The difference is that an element with
|
|
1341
|
-
* `visibility="visible"` will be visible even if the parent is hidden.
|
|
1629
|
+
* @function Highcharts.SVGElement#show
|
|
1342
1630
|
*
|
|
1343
|
-
* @
|
|
1631
|
+
* @param {boolean} [inherit=false]
|
|
1632
|
+
* Set the visibility attribute to `inherit` rather than `visible`.
|
|
1633
|
+
* The difference is that an element with `visibility="visible"`
|
|
1634
|
+
* will be visible even if the parent is hidden.
|
|
1635
|
+
*
|
|
1636
|
+
* @return {Highcharts.SVGElement}
|
|
1637
|
+
* Returns the SVGElement for chaining.
|
|
1344
1638
|
*/
|
|
1345
1639
|
show: function (inherit) {
|
|
1346
1640
|
return this.attr({ visibility: inherit ? 'inherit' : 'visible' });
|
|
@@ -1350,7 +1644,10 @@ extend(SVGElement.prototype, /** @lends Highcharts.SVGElement.prototype */ {
|
|
|
1350
1644
|
* Hide the element, equivalent to setting the `visibility` attribute to
|
|
1351
1645
|
* `hidden`.
|
|
1352
1646
|
*
|
|
1353
|
-
* @
|
|
1647
|
+
* @function Highcharts.SVGElement#hide
|
|
1648
|
+
*
|
|
1649
|
+
* @return {Highcharts.SVGElement}
|
|
1650
|
+
* Returns the SVGElement for chaining.
|
|
1354
1651
|
*/
|
|
1355
1652
|
hide: function () {
|
|
1356
1653
|
return this.attr({ visibility: 'hidden' });
|
|
@@ -1360,7 +1657,10 @@ extend(SVGElement.prototype, /** @lends Highcharts.SVGElement.prototype */ {
|
|
|
1360
1657
|
* Fade out an element by animating its opacity down to 0, and hide it on
|
|
1361
1658
|
* complete. Used internally for the tooltip.
|
|
1362
1659
|
*
|
|
1363
|
-
* @
|
|
1660
|
+
* @function Highcharts.SVGElement#fadeOut
|
|
1661
|
+
*
|
|
1662
|
+
* @param {number} [duration=150]
|
|
1663
|
+
* The fade duration in milliseconds.
|
|
1364
1664
|
*/
|
|
1365
1665
|
fadeOut: function (duration) {
|
|
1366
1666
|
var elemWrapper = this;
|
|
@@ -1378,13 +1678,17 @@ extend(SVGElement.prototype, /** @lends Highcharts.SVGElement.prototype */ {
|
|
|
1378
1678
|
/**
|
|
1379
1679
|
* Add the element to the DOM. All elements must be added this way.
|
|
1380
1680
|
*
|
|
1381
|
-
* @
|
|
1382
|
-
*
|
|
1383
|
-
*
|
|
1681
|
+
* @sample highcharts/members/renderer-g
|
|
1682
|
+
* Elements added to a group
|
|
1683
|
+
*
|
|
1684
|
+
* @function Highcharts.SVGElement#add
|
|
1384
1685
|
*
|
|
1385
|
-
* @
|
|
1686
|
+
* @param {Highcharts.SVGElement|Highcharts.SVGDOMElement} [parent]
|
|
1687
|
+
* The parent item to add it to. If undefined, the element is added
|
|
1688
|
+
* to the {@link Highcharts.SVGRenderer.box}.
|
|
1386
1689
|
*
|
|
1387
|
-
* @
|
|
1690
|
+
* @return {Highcharts.SVGElement}
|
|
1691
|
+
* Returns the SVGElement for chaining.
|
|
1388
1692
|
*/
|
|
1389
1693
|
add: function (parent) {
|
|
1390
1694
|
|
|
@@ -1430,7 +1734,10 @@ extend(SVGElement.prototype, /** @lends Highcharts.SVGElement.prototype */ {
|
|
|
1430
1734
|
* Removes an element from the DOM.
|
|
1431
1735
|
*
|
|
1432
1736
|
* @private
|
|
1433
|
-
* @
|
|
1737
|
+
* @function Highcharts.SVGElement#safeRemoveChild
|
|
1738
|
+
*
|
|
1739
|
+
* @param {Highcharts.SVGDOMElement|Highcharts.HTMLDOMElement} element
|
|
1740
|
+
* The DOM node to remove.
|
|
1434
1741
|
*/
|
|
1435
1742
|
safeRemoveChild: function (element) {
|
|
1436
1743
|
var parentNode = element.parentNode;
|
|
@@ -1443,7 +1750,7 @@ extend(SVGElement.prototype, /** @lends Highcharts.SVGElement.prototype */ {
|
|
|
1443
1750
|
* Destroy the element and element wrapper and clear up the DOM and event
|
|
1444
1751
|
* hooks.
|
|
1445
1752
|
*
|
|
1446
|
-
*
|
|
1753
|
+
* @function Highcharts.SVGElement#destroy
|
|
1447
1754
|
*/
|
|
1448
1755
|
destroy: function () {
|
|
1449
1756
|
var wrapper = this,
|
|
@@ -1525,6 +1832,14 @@ extend(SVGElement.prototype, /** @lends Highcharts.SVGElement.prototype */ {
|
|
|
1525
1832
|
|
|
1526
1833
|
|
|
1527
1834
|
|
|
1835
|
+
/**
|
|
1836
|
+
* @private
|
|
1837
|
+
* @function Highcharts.SVGElement#xGetter
|
|
1838
|
+
*
|
|
1839
|
+
* @param {string} key
|
|
1840
|
+
*
|
|
1841
|
+
* @return {number|string|null}
|
|
1842
|
+
*/
|
|
1528
1843
|
xGetter: function (key) {
|
|
1529
1844
|
if (this.element.nodeName === 'circle') {
|
|
1530
1845
|
if (key === 'x') {
|
|
@@ -1537,12 +1852,18 @@ extend(SVGElement.prototype, /** @lends Highcharts.SVGElement.prototype */ {
|
|
|
1537
1852
|
},
|
|
1538
1853
|
|
|
1539
1854
|
/**
|
|
1540
|
-
* Get the current value of an attribute or pseudo attribute,
|
|
1541
|
-
* for animation. Called internally from
|
|
1542
|
-
* Highcharts.SVGRenderer#attr}
|
|
1543
|
-
* function.
|
|
1855
|
+
* Get the current value of an attribute or pseudo attribute,
|
|
1856
|
+
* used mainly for animation. Called internally from
|
|
1857
|
+
* the {@link Highcharts.SVGRenderer#attr} function.
|
|
1544
1858
|
*
|
|
1545
1859
|
* @private
|
|
1860
|
+
* @function Highcharts.SVGElement#_defaultGetter
|
|
1861
|
+
*
|
|
1862
|
+
* @param {string} key
|
|
1863
|
+
* Property key.
|
|
1864
|
+
*
|
|
1865
|
+
* @return {number|string|null}
|
|
1866
|
+
* Property value.
|
|
1546
1867
|
*/
|
|
1547
1868
|
_defaultGetter: function (key) {
|
|
1548
1869
|
var ret = pick(
|
|
@@ -1558,7 +1879,16 @@ extend(SVGElement.prototype, /** @lends Highcharts.SVGElement.prototype */ {
|
|
|
1558
1879
|
return ret;
|
|
1559
1880
|
},
|
|
1560
1881
|
|
|
1561
|
-
|
|
1882
|
+
/**
|
|
1883
|
+
* @private
|
|
1884
|
+
* @function Highcharts.SVGElement#dSettter
|
|
1885
|
+
*
|
|
1886
|
+
* @param {number|string|Highcharts.SVGPathArray} value
|
|
1887
|
+
*
|
|
1888
|
+
* @param {string} key
|
|
1889
|
+
*
|
|
1890
|
+
* @param {Highcharts.SVGDOMElement} element
|
|
1891
|
+
*/
|
|
1562
1892
|
dSetter: function (value, key, element) {
|
|
1563
1893
|
if (value && value.join) { // join path
|
|
1564
1894
|
value = value.join(' ');
|
|
@@ -1576,16 +1906,40 @@ extend(SVGElement.prototype, /** @lends Highcharts.SVGElement.prototype */ {
|
|
|
1576
1906
|
}
|
|
1577
1907
|
|
|
1578
1908
|
},
|
|
1909
|
+
|
|
1579
1910
|
|
|
1911
|
+
|
|
1912
|
+
/**
|
|
1913
|
+
* @private
|
|
1914
|
+
* @function Highcharts.SVGElement#alignSetter
|
|
1915
|
+
*
|
|
1916
|
+
* @param {"start"|"middle"|"end"} value
|
|
1917
|
+
*/
|
|
1580
1918
|
alignSetter: function (value) {
|
|
1581
1919
|
var convert = { left: 'start', center: 'middle', right: 'end' };
|
|
1582
1920
|
this.alignValue = value;
|
|
1583
1921
|
this.element.setAttribute('text-anchor', convert[value]);
|
|
1584
1922
|
},
|
|
1923
|
+
/**
|
|
1924
|
+
* @private
|
|
1925
|
+
* @function Highcharts.SVGElement#opacitySetter
|
|
1926
|
+
*
|
|
1927
|
+
* @param {string} value
|
|
1928
|
+
*
|
|
1929
|
+
* @param {string} key
|
|
1930
|
+
*
|
|
1931
|
+
* @param {Highcharts.SVGDOMElement} element
|
|
1932
|
+
*/
|
|
1585
1933
|
opacitySetter: function (value, key, element) {
|
|
1586
1934
|
this[key] = value;
|
|
1587
1935
|
element.setAttribute(key, value);
|
|
1588
1936
|
},
|
|
1937
|
+
/**
|
|
1938
|
+
* @private
|
|
1939
|
+
* @function Highcharts.SVGElement#titleSetter
|
|
1940
|
+
*
|
|
1941
|
+
* @param {string} value
|
|
1942
|
+
*/
|
|
1589
1943
|
titleSetter: function (value) {
|
|
1590
1944
|
var titleNode = this.element.getElementsByTagName('title')[0];
|
|
1591
1945
|
if (!titleNode) {
|
|
@@ -1608,6 +1962,12 @@ extend(SVGElement.prototype, /** @lends Highcharts.SVGElement.prototype */ {
|
|
|
1608
1962
|
)
|
|
1609
1963
|
);
|
|
1610
1964
|
},
|
|
1965
|
+
/**
|
|
1966
|
+
* @private
|
|
1967
|
+
* @function Highcharts.SVGElement#textSetter
|
|
1968
|
+
*
|
|
1969
|
+
* @param {string} value
|
|
1970
|
+
*/
|
|
1611
1971
|
textSetter: function (value) {
|
|
1612
1972
|
if (value !== this.textStr) {
|
|
1613
1973
|
// Delete bBox memo when the text changes
|
|
@@ -1619,6 +1979,16 @@ extend(SVGElement.prototype, /** @lends Highcharts.SVGElement.prototype */ {
|
|
|
1619
1979
|
}
|
|
1620
1980
|
}
|
|
1621
1981
|
},
|
|
1982
|
+
/**
|
|
1983
|
+
* @private
|
|
1984
|
+
* @function Highcharts.SVGElement#fillSetter
|
|
1985
|
+
*
|
|
1986
|
+
* @param {Highcharts.Color|Highcharts.ColorString} value
|
|
1987
|
+
*
|
|
1988
|
+
* @param {string} key
|
|
1989
|
+
*
|
|
1990
|
+
* @param {Highcharts.SVGDOMElement} element
|
|
1991
|
+
*/
|
|
1622
1992
|
fillSetter: function (value, key, element) {
|
|
1623
1993
|
if (typeof value === 'string') {
|
|
1624
1994
|
element.setAttribute(key, value);
|
|
@@ -1626,6 +1996,16 @@ extend(SVGElement.prototype, /** @lends Highcharts.SVGElement.prototype */ {
|
|
|
1626
1996
|
this.complexColor(value, key, element);
|
|
1627
1997
|
}
|
|
1628
1998
|
},
|
|
1999
|
+
/**
|
|
2000
|
+
* @private
|
|
2001
|
+
* @function Highcharts.SVGElement#visibilitySetter
|
|
2002
|
+
*
|
|
2003
|
+
* @param {string} value
|
|
2004
|
+
*
|
|
2005
|
+
* @param {string} key
|
|
2006
|
+
*
|
|
2007
|
+
* @param {Highcharts.SVGDOMElement} element
|
|
2008
|
+
*/
|
|
1629
2009
|
visibilitySetter: function (value, key, element) {
|
|
1630
2010
|
// IE9-11 doesn't handle visibilty:inherit well, so we remove the
|
|
1631
2011
|
// attribute instead (#2881, #3909)
|
|
@@ -1636,6 +2016,16 @@ extend(SVGElement.prototype, /** @lends Highcharts.SVGElement.prototype */ {
|
|
|
1636
2016
|
}
|
|
1637
2017
|
this[key] = value;
|
|
1638
2018
|
},
|
|
2019
|
+
/**
|
|
2020
|
+
* @private
|
|
2021
|
+
* @function Highcharts.SVGElement#zIndexSetter
|
|
2022
|
+
*
|
|
2023
|
+
* @param {string} value
|
|
2024
|
+
*
|
|
2025
|
+
* @param {string} key
|
|
2026
|
+
*
|
|
2027
|
+
* @return {boolean}
|
|
2028
|
+
*/
|
|
1639
2029
|
zIndexSetter: function (value, key) {
|
|
1640
2030
|
var renderer = this.renderer,
|
|
1641
2031
|
parentGroup = this.parentGroup,
|
|
@@ -1720,6 +2110,16 @@ extend(SVGElement.prototype, /** @lends Highcharts.SVGElement.prototype */ {
|
|
|
1720
2110
|
}
|
|
1721
2111
|
return inserted;
|
|
1722
2112
|
},
|
|
2113
|
+
/**
|
|
2114
|
+
* @private
|
|
2115
|
+
* @function Highcharts.SVGElement#_defaultSetter
|
|
2116
|
+
*
|
|
2117
|
+
* @param {string} value
|
|
2118
|
+
*
|
|
2119
|
+
* @param {string} key
|
|
2120
|
+
*
|
|
2121
|
+
* @param {Highcharts.SVGDOMElement} element
|
|
2122
|
+
*/
|
|
1723
2123
|
_defaultSetter: function (value, key, element) {
|
|
1724
2124
|
element.setAttribute(key, value);
|
|
1725
2125
|
}
|
|
@@ -1753,24 +2153,33 @@ SVGElement.prototype.matrixSetter = function (value, key) {
|
|
|
1753
2153
|
* An existing chart's renderer can be accessed through {@link Chart.renderer}.
|
|
1754
2154
|
* The renderer can also be used completely decoupled from a chart.
|
|
1755
2155
|
*
|
|
1756
|
-
* @
|
|
1757
|
-
*
|
|
1758
|
-
* @
|
|
1759
|
-
*
|
|
1760
|
-
* for export.
|
|
1761
|
-
* @param {boolean} [allowHTML=true] - Whether the renderer is allowed to
|
|
1762
|
-
* include HTML text, which will be projected on top of the SVG.
|
|
2156
|
+
* @sample highcharts/members/renderer-on-chart
|
|
2157
|
+
* Annotating a chart programmatically.
|
|
2158
|
+
* @sample highcharts/members/renderer-basic
|
|
2159
|
+
* Independent SVG drawing.
|
|
1763
2160
|
*
|
|
1764
2161
|
* @example
|
|
1765
2162
|
* // Use directly without a chart object.
|
|
1766
2163
|
* var renderer = new Highcharts.Renderer(parentNode, 600, 400);
|
|
1767
2164
|
*
|
|
1768
|
-
* @
|
|
1769
|
-
*
|
|
1770
|
-
*
|
|
1771
|
-
*
|
|
2165
|
+
* @class
|
|
2166
|
+
* @name Highcharts.SVGRenderer
|
|
2167
|
+
*
|
|
2168
|
+
* @param {Highcharts.HTMLDOMElement} container
|
|
2169
|
+
* Where to put the SVG in the web page.
|
|
1772
2170
|
*
|
|
1773
|
-
* @
|
|
2171
|
+
* @param {number} width
|
|
2172
|
+
* The width of the SVG.
|
|
2173
|
+
*
|
|
2174
|
+
* @param {number} height
|
|
2175
|
+
* The height of the SVG.
|
|
2176
|
+
*
|
|
2177
|
+
* @param {boolean} [forExport=false]
|
|
2178
|
+
* Whether the rendered content is intended for export.
|
|
2179
|
+
*
|
|
2180
|
+
* @param {boolean} [allowHTML=true]
|
|
2181
|
+
* Whether the renderer is allowed to include HTML text, which will be
|
|
2182
|
+
* projected on top of the SVG.
|
|
1774
2183
|
*/
|
|
1775
2184
|
SVGRenderer = H.SVGRenderer = function () {
|
|
1776
2185
|
this.init.apply(this, arguments);
|
|
@@ -1779,13 +2188,35 @@ extend(SVGRenderer.prototype, /** @lends Highcharts.SVGRenderer.prototype */ {
|
|
|
1779
2188
|
/**
|
|
1780
2189
|
* A pointer to the renderer's associated Element class. The VMLRenderer
|
|
1781
2190
|
* will have a pointer to VMLElement here.
|
|
1782
|
-
*
|
|
2191
|
+
*
|
|
2192
|
+
* @name Highcharts.SVGRenderer#Element
|
|
2193
|
+
* @type {Highcharts.SVGElement}
|
|
1783
2194
|
*/
|
|
1784
2195
|
Element: SVGElement,
|
|
2196
|
+
|
|
1785
2197
|
SVG_NS: SVG_NS,
|
|
2198
|
+
|
|
1786
2199
|
/**
|
|
1787
2200
|
* Initialize the SVGRenderer. Overridable initiator function that takes
|
|
1788
2201
|
* the same parameters as the constructor.
|
|
2202
|
+
*
|
|
2203
|
+
* @function Highcharts.SVGRenderer#init
|
|
2204
|
+
*
|
|
2205
|
+
* @param {Highcharts.HTMLDOMElement} container
|
|
2206
|
+
* Where to put the SVG in the web page.
|
|
2207
|
+
*
|
|
2208
|
+
* @param {number} width
|
|
2209
|
+
* The width of the SVG.
|
|
2210
|
+
*
|
|
2211
|
+
* @param {number} height
|
|
2212
|
+
* The height of the SVG.
|
|
2213
|
+
*
|
|
2214
|
+
* @param {boolean} [forExport=false]
|
|
2215
|
+
* Whether the rendered content is intended for export.
|
|
2216
|
+
*
|
|
2217
|
+
* @param {boolean} [allowHTML=true]
|
|
2218
|
+
* Whether the renderer is allowed to include HTML text, which will
|
|
2219
|
+
* be projected on top of the SVG.
|
|
1789
2220
|
*/
|
|
1790
2221
|
init: function (container, width, height, style, forExport, allowHTML) {
|
|
1791
2222
|
var renderer = this,
|
|
@@ -1816,23 +2247,25 @@ extend(SVGRenderer.prototype, /** @lends Highcharts.SVGRenderer.prototype */ {
|
|
|
1816
2247
|
|
|
1817
2248
|
/**
|
|
1818
2249
|
* The root `svg` node of the renderer.
|
|
1819
|
-
*
|
|
1820
|
-
* @
|
|
1821
|
-
* @type {SVGDOMElement}
|
|
2250
|
+
*
|
|
2251
|
+
* @name Highcharts.SVGRenderer#box
|
|
2252
|
+
* @type {Highcharts.SVGDOMElement}
|
|
1822
2253
|
*/
|
|
1823
2254
|
this.box = element;
|
|
1824
2255
|
/**
|
|
1825
2256
|
* The wrapper for the root `svg` node of the renderer.
|
|
1826
2257
|
*
|
|
1827
|
-
* @name boxWrapper
|
|
1828
|
-
* @
|
|
1829
|
-
* @type {SVGElement}
|
|
2258
|
+
* @name Highcharts.SVGRenderer#boxWrapper
|
|
2259
|
+
* @type {Highcharts.SVGElement}
|
|
1830
2260
|
*/
|
|
1831
2261
|
this.boxWrapper = boxWrapper;
|
|
1832
2262
|
renderer.alignedObjects = [];
|
|
1833
2263
|
|
|
1834
2264
|
/**
|
|
1835
2265
|
* Page url used for internal references.
|
|
2266
|
+
*
|
|
2267
|
+
* @private
|
|
2268
|
+
* @name Highcharts.SVGRenderer#url
|
|
1836
2269
|
* @type {string}
|
|
1837
2270
|
*/
|
|
1838
2271
|
// #24, #672, #1070
|
|
@@ -1841,7 +2274,7 @@ extend(SVGRenderer.prototype, /** @lends Highcharts.SVGRenderer.prototype */ {
|
|
|
1841
2274
|
doc.getElementsByTagName('base').length
|
|
1842
2275
|
) ?
|
|
1843
2276
|
win.location.href
|
|
1844
|
-
.
|
|
2277
|
+
.split('#')[0] // remove the hash
|
|
1845
2278
|
.replace(/<[^>]*>/g, '') // wing cut HTML
|
|
1846
2279
|
// escape parantheses and quotes
|
|
1847
2280
|
.replace(/([\('\)])/g, '\\$1')
|
|
@@ -1857,9 +2290,9 @@ extend(SVGRenderer.prototype, /** @lends Highcharts.SVGRenderer.prototype */ {
|
|
|
1857
2290
|
|
|
1858
2291
|
/**
|
|
1859
2292
|
* A pointer to the `defs` node of the root SVG.
|
|
1860
|
-
*
|
|
1861
|
-
* @name defs
|
|
1862
|
-
* @
|
|
2293
|
+
*
|
|
2294
|
+
* @name Highcharts.SVGRenderer#defs
|
|
2295
|
+
* @type {Highcharts.SVGElement}
|
|
1863
2296
|
*/
|
|
1864
2297
|
renderer.defs = this.createElement('defs').add();
|
|
1865
2298
|
renderer.allowHTML = allowHTML;
|
|
@@ -1898,20 +2331,24 @@ extend(SVGRenderer.prototype, /** @lends Highcharts.SVGRenderer.prototype */ {
|
|
|
1898
2331
|
renderer.unSubPixelFix = addEvent(win, 'resize', subPixelFix);
|
|
1899
2332
|
}
|
|
1900
2333
|
},
|
|
2334
|
+
|
|
1901
2335
|
|
|
2336
|
+
|
|
1902
2337
|
/**
|
|
1903
2338
|
* General method for adding a definition to the SVG `defs` tag. Can be used
|
|
1904
|
-
*
|
|
1905
|
-
*
|
|
1906
|
-
*
|
|
1907
|
-
*
|
|
1908
|
-
*
|
|
1909
|
-
* Styled mode only.
|
|
2339
|
+
* for gradients, fills, filters etc. Styled mode only. A hook for adding
|
|
2340
|
+
* general definitions to the SVG's defs tag. Definitions can be referenced
|
|
2341
|
+
* from the CSS by its `id`. Read more in
|
|
2342
|
+
* {@link https://www.highcharts.com/docs/chart-design-and-style/gradients-shadows-and-patterns|gradients, shadows and patterns}.
|
|
2343
|
+
* Styled mode only.
|
|
1910
2344
|
*
|
|
1911
|
-
* @
|
|
1912
|
-
* children
|
|
2345
|
+
* @function Highcharts.SVGRenderer#definition
|
|
1913
2346
|
*
|
|
1914
|
-
* @
|
|
2347
|
+
* @param {Highcharts.SVGDefinitionObject} def
|
|
2348
|
+
* A serialized form of an SVG definition, including children.
|
|
2349
|
+
*
|
|
2350
|
+
* @return {Highcharts.SVGElement}
|
|
2351
|
+
* The inserted node.
|
|
1915
2352
|
*/
|
|
1916
2353
|
definition: function (def) {
|
|
1917
2354
|
var ren = this;
|
|
@@ -1955,6 +2392,7 @@ extend(SVGRenderer.prototype, /** @lends Highcharts.SVGRenderer.prototype */ {
|
|
|
1955
2392
|
}
|
|
1956
2393
|
return recurse(def);
|
|
1957
2394
|
},
|
|
2395
|
+
|
|
1958
2396
|
|
|
1959
2397
|
|
|
1960
2398
|
|
|
@@ -1965,7 +2403,10 @@ extend(SVGRenderer.prototype, /** @lends Highcharts.SVGRenderer.prototype */ {
|
|
|
1965
2403
|
* needto render preliminarily in another div to get the text bounding boxes
|
|
1966
2404
|
* right.
|
|
1967
2405
|
*
|
|
1968
|
-
* @
|
|
2406
|
+
* @function Highcharts.SVGRenderer#isHidden
|
|
2407
|
+
*
|
|
2408
|
+
* @return {boolean}
|
|
2409
|
+
* True if it is hidden.
|
|
1969
2410
|
*/
|
|
1970
2411
|
isHidden: function () { // #608
|
|
1971
2412
|
return !this.boxWrapper.getBBox().width;
|
|
@@ -1973,6 +2414,8 @@ extend(SVGRenderer.prototype, /** @lends Highcharts.SVGRenderer.prototype */ {
|
|
|
1973
2414
|
|
|
1974
2415
|
/**
|
|
1975
2416
|
* Destroys the renderer and its allocated members.
|
|
2417
|
+
*
|
|
2418
|
+
* @function Highcharts.SVGRenderer#destroy
|
|
1976
2419
|
*/
|
|
1977
2420
|
destroy: function () {
|
|
1978
2421
|
var renderer = this,
|
|
@@ -2006,8 +2449,13 @@ extend(SVGRenderer.prototype, /** @lends Highcharts.SVGRenderer.prototype */ {
|
|
|
2006
2449
|
* primitive factories like {@link SVGRenderer#path}, {@link
|
|
2007
2450
|
* SVGRenderer#rect} or {@link SVGRenderer#text}.
|
|
2008
2451
|
*
|
|
2009
|
-
* @
|
|
2010
|
-
*
|
|
2452
|
+
* @function Highcharts.SVGRenderer#createElement
|
|
2453
|
+
*
|
|
2454
|
+
* @param {string} nodeName
|
|
2455
|
+
* The node name, for example `rect`, `g` etc.
|
|
2456
|
+
*
|
|
2457
|
+
* @return {Highcharts.SVGElement}
|
|
2458
|
+
* The generated SVGElement.
|
|
2011
2459
|
*/
|
|
2012
2460
|
createElement: function (nodeName) {
|
|
2013
2461
|
var wrapper = new this.Element();
|
|
@@ -2018,7 +2466,9 @@ extend(SVGRenderer.prototype, /** @lends Highcharts.SVGRenderer.prototype */ {
|
|
|
2018
2466
|
/**
|
|
2019
2467
|
* Dummy function for plugins, called every time the renderer is updated.
|
|
2020
2468
|
* Prior to Highcharts 5, this was used for the canvg renderer.
|
|
2021
|
-
*
|
|
2469
|
+
*
|
|
2470
|
+
* @deprecated
|
|
2471
|
+
* @function Highcharts.SVGRenderer#draw
|
|
2022
2472
|
*/
|
|
2023
2473
|
draw: noop,
|
|
2024
2474
|
|
|
@@ -2028,6 +2478,13 @@ extend(SVGRenderer.prototype, /** @lends Highcharts.SVGRenderer.prototype */ {
|
|
|
2028
2478
|
* function.
|
|
2029
2479
|
*
|
|
2030
2480
|
* @private
|
|
2481
|
+
* @function Highcharts.SVGRenderer#getRadialAttr
|
|
2482
|
+
*
|
|
2483
|
+
* @param {Array<number>} radialReference
|
|
2484
|
+
*
|
|
2485
|
+
* @param {Highcharts.SVGAttributes} gradAttr
|
|
2486
|
+
*
|
|
2487
|
+
* @return {Highcharts.SVGAttributes}
|
|
2031
2488
|
*/
|
|
2032
2489
|
getRadialAttr: function (radialReference, gradAttr) {
|
|
2033
2490
|
return {
|
|
@@ -2040,38 +2497,107 @@ extend(SVGRenderer.prototype, /** @lends Highcharts.SVGRenderer.prototype */ {
|
|
|
2040
2497
|
},
|
|
2041
2498
|
|
|
2042
2499
|
/**
|
|
2043
|
-
*
|
|
2500
|
+
* Truncate the text node contents to a given length. Used when the css
|
|
2501
|
+
* width is set. If the `textOverflow` is `ellipsis`, the text is truncated
|
|
2502
|
+
* character by character to the given length. If not, the text is
|
|
2503
|
+
* word-wrapped line by line.
|
|
2044
2504
|
*
|
|
2045
2505
|
* @private
|
|
2506
|
+
* @function Highcharts.SVGRenderer#truncate
|
|
2507
|
+
*
|
|
2508
|
+
* @param {Highcharts.SVGElement} wrapper
|
|
2509
|
+
*
|
|
2510
|
+
* @param {Highcharts.SVGDOMElement} tspan
|
|
2511
|
+
*
|
|
2512
|
+
* @param {string} text
|
|
2513
|
+
*
|
|
2514
|
+
* @param {Array.<string>} words
|
|
2515
|
+
*
|
|
2516
|
+
* @param {number} width
|
|
2517
|
+
*
|
|
2518
|
+
* @param {Function} getString
|
|
2519
|
+
*
|
|
2520
|
+
* @return {boolean}
|
|
2521
|
+
* True if tspan is too long.
|
|
2046
2522
|
*/
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2523
|
+
truncate: function (
|
|
2524
|
+
wrapper,
|
|
2525
|
+
tspan,
|
|
2526
|
+
text,
|
|
2527
|
+
words,
|
|
2528
|
+
startAt,
|
|
2529
|
+
width,
|
|
2530
|
+
getString
|
|
2531
|
+
) {
|
|
2052
2532
|
var renderer = this,
|
|
2053
2533
|
rotation = wrapper.rotation,
|
|
2054
|
-
str
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2534
|
+
str,
|
|
2535
|
+
// Word wrap can not be truncated to shorter than one word, ellipsis
|
|
2536
|
+
// text can be completely blank.
|
|
2537
|
+
minIndex = words ? 1 : 0,
|
|
2538
|
+
maxIndex = (text || words).length,
|
|
2539
|
+
currentIndex = maxIndex,
|
|
2540
|
+
// Cache the lengths to avoid checking the same twice
|
|
2541
|
+
lengths = [],
|
|
2058
2542
|
updateTSpan = function (s) {
|
|
2059
|
-
|
|
2543
|
+
if (tspan.firstChild) {
|
|
2544
|
+
tspan.removeChild(tspan.firstChild);
|
|
2545
|
+
}
|
|
2060
2546
|
if (s) {
|
|
2061
2547
|
tspan.appendChild(doc.createTextNode(s));
|
|
2062
2548
|
}
|
|
2063
2549
|
},
|
|
2550
|
+
getSubStringLength = function (charEnd, concatenatedEnd) {
|
|
2551
|
+
// charEnd is useed when finding the character-by-character
|
|
2552
|
+
// break for ellipsis, concatenatedEnd is used for word-by-word
|
|
2553
|
+
// break for word wrapping.
|
|
2554
|
+
var end = concatenatedEnd || charEnd;
|
|
2555
|
+
if (lengths[end] === undefined) {
|
|
2556
|
+
// Modern browsers
|
|
2557
|
+
if (tspan.getSubStringLength) {
|
|
2558
|
+
// Fails with DOM exception on unit-tests/legend/members
|
|
2559
|
+
// of unknown reason. Desired width is 0, text content
|
|
2560
|
+
// is "5" and end is 1.
|
|
2561
|
+
try {
|
|
2562
|
+
lengths[end] = startAt + tspan.getSubStringLength(
|
|
2563
|
+
0,
|
|
2564
|
+
words ? end + 1 : end
|
|
2565
|
+
);
|
|
2566
|
+
|
|
2567
|
+
} catch (e) {}
|
|
2568
|
+
|
|
2569
|
+
// Legacy
|
|
2570
|
+
} else if (renderer.getSpanWidth) { // #9058 jsdom
|
|
2571
|
+
updateTSpan(getString(text || words, charEnd));
|
|
2572
|
+
lengths[end] = startAt +
|
|
2573
|
+
renderer.getSpanWidth(wrapper, tspan);
|
|
2574
|
+
}
|
|
2575
|
+
}
|
|
2576
|
+
return lengths[end];
|
|
2577
|
+
},
|
|
2064
2578
|
actualWidth,
|
|
2065
|
-
|
|
2579
|
+
truncated;
|
|
2580
|
+
|
|
2066
2581
|
wrapper.rotation = 0; // discard rotation when computing box
|
|
2067
|
-
actualWidth =
|
|
2068
|
-
|
|
2069
|
-
if (
|
|
2582
|
+
actualWidth = getSubStringLength(tspan.textContent.length);
|
|
2583
|
+
truncated = startAt + actualWidth > width;
|
|
2584
|
+
if (truncated) {
|
|
2585
|
+
|
|
2586
|
+
// Do a binary search for the index where to truncate the text
|
|
2070
2587
|
while (minIndex <= maxIndex) {
|
|
2071
2588
|
currentIndex = Math.ceil((minIndex + maxIndex) / 2);
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2589
|
+
|
|
2590
|
+
// When checking words for word-wrap, we need to build the
|
|
2591
|
+
// string and measure the subStringLength at the concatenated
|
|
2592
|
+
// word length.
|
|
2593
|
+
if (words) {
|
|
2594
|
+
str = getString(words, currentIndex);
|
|
2595
|
+
}
|
|
2596
|
+
actualWidth = getSubStringLength(
|
|
2597
|
+
currentIndex,
|
|
2598
|
+
str && str.length - 1
|
|
2599
|
+
);
|
|
2600
|
+
|
|
2075
2601
|
if (minIndex === maxIndex) {
|
|
2076
2602
|
// Complete
|
|
2077
2603
|
minIndex = maxIndex + 1;
|
|
@@ -2083,14 +2609,29 @@ extend(SVGRenderer.prototype, /** @lends Highcharts.SVGRenderer.prototype */ {
|
|
|
2083
2609
|
minIndex = currentIndex;
|
|
2084
2610
|
}
|
|
2085
2611
|
}
|
|
2086
|
-
// If max index was 0 it means
|
|
2612
|
+
// If max index was 0 it means the shortest possible text was also
|
|
2613
|
+
// too large. For ellipsis that means only the ellipsis, while for
|
|
2614
|
+
// word wrap it means the whole first word.
|
|
2087
2615
|
if (maxIndex === 0) {
|
|
2088
|
-
// Remove
|
|
2616
|
+
// Remove ellipsis
|
|
2089
2617
|
updateTSpan('');
|
|
2618
|
+
|
|
2619
|
+
// If the new text length is one less than the original, we don't
|
|
2620
|
+
// need the ellipsis
|
|
2621
|
+
} else if (!(text && maxIndex === text.length - 1)) {
|
|
2622
|
+
updateTSpan(str || getString(text || words, currentIndex));
|
|
2090
2623
|
}
|
|
2091
2624
|
}
|
|
2625
|
+
|
|
2626
|
+
// When doing line wrapping, prepare for the next line by removing the
|
|
2627
|
+
// items from this line.
|
|
2628
|
+
if (words) {
|
|
2629
|
+
words.splice(0, currentIndex);
|
|
2630
|
+
}
|
|
2631
|
+
|
|
2632
|
+
wrapper.actualWidth = actualWidth;
|
|
2092
2633
|
wrapper.rotation = rotation; // Apply rotation again.
|
|
2093
|
-
return
|
|
2634
|
+
return truncated;
|
|
2094
2635
|
},
|
|
2095
2636
|
|
|
2096
2637
|
/**
|
|
@@ -2103,7 +2644,8 @@ extend(SVGRenderer.prototype, /** @lends Highcharts.SVGRenderer.prototype */ {
|
|
|
2103
2644
|
* // Add support for unescaping quotes
|
|
2104
2645
|
* Highcharts.SVGRenderer.prototype.escapes['"'] = '"';
|
|
2105
2646
|
*
|
|
2106
|
-
* @
|
|
2647
|
+
* @name Highcharts.SVGRenderer#escapes
|
|
2648
|
+
* @type {Highcharts.Dictionary<string>}
|
|
2107
2649
|
*/
|
|
2108
2650
|
escapes: {
|
|
2109
2651
|
'&': '&',
|
|
@@ -2115,11 +2657,15 @@ extend(SVGRenderer.prototype, /** @lends Highcharts.SVGRenderer.prototype */ {
|
|
|
2115
2657
|
|
|
2116
2658
|
/**
|
|
2117
2659
|
* Parse a simple HTML string into SVG tspans. Called internally when text
|
|
2118
|
-
*
|
|
2119
|
-
*
|
|
2120
|
-
*
|
|
2660
|
+
* is set on an SVGElement. The function supports a subset of HTML tags, CSS
|
|
2661
|
+
* text features like `width`, `text-overflow`, `white-space`, and also
|
|
2662
|
+
* attributes like `href` and `style`.
|
|
2663
|
+
*
|
|
2121
2664
|
* @private
|
|
2122
|
-
* @
|
|
2665
|
+
* @function Highcharts.SVGRenderer#buildText
|
|
2666
|
+
*
|
|
2667
|
+
* @param {Highcharts.SVGElement} wrapper
|
|
2668
|
+
* The parent SVGElement.
|
|
2123
2669
|
*/
|
|
2124
2670
|
buildText: function (wrapper) {
|
|
2125
2671
|
var textNode = wrapper.element,
|
|
@@ -2129,7 +2675,7 @@ extend(SVGRenderer.prototype, /** @lends Highcharts.SVGRenderer.prototype */ {
|
|
|
2129
2675
|
hasMarkup = textStr.indexOf('<') !== -1,
|
|
2130
2676
|
lines,
|
|
2131
2677
|
childNodes = textNode.childNodes,
|
|
2132
|
-
|
|
2678
|
+
truncated,
|
|
2133
2679
|
parentX = attr(textNode, 'x'),
|
|
2134
2680
|
textStyles = wrapper.styles,
|
|
2135
2681
|
width = wrapper.textWidth,
|
|
@@ -2253,7 +2799,8 @@ extend(SVGRenderer.prototype, /** @lends Highcharts.SVGRenderer.prototype */ {
|
|
|
2253
2799
|
// build the lines
|
|
2254
2800
|
each(lines, function buildTextLines(line, lineNo) {
|
|
2255
2801
|
var spans,
|
|
2256
|
-
spanNo = 0
|
|
2802
|
+
spanNo = 0,
|
|
2803
|
+
lineLength = 0;
|
|
2257
2804
|
line = line
|
|
2258
2805
|
// Trim to prevent useless/costly process on the spaces
|
|
2259
2806
|
// (#5258)
|
|
@@ -2345,88 +2892,55 @@ extend(SVGRenderer.prototype, /** @lends Highcharts.SVGRenderer.prototype */ {
|
|
|
2345
2892
|
);
|
|
2346
2893
|
}
|
|
2347
2894
|
|
|
2348
|
-
/*
|
|
2349
|
-
// Experimental text wrapping based on
|
|
2350
|
-
// getSubstringLength
|
|
2351
|
-
if (width) {
|
|
2352
|
-
var spans = renderer.breakText(wrapper, width);
|
|
2353
|
-
|
|
2354
|
-
each(spans, function (span) {
|
|
2355
|
-
|
|
2356
|
-
var dy = getLineHeight(tspan);
|
|
2357
|
-
tspan = doc.createElementNS(
|
|
2358
|
-
SVG_NS,
|
|
2359
|
-
'tspan'
|
|
2360
|
-
);
|
|
2361
|
-
tspan.appendChild(
|
|
2362
|
-
doc.createTextNode(span)
|
|
2363
|
-
);
|
|
2364
|
-
attr(tspan, {
|
|
2365
|
-
dy: dy,
|
|
2366
|
-
x: parentX
|
|
2367
|
-
});
|
|
2368
|
-
if (spanStyle) { // #390
|
|
2369
|
-
attr(tspan, 'style', spanStyle);
|
|
2370
|
-
}
|
|
2371
|
-
textNode.appendChild(tspan);
|
|
2372
|
-
});
|
|
2373
|
-
|
|
2374
|
-
}
|
|
2375
|
-
// */
|
|
2376
|
-
|
|
2377
2895
|
// Check width and apply soft breaks or ellipsis
|
|
2378
2896
|
if (width) {
|
|
2379
2897
|
var words = span.replace(
|
|
2380
2898
|
/([^\^])-/g,
|
|
2381
2899
|
'$1- '
|
|
2382
2900
|
).split(' '), // #1273
|
|
2383
|
-
hasWhiteSpace = (
|
|
2901
|
+
hasWhiteSpace = !noWrap && (
|
|
2384
2902
|
spans.length > 1 ||
|
|
2385
2903
|
lineNo ||
|
|
2386
|
-
|
|
2904
|
+
words.length > 1
|
|
2387
2905
|
),
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
actualWidth,
|
|
2391
|
-
dy = getLineHeight(tspan),
|
|
2392
|
-
rotation = wrapper.rotation;
|
|
2906
|
+
wrapLineNo = 0,
|
|
2907
|
+
dy = getLineHeight(tspan);
|
|
2393
2908
|
|
|
2394
2909
|
if (ellipsis) {
|
|
2395
|
-
|
|
2910
|
+
truncated = renderer.truncate(
|
|
2396
2911
|
wrapper,
|
|
2397
2912
|
tspan,
|
|
2398
2913
|
span,
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2914
|
+
undefined,
|
|
2915
|
+
0,
|
|
2916
|
+
// Target width
|
|
2917
|
+
Math.max(
|
|
2918
|
+
0,
|
|
2919
|
+
// Substract the font face to make
|
|
2920
|
+
// room for the ellipsis itself
|
|
2921
|
+
width - parseInt(fontSize || 12, 10)
|
|
2922
|
+
),
|
|
2923
|
+
// Build the text to test for
|
|
2924
|
+
function (text, currentIndex) {
|
|
2925
|
+
return text.substring(
|
|
2926
|
+
0,
|
|
2927
|
+
currentIndex
|
|
2928
|
+
) + '\u2026';
|
|
2929
|
+
}
|
|
2413
2930
|
);
|
|
2414
|
-
|
|
2931
|
+
} else if (hasWhiteSpace) {
|
|
2415
2932
|
|
|
2416
|
-
|
|
2417
|
-
// correct string length
|
|
2418
|
-
if (wasTooLong === undefined) {
|
|
2419
|
-
wasTooLong = tooLong; // First time
|
|
2420
|
-
}
|
|
2933
|
+
while (words.length) {
|
|
2421
2934
|
|
|
2422
|
-
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
|
|
2426
|
-
|
|
2427
|
-
|
|
2935
|
+
// For subsequent lines, create tspans
|
|
2936
|
+
// with the same style attributes as the
|
|
2937
|
+
// parent text node.
|
|
2938
|
+
if (
|
|
2939
|
+
words.length &&
|
|
2940
|
+
!noWrap &&
|
|
2941
|
+
wrapLineNo > 0
|
|
2942
|
+
) {
|
|
2428
2943
|
|
|
2429
|
-
if (words.length && !noWrap) {
|
|
2430
2944
|
tspan = doc.createElementNS(
|
|
2431
2945
|
SVG_NS,
|
|
2432
2946
|
'tspan'
|
|
@@ -2442,34 +2956,48 @@ extend(SVGRenderer.prototype, /** @lends Highcharts.SVGRenderer.prototype */ {
|
|
|
2442
2956
|
styleAttribute
|
|
2443
2957
|
);
|
|
2444
2958
|
}
|
|
2959
|
+
// Start by appending the full
|
|
2960
|
+
// remaining text
|
|
2961
|
+
tspan.appendChild(
|
|
2962
|
+
doc.createTextNode(
|
|
2963
|
+
words.join(' ')
|
|
2964
|
+
.replace(/- /g, '-')
|
|
2965
|
+
)
|
|
2966
|
+
);
|
|
2445
2967
|
textNode.appendChild(tspan);
|
|
2446
2968
|
}
|
|
2447
2969
|
|
|
2448
|
-
//
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
.
|
|
2462
|
-
|
|
2970
|
+
// For each line, truncate the remaining
|
|
2971
|
+
// words into the line length.
|
|
2972
|
+
renderer.truncate(
|
|
2973
|
+
wrapper,
|
|
2974
|
+
tspan,
|
|
2975
|
+
null,
|
|
2976
|
+
words,
|
|
2977
|
+
wrapLineNo === 0 ? lineLength : 0,
|
|
2978
|
+
width,
|
|
2979
|
+
// Build the text to test for
|
|
2980
|
+
function (text, currentIndex) {
|
|
2981
|
+
return words
|
|
2982
|
+
.slice(0, currentIndex)
|
|
2983
|
+
.join(' ')
|
|
2984
|
+
.replace(/- /g, '-');
|
|
2985
|
+
}
|
|
2463
2986
|
);
|
|
2987
|
+
|
|
2988
|
+
lineLength = wrapper.actualWidth;
|
|
2989
|
+
wrapLineNo++;
|
|
2464
2990
|
}
|
|
2465
2991
|
}
|
|
2466
|
-
wrapper.rotation = rotation;
|
|
2467
2992
|
}
|
|
2468
2993
|
|
|
2469
2994
|
spanNo++;
|
|
2470
2995
|
}
|
|
2996
|
+
|
|
2471
2997
|
}
|
|
2998
|
+
|
|
2472
2999
|
});
|
|
3000
|
+
|
|
2473
3001
|
// To avoid beginning lines that doesn't add to the textNode
|
|
2474
3002
|
// (#6144)
|
|
2475
3003
|
isSubsequentLine = (
|
|
@@ -2478,7 +3006,7 @@ extend(SVGRenderer.prototype, /** @lends Highcharts.SVGRenderer.prototype */ {
|
|
|
2478
3006
|
);
|
|
2479
3007
|
});
|
|
2480
3008
|
|
|
2481
|
-
if (ellipsis &&
|
|
3009
|
+
if (ellipsis && truncated) {
|
|
2482
3010
|
wrapper.attr(
|
|
2483
3011
|
'title',
|
|
2484
3012
|
unescapeEntities(wrapper.textStr, ['<', '>']) // #7179
|
|
@@ -2495,99 +3023,63 @@ extend(SVGRenderer.prototype, /** @lends Highcharts.SVGRenderer.prototype */ {
|
|
|
2495
3023
|
}
|
|
2496
3024
|
},
|
|
2497
3025
|
|
|
2498
|
-
|
|
2499
|
-
|
|
2500
|
-
/*
|
|
2501
|
-
breakText: function (wrapper, width) {
|
|
2502
|
-
var bBox = wrapper.getBBox(),
|
|
2503
|
-
node = wrapper.element,
|
|
2504
|
-
charnum = node.textContent.length,
|
|
2505
|
-
stringWidth,
|
|
2506
|
-
// try this position first, based on average character width
|
|
2507
|
-
guessedLineCharLength = Math.round(width * charnum / bBox.width),
|
|
2508
|
-
pos = guessedLineCharLength,
|
|
2509
|
-
spans = [],
|
|
2510
|
-
increment = 0,
|
|
2511
|
-
startPos = 0,
|
|
2512
|
-
endPos,
|
|
2513
|
-
safe = 0;
|
|
2514
|
-
|
|
2515
|
-
if (bBox.width > width) {
|
|
2516
|
-
while (startPos < charnum && safe < 100) {
|
|
2517
|
-
|
|
2518
|
-
while (endPos === undefined && safe < 100) {
|
|
2519
|
-
stringWidth = node.getSubStringLength(
|
|
2520
|
-
startPos,
|
|
2521
|
-
pos - startPos
|
|
2522
|
-
);
|
|
2523
|
-
|
|
2524
|
-
if (stringWidth <= width) {
|
|
2525
|
-
if (increment === -1) {
|
|
2526
|
-
endPos = pos;
|
|
2527
|
-
} else {
|
|
2528
|
-
increment = 1;
|
|
2529
|
-
}
|
|
2530
|
-
} else {
|
|
2531
|
-
if (increment === 1) {
|
|
2532
|
-
endPos = pos - 1;
|
|
2533
|
-
} else {
|
|
2534
|
-
increment = -1;
|
|
2535
|
-
}
|
|
2536
|
-
}
|
|
2537
|
-
pos += increment;
|
|
2538
|
-
safe++;
|
|
2539
|
-
}
|
|
2540
|
-
|
|
2541
|
-
spans.push(
|
|
2542
|
-
node.textContent.substr(startPos, endPos - startPos)
|
|
2543
|
-
);
|
|
2544
|
-
|
|
2545
|
-
startPos = endPos;
|
|
2546
|
-
pos = startPos + guessedLineCharLength;
|
|
2547
|
-
endPos = undefined;
|
|
2548
|
-
}
|
|
2549
|
-
}
|
|
2550
|
-
|
|
2551
|
-
return spans;
|
|
2552
|
-
},
|
|
2553
|
-
// */
|
|
2554
|
-
|
|
2555
3026
|
/**
|
|
2556
3027
|
* Returns white for dark colors and black for bright colors.
|
|
2557
3028
|
*
|
|
2558
|
-
* @
|
|
2559
|
-
*
|
|
3029
|
+
* @function Highcharts.SVGRenderer#getContrast
|
|
3030
|
+
*
|
|
3031
|
+
* @param {Highcharts.ColorString} rgba
|
|
3032
|
+
* The color to get the contrast for.
|
|
3033
|
+
*
|
|
3034
|
+
* @return {string}
|
|
3035
|
+
* The contrast color, either `#000000` or `#FFFFFF`.
|
|
2560
3036
|
*/
|
|
2561
3037
|
getContrast: function (rgba) {
|
|
2562
3038
|
rgba = color(rgba).rgba;
|
|
2563
3039
|
|
|
2564
3040
|
// The threshold may be discussed. Here's a proposal for adding
|
|
2565
3041
|
// different weight to the color channels (#6216)
|
|
2566
|
-
/*
|
|
2567
3042
|
rgba[0] *= 1; // red
|
|
2568
3043
|
rgba[1] *= 1.2; // green
|
|
2569
|
-
rgba[2] *= 0.
|
|
2570
|
-
*/
|
|
3044
|
+
rgba[2] *= 0.5; // blue
|
|
2571
3045
|
|
|
2572
|
-
return rgba[0] + rgba[1] + rgba[2] >
|
|
3046
|
+
return rgba[0] + rgba[1] + rgba[2] > 1.8 * 255 ? '#000000' : '#FFFFFF';
|
|
2573
3047
|
},
|
|
2574
3048
|
|
|
2575
3049
|
/**
|
|
2576
3050
|
* Create a button with preset states.
|
|
2577
|
-
*
|
|
2578
|
-
* @
|
|
2579
|
-
*
|
|
2580
|
-
* @param {
|
|
2581
|
-
*
|
|
2582
|
-
*
|
|
2583
|
-
*
|
|
2584
|
-
*
|
|
2585
|
-
*
|
|
2586
|
-
*
|
|
2587
|
-
*
|
|
2588
|
-
*
|
|
2589
|
-
* @param {
|
|
2590
|
-
*
|
|
3051
|
+
*
|
|
3052
|
+
* @function Highcharts.SVGRenderer#button
|
|
3053
|
+
*
|
|
3054
|
+
* @param {string} text
|
|
3055
|
+
* The text or HTML to draw.
|
|
3056
|
+
*
|
|
3057
|
+
* @param {number} x
|
|
3058
|
+
* The x position of the button's left side.
|
|
3059
|
+
*
|
|
3060
|
+
* @param {number} y
|
|
3061
|
+
* The y position of the button's top side.
|
|
3062
|
+
*
|
|
3063
|
+
* @param {Function} callback
|
|
3064
|
+
* The function to execute on button click or touch.
|
|
3065
|
+
*
|
|
3066
|
+
* @param {Highcharts.SVGAttributes} [normalState]
|
|
3067
|
+
* SVG attributes for the normal state.
|
|
3068
|
+
*
|
|
3069
|
+
* @param {Highcharts.SVGAttributes} [hoverState]
|
|
3070
|
+
* SVG attributes for the hover state.
|
|
3071
|
+
*
|
|
3072
|
+
* @param {Highcharts.SVGAttributes} [pressedState]
|
|
3073
|
+
* SVG attributes for the pressed state.
|
|
3074
|
+
*
|
|
3075
|
+
* @param {Highcharts.SVGAttributes} [disabledState]
|
|
3076
|
+
* SVG attributes for the disabled state.
|
|
3077
|
+
*
|
|
3078
|
+
* @param {Highcharts.SymbolKey} [shape=rect]
|
|
3079
|
+
* The shape type.
|
|
3080
|
+
*
|
|
3081
|
+
* @return {Highcharts.SVGElement}
|
|
3082
|
+
* The button element.
|
|
2591
3083
|
*/
|
|
2592
3084
|
button: function (
|
|
2593
3085
|
text,
|
|
@@ -2665,11 +3157,16 @@ extend(SVGRenderer.prototype, /** @lends Highcharts.SVGRenderer.prototype */ {
|
|
|
2665
3157
|
/**
|
|
2666
3158
|
* Make a straight line crisper by not spilling out to neighbour pixels.
|
|
2667
3159
|
*
|
|
2668
|
-
* @
|
|
2669
|
-
*
|
|
2670
|
-
* @param {
|
|
2671
|
-
*
|
|
2672
|
-
*
|
|
3160
|
+
* @function Highcharts.SVGRenderer#crispLine
|
|
3161
|
+
*
|
|
3162
|
+
* @param {Highcharts.SVGPathArray} points
|
|
3163
|
+
* The original points on the format `['M', 0, 0, 'L', 100, 0]`.
|
|
3164
|
+
*
|
|
3165
|
+
* @param {number} width
|
|
3166
|
+
* The width of the line.
|
|
3167
|
+
*
|
|
3168
|
+
* @return {Highcharts.SVGPathArray}
|
|
3169
|
+
* The original points array, but modified to render crisply.
|
|
2673
3170
|
*/
|
|
2674
3171
|
crispLine: function (points, width) {
|
|
2675
3172
|
// normalize to a crisp line
|
|
@@ -2688,24 +3185,34 @@ extend(SVGRenderer.prototype, /** @lends Highcharts.SVGRenderer.prototype */ {
|
|
|
2688
3185
|
/**
|
|
2689
3186
|
* Draw a path, wraps the SVG `path` element.
|
|
2690
3187
|
*
|
|
2691
|
-
* @
|
|
3188
|
+
* @sample highcharts/members/renderer-path-on-chart/
|
|
3189
|
+
* Draw a path in a chart
|
|
3190
|
+
* @sample highcharts/members/renderer-path/
|
|
3191
|
+
* Draw a path independent from a chart
|
|
2692
3192
|
*
|
|
2693
3193
|
* @example
|
|
2694
3194
|
* var path = renderer.path(['M', 10, 10, 'L', 30, 30, 'z'])
|
|
2695
3195
|
* .attr({ stroke: '#ff00ff' })
|
|
2696
3196
|
* .add();
|
|
2697
|
-
* @returns {SVGElement} The generated wrapper element.
|
|
2698
3197
|
*
|
|
2699
|
-
* @
|
|
2700
|
-
*
|
|
2701
|
-
* @
|
|
2702
|
-
*
|
|
3198
|
+
* @function Highcharts.SVGRenderer#path
|
|
3199
|
+
*
|
|
3200
|
+
* @param {Highcharts.SVGPathArray} [path]
|
|
3201
|
+
* An SVG path definition in array form.
|
|
3202
|
+
*
|
|
3203
|
+
* @return {Highcharts.SVGElement}
|
|
3204
|
+
* The generated wrapper element.
|
|
2703
3205
|
*
|
|
2704
3206
|
*//**
|
|
2705
3207
|
* Draw a path, wraps the SVG `path` element.
|
|
2706
3208
|
*
|
|
2707
|
-
* @
|
|
2708
|
-
*
|
|
3209
|
+
* @function Highcharts.SVGRenderer#path
|
|
3210
|
+
*
|
|
3211
|
+
* @param {Highcharts.SVGAttributes} [attribs]
|
|
3212
|
+
* The initial attributes.
|
|
3213
|
+
*
|
|
3214
|
+
* @return {Highcharts.SVGElement}
|
|
3215
|
+
* The generated wrapper element.
|
|
2709
3216
|
*/
|
|
2710
3217
|
path: function (path) {
|
|
2711
3218
|
var attribs = {
|
|
@@ -2722,17 +3229,32 @@ extend(SVGRenderer.prototype, /** @lends Highcharts.SVGRenderer.prototype */ {
|
|
|
2722
3229
|
/**
|
|
2723
3230
|
* Draw a circle, wraps the SVG `circle` element.
|
|
2724
3231
|
*
|
|
2725
|
-
* @
|
|
2726
|
-
*
|
|
2727
|
-
* @param {number} [r] The radius.
|
|
2728
|
-
* @returns {SVGElement} The generated wrapper element.
|
|
3232
|
+
* @sample highcharts/members/renderer-circle/
|
|
3233
|
+
* Drawing a circle
|
|
2729
3234
|
*
|
|
2730
|
-
* @
|
|
3235
|
+
* @function Highcharts.SVGRenderer#circle
|
|
3236
|
+
*
|
|
3237
|
+
* @param {number} [x]
|
|
3238
|
+
* The center x position.
|
|
3239
|
+
*
|
|
3240
|
+
* @param {number} [y]
|
|
3241
|
+
* The center y position.
|
|
3242
|
+
*
|
|
3243
|
+
* @param {number} [r]
|
|
3244
|
+
* The radius.
|
|
3245
|
+
*
|
|
3246
|
+
* @return {Highcharts.SVGElement}
|
|
3247
|
+
* The generated wrapper element.
|
|
2731
3248
|
*//**
|
|
2732
3249
|
* Draw a circle, wraps the SVG `circle` element.
|
|
2733
3250
|
*
|
|
2734
|
-
* @
|
|
2735
|
-
*
|
|
3251
|
+
* @function Highcharts.SVGRenderer#circle
|
|
3252
|
+
*
|
|
3253
|
+
* @param {Highcharts.SVGAttributes} [attribs]
|
|
3254
|
+
* The initial attributes.
|
|
3255
|
+
*
|
|
3256
|
+
* @return {Highcharts.SVGElement}
|
|
3257
|
+
* The generated wrapper element.
|
|
2736
3258
|
*/
|
|
2737
3259
|
circle: function (x, y, r) {
|
|
2738
3260
|
var attribs = isObject(x) ? x : { x: x, y: y, r: r },
|
|
@@ -2748,22 +3270,44 @@ extend(SVGRenderer.prototype, /** @lends Highcharts.SVGRenderer.prototype */ {
|
|
|
2748
3270
|
|
|
2749
3271
|
/**
|
|
2750
3272
|
* Draw and return an arc.
|
|
2751
|
-
* @param {number} [x=0] Center X position.
|
|
2752
|
-
* @param {number} [y=0] Center Y position.
|
|
2753
|
-
* @param {number} [r=0] The outer radius of the arc.
|
|
2754
|
-
* @param {number} [innerR=0] Inner radius like used in donut charts.
|
|
2755
|
-
* @param {number} [start=0] The starting angle of the arc in radians, where
|
|
2756
|
-
* 0 is to the right and `-Math.PI/2` is up.
|
|
2757
|
-
* @param {number} [end=0] The ending angle of the arc in radians, where 0
|
|
2758
|
-
* is to the right and `-Math.PI/2` is up.
|
|
2759
|
-
* @returns {SVGElement} The generated wrapper element.
|
|
2760
3273
|
*
|
|
2761
3274
|
* @sample highcharts/members/renderer-arc/
|
|
2762
3275
|
* Drawing an arc
|
|
3276
|
+
*
|
|
3277
|
+
* @function Highcharts.SVGRenderer#arc
|
|
3278
|
+
*
|
|
3279
|
+
* @param {number} [x=0]
|
|
3280
|
+
* Center X position.
|
|
3281
|
+
*
|
|
3282
|
+
* @param {number} [y=0]
|
|
3283
|
+
* Center Y position.
|
|
3284
|
+
*
|
|
3285
|
+
* @param {number} [r=0]
|
|
3286
|
+
* The outer radius of the arc.
|
|
3287
|
+
*
|
|
3288
|
+
* @param {number} [innerR=0]
|
|
3289
|
+
* Inner radius like used in donut charts.
|
|
3290
|
+
*
|
|
3291
|
+
* @param {number} [start=0]
|
|
3292
|
+
* The starting angle of the arc in radians, where 0 is to the right
|
|
3293
|
+
* and `-Math.PI/2` is up.
|
|
3294
|
+
*
|
|
3295
|
+
* @param {number} [end=0]
|
|
3296
|
+
* The ending angle of the arc in radians, where 0 is to the right
|
|
3297
|
+
* and `-Math.PI/2` is up.
|
|
3298
|
+
*
|
|
3299
|
+
* @return {Highcharts.SVGElement}
|
|
3300
|
+
* The generated wrapper element.
|
|
2763
3301
|
*//**
|
|
2764
3302
|
* Draw and return an arc. Overloaded function that takes arguments object.
|
|
2765
|
-
*
|
|
2766
|
-
* @
|
|
3303
|
+
*
|
|
3304
|
+
* @function Highcharts.SVGRenderer#arc
|
|
3305
|
+
*
|
|
3306
|
+
* @param {Highcharts.SVGAttributes} attribs
|
|
3307
|
+
* Initial SVG attributes.
|
|
3308
|
+
*
|
|
3309
|
+
* @return {Highcharts.SVGElement}
|
|
3310
|
+
* The generated wrapper element.
|
|
2767
3311
|
*/
|
|
2768
3312
|
arc: function (x, y, r, innerR, start, end) {
|
|
2769
3313
|
var arc,
|
|
@@ -2794,25 +3338,44 @@ extend(SVGRenderer.prototype, /** @lends Highcharts.SVGRenderer.prototype */ {
|
|
|
2794
3338
|
|
|
2795
3339
|
/**
|
|
2796
3340
|
* Draw and return a rectangle.
|
|
2797
|
-
*
|
|
2798
|
-
* @
|
|
2799
|
-
*
|
|
2800
|
-
* @param {number} [
|
|
2801
|
-
*
|
|
2802
|
-
*
|
|
2803
|
-
*
|
|
2804
|
-
*
|
|
3341
|
+
*
|
|
3342
|
+
* @function Highcharts.SVGRenderer#rect
|
|
3343
|
+
*
|
|
3344
|
+
* @param {number} [x]
|
|
3345
|
+
* Left position.
|
|
3346
|
+
*
|
|
3347
|
+
* @param {number} [y]
|
|
3348
|
+
* Top position.
|
|
3349
|
+
*
|
|
3350
|
+
* @param {number} [width]
|
|
3351
|
+
* Width of the rectangle.
|
|
3352
|
+
*
|
|
3353
|
+
* @param {number} [height]
|
|
3354
|
+
* Height of the rectangle.
|
|
3355
|
+
*
|
|
3356
|
+
* @param {number} [r]
|
|
3357
|
+
* Border corner radius.
|
|
3358
|
+
*
|
|
3359
|
+
* @param {number} [strokeWidth]
|
|
3360
|
+
* A stroke width can be supplied to allow crisp drawing.
|
|
3361
|
+
*
|
|
3362
|
+
* @return {Highcharts.SVGElement}
|
|
3363
|
+
* The generated wrapper element.
|
|
2805
3364
|
*//**
|
|
2806
3365
|
* Draw and return a rectangle.
|
|
2807
|
-
* @param {SVGAttributes} [attributes]
|
|
2808
|
-
* General SVG attributes for the rectangle.
|
|
2809
|
-
* @return {SVGElement}
|
|
2810
|
-
* The generated wrapper element.
|
|
2811
3366
|
*
|
|
2812
3367
|
* @sample highcharts/members/renderer-rect-on-chart/
|
|
2813
3368
|
* Draw a rectangle in a chart
|
|
2814
3369
|
* @sample highcharts/members/renderer-rect/
|
|
2815
3370
|
* Draw a rectangle independent from a chart
|
|
3371
|
+
*
|
|
3372
|
+
* @function Highcharts.SVGRenderer#rect
|
|
3373
|
+
*
|
|
3374
|
+
* @param {Highcharts.SVGAttributes} [attributes]
|
|
3375
|
+
* General SVG attributes for the rectangle.
|
|
3376
|
+
*
|
|
3377
|
+
* @return {Highcharts.SVGElement}
|
|
3378
|
+
* The generated wrapper element.
|
|
2816
3379
|
*/
|
|
2817
3380
|
rect: function (x, y, width, height, r, strokeWidth) {
|
|
2818
3381
|
|
|
@@ -2845,12 +3408,20 @@ extend(SVGRenderer.prototype, /** @lends Highcharts.SVGRenderer.prototype */ {
|
|
|
2845
3408
|
/**
|
|
2846
3409
|
* Resize the {@link SVGRenderer#box} and re-align all aligned child
|
|
2847
3410
|
* elements.
|
|
2848
|
-
*
|
|
2849
|
-
*
|
|
2850
|
-
*
|
|
2851
|
-
*
|
|
2852
|
-
* @
|
|
2853
|
-
*
|
|
3411
|
+
*
|
|
3412
|
+
* @sample highcharts/members/renderer-g/
|
|
3413
|
+
* Show and hide grouped objects
|
|
3414
|
+
*
|
|
3415
|
+
* @function Highcharts.SVGRenderer#setSize
|
|
3416
|
+
*
|
|
3417
|
+
* @param {number} width
|
|
3418
|
+
* The new pixel width.
|
|
3419
|
+
*
|
|
3420
|
+
* @param {number} height
|
|
3421
|
+
* The new pixel height.
|
|
3422
|
+
*
|
|
3423
|
+
* @param {boolean|Highcharts.AnimationOptionsObject} [animate=true]
|
|
3424
|
+
* Whether and how to animate.
|
|
2854
3425
|
*/
|
|
2855
3426
|
setSize: function (width, height, animate) {
|
|
2856
3427
|
var renderer = this,
|
|
@@ -2881,15 +3452,16 @@ extend(SVGRenderer.prototype, /** @lends Highcharts.SVGRenderer.prototype */ {
|
|
|
2881
3452
|
/**
|
|
2882
3453
|
* Create and return an svg group element. Child
|
|
2883
3454
|
* {@link Highcharts.SVGElement} objects are added to the group by using the
|
|
2884
|
-
* group as the first parameter
|
|
2885
|
-
* in {@link Highcharts.SVGElement#add|add()}.
|
|
3455
|
+
* group as the first parameter in {@link Highcharts.SVGElement#add|add()}.
|
|
2886
3456
|
*
|
|
2887
|
-
* @
|
|
2888
|
-
* `highcharts-{name}`. This can be used for styling and scripting.
|
|
2889
|
-
* @returns {SVGElement} The generated wrapper element.
|
|
3457
|
+
* @function Highcharts.SVGRenderer#g
|
|
2890
3458
|
*
|
|
2891
|
-
* @
|
|
2892
|
-
*
|
|
3459
|
+
* @param {string} [name]
|
|
3460
|
+
* The group will be given a class name of `highcharts-{name}`. This
|
|
3461
|
+
* can be used for styling and scripting.
|
|
3462
|
+
*
|
|
3463
|
+
* @return {Highcharts.SVGElement}
|
|
3464
|
+
* The generated wrapper element.
|
|
2893
3465
|
*/
|
|
2894
3466
|
g: function (name) {
|
|
2895
3467
|
var elem = this.createElement('g');
|
|
@@ -2898,20 +3470,35 @@ extend(SVGRenderer.prototype, /** @lends Highcharts.SVGRenderer.prototype */ {
|
|
|
2898
3470
|
|
|
2899
3471
|
/**
|
|
2900
3472
|
* Display an image.
|
|
2901
|
-
* @param {string} src The image source.
|
|
2902
|
-
* @param {number} [x] The X position.
|
|
2903
|
-
* @param {number} [y] The Y position.
|
|
2904
|
-
* @param {number} [width] The image width. If omitted, it defaults to the
|
|
2905
|
-
* image file width.
|
|
2906
|
-
* @param {number} [height] The image height. If omitted it defaults to the
|
|
2907
|
-
* image file height.
|
|
2908
|
-
* @param {function} [onload] Event handler for image load.
|
|
2909
|
-
* @returns {SVGElement} The generated wrapper element.
|
|
2910
3473
|
*
|
|
2911
3474
|
* @sample highcharts/members/renderer-image-on-chart/
|
|
2912
3475
|
* Add an image in a chart
|
|
2913
3476
|
* @sample highcharts/members/renderer-image/
|
|
2914
3477
|
* Add an image independent of a chart
|
|
3478
|
+
*
|
|
3479
|
+
* @function Highcharts.SVGRenderer#image
|
|
3480
|
+
*
|
|
3481
|
+
* @param {string} src
|
|
3482
|
+
* The image source.
|
|
3483
|
+
*
|
|
3484
|
+
* @param {number} [x]
|
|
3485
|
+
* The X position.
|
|
3486
|
+
*
|
|
3487
|
+
* @param {number} [y]
|
|
3488
|
+
* The Y position.
|
|
3489
|
+
*
|
|
3490
|
+
* @param {number} [width]
|
|
3491
|
+
* The image width. If omitted, it defaults to the image file width.
|
|
3492
|
+
*
|
|
3493
|
+
* @param {number} [height]
|
|
3494
|
+
* The image height. If omitted it defaults to the image file
|
|
3495
|
+
* height.
|
|
3496
|
+
*
|
|
3497
|
+
* @param {Function} [onload]
|
|
3498
|
+
* Event handler for image load.
|
|
3499
|
+
*
|
|
3500
|
+
* @return {Highcharts.SVGElement}
|
|
3501
|
+
* The generated wrapper element.
|
|
2915
3502
|
*/
|
|
2916
3503
|
image: function (src, x, y, width, height, onload) {
|
|
2917
3504
|
var attribs = {
|
|
@@ -2977,23 +3564,27 @@ extend(SVGRenderer.prototype, /** @lends Highcharts.SVGRenderer.prototype */ {
|
|
|
2977
3564
|
* It is used in Highcharts for point makers, which cake a `symbol` option,
|
|
2978
3565
|
* and label and button backgrounds like in the tooltip and stock flags.
|
|
2979
3566
|
*
|
|
2980
|
-
* @
|
|
2981
|
-
*
|
|
2982
|
-
* @param {
|
|
2983
|
-
*
|
|
2984
|
-
*
|
|
2985
|
-
* @param {
|
|
2986
|
-
*
|
|
2987
|
-
*
|
|
2988
|
-
*
|
|
2989
|
-
*
|
|
2990
|
-
*
|
|
2991
|
-
* @param {number}
|
|
2992
|
-
*
|
|
2993
|
-
*
|
|
2994
|
-
* @param {number}
|
|
2995
|
-
*
|
|
2996
|
-
*
|
|
3567
|
+
* @function Highcharts.SVGRenderer#symbol
|
|
3568
|
+
*
|
|
3569
|
+
* @param {symbol} symbol
|
|
3570
|
+
* The symbol name.
|
|
3571
|
+
*
|
|
3572
|
+
* @param {number} x
|
|
3573
|
+
* The X coordinate for the top left position.
|
|
3574
|
+
*
|
|
3575
|
+
* @param {number} y
|
|
3576
|
+
* The Y coordinate for the top left position.
|
|
3577
|
+
*
|
|
3578
|
+
* @param {number} width
|
|
3579
|
+
* The pixel width.
|
|
3580
|
+
*
|
|
3581
|
+
* @param {number} height
|
|
3582
|
+
* The pixel height.
|
|
3583
|
+
*
|
|
3584
|
+
* @param {Highcharts.SymbolOptionsObject} [options]
|
|
3585
|
+
* Additional options, depending on the actual symbol drawn.
|
|
3586
|
+
*
|
|
3587
|
+
* @return {Highcharts.SVGElement}
|
|
2997
3588
|
*/
|
|
2998
3589
|
symbol: function (symbol, x, y, width, height, options) {
|
|
2999
3590
|
|
|
@@ -3156,16 +3747,11 @@ extend(SVGRenderer.prototype, /** @lends Highcharts.SVGRenderer.prototype */ {
|
|
|
3156
3747
|
return obj;
|
|
3157
3748
|
},
|
|
3158
3749
|
|
|
3159
|
-
/**
|
|
3160
|
-
* @typedef {string} Symbol
|
|
3161
|
-
*
|
|
3162
|
-
* Can be one of `arc`, `callout`, `circle`, `diamond`, `square`,
|
|
3163
|
-
* `triangle`, `triangle-down`. Symbols are used internally for point
|
|
3164
|
-
* markers, button and label borders and backgrounds, or custom shapes.
|
|
3165
|
-
* Extendable by adding to {@link SVGRenderer#symbols}.
|
|
3166
|
-
*/
|
|
3167
3750
|
/**
|
|
3168
3751
|
* An extendable collection of functions for defining symbol paths.
|
|
3752
|
+
*
|
|
3753
|
+
* @name Highcharts.SVGRenderer#symbols
|
|
3754
|
+
* @type {Highcharts.SymbolDictionary}
|
|
3169
3755
|
*/
|
|
3170
3756
|
symbols: {
|
|
3171
3757
|
'circle': function (x, y, w, h) {
|
|
@@ -3272,7 +3858,7 @@ extend(SVGRenderer.prototype, /** @lends Highcharts.SVGRenderer.prototype */ {
|
|
|
3272
3858
|
* Callout shape used for default tooltips, also used for rounded
|
|
3273
3859
|
* rectangles in VML
|
|
3274
3860
|
*/
|
|
3275
|
-
callout: function (x, y, w, h, options) {
|
|
3861
|
+
'callout': function (x, y, w, h, options) {
|
|
3276
3862
|
var arrowLength = 6,
|
|
3277
3863
|
halfDistance = 6,
|
|
3278
3864
|
r = Math.min((options && options.r) || 0, w, h),
|
|
@@ -3375,10 +3961,9 @@ extend(SVGRenderer.prototype, /** @lends Highcharts.SVGRenderer.prototype */ {
|
|
|
3375
3961
|
},
|
|
3376
3962
|
|
|
3377
3963
|
/**
|
|
3378
|
-
*
|
|
3379
|
-
* to
|
|
3380
|
-
*
|
|
3381
|
-
* SVGElement#clip} function.
|
|
3964
|
+
* Define a clipping rectangle. The clipping rectangle is later applied
|
|
3965
|
+
* to {@link SVGElement} objects through the {@link SVGElement#clip}
|
|
3966
|
+
* function.
|
|
3382
3967
|
*
|
|
3383
3968
|
* @example
|
|
3384
3969
|
* var circle = renderer.circle(100, 100, 100)
|
|
@@ -3388,27 +3973,21 @@ extend(SVGRenderer.prototype, /** @lends Highcharts.SVGRenderer.prototype */ {
|
|
|
3388
3973
|
*
|
|
3389
3974
|
* // Leave only the lower right quarter visible
|
|
3390
3975
|
* circle.clip(clipRect);
|
|
3391
|
-
*/
|
|
3392
|
-
/**
|
|
3393
|
-
* Define a clipping rectangle. The clipping rectangle is later applied
|
|
3394
|
-
* to {@link SVGElement} objects through the {@link SVGElement#clip}
|
|
3395
|
-
* function.
|
|
3396
3976
|
*
|
|
3397
|
-
* @
|
|
3977
|
+
* @function Highcharts.SVGRenderer#clipRect
|
|
3978
|
+
*
|
|
3979
|
+
* @param {string} id
|
|
3980
|
+
*
|
|
3398
3981
|
* @param {number} x
|
|
3982
|
+
*
|
|
3399
3983
|
* @param {number} y
|
|
3984
|
+
*
|
|
3400
3985
|
* @param {number} width
|
|
3401
|
-
* @param {number} height
|
|
3402
|
-
* @returns {ClipRect} A clipping rectangle.
|
|
3403
3986
|
*
|
|
3404
|
-
* @
|
|
3405
|
-
* var circle = renderer.circle(100, 100, 100)
|
|
3406
|
-
* .attr({ fill: 'red' })
|
|
3407
|
-
* .add();
|
|
3408
|
-
* var clipRect = renderer.clipRect(100, 100, 100, 100);
|
|
3987
|
+
* @param {number} height
|
|
3409
3988
|
*
|
|
3410
|
-
*
|
|
3411
|
-
*
|
|
3989
|
+
* @return {Highcharts.ClipRectElement}
|
|
3990
|
+
* A clipping rectangle.
|
|
3412
3991
|
*/
|
|
3413
3992
|
clipRect: function (x, y, width, height) {
|
|
3414
3993
|
var wrapper,
|
|
@@ -3435,16 +4014,6 @@ extend(SVGRenderer.prototype, /** @lends Highcharts.SVGRenderer.prototype */ {
|
|
|
3435
4014
|
* and some basic text styling of these. For more advanced features like
|
|
3436
4015
|
* border and background, use {@link Highcharts.SVGRenderer#label} instead.
|
|
3437
4016
|
* To update the text after render, run `text.attr({ text: 'New text' })`.
|
|
3438
|
-
* @param {String} str
|
|
3439
|
-
* The text of (subset) HTML to draw.
|
|
3440
|
-
* @param {number} x
|
|
3441
|
-
* The x position of the text's lower left corner.
|
|
3442
|
-
* @param {number} y
|
|
3443
|
-
* The y position of the text's lower left corner.
|
|
3444
|
-
* @param {Boolean} [useHTML=false]
|
|
3445
|
-
* Use HTML to render the text.
|
|
3446
|
-
*
|
|
3447
|
-
* @return {SVGElement} The text object.
|
|
3448
4017
|
*
|
|
3449
4018
|
* @sample highcharts/members/renderer-text-on-chart/
|
|
3450
4019
|
* Annotate the chart freely
|
|
@@ -3452,6 +4021,23 @@ extend(SVGRenderer.prototype, /** @lends Highcharts.SVGRenderer.prototype */ {
|
|
|
3452
4021
|
* Annotate with a border and in response to the data
|
|
3453
4022
|
* @sample highcharts/members/renderer-text/
|
|
3454
4023
|
* Formatted text
|
|
4024
|
+
*
|
|
4025
|
+
* @function Highcharts.SVGRenderer#text
|
|
4026
|
+
*
|
|
4027
|
+
* @param {string} str
|
|
4028
|
+
* The text of (subset) HTML to draw.
|
|
4029
|
+
*
|
|
4030
|
+
* @param {number} x
|
|
4031
|
+
* The x position of the text's lower left corner.
|
|
4032
|
+
*
|
|
4033
|
+
* @param {number} y
|
|
4034
|
+
* The y position of the text's lower left corner.
|
|
4035
|
+
*
|
|
4036
|
+
* @param {boolean} [useHTML=false]
|
|
4037
|
+
* Use HTML to render the text.
|
|
4038
|
+
*
|
|
4039
|
+
* @return {Highcharts.SVGElement}
|
|
4040
|
+
* The text object.
|
|
3455
4041
|
*/
|
|
3456
4042
|
text: function (str, x, y, useHTML) {
|
|
3457
4043
|
|
|
@@ -3468,7 +4054,7 @@ extend(SVGRenderer.prototype, /** @lends Highcharts.SVGRenderer.prototype */ {
|
|
|
3468
4054
|
if (y) {
|
|
3469
4055
|
attribs.y = Math.round(y);
|
|
3470
4056
|
}
|
|
3471
|
-
if (str
|
|
4057
|
+
if (defined(str)) {
|
|
3472
4058
|
attribs.text = str;
|
|
3473
4059
|
}
|
|
3474
4060
|
|
|
@@ -3500,12 +4086,17 @@ extend(SVGRenderer.prototype, /** @lends Highcharts.SVGRenderer.prototype */ {
|
|
|
3500
4086
|
* Utility to return the baseline offset and total line height from the font
|
|
3501
4087
|
* size.
|
|
3502
4088
|
*
|
|
3503
|
-
* @
|
|
3504
|
-
*
|
|
3505
|
-
* @param {
|
|
3506
|
-
*
|
|
3507
|
-
*
|
|
3508
|
-
*
|
|
4089
|
+
* @function Highcharts.SVGRenderer#fontMetrics
|
|
4090
|
+
*
|
|
4091
|
+
* @param {string} [fontSize]
|
|
4092
|
+
* The current font size to inspect. If not given, the font size
|
|
4093
|
+
* will be found from the DOM element.
|
|
4094
|
+
*
|
|
4095
|
+
* @param {Highcharts.SVGElement|Highcharts.SVGDOMElement} [elem]
|
|
4096
|
+
* The element to inspect for a current font size.
|
|
4097
|
+
*
|
|
4098
|
+
* @return {Highcharts.FontMetricsObject}
|
|
4099
|
+
* The font metrics.
|
|
3509
4100
|
*/
|
|
3510
4101
|
fontMetrics: function (fontSize, elem) {
|
|
3511
4102
|
var lineHeight,
|
|
@@ -3531,7 +4122,7 @@ extend(SVGRenderer.prototype, /** @lends Highcharts.SVGRenderer.prototype */ {
|
|
|
3531
4122
|
|
|
3532
4123
|
// Empirical values found by comparing font size and bounding box
|
|
3533
4124
|
// height. Applies to the default font family.
|
|
3534
|
-
//
|
|
4125
|
+
// https://jsfiddle.net/highcharts/7xvn7/
|
|
3535
4126
|
lineHeight = fontSize < 24 ? fontSize + 3 : Math.round(fontSize * 1.2);
|
|
3536
4127
|
baseline = Math.round(lineHeight * 0.8);
|
|
3537
4128
|
|
|
@@ -3546,6 +4137,13 @@ extend(SVGRenderer.prototype, /** @lends Highcharts.SVGRenderer.prototype */ {
|
|
|
3546
4137
|
* Correct X and Y positioning of a label for rotation (#1764).
|
|
3547
4138
|
*
|
|
3548
4139
|
* @private
|
|
4140
|
+
* @function Highcharts.SVGRenderer#rotCorr
|
|
4141
|
+
*
|
|
4142
|
+
* @param {number} baseline
|
|
4143
|
+
*
|
|
4144
|
+
* @param {number} rotation
|
|
4145
|
+
*
|
|
4146
|
+
* @param {boolean} alterY
|
|
3549
4147
|
*/
|
|
3550
4148
|
rotCorr: function (baseline, rotation, alterY) {
|
|
3551
4149
|
var y = baseline;
|
|
@@ -3566,35 +4164,52 @@ extend(SVGRenderer.prototype, /** @lends Highcharts.SVGRenderer.prototype */ {
|
|
|
3566
4164
|
* using the {@link Highcharts.SVGElement#attr|attr} method. To update the
|
|
3567
4165
|
* text after render, run `label.attr({ text: 'New text' })`.
|
|
3568
4166
|
*
|
|
3569
|
-
* @param {string} str
|
|
3570
|
-
* The initial text string or (subset) HTML to render.
|
|
3571
|
-
* @param {number} x
|
|
3572
|
-
* The x position of the label's left side.
|
|
3573
|
-
* @param {number} y
|
|
3574
|
-
* The y position of the label's top side or baseline, depending on
|
|
3575
|
-
* the `baseline` parameter.
|
|
3576
|
-
* @param {String} shape
|
|
3577
|
-
* The shape of the label's border/background, if any. Defaults to
|
|
3578
|
-
* `rect`. Other possible values are `callout` or other shapes
|
|
3579
|
-
* defined in {@link Highcharts.SVGRenderer#symbols}.
|
|
3580
|
-
* @param {number} anchorX
|
|
3581
|
-
* In case the `shape` has a pointer, like a flag, this is the
|
|
3582
|
-
* coordinates it should be pinned to.
|
|
3583
|
-
* @param {number} anchorY
|
|
3584
|
-
* In case the `shape` has a pointer, like a flag, this is the
|
|
3585
|
-
* coordinates it should be pinned to.
|
|
3586
|
-
* @param {Boolean} baseline
|
|
3587
|
-
* Whether to position the label relative to the text baseline,
|
|
3588
|
-
* like {@link Highcharts.SVGRenderer#text|renderer.text}, or to the
|
|
3589
|
-
* upper border of the rectangle.
|
|
3590
|
-
* @param {String} className
|
|
3591
|
-
* Class name for the group.
|
|
3592
|
-
*
|
|
3593
|
-
* @return {SVGElement}
|
|
3594
|
-
* The generated label.
|
|
3595
|
-
*
|
|
3596
4167
|
* @sample highcharts/members/renderer-label-on-chart/
|
|
3597
4168
|
* A label on the chart
|
|
4169
|
+
*
|
|
4170
|
+
* @function Highcharts.SVGRenderer#label
|
|
4171
|
+
*
|
|
4172
|
+
* @param {string} str
|
|
4173
|
+
* The initial text string or (subset) HTML to render.
|
|
4174
|
+
*
|
|
4175
|
+
* @param {number} x
|
|
4176
|
+
* The x position of the label's left side.
|
|
4177
|
+
*
|
|
4178
|
+
* @param {number} y
|
|
4179
|
+
* The y position of the label's top side or baseline, depending on
|
|
4180
|
+
* the `baseline` parameter.
|
|
4181
|
+
*
|
|
4182
|
+
* @param {string} [shape='rect']
|
|
4183
|
+
* The shape of the label's border/background, if any. Defaults to
|
|
4184
|
+
* `rect`. Other possible values are `callout` or other shapes
|
|
4185
|
+
* defined in {@link Highcharts.SVGRenderer#symbols}.
|
|
4186
|
+
*
|
|
4187
|
+
* @param {string} [shape='rect']
|
|
4188
|
+
* The shape of the label's border/background, if any. Defaults to
|
|
4189
|
+
* `rect`. Other possible values are `callout` or other shapes
|
|
4190
|
+
* defined in {@link Highcharts.SVGRenderer#symbols}.
|
|
4191
|
+
*
|
|
4192
|
+
* @param {number} [anchorX]
|
|
4193
|
+
* In case the `shape` has a pointer, like a flag, this is the
|
|
4194
|
+
* coordinates it should be pinned to.
|
|
4195
|
+
*
|
|
4196
|
+
* @param {number} [anchorY]
|
|
4197
|
+
* In case the `shape` has a pointer, like a flag, this is the
|
|
4198
|
+
* coordinates it should be pinned to.
|
|
4199
|
+
*
|
|
4200
|
+
* @param {boolean} [useHTML=false]
|
|
4201
|
+
* Wether to use HTML to render the label.
|
|
4202
|
+
*
|
|
4203
|
+
* @param {boolean} [baseline=false]
|
|
4204
|
+
* Whether to position the label relative to the text baseline,
|
|
4205
|
+
* like {@link Highcharts.SVGRenderer#text|renderer.text}, or to the
|
|
4206
|
+
* upper border of the rectangle.
|
|
4207
|
+
*
|
|
4208
|
+
* @param {string} [className]
|
|
4209
|
+
* Class name for the group.
|
|
4210
|
+
*
|
|
4211
|
+
* @return {Highcharts.SVGElement}
|
|
4212
|
+
* The generated label.
|
|
3598
4213
|
*/
|
|
3599
4214
|
label: function (
|
|
3600
4215
|
str,
|
|
@@ -3645,7 +4260,7 @@ extend(SVGRenderer.prototype, /** @lends Highcharts.SVGRenderer.prototype */ {
|
|
|
3645
4260
|
};
|
|
3646
4261
|
|
|
3647
4262
|
|
|
3648
|
-
|
|
4263
|
+
/*
|
|
3649
4264
|
* This function runs after the label is added to the DOM (when the
|
|
3650
4265
|
* bounding box is available), and after the text of the label is
|
|
3651
4266
|
* updated to detect the new bounding box and reflect it in the border
|
|
@@ -3703,9 +4318,9 @@ extend(SVGRenderer.prototype, /** @lends Highcharts.SVGRenderer.prototype */ {
|
|
|
3703
4318
|
}
|
|
3704
4319
|
};
|
|
3705
4320
|
|
|
3706
|
-
|
|
4321
|
+
/*
|
|
3707
4322
|
* This function runs after setting text or padding, but only if padding
|
|
3708
|
-
* is changed
|
|
4323
|
+
* is changed.
|
|
3709
4324
|
*/
|
|
3710
4325
|
updateTextPadding = function () {
|
|
3711
4326
|
var textX = paddingLeft + padding,
|
|
@@ -3743,10 +4358,8 @@ extend(SVGRenderer.prototype, /** @lends Highcharts.SVGRenderer.prototype */ {
|
|
|
3743
4358
|
text.y = textY;
|
|
3744
4359
|
};
|
|
3745
4360
|
|
|
3746
|
-
|
|
4361
|
+
/*
|
|
3747
4362
|
* Set a box attribute, or defer it if the box is not yet created
|
|
3748
|
-
* @param {Object} key
|
|
3749
|
-
* @param {Object} value
|
|
3750
4363
|
*/
|
|
3751
4364
|
boxAttr = function (key, value) {
|
|
3752
4365
|
if (box) {
|
|
@@ -3756,7 +4369,7 @@ extend(SVGRenderer.prototype, /** @lends Highcharts.SVGRenderer.prototype */ {
|
|
|
3756
4369
|
}
|
|
3757
4370
|
};
|
|
3758
4371
|
|
|
3759
|
-
|
|
4372
|
+
/*
|
|
3760
4373
|
* After the text element is added, get the desired size of the border
|
|
3761
4374
|
* box and add it before the text in the DOM.
|
|
3762
4375
|
*/
|
|
@@ -3869,10 +4482,9 @@ extend(SVGRenderer.prototype, /** @lends Highcharts.SVGRenderer.prototype */ {
|
|
|
3869
4482
|
// Redirect certain methods to either the box or the text
|
|
3870
4483
|
var baseCss = wrapper.css;
|
|
3871
4484
|
return extend(wrapper, {
|
|
3872
|
-
|
|
4485
|
+
/*
|
|
3873
4486
|
* Pick up some properties and apply them to the text instead of the
|
|
3874
4487
|
* wrapper.
|
|
3875
|
-
* @ignore
|
|
3876
4488
|
*/
|
|
3877
4489
|
css: function (styles) {
|
|
3878
4490
|
if (styles) {
|
|
@@ -3894,9 +4506,8 @@ extend(SVGRenderer.prototype, /** @lends Highcharts.SVGRenderer.prototype */ {
|
|
|
3894
4506
|
}
|
|
3895
4507
|
return baseCss.call(wrapper, styles);
|
|
3896
4508
|
},
|
|
3897
|
-
|
|
4509
|
+
/*
|
|
3898
4510
|
* Return the bounding box of the box, not the group.
|
|
3899
|
-
* @ignore
|
|
3900
4511
|
*/
|
|
3901
4512
|
getBBox: function () {
|
|
3902
4513
|
return {
|
|
@@ -3907,9 +4518,8 @@ extend(SVGRenderer.prototype, /** @lends Highcharts.SVGRenderer.prototype */ {
|
|
|
3907
4518
|
};
|
|
3908
4519
|
},
|
|
3909
4520
|
|
|
3910
|
-
|
|
4521
|
+
/*
|
|
3911
4522
|
* Destroy and release memory.
|
|
3912
|
-
* @ignore
|
|
3913
4523
|
*/
|
|
3914
4524
|
destroy: function () {
|
|
3915
4525
|
|