highcharts 7.1.1 → 7.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bower.json +1 -1
- package/css/annotations/popup.css +3 -3
- package/css/annotations/popup.scss +1 -1
- package/css/stocktools/gui.css +5 -5
- package/css/stocktools/gui.scss +1 -1
- package/es-modules/annotations/ControlPoint.js +1 -1
- package/es-modules/annotations/MockPoint.js +45 -12
- package/es-modules/annotations/annotations.src.js +203 -166
- package/es-modules/annotations/controllable/ControllableCircle.js +2 -10
- package/es-modules/annotations/controllable/ControllableImage.js +2 -10
- package/es-modules/annotations/controllable/ControllableLabel.js +54 -9
- package/es-modules/annotations/controllable/ControllableRect.js +2 -10
- package/es-modules/annotations/controllable/controllableMixin.js +32 -4
- package/es-modules/annotations/controllable/markerMixin.js +1 -0
- package/es-modules/annotations/eventEmitterMixin.js +1 -0
- package/es-modules/annotations/navigationBindings.js +15 -11
- package/es-modules/annotations/popup.js +59 -81
- package/es-modules/annotations/types/CrookedLine.js +19 -7
- package/es-modules/annotations/types/ElliottWave.js +7 -6
- package/es-modules/annotations/types/Fibonacci.js +14 -14
- package/es-modules/annotations/types/InfinityLine.js +4 -4
- package/es-modules/annotations/types/Measure.js +41 -41
- package/es-modules/annotations/types/Pitchfork.js +5 -4
- package/es-modules/annotations/types/VerticalLine.js +6 -5
- package/es-modules/error-messages.js +6 -1
- package/es-modules/indicators/indicators.src.js +5 -3
- package/es-modules/mixins/nodes.js +16 -8
- package/es-modules/modules/accessibility/AccessibilityComponent.js +4 -4
- package/es-modules/modules/accessibility/KeyboardNavigation.js +17 -4
- package/es-modules/modules/accessibility/components/RangeSelectorComponent.js +3 -2
- package/es-modules/modules/accessibility/components/SeriesComponent.js +110 -2
- package/es-modules/modules/accessibility/components/ZoomComponent.js +1 -1
- package/es-modules/modules/accessibility/options.js +2 -1
- package/es-modules/modules/bellcurve.src.js +27 -29
- package/es-modules/modules/boost/boost-init.js +14 -0
- package/es-modules/modules/boost/boost-overrides.js +13 -3
- package/es-modules/modules/boost/wgl-renderer.js +30 -15
- package/es-modules/modules/boost/wgl-shader.js +33 -16
- package/es-modules/modules/boost/wgl-vbuffer.js +8 -4
- package/es-modules/modules/broken-axis.src.js +1 -1
- package/es-modules/modules/bullet.src.js +68 -68
- package/es-modules/modules/cylinder.src.js +3 -1
- package/es-modules/modules/data.src.js +9 -5
- package/es-modules/modules/draggable-points.src.js +1 -1
- package/es-modules/modules/drilldown.src.js +1 -1
- package/es-modules/modules/export-data.src.js +7 -8
- package/es-modules/modules/exporting.src.js +9 -1
- package/es-modules/modules/full-screen.src.js +1 -1
- package/es-modules/modules/funnel3d.src.js +10 -3
- package/es-modules/modules/histogram.src.js +162 -164
- package/es-modules/modules/item-series.src.js +10 -10
- package/es-modules/modules/networkgraph/layouts.js +16 -12
- package/es-modules/modules/networkgraph/networkgraph.src.js +147 -51
- package/es-modules/modules/offline-exporting.src.js +15 -2
- package/es-modules/modules/oldie-polyfills.src.js +1 -1
- package/es-modules/modules/organization.src.js +65 -20
- package/es-modules/modules/pareto.src.js +52 -51
- package/es-modules/modules/pattern-fill.src.js +1 -1
- package/es-modules/modules/price-indicator.src.js +1 -1
- package/es-modules/modules/pyramid3d.src.js +1 -1
- package/es-modules/modules/sankey.src.js +22 -10
- package/es-modules/modules/series-label.src.js +16 -8
- package/es-modules/modules/solid-gauge.src.js +128 -79
- package/es-modules/modules/static-scale.src.js +8 -1
- package/es-modules/modules/stock-tools-gui.js +1 -1
- package/es-modules/modules/streamgraph.src.js +11 -11
- package/es-modules/modules/sunburst.src.js +23 -2
- package/es-modules/modules/tilemap.src.js +58 -57
- package/es-modules/modules/timeline.src.js +17 -12
- package/es-modules/modules/treemap.src.js +6 -6
- package/es-modules/modules/variwide.src.js +39 -39
- package/es-modules/modules/vector.src.js +108 -107
- package/es-modules/modules/venn.src.js +4 -2
- package/es-modules/modules/windbarb.src.js +43 -43
- package/es-modules/modules/wordcloud.src.js +1 -0
- package/es-modules/modules/xrange.src.js +112 -104
- package/es-modules/parts/AreaSeries.js +4 -1
- package/es-modules/parts/Axis.js +809 -1870
- package/es-modules/parts/Chart.js +254 -743
- package/es-modules/parts/Color.js +160 -113
- package/es-modules/parts/ColumnSeries.js +9 -3
- package/es-modules/parts/DataLabels.js +31 -2
- package/es-modules/parts/Dynamics.js +73 -26
- package/es-modules/parts/FlagsSeries.js +6 -4
- package/es-modules/parts/Globals.js +20 -36
- package/es-modules/parts/Html.js +116 -235
- package/es-modules/parts/Interaction.js +17 -7
- package/es-modules/parts/Legend.js +277 -632
- package/es-modules/parts/MSPointer.js +62 -106
- package/es-modules/parts/Options.js +128 -367
- package/es-modules/parts/OrdinalAxis.js +12 -0
- package/es-modules/parts/PieSeries.js +61 -44
- package/es-modules/parts/PlotLineOrBand.js +38 -3
- package/es-modules/parts/Point.js +117 -227
- package/es-modules/parts/Pointer.js +273 -558
- package/es-modules/parts/RangeSelector.js +5 -3
- package/es-modules/parts/Responsive.js +8 -4
- package/es-modules/parts/ScrollablePlotArea.js +215 -81
- package/es-modules/parts/Scrollbar.js +38 -23
- package/es-modules/parts/Series.js +151 -47
- package/es-modules/parts/Stacking.js +8 -3
- package/es-modules/parts/StockChart.js +42 -29
- package/es-modules/parts/SvgRenderer.js +1080 -2100
- package/es-modules/parts/Tick.js +11 -4
- package/es-modules/parts/Time.js +179 -363
- package/es-modules/parts/Tooltip.js +23 -12
- package/es-modules/parts/TouchPointer.js +69 -187
- package/es-modules/parts/Utilities.js +593 -846
- package/es-modules/parts-3d/Axis.js +2 -2
- package/es-modules/parts-3d/Column.js +18 -8
- package/es-modules/parts-gantt/GanttSeries.js +17 -21
- package/es-modules/parts-gantt/GridAxis.js +183 -101
- package/es-modules/parts-gantt/PathfinderAlgorithms.js +2 -2
- package/es-modules/parts-gantt/TreeGrid.js +53 -36
- package/es-modules/parts-map/ColorAxis.js +35 -14
- package/es-modules/parts-map/MapBubbleSeries.js +2 -1
- package/es-modules/parts-map/MapSeries.js +29 -18
- package/es-modules/parts-more/AreaRangeSeries.js +13 -12
- package/es-modules/parts-more/ColumnRangeSeries.js +8 -2
- package/es-modules/parts-more/GaugeSeries.js +9 -9
- package/es-modules/parts-more/PackedBubbleSeries.js +152 -115
- package/es-modules/parts-more/RadialAxis.js +102 -8
- package/es-modules/parts-more/WaterfallSeries.js +148 -35
- package/highcharts-3d.js +68 -67
- package/highcharts-3d.js.map +1 -1
- package/highcharts-3d.src.js +21 -11
- package/highcharts-gantt.d.ts +5 -3
- package/highcharts-gantt.js +618 -610
- package/highcharts-gantt.js.map +1 -1
- package/highcharts-gantt.src.d.ts +5 -3
- package/highcharts-gantt.src.js +5185 -8892
- package/highcharts-more.js +144 -140
- package/highcharts-more.js.map +1 -1
- package/highcharts-more.src.js +449 -194
- package/highcharts.d.ts +3943 -5236
- package/highcharts.js +454 -449
- package/highcharts.js.map +1 -1
- package/highcharts.src.d.ts +3943 -5236
- package/highcharts.src.js +4767 -8601
- package/highmaps.d.ts +5 -3
- package/highmaps.js +498 -494
- package/highmaps.js.map +1 -1
- package/highmaps.src.d.ts +5 -3
- package/highmaps.src.js +4547 -8507
- package/highstock.d.ts +5 -3
- package/highstock.js +597 -590
- package/highstock.js.map +1 -1
- package/highstock.src.d.ts +5 -3
- package/highstock.src.js +4871 -8661
- package/indicators/acceleration-bands.js +1 -1
- package/indicators/acceleration-bands.src.js +1 -1
- package/indicators/accumulation-distribution.js +1 -1
- package/indicators/accumulation-distribution.src.js +1 -1
- package/indicators/ao.js +1 -1
- package/indicators/ao.src.js +1 -1
- package/indicators/apo.js +1 -1
- package/indicators/apo.src.js +1 -1
- package/indicators/aroon-oscillator.js +1 -1
- package/indicators/aroon-oscillator.src.js +1 -1
- package/indicators/aroon.js +1 -1
- package/indicators/aroon.src.js +1 -1
- package/indicators/atr.js +1 -1
- package/indicators/atr.src.js +1 -1
- package/indicators/bollinger-bands.js +1 -1
- package/indicators/bollinger-bands.src.js +1 -1
- package/indicators/cci.js +1 -1
- package/indicators/cci.src.js +1 -1
- package/indicators/chaikin.js +1 -1
- package/indicators/chaikin.src.js +1 -1
- package/indicators/cmf.js +1 -1
- package/indicators/cmf.src.js +1 -1
- package/indicators/dema.js +1 -1
- package/indicators/dema.src.js +1 -1
- package/indicators/dpo.js +1 -1
- package/indicators/dpo.src.js +1 -1
- package/indicators/ema.js +1 -1
- package/indicators/ema.src.js +1 -1
- package/indicators/ichimoku-kinko-hyo.js +1 -1
- package/indicators/ichimoku-kinko-hyo.src.js +1 -1
- package/indicators/indicators-all.js +105 -105
- package/indicators/indicators-all.js.map +1 -1
- package/indicators/indicators-all.src.js +6 -4
- package/indicators/indicators.js +9 -9
- package/indicators/indicators.js.map +1 -1
- package/indicators/indicators.src.js +6 -4
- package/indicators/keltner-channels.js +1 -1
- package/indicators/keltner-channels.src.js +1 -1
- package/indicators/macd.js +1 -1
- package/indicators/macd.src.js +1 -1
- package/indicators/mfi.js +1 -1
- package/indicators/mfi.src.js +1 -1
- package/indicators/momentum.js +1 -1
- package/indicators/momentum.src.js +1 -1
- package/indicators/natr.js +1 -1
- package/indicators/natr.src.js +1 -1
- package/indicators/pivot-points.js +1 -1
- package/indicators/pivot-points.src.js +1 -1
- package/indicators/ppo.js +1 -1
- package/indicators/ppo.src.js +1 -1
- package/indicators/price-channel.js +1 -1
- package/indicators/price-channel.src.js +1 -1
- package/indicators/price-envelopes.js +1 -1
- package/indicators/price-envelopes.src.js +1 -1
- package/indicators/psar.js +1 -1
- package/indicators/psar.src.js +1 -1
- package/indicators/regressions.js +1 -1
- package/indicators/regressions.src.js +1 -1
- package/indicators/roc.js +1 -1
- package/indicators/roc.src.js +1 -1
- package/indicators/rsi.js +1 -1
- package/indicators/rsi.src.js +1 -1
- package/indicators/stochastic.js +1 -1
- package/indicators/stochastic.src.js +1 -1
- package/indicators/supertrend.js +1 -1
- package/indicators/supertrend.src.js +1 -1
- package/indicators/tema.js +1 -1
- package/indicators/tema.src.js +1 -1
- package/indicators/trix.js +1 -1
- package/indicators/trix.src.js +1 -1
- package/indicators/volume-by-price.js +1 -1
- package/indicators/volume-by-price.src.js +1 -1
- package/indicators/vwap.js +1 -1
- package/indicators/vwap.src.js +1 -1
- package/indicators/williams-r.js +1 -1
- package/indicators/williams-r.src.js +1 -1
- package/indicators/wma.js +1 -1
- package/indicators/wma.src.js +1 -1
- package/indicators/zigzag.js +1 -1
- package/indicators/zigzag.src.js +1 -1
- package/modules/accessibility.js +92 -89
- package/modules/accessibility.js.map +1 -1
- package/modules/accessibility.src.js +138 -15
- package/modules/annotations-advanced.js +128 -127
- package/modules/annotations-advanced.js.map +1 -1
- package/modules/annotations-advanced.src.js +514 -396
- package/modules/annotations.d.ts +36 -0
- package/modules/annotations.js +81 -81
- package/modules/annotations.js.map +1 -1
- package/modules/annotations.src.d.ts +36 -0
- package/modules/annotations.src.js +418 -315
- package/modules/arrow-symbols.js +1 -1
- package/modules/arrow-symbols.src.js +1 -1
- package/modules/boost-canvas.js +1 -1
- package/modules/boost-canvas.src.js +1 -1
- package/modules/boost.js +63 -63
- package/modules/boost.js.map +1 -1
- package/modules/boost.src.js +99 -39
- package/modules/broken-axis.js +1 -1
- package/modules/broken-axis.src.js +2 -2
- package/modules/bullet.js +1 -1
- package/modules/bullet.src.js +69 -69
- package/modules/current-date-indicator.js +1 -1
- package/modules/current-date-indicator.src.js +1 -1
- package/modules/cylinder.js +1 -1
- package/modules/cylinder.js.map +1 -1
- package/modules/cylinder.src.js +4 -2
- package/modules/data.js +4 -4
- package/modules/data.js.map +1 -1
- package/modules/data.src.js +10 -6
- package/modules/datagrouping.js +1 -1
- package/modules/datagrouping.src.js +1 -1
- package/modules/debugger.js +4 -4
- package/modules/debugger.js.map +1 -1
- package/modules/debugger.src.js +7 -2
- package/modules/dependency-wheel.js +1 -1
- package/modules/dependency-wheel.src.js +1 -1
- package/modules/dotplot.js +1 -1
- package/modules/dotplot.src.js +1 -1
- package/modules/drag-panes.js +1 -1
- package/modules/drag-panes.src.js +1 -1
- package/modules/draggable-points.js +1 -1
- package/modules/draggable-points.src.js +2 -2
- package/modules/drilldown.js +1 -1
- package/modules/drilldown.src.js +2 -2
- package/modules/export-data.js +2 -2
- package/modules/export-data.js.map +1 -1
- package/modules/export-data.src.js +8 -9
- package/modules/exporting.js +25 -25
- package/modules/exporting.js.map +1 -1
- package/modules/exporting.src.js +11 -3
- package/modules/full-screen.js +1 -1
- package/modules/full-screen.src.js +2 -2
- package/modules/funnel.js +1 -1
- package/modules/funnel.src.js +1 -1
- package/modules/funnel3d.js +2 -2
- package/modules/funnel3d.js.map +1 -1
- package/modules/funnel3d.src.js +11 -4
- package/modules/gantt.js +166 -164
- package/modules/gantt.js.map +1 -1
- package/modules/gantt.src.js +422 -295
- package/modules/grid-axis.js +18 -16
- package/modules/grid-axis.js.map +1 -1
- package/modules/grid-axis.src.js +184 -102
- package/modules/heatmap.js +22 -22
- package/modules/heatmap.js.map +1 -1
- package/modules/heatmap.src.js +36 -15
- package/modules/histogram-bellcurve.js +1 -1
- package/modules/histogram-bellcurve.js.map +1 -1
- package/modules/histogram-bellcurve.src.js +186 -183
- package/modules/item-series.js +1 -1
- package/modules/item-series.src.js +11 -11
- package/modules/map-parser.js +1 -1
- package/modules/map-parser.src.js +1 -1
- package/modules/map.js +83 -83
- package/modules/map.js.map +1 -1
- package/modules/map.src.js +67 -34
- package/modules/networkgraph.js +10 -9
- package/modules/networkgraph.js.map +1 -1
- package/modules/networkgraph.src.js +180 -72
- package/modules/no-data-to-display.js +1 -1
- package/modules/no-data-to-display.src.js +1 -1
- package/modules/offline-exporting.js +15 -15
- package/modules/offline-exporting.js.map +1 -1
- package/modules/offline-exporting.src.js +17 -4
- package/modules/oldie-polyfills.js +1 -1
- package/modules/oldie-polyfills.src.js +2 -2
- package/modules/oldie.js +2 -2
- package/modules/oldie.src.js +2 -2
- package/modules/organization.js +1 -1
- package/modules/organization.js.map +1 -1
- package/modules/organization.src.js +66 -21
- package/modules/overlapping-datalabels.js +1 -1
- package/modules/overlapping-datalabels.src.js +1 -1
- package/modules/parallel-coordinates.js +1 -1
- package/modules/parallel-coordinates.src.js +1 -1
- package/modules/pareto.js +1 -1
- package/modules/pareto.js.map +1 -1
- package/modules/pareto.src.js +53 -52
- package/modules/pathfinder.js +3 -3
- package/modules/pathfinder.js.map +1 -1
- package/modules/pathfinder.src.js +3 -3
- package/modules/pattern-fill.js +1 -1
- package/modules/pattern-fill.src.js +2 -2
- package/modules/price-indicator.js +1 -1
- package/modules/price-indicator.src.js +2 -2
- package/modules/pyramid3d.js +1 -1
- package/modules/pyramid3d.src.js +2 -2
- package/modules/sankey.js +14 -14
- package/modules/sankey.js.map +1 -1
- package/modules/sankey.src.js +39 -19
- package/modules/series-label.js +16 -16
- package/modules/series-label.js.map +1 -1
- package/modules/series-label.src.js +17 -9
- package/modules/solid-gauge.js +5 -5
- package/modules/solid-gauge.js.map +1 -1
- package/modules/solid-gauge.src.js +129 -80
- package/modules/sonification.js +1 -1
- package/modules/sonification.src.js +1 -1
- package/modules/static-scale.js +4 -4
- package/modules/static-scale.js.map +1 -1
- package/modules/static-scale.src.js +9 -2
- package/modules/stock-tools.js +2 -2
- package/modules/stock-tools.src.js +3 -3
- package/modules/stock.js +146 -145
- package/modules/stock.js.map +1 -1
- package/modules/stock.src.js +105 -61
- package/modules/streamgraph.js +1 -1
- package/modules/streamgraph.src.js +12 -12
- package/modules/sunburst.js +40 -40
- package/modules/sunburst.js.map +1 -1
- package/modules/sunburst.src.js +30 -9
- package/modules/tilemap.js +1 -1
- package/modules/tilemap.js.map +1 -1
- package/modules/tilemap.src.js +59 -58
- package/modules/timeline.js +12 -11
- package/modules/timeline.js.map +1 -1
- package/modules/timeline.src.js +18 -13
- package/modules/treegrid.js +45 -43
- package/modules/treegrid.js.map +1 -1
- package/modules/treegrid.src.js +238 -139
- package/modules/treemap.js +1 -1
- package/modules/treemap.src.js +7 -7
- package/modules/variable-pie.js +1 -1
- package/modules/variable-pie.src.js +1 -1
- package/modules/variwide.js +1 -1
- package/modules/variwide.src.js +40 -40
- package/modules/vector.js +1 -1
- package/modules/vector.js.map +1 -1
- package/modules/vector.src.js +109 -108
- package/modules/venn.js +23 -23
- package/modules/venn.js.map +1 -1
- package/modules/venn.src.js +5 -3
- package/modules/windbarb.js +1 -1
- package/modules/windbarb.src.js +44 -44
- package/modules/wordcloud.js +10 -10
- package/modules/wordcloud.js.map +1 -1
- package/modules/wordcloud.src.js +2 -1
- package/modules/xrange.js +12 -12
- package/modules/xrange.js.map +1 -1
- package/modules/xrange.src.js +113 -105
- package/package.json +1 -1
- package/themes/avocado.js +21 -37
- package/themes/avocado.src.js +1 -1
- package/themes/dark-blue.js +1 -1
- package/themes/dark-blue.src.js +1 -1
- package/themes/dark-green.js +1 -1
- package/themes/dark-green.src.js +1 -1
- package/themes/dark-unica.js +1 -1
- package/themes/dark-unica.src.js +1 -1
- package/themes/gray.js +1 -1
- package/themes/gray.src.js +1 -1
- package/themes/grid-light.js +1 -1
- package/themes/grid-light.src.js +1 -1
- package/themes/grid.js +1 -1
- package/themes/grid.src.js +1 -1
- package/themes/sand-signika.js +1 -1
- package/themes/sand-signika.src.js +1 -1
- package/themes/skies.js +1 -1
- package/themes/skies.src.js +1 -1
- package/themes/sunset.js +21 -37
- package/themes/sunset.src.js +1 -1
- package/.DS_Store +0 -0
- package/es-modules/.DS_Store +0 -0
- package/es-modules/modules/annotations-legacy.src.js +0 -1977
- package/js/.DS_Store +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Highcharts JS v7.1.
|
|
2
|
+
* @license Highcharts JS v7.1.2 (2019-06-04)
|
|
3
3
|
*
|
|
4
4
|
* Annotations module
|
|
5
5
|
*
|
|
@@ -39,6 +39,7 @@
|
|
|
39
39
|
* The units of the distance are specific to a transformation,
|
|
40
40
|
* e.g. for rotation they are radians, for scaling they are scale factors.
|
|
41
41
|
*
|
|
42
|
+
* @private
|
|
42
43
|
* @mixin
|
|
43
44
|
* @memberOf Annotation
|
|
44
45
|
*/
|
|
@@ -326,7 +327,7 @@
|
|
|
326
327
|
* a control point
|
|
327
328
|
* @param {Annotation.ControlPoint.Options} options an options object
|
|
328
329
|
* @param {number} [index]
|
|
329
|
-
|
|
330
|
+
*/
|
|
330
331
|
function ControlPoint(chart, target, options, index) {
|
|
331
332
|
this.chart = chart;
|
|
332
333
|
this.target = target;
|
|
@@ -452,19 +453,49 @@
|
|
|
452
453
|
_registerModule(_modules, 'annotations/MockPoint.js', [_modules['parts/Globals.js']], function (H) {
|
|
453
454
|
|
|
454
455
|
/**
|
|
455
|
-
* A
|
|
456
|
+
* A mock point label configuration.
|
|
456
457
|
*
|
|
457
|
-
* @
|
|
458
|
+
* @interface Annotation.MockLabelOptionsObject
|
|
459
|
+
*//**
|
|
460
|
+
* X value translated to x axis scale
|
|
461
|
+
* @name Annotation.MockLabelOptionsObject#x
|
|
462
|
+
* @type {number|undefined}
|
|
463
|
+
*//**
|
|
464
|
+
* Y value translated to y axis scale
|
|
465
|
+
* @name Annotation.MockLabelOptionsObject#y
|
|
466
|
+
* @type {number|undefined}
|
|
467
|
+
*//**
|
|
468
|
+
* @name Annotation.MockLabelOptionsObject#point
|
|
469
|
+
* @type {Highcharts.Point}
|
|
458
470
|
*/
|
|
459
471
|
|
|
460
472
|
/**
|
|
461
473
|
* A mock point configuration.
|
|
462
474
|
*
|
|
463
|
-
* @
|
|
464
|
-
|
|
465
|
-
*
|
|
466
|
-
* @
|
|
467
|
-
* @
|
|
475
|
+
* @interface Highcharts.MockPointOptionsObject
|
|
476
|
+
*//**
|
|
477
|
+
* x value for the point in xAxis scale or pixels
|
|
478
|
+
* @name Highcharts.MockPointOptionsObject#x
|
|
479
|
+
* @type {number}
|
|
480
|
+
*//**
|
|
481
|
+
* y value for the point in yAxis scale or pixels
|
|
482
|
+
* @name Highcharts.MockPointOptionsObject#y
|
|
483
|
+
* @type {number}
|
|
484
|
+
*//**
|
|
485
|
+
* xAxis index or id
|
|
486
|
+
* @name Highcharts.MockPointOptionsObject#xAxis
|
|
487
|
+
* @type {Highcharts.Axis|number|string|undefined}
|
|
488
|
+
*//**
|
|
489
|
+
* yAxis index or id
|
|
490
|
+
* @name Highcharts.MockPointOptionsObject#yAxis
|
|
491
|
+
* @property {Highcharts.Axis|number|string|undefined}
|
|
492
|
+
*/
|
|
493
|
+
|
|
494
|
+
/**
|
|
495
|
+
* A point-like object, a mock point or a point uses in series.
|
|
496
|
+
*
|
|
497
|
+
* @private
|
|
498
|
+
* @typedef {Highcharts.Point|Highcharts.MockPoint} Highcharts.PointLike
|
|
468
499
|
*/
|
|
469
500
|
|
|
470
501
|
/**
|
|
@@ -472,12 +503,15 @@
|
|
|
472
503
|
* It is created when there is a need of pointing to some chart's position
|
|
473
504
|
* using axis values or pixel values
|
|
474
505
|
*
|
|
506
|
+
* @private
|
|
475
507
|
* @class
|
|
476
|
-
* @
|
|
508
|
+
* @name Highcharts.MockPoint
|
|
509
|
+
*
|
|
510
|
+
* @param {Highcharts.Chart} chart
|
|
511
|
+
* The chart object
|
|
477
512
|
*
|
|
478
|
-
* @param {
|
|
479
|
-
*
|
|
480
|
-
* @param {Annotation.MockPoint.Options} options an options object
|
|
513
|
+
* @param {Highcharts.MockPointOptionsObject} options
|
|
514
|
+
* The options object
|
|
481
515
|
*/
|
|
482
516
|
function MockPoint(chart, target, options) {
|
|
483
517
|
/**
|
|
@@ -502,7 +536,7 @@
|
|
|
502
536
|
/**
|
|
503
537
|
* Options for the mock point.
|
|
504
538
|
*
|
|
505
|
-
* @type {
|
|
539
|
+
* @type {Highcharts.MockPointOptionsObject}
|
|
506
540
|
*/
|
|
507
541
|
this.options = options;
|
|
508
542
|
|
|
@@ -870,6 +904,7 @@
|
|
|
870
904
|
* It provides methods for handling points, control points
|
|
871
905
|
* and points transformations.
|
|
872
906
|
*
|
|
907
|
+
* @private
|
|
873
908
|
* @mixin
|
|
874
909
|
* @memberOf Annotation
|
|
875
910
|
*/
|
|
@@ -1003,10 +1038,13 @@
|
|
|
1003
1038
|
/**
|
|
1004
1039
|
* Map point's options to a point-like object.
|
|
1005
1040
|
*
|
|
1006
|
-
* @param {
|
|
1007
|
-
*
|
|
1008
|
-
* @
|
|
1009
|
-
*
|
|
1041
|
+
* @param {Highcharts.MockPointOptionsObject} pointOptions
|
|
1042
|
+
* point's options
|
|
1043
|
+
* @param {Highcharts.PointLike} point
|
|
1044
|
+
* a point like instance
|
|
1045
|
+
*
|
|
1046
|
+
* @return {Highcharts.PointLike|null}
|
|
1047
|
+
* if the point is found/set returns this point, otherwise null
|
|
1010
1048
|
*/
|
|
1011
1049
|
point: function (pointOptions, point) {
|
|
1012
1050
|
if (pointOptions && pointOptions.series) {
|
|
@@ -1192,6 +1230,30 @@
|
|
|
1192
1230
|
this.transformPoint('translate', null, null, dx, dy, i);
|
|
1193
1231
|
},
|
|
1194
1232
|
|
|
1233
|
+
/**
|
|
1234
|
+
* Translate shape within controllable item.
|
|
1235
|
+
* Replaces `controllable.translate` method.
|
|
1236
|
+
*
|
|
1237
|
+
* @param {number} dx translation for x coordinate
|
|
1238
|
+
* @param {number} dy translation for y coordinate
|
|
1239
|
+
*/
|
|
1240
|
+
translateShape: function (dx, dy) {
|
|
1241
|
+
var chart = this.annotation.chart,
|
|
1242
|
+
// Annotation.options
|
|
1243
|
+
shapeOptions = this.annotation.userOptions,
|
|
1244
|
+
// Chart.options.annotations
|
|
1245
|
+
annotationIndex = chart.annotations.indexOf(this.annotation),
|
|
1246
|
+
chartOptions = chart.options.annotations[annotationIndex];
|
|
1247
|
+
|
|
1248
|
+
this.translatePoint(dx, dy, 0);
|
|
1249
|
+
|
|
1250
|
+
// Options stored in:
|
|
1251
|
+
// - chart (for exporting)
|
|
1252
|
+
// - current config (for redraws)
|
|
1253
|
+
chartOptions[this.collection][this.index].point = this.options.point;
|
|
1254
|
+
shapeOptions[this.collection][this.index].point = this.options.point;
|
|
1255
|
+
},
|
|
1256
|
+
|
|
1195
1257
|
/**
|
|
1196
1258
|
* Rotate a controllable.
|
|
1197
1259
|
*
|
|
@@ -1370,6 +1432,7 @@
|
|
|
1370
1432
|
};
|
|
1371
1433
|
|
|
1372
1434
|
/**
|
|
1435
|
+
* @private
|
|
1373
1436
|
* @mixin
|
|
1374
1437
|
*/
|
|
1375
1438
|
var markerMixin = {
|
|
@@ -1701,6 +1764,8 @@
|
|
|
1701
1764
|
*/
|
|
1702
1765
|
type: 'rect',
|
|
1703
1766
|
|
|
1767
|
+
translate: controllableMixin.translateShape,
|
|
1768
|
+
|
|
1704
1769
|
render: function (parent) {
|
|
1705
1770
|
var attrs = this.attrsFromOptions(this.options);
|
|
1706
1771
|
|
|
@@ -1732,16 +1797,6 @@
|
|
|
1732
1797
|
this.graphic.placed = Boolean(position);
|
|
1733
1798
|
|
|
1734
1799
|
controllableMixin.redraw.call(this, animation);
|
|
1735
|
-
},
|
|
1736
|
-
|
|
1737
|
-
translate: function (dx, dy) {
|
|
1738
|
-
var annotationOptions = this.annotation.userOptions,
|
|
1739
|
-
shapeOptions = annotationOptions[this.collection][this.index];
|
|
1740
|
-
|
|
1741
|
-
this.translatePoint(dx, dy, 0);
|
|
1742
|
-
|
|
1743
|
-
// Options stored in chart:
|
|
1744
|
-
shapeOptions.point = this.options.point;
|
|
1745
1800
|
}
|
|
1746
1801
|
}
|
|
1747
1802
|
);
|
|
@@ -1783,6 +1838,8 @@
|
|
|
1783
1838
|
*/
|
|
1784
1839
|
type: 'circle',
|
|
1785
1840
|
|
|
1841
|
+
translate: controllableMixin.translateShape,
|
|
1842
|
+
|
|
1786
1843
|
render: function (parent) {
|
|
1787
1844
|
var attrs = this.attrsFromOptions(this.options);
|
|
1788
1845
|
|
|
@@ -1815,16 +1872,6 @@
|
|
|
1815
1872
|
controllableMixin.redraw.call(this, animation);
|
|
1816
1873
|
},
|
|
1817
1874
|
|
|
1818
|
-
translate: function (dx, dy) {
|
|
1819
|
-
var annotationOptions = this.annotation.userOptions,
|
|
1820
|
-
shapeOptions = annotationOptions[this.collection][this.index];
|
|
1821
|
-
|
|
1822
|
-
this.translatePoint(dx, dy, 0);
|
|
1823
|
-
|
|
1824
|
-
// Options stored in chart:
|
|
1825
|
-
shapeOptions.point = this.options.point;
|
|
1826
|
-
},
|
|
1827
|
-
|
|
1828
1875
|
/**
|
|
1829
1876
|
* Set the radius.
|
|
1830
1877
|
*
|
|
@@ -1841,15 +1888,50 @@
|
|
|
1841
1888
|
});
|
|
1842
1889
|
_registerModule(_modules, 'annotations/controllable/ControllableLabel.js', [_modules['parts/Globals.js'], _modules['annotations/controllable/controllableMixin.js'], _modules['annotations/MockPoint.js']], function (H, controllableMixin, MockPoint) {
|
|
1843
1890
|
|
|
1891
|
+
|
|
1892
|
+
/**
|
|
1893
|
+
* @private
|
|
1894
|
+
* @interface Highcharts.AnnotationAnchorObject
|
|
1895
|
+
*//**
|
|
1896
|
+
* Relative to the plot area position
|
|
1897
|
+
* @name Highcharts.AnnotationAnchorObject#relativePosition
|
|
1898
|
+
* @type {Highcharts.AnnotationAnchorPositionObject}
|
|
1899
|
+
*//**
|
|
1900
|
+
* Absolute position
|
|
1901
|
+
* @name Highcharts.AnnotationAnchorObject#absolutePosition
|
|
1902
|
+
* @type {Highcharts.AnnotationAnchorPositionObject}
|
|
1903
|
+
*/
|
|
1904
|
+
|
|
1905
|
+
/**
|
|
1906
|
+
* An object which denotes an anchor position
|
|
1907
|
+
*
|
|
1908
|
+
* @private
|
|
1909
|
+
* @interface Highcharts.AnnotationAnchorPositionObject
|
|
1910
|
+
*//**
|
|
1911
|
+
* @name Highcharts.AnnotationAnchorPositionObject#x
|
|
1912
|
+
* @property {number}
|
|
1913
|
+
*//**
|
|
1914
|
+
* @name Highcharts.AnnotationAnchorPositionObject#y
|
|
1915
|
+
* @property {number}
|
|
1916
|
+
*//**
|
|
1917
|
+
* @name Highcharts.AnnotationAnchorPositionObject#height
|
|
1918
|
+
* @property {number}
|
|
1919
|
+
*//**
|
|
1920
|
+
* @name Highcharts.AnnotationAnchorPositionObject#width
|
|
1921
|
+
* @property {number}
|
|
1922
|
+
*/
|
|
1923
|
+
|
|
1844
1924
|
/**
|
|
1845
1925
|
* A controllable label class.
|
|
1846
1926
|
*
|
|
1927
|
+
* @private
|
|
1847
1928
|
* @class
|
|
1929
|
+
* @name Annotation.ControllableLabel
|
|
1930
|
+
*
|
|
1848
1931
|
* @mixes Annotation.controllableMixin
|
|
1849
|
-
* @memberOf Annotation
|
|
1850
1932
|
*
|
|
1851
1933
|
* @param {Highcharts.Annotation} annotation an annotation instance
|
|
1852
|
-
* @param {
|
|
1934
|
+
* @param {object} options a label's options
|
|
1853
1935
|
* @param {number} index of the label
|
|
1854
1936
|
**/
|
|
1855
1937
|
function ControllableLabel(annotation, options, index) {
|
|
@@ -1861,7 +1943,7 @@
|
|
|
1861
1943
|
* Shapes which do not have background - the object is used for proper
|
|
1862
1944
|
* setting of the contrast color.
|
|
1863
1945
|
*
|
|
1864
|
-
* @type {Array<
|
|
1946
|
+
* @type {Array<string>}
|
|
1865
1947
|
*/
|
|
1866
1948
|
ControllableLabel.shapesWithoutBackground = ['connector'];
|
|
1867
1949
|
|
|
@@ -2031,16 +2113,24 @@
|
|
|
2031
2113
|
* @param {number} dy translation for y coordinate
|
|
2032
2114
|
**/
|
|
2033
2115
|
translate: function (dx, dy) {
|
|
2034
|
-
var
|
|
2035
|
-
|
|
2116
|
+
var chart = this.annotation.chart,
|
|
2117
|
+
// Annotation.options
|
|
2118
|
+
labelOptions = this.annotation.userOptions,
|
|
2119
|
+
// Chart.options.annotations
|
|
2120
|
+
annotationIndex = chart.annotations.indexOf(this.annotation),
|
|
2121
|
+
chartAnnotations = chart.options.annotations,
|
|
2122
|
+
chartOptions = chartAnnotations[annotationIndex];
|
|
2036
2123
|
|
|
2037
2124
|
// Local options:
|
|
2038
2125
|
this.options.x += dx;
|
|
2039
2126
|
this.options.y += dy;
|
|
2040
2127
|
|
|
2041
2128
|
// Options stored in chart:
|
|
2042
|
-
|
|
2043
|
-
|
|
2129
|
+
chartOptions[this.collection][this.index].x = this.options.x;
|
|
2130
|
+
chartOptions[this.collection][this.index].y = this.options.y;
|
|
2131
|
+
|
|
2132
|
+
labelOptions[this.collection][this.index].x = this.options.x;
|
|
2133
|
+
labelOptions[this.collection][this.index].y = this.options.y;
|
|
2044
2134
|
},
|
|
2045
2135
|
|
|
2046
2136
|
render: function (parent) {
|
|
@@ -2148,8 +2238,9 @@
|
|
|
2148
2238
|
/**
|
|
2149
2239
|
* Returns the label position relative to its anchor.
|
|
2150
2240
|
*
|
|
2151
|
-
* @param {
|
|
2152
|
-
*
|
|
2241
|
+
* @param {Highcharts.AnnotationAnchorObject} anchor
|
|
2242
|
+
*
|
|
2243
|
+
* @return {Highcharts.AnnotationAnchorPositionObject|null} position
|
|
2153
2244
|
*/
|
|
2154
2245
|
position: function (anchor) {
|
|
2155
2246
|
var item = this.graphic,
|
|
@@ -2243,6 +2334,7 @@
|
|
|
2243
2334
|
|
|
2244
2335
|
/**
|
|
2245
2336
|
* General symbol definition for labels with connector
|
|
2337
|
+
* @private
|
|
2246
2338
|
*/
|
|
2247
2339
|
H.SVGRenderer.prototype.symbols.connector = function (x, y, w, h, options) {
|
|
2248
2340
|
var anchorX = options && options.anchorX,
|
|
@@ -2333,6 +2425,8 @@
|
|
|
2333
2425
|
*/
|
|
2334
2426
|
type: 'image',
|
|
2335
2427
|
|
|
2428
|
+
translate: controllableMixin.translateShape,
|
|
2429
|
+
|
|
2336
2430
|
render: function (parent) {
|
|
2337
2431
|
var attrs = this.attrsFromOptions(this.options),
|
|
2338
2432
|
options = this.options;
|
|
@@ -2370,16 +2464,6 @@
|
|
|
2370
2464
|
this.graphic.placed = Boolean(position);
|
|
2371
2465
|
|
|
2372
2466
|
controllableMixin.redraw.call(this, animation);
|
|
2373
|
-
},
|
|
2374
|
-
|
|
2375
|
-
translate: function (dx, dy) {
|
|
2376
|
-
var annotationOptions = this.annotation.userOptions,
|
|
2377
|
-
shapeOptions = annotationOptions[this.collection][this.index];
|
|
2378
|
-
|
|
2379
|
-
this.translatePoint(dx, dy, 0);
|
|
2380
|
-
|
|
2381
|
-
// Options stored in chart:
|
|
2382
|
-
shapeOptions.point = this.options.point;
|
|
2383
2467
|
}
|
|
2384
2468
|
}
|
|
2385
2469
|
);
|
|
@@ -2388,11 +2472,15 @@
|
|
|
2388
2472
|
return ControllableImage;
|
|
2389
2473
|
});
|
|
2390
2474
|
_registerModule(_modules, 'annotations/annotations.src.js', [_modules['parts/Globals.js'], _modules['annotations/controllable/controllableMixin.js'], _modules['annotations/controllable/ControllableRect.js'], _modules['annotations/controllable/ControllableCircle.js'], _modules['annotations/controllable/ControllablePath.js'], _modules['annotations/controllable/ControllableImage.js'], _modules['annotations/controllable/ControllableLabel.js'], _modules['annotations/eventEmitterMixin.js'], _modules['annotations/MockPoint.js'], _modules['annotations/ControlPoint.js']], function (H, controllableMixin, ControllableRect, ControllableCircle, ControllablePath, ControllableImage, ControllableLabel, eventEmitterMixin, MockPoint, ControlPoint) {
|
|
2391
|
-
|
|
2392
|
-
* (c) 2009-2017 Highsoft, Black Label
|
|
2475
|
+
/* *
|
|
2393
2476
|
*
|
|
2394
|
-
*
|
|
2395
|
-
|
|
2477
|
+
* (c) 2009-2017 Highsoft, Black Label
|
|
2478
|
+
*
|
|
2479
|
+
* License: www.highcharts.com/license
|
|
2480
|
+
*
|
|
2481
|
+
* */
|
|
2482
|
+
|
|
2483
|
+
|
|
2396
2484
|
|
|
2397
2485
|
var merge = H.merge,
|
|
2398
2486
|
addEvent = H.addEvent,
|
|
@@ -2404,7 +2492,8 @@
|
|
|
2404
2492
|
pick = H.pick,
|
|
2405
2493
|
reduce = H.reduce,
|
|
2406
2494
|
splat = H.splat,
|
|
2407
|
-
destroyObjectProperties = H.destroyObjectProperties
|
|
2495
|
+
destroyObjectProperties = H.destroyObjectProperties,
|
|
2496
|
+
chartProto = H.Chart.prototype;
|
|
2408
2497
|
|
|
2409
2498
|
/* *********************************************************************
|
|
2410
2499
|
*
|
|
@@ -2432,8 +2521,7 @@
|
|
|
2432
2521
|
* existing points or created mock points
|
|
2433
2522
|
*
|
|
2434
2523
|
* @class
|
|
2435
|
-
* @
|
|
2436
|
-
* @mixes Annotation.eventEmitterMixin
|
|
2524
|
+
* @name Highcharts.Annotation
|
|
2437
2525
|
*
|
|
2438
2526
|
* @param {Highcharts.Chart} chart a chart instance
|
|
2439
2527
|
* @param {Highcharts.AnnotationsOptions} options the options object
|
|
@@ -2451,7 +2539,7 @@
|
|
|
2451
2539
|
/**
|
|
2452
2540
|
* The array of points which defines the annotation.
|
|
2453
2541
|
*
|
|
2454
|
-
* @type {Array<
|
|
2542
|
+
* @type {Array<Highcharts.Point>}
|
|
2455
2543
|
*/
|
|
2456
2544
|
this.points = [];
|
|
2457
2545
|
|
|
@@ -2474,7 +2562,7 @@
|
|
|
2474
2562
|
/**
|
|
2475
2563
|
* The array of shapes which belong to the annotation.
|
|
2476
2564
|
*
|
|
2477
|
-
* @type {Array<
|
|
2565
|
+
* @type {Array<Annotation.Shape>}
|
|
2478
2566
|
*/
|
|
2479
2567
|
this.shapes = [];
|
|
2480
2568
|
|
|
@@ -2543,7 +2631,10 @@
|
|
|
2543
2631
|
true,
|
|
2544
2632
|
Annotation.prototype,
|
|
2545
2633
|
controllableMixin,
|
|
2546
|
-
eventEmitterMixin,
|
|
2634
|
+
eventEmitterMixin,
|
|
2635
|
+
/** @lends Annotation# */
|
|
2636
|
+
{
|
|
2637
|
+
|
|
2547
2638
|
/**
|
|
2548
2639
|
* List of events for `annotation.options.events` that should not be
|
|
2549
2640
|
* added to `annotation.graphic` but to the `annotation`.
|
|
@@ -2551,14 +2642,12 @@
|
|
|
2551
2642
|
* @type {Array<string>}
|
|
2552
2643
|
*/
|
|
2553
2644
|
nonDOMEvents: ['add', 'afterUpdate', 'remove'],
|
|
2645
|
+
|
|
2554
2646
|
/**
|
|
2555
2647
|
* A basic type of an annotation. It allows to add custom labels
|
|
2556
2648
|
* or shapes. The items can be tied to points, axis coordinates
|
|
2557
2649
|
* or chart pixel coordinates.
|
|
2558
2650
|
*
|
|
2559
|
-
* @private
|
|
2560
|
-
* @type {Object}
|
|
2561
|
-
* @ignore-options base, annotations.crookedLine
|
|
2562
2651
|
* @sample highcharts/annotations/basic/
|
|
2563
2652
|
* Basic annotations
|
|
2564
2653
|
* @sample highcharts/demo/annotations/
|
|
@@ -2566,13 +2655,25 @@
|
|
|
2566
2655
|
* @sample highcharts/css/annotations
|
|
2567
2656
|
* Styled mode
|
|
2568
2657
|
* @sample highcharts/annotations-advanced/controllable
|
|
2569
|
-
*
|
|
2658
|
+
* Controllable items
|
|
2570
2659
|
* @sample {highstock} stock/annotations/fibonacci-retracements
|
|
2571
2660
|
* Custom annotation, Fibonacci retracement
|
|
2572
|
-
*
|
|
2573
|
-
* @
|
|
2661
|
+
*
|
|
2662
|
+
* @type {Array<*>}
|
|
2663
|
+
* @since 6.0.0
|
|
2664
|
+
* @optionparent annotations
|
|
2574
2665
|
*/
|
|
2575
2666
|
defaultOptions: {
|
|
2667
|
+
|
|
2668
|
+
/**
|
|
2669
|
+
* Sets an ID for an annotation. Can be user later when removing an
|
|
2670
|
+
* annotation in [Chart#removeAnnotation(id)](
|
|
2671
|
+
* /class-reference/Highcharts.Chart#removeAnnotation) method.
|
|
2672
|
+
*
|
|
2673
|
+
* @type {string}
|
|
2674
|
+
* @apioption annotations.id
|
|
2675
|
+
*/
|
|
2676
|
+
|
|
2576
2677
|
/**
|
|
2577
2678
|
* Whether the annotation is visible.
|
|
2578
2679
|
*
|
|
@@ -2585,7 +2686,10 @@
|
|
|
2585
2686
|
* Allow an annotation to be draggable by a user. Possible
|
|
2586
2687
|
* values are `"x"`, `"xy"`, `"y"` and `""` (disabled).
|
|
2587
2688
|
*
|
|
2588
|
-
* @
|
|
2689
|
+
* @sample highcharts/annotations/draggable/
|
|
2690
|
+
* Annotations draggable: 'xy'
|
|
2691
|
+
*
|
|
2692
|
+
* @type {string}
|
|
2589
2693
|
* @validvalue ["x", "xy", "y", ""]
|
|
2590
2694
|
*/
|
|
2591
2695
|
draggable: 'xy',
|
|
@@ -2621,18 +2725,20 @@
|
|
|
2621
2725
|
/**
|
|
2622
2726
|
* The background color or gradient for the annotation's label.
|
|
2623
2727
|
*
|
|
2624
|
-
* @type {Color}
|
|
2625
2728
|
* @sample highcharts/annotations/label-presentation/
|
|
2626
2729
|
* Set labels graphic options
|
|
2730
|
+
*
|
|
2731
|
+
* @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}
|
|
2627
2732
|
*/
|
|
2628
2733
|
backgroundColor: 'rgba(0, 0, 0, 0.75)',
|
|
2629
2734
|
|
|
2630
2735
|
/**
|
|
2631
2736
|
* The border color for the annotation's label.
|
|
2632
2737
|
*
|
|
2633
|
-
* @type {Color}
|
|
2634
2738
|
* @sample highcharts/annotations/label-presentation/
|
|
2635
2739
|
* Set labels graphic options
|
|
2740
|
+
*
|
|
2741
|
+
* @type {Highcharts.ColorString}
|
|
2636
2742
|
*/
|
|
2637
2743
|
borderColor: 'black',
|
|
2638
2744
|
|
|
@@ -2657,6 +2763,7 @@
|
|
|
2657
2763
|
*
|
|
2658
2764
|
* @sample highcharts/css/annotations
|
|
2659
2765
|
* Styled mode annotations
|
|
2766
|
+
*
|
|
2660
2767
|
* @since 6.0.5
|
|
2661
2768
|
*/
|
|
2662
2769
|
className: '',
|
|
@@ -2673,67 +2780,70 @@
|
|
|
2673
2780
|
/**
|
|
2674
2781
|
* The label's pixel distance from the point.
|
|
2675
2782
|
*
|
|
2676
|
-
* @type {number}
|
|
2677
2783
|
* @sample highcharts/annotations/label-position/
|
|
2678
2784
|
* Set labels position
|
|
2679
|
-
*
|
|
2680
|
-
* @
|
|
2785
|
+
*
|
|
2786
|
+
* @type {number}
|
|
2787
|
+
* @apioption annotations.labelOptions.distance
|
|
2681
2788
|
*/
|
|
2682
2789
|
|
|
2683
2790
|
/**
|
|
2684
|
-
* A
|
|
2791
|
+
* A
|
|
2792
|
+
* [format](https://www.highcharts.com/docs/chart-concepts/labels-and-string-formatting)
|
|
2793
|
+
* string for the data label.
|
|
2794
|
+
*
|
|
2795
|
+
* @see [plotOptions.series.dataLabels.format](plotOptions.series.dataLabels.format.html)
|
|
2685
2796
|
*
|
|
2686
|
-
* @type {string}
|
|
2687
|
-
* @see [plotOptions.series.dataLabels.format](
|
|
2688
|
-
* plotOptions.series.dataLabels.format.html)
|
|
2689
2797
|
* @sample highcharts/annotations/label-text/
|
|
2690
2798
|
* Set labels text
|
|
2691
|
-
*
|
|
2692
|
-
* @
|
|
2799
|
+
*
|
|
2800
|
+
* @type {string}
|
|
2801
|
+
* @apioption annotations.labelOptions.format
|
|
2693
2802
|
*/
|
|
2694
2803
|
|
|
2695
2804
|
/**
|
|
2696
2805
|
* Alias for the format option.
|
|
2697
2806
|
*
|
|
2698
|
-
* @type {string}
|
|
2699
2807
|
* @see [format](annotations.labelOptions.format.html)
|
|
2808
|
+
*
|
|
2700
2809
|
* @sample highcharts/annotations/label-text/
|
|
2701
2810
|
* Set labels text
|
|
2702
|
-
*
|
|
2703
|
-
* @
|
|
2811
|
+
*
|
|
2812
|
+
* @type {string}
|
|
2813
|
+
* @apioption annotations.labelOptions.text
|
|
2704
2814
|
*/
|
|
2705
2815
|
|
|
2706
2816
|
/**
|
|
2707
|
-
* Callback JavaScript function to format
|
|
2708
|
-
*
|
|
2709
|
-
*
|
|
2710
|
-
*
|
|
2817
|
+
* Callback JavaScript function to format the annotation's
|
|
2818
|
+
* label. Note that if a `format` or `text` are defined, the
|
|
2819
|
+
* format or text take precedence and the formatter is ignored.
|
|
2820
|
+
* `This` refers to a point object.
|
|
2711
2821
|
*
|
|
2712
|
-
* @type {function}
|
|
2713
2822
|
* @sample highcharts/annotations/label-text/
|
|
2714
2823
|
* Set labels text
|
|
2715
|
-
*
|
|
2716
|
-
*
|
|
2717
|
-
* }
|
|
2824
|
+
*
|
|
2825
|
+
* @type {Highcharts.FormatterCallbackFunction<Highcharts.Point>}
|
|
2826
|
+
* @default function () { return defined(this.y) ? this.y : 'Annotation label'; }
|
|
2718
2827
|
*/
|
|
2719
2828
|
formatter: function () {
|
|
2720
2829
|
return defined(this.y) ? this.y : 'Annotation label';
|
|
2721
2830
|
},
|
|
2722
2831
|
|
|
2723
2832
|
/**
|
|
2724
|
-
* How to handle the annotation's label that flow
|
|
2725
|
-
*
|
|
2726
|
-
*
|
|
2833
|
+
* How to handle the annotation's label that flow outside the
|
|
2834
|
+
* plot area. The justify option aligns the label inside the
|
|
2835
|
+
* plot area.
|
|
2727
2836
|
*
|
|
2728
|
-
* @validvalue ["allow", "justify"]
|
|
2729
2837
|
* @sample highcharts/annotations/label-crop-overflow/
|
|
2730
2838
|
* Crop or justify labels
|
|
2839
|
+
*
|
|
2840
|
+
* @validvalue ["allow", "justify"]
|
|
2731
2841
|
*/
|
|
2732
2842
|
overflow: 'justify',
|
|
2733
2843
|
|
|
2734
2844
|
/**
|
|
2735
2845
|
* When either the borderWidth or the backgroundColor is set,
|
|
2736
|
-
* this
|
|
2846
|
+
* this is the padding within the box.
|
|
2737
2847
|
*
|
|
2738
2848
|
* @sample highcharts/annotations/label-presentation/
|
|
2739
2849
|
* Set labels graphic options
|
|
@@ -2741,13 +2851,14 @@
|
|
|
2741
2851
|
padding: 5,
|
|
2742
2852
|
|
|
2743
2853
|
/**
|
|
2744
|
-
* The shadow of the box. The shadow can be
|
|
2745
|
-
*
|
|
2746
|
-
* `
|
|
2854
|
+
* The shadow of the box. The shadow can be an object
|
|
2855
|
+
* configuration containing `color`, `offsetX`, `offsetY`,
|
|
2856
|
+
* `opacity` and `width`.
|
|
2747
2857
|
*
|
|
2748
|
-
* @type {Boolean|Object}
|
|
2749
2858
|
* @sample highcharts/annotations/label-presentation/
|
|
2750
2859
|
* Set labels graphic options
|
|
2860
|
+
*
|
|
2861
|
+
* @type {boolean|Highcharts.ShadowOptionsObject}
|
|
2751
2862
|
*/
|
|
2752
2863
|
shadow: false,
|
|
2753
2864
|
|
|
@@ -2755,7 +2866,6 @@
|
|
|
2755
2866
|
* The name of a symbol to use for the border around the label.
|
|
2756
2867
|
* Symbols are predefined functions on the Renderer object.
|
|
2757
2868
|
*
|
|
2758
|
-
* @type {string}
|
|
2759
2869
|
* @sample highcharts/annotations/shapes/
|
|
2760
2870
|
* Available shapes for labels
|
|
2761
2871
|
*/
|
|
@@ -2764,24 +2874,25 @@
|
|
|
2764
2874
|
/**
|
|
2765
2875
|
* Styles for the annotation's label.
|
|
2766
2876
|
*
|
|
2767
|
-
* @
|
|
2877
|
+
* @see [plotOptions.series.dataLabels.style](plotOptions.series.dataLabels.style.html)
|
|
2878
|
+
*
|
|
2768
2879
|
* @sample highcharts/annotations/label-presentation/
|
|
2769
2880
|
* Set labels graphic options
|
|
2770
|
-
*
|
|
2771
|
-
*
|
|
2881
|
+
*
|
|
2882
|
+
* @type {Highcharts.CSSObject}
|
|
2772
2883
|
*/
|
|
2773
2884
|
style: {
|
|
2885
|
+
/** @ignore */
|
|
2774
2886
|
fontSize: '11px',
|
|
2887
|
+
/** @ignore */
|
|
2775
2888
|
fontWeight: 'normal',
|
|
2889
|
+
/** @ignore */
|
|
2776
2890
|
color: 'contrast'
|
|
2777
2891
|
},
|
|
2778
2892
|
|
|
2779
2893
|
/**
|
|
2780
|
-
* Whether to [use HTML](
|
|
2894
|
+
* Whether to [use HTML](https://www.highcharts.com/docs/chart-concepts/labels-and-string-formatting#html)
|
|
2781
2895
|
* to render the annotation's label.
|
|
2782
|
-
*
|
|
2783
|
-
* @type {boolean}
|
|
2784
|
-
* @default false
|
|
2785
2896
|
*/
|
|
2786
2897
|
useHTML: false,
|
|
2787
2898
|
|
|
@@ -2821,60 +2932,58 @@
|
|
|
2821
2932
|
* multiple labels, they can be added to the
|
|
2822
2933
|
* [labelOptions](annotations.labelOptions.html).
|
|
2823
2934
|
*
|
|
2824
|
-
* @type
|
|
2825
|
-
* @extends
|
|
2826
|
-
* @apioption annotations.
|
|
2935
|
+
* @type {Array<*>}
|
|
2936
|
+
* @extends annotations.labelOptions
|
|
2937
|
+
* @apioption annotations.labels
|
|
2827
2938
|
*/
|
|
2828
2939
|
|
|
2829
2940
|
/**
|
|
2830
|
-
* This option defines the point to which the label
|
|
2831
|
-
*
|
|
2832
|
-
*
|
|
2833
|
-
*
|
|
2834
|
-
* properies and optionally axes.
|
|
2941
|
+
* This option defines the point to which the label will be
|
|
2942
|
+
* connected. It can be either the point which exists in the
|
|
2943
|
+
* series - it is referenced by the point's id - or a new point with
|
|
2944
|
+
* defined x, y properties and optionally axes.
|
|
2835
2945
|
*
|
|
2836
|
-
* @type {string|MockPointOptions}
|
|
2837
2946
|
* @sample highcharts/annotations/mock-point/
|
|
2838
2947
|
* Attach annotation to a mock point
|
|
2839
|
-
*
|
|
2948
|
+
*
|
|
2949
|
+
* @type {string|Highcharts.MockPointOptionsObject}
|
|
2950
|
+
* @apioption annotations.labels.point
|
|
2840
2951
|
*/
|
|
2841
2952
|
|
|
2842
2953
|
/**
|
|
2843
2954
|
* The x position of the point. Units can be either in axis
|
|
2844
2955
|
* or chart pixel coordinates.
|
|
2845
2956
|
*
|
|
2846
|
-
* @type
|
|
2847
|
-
* @apioption annotations.
|
|
2957
|
+
* @type {number}
|
|
2958
|
+
* @apioption annotations.labels.point.x
|
|
2848
2959
|
*/
|
|
2849
2960
|
|
|
2850
2961
|
/**
|
|
2851
2962
|
* The y position of the point. Units can be either in axis
|
|
2852
2963
|
* or chart pixel coordinates.
|
|
2853
2964
|
*
|
|
2854
|
-
* @type
|
|
2855
|
-
* @apioption annotations.
|
|
2965
|
+
* @type {number}
|
|
2966
|
+
* @apioption annotations.labels.point.y
|
|
2856
2967
|
*/
|
|
2857
2968
|
|
|
2858
2969
|
/**
|
|
2859
|
-
* This number defines which xAxis the point is connected to.
|
|
2860
|
-
*
|
|
2861
|
-
*
|
|
2862
|
-
* the
|
|
2863
|
-
* x coordinate refers to the chart pixels.
|
|
2970
|
+
* This number defines which xAxis the point is connected to. It
|
|
2971
|
+
* refers to either the axis id or the index of the axis in the
|
|
2972
|
+
* xAxis array. If the option is not configured or the axis is not
|
|
2973
|
+
* found the point's x coordinate refers to the chart pixels.
|
|
2864
2974
|
*
|
|
2865
|
-
* @type
|
|
2866
|
-
* @apioption annotations.
|
|
2975
|
+
* @type {number|string}
|
|
2976
|
+
* @apioption annotations.labels.point.xAxis
|
|
2867
2977
|
*/
|
|
2868
2978
|
|
|
2869
2979
|
/**
|
|
2870
|
-
* This number defines which yAxis the point is connected to.
|
|
2871
|
-
*
|
|
2872
|
-
*
|
|
2873
|
-
* the
|
|
2874
|
-
* y coordinate refers to the chart pixels.
|
|
2980
|
+
* This number defines which yAxis the point is connected to. It
|
|
2981
|
+
* refers to either the axis id or the index of the axis in the
|
|
2982
|
+
* yAxis array. If the option is not configured or the axis is not
|
|
2983
|
+
* found the point's y coordinate refers to the chart pixels.
|
|
2875
2984
|
*
|
|
2876
|
-
* @type
|
|
2877
|
-
* @apioption annotations.
|
|
2985
|
+
* @type {number|string}
|
|
2986
|
+
* @apioption annotations.labels.point.yAxis
|
|
2878
2987
|
*/
|
|
2879
2988
|
|
|
2880
2989
|
|
|
@@ -2883,119 +2992,126 @@
|
|
|
2883
2992
|
* multiple shapes, then can be added to the
|
|
2884
2993
|
* [shapeOptions](annotations.shapeOptions.html).
|
|
2885
2994
|
*
|
|
2886
|
-
* @type
|
|
2887
|
-
* @extends
|
|
2888
|
-
* @apioption annotations.
|
|
2995
|
+
* @type {Array<*>}
|
|
2996
|
+
* @extends annotations.shapeOptions
|
|
2997
|
+
* @apioption annotations.shapes
|
|
2889
2998
|
*/
|
|
2890
2999
|
|
|
2891
3000
|
/**
|
|
2892
3001
|
* This option defines the point to which the shape will be
|
|
2893
|
-
* connected.
|
|
2894
|
-
*
|
|
2895
|
-
*
|
|
2896
|
-
* properties and optionally axes.
|
|
3002
|
+
* connected. It can be either the point which exists in the
|
|
3003
|
+
* series - it is referenced by the point's id - or a new point with
|
|
3004
|
+
* defined x, y properties and optionally axes.
|
|
2897
3005
|
*
|
|
2898
|
-
* @type
|
|
2899
|
-
* @extends
|
|
2900
|
-
* @apioption annotations.
|
|
3006
|
+
* @type {string|Highcharts.MockPointOptionsObject}
|
|
3007
|
+
* @extends annotations.labels.point
|
|
3008
|
+
* @apioption annotations.shapes.point
|
|
2901
3009
|
*/
|
|
2902
3010
|
|
|
2903
3011
|
/**
|
|
2904
|
-
* An array of points for the shape. This option is available
|
|
2905
|
-
*
|
|
2906
|
-
*
|
|
3012
|
+
* An array of points for the shape. This option is available for
|
|
3013
|
+
* shapes which can use multiple points such as path. A point can be
|
|
3014
|
+
* either a point object or a point's id.
|
|
2907
3015
|
*
|
|
2908
|
-
* @type {Array<string|Highcharts.MockPoint.Options>}
|
|
2909
3016
|
* @see [annotations.shapes.point](annotations.shapes.point.html)
|
|
2910
|
-
*
|
|
3017
|
+
*
|
|
3018
|
+
* @type {Array<string|Highcharts.MockPointOptionsObject>}
|
|
3019
|
+
* @extends annotations.labels.point
|
|
3020
|
+
* @apioption annotations.shapes.points
|
|
2911
3021
|
*/
|
|
2912
3022
|
|
|
2913
3023
|
/**
|
|
2914
|
-
* Id of the marker which will be drawn at the final
|
|
2915
|
-
*
|
|
2916
|
-
* Custom markers can be defined in defs property.
|
|
3024
|
+
* Id of the marker which will be drawn at the final vertex of the
|
|
3025
|
+
* path. Custom markers can be defined in defs property.
|
|
2917
3026
|
*
|
|
2918
|
-
* @type {string}
|
|
2919
3027
|
* @see [defs.markers](defs.markers.html)
|
|
3028
|
+
*
|
|
2920
3029
|
* @sample highcharts/annotations/custom-markers/
|
|
2921
3030
|
* Define a custom marker for annotations
|
|
2922
|
-
*
|
|
3031
|
+
*
|
|
3032
|
+
* @type {string}
|
|
3033
|
+
* @apioption annotations.shapes.markerEnd
|
|
2923
3034
|
*/
|
|
2924
3035
|
|
|
2925
3036
|
/**
|
|
2926
|
-
* Id of the marker which will be drawn at the first
|
|
2927
|
-
*
|
|
2928
|
-
* Custom markers can be defined in defs property.
|
|
3037
|
+
* Id of the marker which will be drawn at the first vertex of the
|
|
3038
|
+
* path. Custom markers can be defined in defs property.
|
|
2929
3039
|
*
|
|
2930
|
-
* @type {string}
|
|
2931
3040
|
* @see [defs.markers](defs.markers.html)
|
|
3041
|
+
*
|
|
2932
3042
|
* @sample {highcharts} highcharts/annotations/custom-markers/
|
|
2933
3043
|
* Define a custom marker for annotations
|
|
2934
|
-
*
|
|
3044
|
+
*
|
|
3045
|
+
* @type {string}
|
|
3046
|
+
* @apioption annotations.shapes.markerStart
|
|
2935
3047
|
*/
|
|
2936
3048
|
|
|
2937
3049
|
|
|
2938
3050
|
/**
|
|
2939
|
-
* Options for annotation's shapes. Each shape inherits options
|
|
2940
|
-
*
|
|
2941
|
-
*
|
|
2942
|
-
*
|
|
2943
|
-
* @type {Object}
|
|
3051
|
+
* Options for annotation's shapes. Each shape inherits options from
|
|
3052
|
+
* the shapeOptions object. An option from the shapeOptions can be
|
|
3053
|
+
* overwritten by config for a specific shape.
|
|
2944
3054
|
*/
|
|
2945
3055
|
shapeOptions: {
|
|
3056
|
+
|
|
2946
3057
|
/**
|
|
2947
3058
|
* The width of the shape.
|
|
2948
3059
|
*
|
|
2949
|
-
* @type {number}
|
|
2950
3060
|
* @sample highcharts/annotations/shape/
|
|
2951
3061
|
* Basic shape annotation
|
|
2952
|
-
*
|
|
3062
|
+
*
|
|
3063
|
+
* @type {number}
|
|
3064
|
+
* @apioption annotations.shapeOptions.width
|
|
2953
3065
|
**/
|
|
2954
3066
|
|
|
2955
3067
|
/**
|
|
2956
3068
|
* The height of the shape.
|
|
2957
3069
|
*
|
|
2958
|
-
* @type {number}
|
|
2959
3070
|
* @sample highcharts/annotations/shape/
|
|
2960
3071
|
* Basic shape annotation
|
|
2961
|
-
*
|
|
3072
|
+
*
|
|
3073
|
+
* @type {number}
|
|
3074
|
+
* @apioption annotations.shapeOptions.height
|
|
2962
3075
|
*/
|
|
2963
3076
|
|
|
2964
3077
|
/**
|
|
2965
|
-
* The
|
|
3078
|
+
* The type of the shape, e.g. circle or rectangle.
|
|
2966
3079
|
*
|
|
2967
|
-
* @type {Color}
|
|
2968
3080
|
* @sample highcharts/annotations/shape/
|
|
2969
3081
|
* Basic shape annotation
|
|
3082
|
+
*
|
|
3083
|
+
* @type {string}
|
|
3084
|
+
* @default 'rect'
|
|
3085
|
+
* @apioption annotations.shapeOptions.type
|
|
2970
3086
|
*/
|
|
2971
|
-
stroke: 'rgba(0, 0, 0, 0.75)',
|
|
2972
3087
|
|
|
2973
3088
|
/**
|
|
2974
|
-
* The
|
|
3089
|
+
* The color of the shape's stroke.
|
|
2975
3090
|
*
|
|
2976
3091
|
* @sample highcharts/annotations/shape/
|
|
2977
3092
|
* Basic shape annotation
|
|
3093
|
+
*
|
|
3094
|
+
* @type {Highcharts.ColorString}
|
|
2978
3095
|
*/
|
|
2979
|
-
|
|
3096
|
+
stroke: 'rgba(0, 0, 0, 0.75)',
|
|
2980
3097
|
|
|
2981
3098
|
/**
|
|
2982
|
-
* The
|
|
3099
|
+
* The pixel stroke width of the shape.
|
|
2983
3100
|
*
|
|
2984
|
-
* @type {Color}
|
|
2985
3101
|
* @sample highcharts/annotations/shape/
|
|
2986
3102
|
* Basic shape annotation
|
|
2987
3103
|
*/
|
|
2988
|
-
|
|
3104
|
+
strokeWidth: 1,
|
|
2989
3105
|
|
|
2990
3106
|
/**
|
|
2991
|
-
* The
|
|
3107
|
+
* The color of the shape's fill.
|
|
2992
3108
|
*
|
|
2993
|
-
* @type {string}
|
|
2994
3109
|
* @sample highcharts/annotations/shape/
|
|
2995
3110
|
* Basic shape annotation
|
|
2996
|
-
*
|
|
2997
|
-
* @
|
|
3111
|
+
*
|
|
3112
|
+
* @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}
|
|
2998
3113
|
*/
|
|
3114
|
+
fill: 'rgba(0, 0, 0, 0.75)',
|
|
2999
3115
|
|
|
3000
3116
|
/**
|
|
3001
3117
|
* The radius of the shape.
|
|
@@ -3018,10 +3134,16 @@
|
|
|
3018
3134
|
* Options from the controlPointOptions can be overwritten
|
|
3019
3135
|
* by options in a specific control point.
|
|
3020
3136
|
*
|
|
3021
|
-
* @type
|
|
3022
|
-
* @apioption annotations.
|
|
3137
|
+
* @type {Annotation.ControlPoint.Options}
|
|
3138
|
+
* @apioption annotations.controlPointOptions
|
|
3023
3139
|
*/
|
|
3024
3140
|
controlPointOptions: {
|
|
3141
|
+
|
|
3142
|
+
/**
|
|
3143
|
+
* @function {Annotation.ControlPoint.Positioner}
|
|
3144
|
+
* @apioption annotations.controlPointOptions.positioner
|
|
3145
|
+
*/
|
|
3146
|
+
|
|
3025
3147
|
symbol: 'circle',
|
|
3026
3148
|
width: 10,
|
|
3027
3149
|
height: 10,
|
|
@@ -3031,57 +3153,53 @@
|
|
|
3031
3153
|
fill: 'white'
|
|
3032
3154
|
},
|
|
3033
3155
|
visible: false,
|
|
3034
|
-
|
|
3035
|
-
/**
|
|
3036
|
-
* @function {Annotation.ControlPoint.Positioner}
|
|
3037
|
-
* @apioption annotations.crookedLine.controlPointOptions.positioner
|
|
3038
|
-
*/
|
|
3039
|
-
|
|
3040
|
-
|
|
3041
3156
|
events: {}
|
|
3042
3157
|
},
|
|
3043
3158
|
|
|
3044
|
-
|
|
3045
|
-
/**
|
|
3046
|
-
* Events available in annotations.
|
|
3047
|
-
*
|
|
3048
|
-
* @type {Object}
|
|
3049
|
-
*/
|
|
3050
3159
|
/**
|
|
3051
3160
|
* Event callback when annotation is added to the chart.
|
|
3052
3161
|
*
|
|
3053
|
-
* @
|
|
3054
|
-
* @
|
|
3162
|
+
* @type {Highcharts.EventCallbackFunction<Highcharts.Annotation>}
|
|
3163
|
+
* @since 7.1.0
|
|
3164
|
+
* @apioption annotations.events.add
|
|
3055
3165
|
*/
|
|
3166
|
+
|
|
3056
3167
|
/**
|
|
3057
3168
|
* Event callback when annotation is updated (e.g. drag and
|
|
3058
3169
|
* droppped or resized by control points).
|
|
3059
3170
|
*
|
|
3060
|
-
* @
|
|
3061
|
-
* @
|
|
3171
|
+
* @type {Highcharts.EventCallbackFunction<Highcharts.Annotation>}
|
|
3172
|
+
* @since 7.1.0
|
|
3173
|
+
* @apioption annotations.events.afterUpdate
|
|
3062
3174
|
*/
|
|
3175
|
+
|
|
3063
3176
|
/**
|
|
3064
3177
|
* Event callback when annotation is removed from the chart.
|
|
3065
3178
|
*
|
|
3066
|
-
* @
|
|
3067
|
-
* @
|
|
3179
|
+
* @type {Highcharts.EventCallbackFunction<Highcharts.Annotation>}
|
|
3180
|
+
* @since 7.1.0
|
|
3181
|
+
* @apioption annotations.events.remove
|
|
3182
|
+
*/
|
|
3183
|
+
|
|
3184
|
+
/**
|
|
3185
|
+
* Events available in annotations.
|
|
3068
3186
|
*/
|
|
3069
3187
|
events: {},
|
|
3070
3188
|
|
|
3071
3189
|
/**
|
|
3072
3190
|
* The Z index of the annotation.
|
|
3073
|
-
*
|
|
3074
|
-
* @type {number}
|
|
3075
|
-
* @default 6
|
|
3076
3191
|
*/
|
|
3077
3192
|
zIndex: 6
|
|
3193
|
+
|
|
3078
3194
|
},
|
|
3079
3195
|
|
|
3080
3196
|
/**
|
|
3081
3197
|
* Initialize the annotation.
|
|
3082
3198
|
*
|
|
3083
|
-
* @param {Highcharts.Chart}
|
|
3084
|
-
*
|
|
3199
|
+
* @param {Highcharts.Chart}
|
|
3200
|
+
* The chart
|
|
3201
|
+
* @param {Highcharts.AnnotationsOptions}
|
|
3202
|
+
* The user options for the annotation
|
|
3085
3203
|
*/
|
|
3086
3204
|
init: function () {
|
|
3087
3205
|
this.linkPoints();
|
|
@@ -3330,10 +3448,11 @@
|
|
|
3330
3448
|
},
|
|
3331
3449
|
|
|
3332
3450
|
/**
|
|
3333
|
-
* See {@link Highcharts.
|
|
3451
|
+
* See {@link Highcharts.Chart#removeAnnotation}.
|
|
3334
3452
|
*/
|
|
3335
3453
|
remove: function () {
|
|
3336
|
-
|
|
3454
|
+
// Let chart.update() remove annoations on demand
|
|
3455
|
+
return this.chart.removeAnnotation(this);
|
|
3337
3456
|
},
|
|
3338
3457
|
|
|
3339
3458
|
update: function (userOptions) {
|
|
@@ -3369,7 +3488,7 @@
|
|
|
3369
3488
|
* Initialisation of a single shape
|
|
3370
3489
|
*
|
|
3371
3490
|
* @param {Object} shapeOptions - a confg object for a single shape
|
|
3372
|
-
|
|
3491
|
+
*/
|
|
3373
3492
|
initShape: function (shapeOptions, index) {
|
|
3374
3493
|
var options = merge(
|
|
3375
3494
|
this.options.shapeOptions,
|
|
@@ -3481,7 +3600,7 @@
|
|
|
3481
3600
|
item.destroy();
|
|
3482
3601
|
},
|
|
3483
3602
|
|
|
3484
|
-
|
|
3603
|
+
/**
|
|
3485
3604
|
* @private
|
|
3486
3605
|
*/
|
|
3487
3606
|
renderItem: function (item) {
|
|
@@ -3498,7 +3617,7 @@
|
|
|
3498
3617
|
* An object uses for mapping between a shape type and a constructor.
|
|
3499
3618
|
* To add a new shape type extend this object with type name as a key
|
|
3500
3619
|
* and a constructor as its value.
|
|
3501
|
-
|
|
3620
|
+
*/
|
|
3502
3621
|
Annotation.shapesMap = {
|
|
3503
3622
|
'rect': ControllableRect,
|
|
3504
3623
|
'circle': ControllableCircle,
|
|
@@ -3538,10 +3657,7 @@
|
|
|
3538
3657
|
*
|
|
3539
3658
|
******************************************************************** */
|
|
3540
3659
|
|
|
3541
|
-
|
|
3542
|
-
H.Chart.prototype.collectionsWithUpdate.push('annotations');
|
|
3543
|
-
|
|
3544
|
-
H.extend(H.Chart.prototype, /** @lends Highcharts.Chart# */ {
|
|
3660
|
+
H.extend(chartProto, /** @lends Highcharts.Chart# */ {
|
|
3545
3661
|
initAnnotation: function (userOptions) {
|
|
3546
3662
|
var Constructor =
|
|
3547
3663
|
Annotation.types[userOptions.type] || Annotation,
|
|
@@ -3609,8 +3725,13 @@
|
|
|
3609
3725
|
}
|
|
3610
3726
|
});
|
|
3611
3727
|
|
|
3728
|
+
// Let chart.update() update annotations
|
|
3729
|
+
chartProto.collectionsWithUpdate.push('annotations');
|
|
3730
|
+
|
|
3731
|
+
// Let chart.update() create annoations on demand
|
|
3732
|
+
chartProto.collectionsWithInit.annotations = [chartProto.addAnnotation];
|
|
3612
3733
|
|
|
3613
|
-
|
|
3734
|
+
chartProto.callbacks.push(function (chart) {
|
|
3614
3735
|
chart.annotations = [];
|
|
3615
3736
|
|
|
3616
3737
|
if (!chart.options.annotations) {
|
|
@@ -3724,13 +3845,24 @@
|
|
|
3724
3845
|
/**
|
|
3725
3846
|
* A crooked line annotation.
|
|
3726
3847
|
*
|
|
3727
|
-
* @excluding labels, shapes
|
|
3728
3848
|
* @sample highcharts/annotations-advanced/crooked-line/
|
|
3729
3849
|
* Crooked line
|
|
3730
|
-
*
|
|
3850
|
+
*
|
|
3851
|
+
* @product highstock
|
|
3731
3852
|
* @optionparent annotations.crookedLine
|
|
3732
3853
|
*/
|
|
3733
3854
|
{
|
|
3855
|
+
|
|
3856
|
+
/**
|
|
3857
|
+
* @extends annotations.labelOptions
|
|
3858
|
+
* @apioption annotations.crookedLine.labelOptions
|
|
3859
|
+
*/
|
|
3860
|
+
|
|
3861
|
+
/**
|
|
3862
|
+
* @extends annotations.shapeOptions
|
|
3863
|
+
* @apioption annotations.crookedLine.shapeOptions
|
|
3864
|
+
*/
|
|
3865
|
+
|
|
3734
3866
|
/**
|
|
3735
3867
|
* Additional options for an annotation with the type.
|
|
3736
3868
|
*/
|
|
@@ -3749,24 +3881,26 @@
|
|
|
3749
3881
|
yAxis: 0,
|
|
3750
3882
|
|
|
3751
3883
|
/**
|
|
3752
|
-
* @type
|
|
3884
|
+
* @type {Array<*>}
|
|
3753
3885
|
* @apioption annotations.crookedLine.typeOptions.points
|
|
3754
3886
|
*/
|
|
3755
3887
|
|
|
3756
3888
|
/**
|
|
3757
3889
|
* The x position of the point.
|
|
3758
|
-
*
|
|
3890
|
+
*
|
|
3891
|
+
* @type {number}
|
|
3759
3892
|
* @apioption annotations.crookedLine.typeOptions.points.x
|
|
3760
3893
|
*/
|
|
3761
3894
|
|
|
3762
3895
|
/**
|
|
3763
3896
|
* The y position of the point.
|
|
3764
|
-
*
|
|
3897
|
+
*
|
|
3898
|
+
* @type {number}
|
|
3765
3899
|
* @apioption annotations.crookedLine.typeOptions.points.y
|
|
3766
3900
|
*/
|
|
3767
3901
|
|
|
3768
3902
|
/**
|
|
3769
|
-
* @type
|
|
3903
|
+
* @type {number}
|
|
3770
3904
|
* @excluding positioner, events
|
|
3771
3905
|
* @apioption annotations.crookedLine.typeOptions.points.controlPoint
|
|
3772
3906
|
*/
|
|
@@ -3774,7 +3908,6 @@
|
|
|
3774
3908
|
/**
|
|
3775
3909
|
* Line options.
|
|
3776
3910
|
*
|
|
3777
|
-
* @type {Object}
|
|
3778
3911
|
* @excluding height, point, points, r, type, width
|
|
3779
3912
|
*/
|
|
3780
3913
|
line: {
|
|
@@ -3867,22 +4000,23 @@
|
|
|
3867
4000
|
/**
|
|
3868
4001
|
* An elliott wave annotation.
|
|
3869
4002
|
*
|
|
3870
|
-
* @extends annotations.crookedLine
|
|
3871
4003
|
* @sample highcharts/annotations-advanced/elliott-wave/
|
|
3872
4004
|
* Elliott wave
|
|
3873
|
-
*
|
|
4005
|
+
*
|
|
4006
|
+
* @extends annotations.crookedLine
|
|
4007
|
+
* @product highstock
|
|
3874
4008
|
* @optionparent annotations.elliottWave
|
|
3875
4009
|
*/
|
|
3876
4010
|
{
|
|
3877
4011
|
typeOptions: {
|
|
4012
|
+
|
|
3878
4013
|
/**
|
|
3879
|
-
* @
|
|
3880
|
-
* @
|
|
3881
|
-
* @apioption annotations.crookedLine.typeOptions.points.label
|
|
4014
|
+
* @extends annotations.crookedLine.labelOptions
|
|
4015
|
+
* @apioption annotations.elliottWave.typeOptions.points.label
|
|
3882
4016
|
*/
|
|
3883
4017
|
|
|
3884
4018
|
/**
|
|
3885
|
-
* @ignore
|
|
4019
|
+
* @ignore-options
|
|
3886
4020
|
*/
|
|
3887
4021
|
labels: ['(0)', '(A)', '(B)', '(C)', '(D)', '(E)'],
|
|
3888
4022
|
line: {
|
|
@@ -4291,7 +4425,8 @@
|
|
|
4291
4425
|
H.extendAnnotation(
|
|
4292
4426
|
InfinityLine,
|
|
4293
4427
|
CrookedLine,
|
|
4294
|
-
/** @lends Annotation.InfinityLine# */
|
|
4428
|
+
/** @lends Annotation.InfinityLine# */
|
|
4429
|
+
{
|
|
4295
4430
|
addShapes: function () {
|
|
4296
4431
|
var typeOptions = this.options.typeOptions,
|
|
4297
4432
|
points = [
|
|
@@ -4320,12 +4455,11 @@
|
|
|
4320
4455
|
/**
|
|
4321
4456
|
* An infinity line annotation.
|
|
4322
4457
|
*
|
|
4323
|
-
* @extends annotations.crookedLine
|
|
4324
4458
|
* @sample highcharts/annotations-advanced/infinity-line/
|
|
4325
4459
|
* Infinity Line
|
|
4326
4460
|
*
|
|
4327
|
-
* @
|
|
4328
|
-
*
|
|
4461
|
+
* @extends annotations.crookedLine
|
|
4462
|
+
* @product highstock
|
|
4329
4463
|
* @apioption annotations.infinityLine
|
|
4330
4464
|
*/
|
|
4331
4465
|
|
|
@@ -4503,11 +4637,11 @@
|
|
|
4503
4637
|
/**
|
|
4504
4638
|
* A fibonacci annotation.
|
|
4505
4639
|
*
|
|
4506
|
-
* @extends annotations.crookedLine
|
|
4507
4640
|
* @sample highcharts/annotations-advanced/fibonacci/
|
|
4508
4641
|
* Fibonacci
|
|
4509
4642
|
*
|
|
4510
|
-
* @
|
|
4643
|
+
* @extends annotations.crookedLine
|
|
4644
|
+
* @product highstock
|
|
4511
4645
|
* @optionparent annotations.fibonacci
|
|
4512
4646
|
*/
|
|
4513
4647
|
{
|
|
@@ -4520,16 +4654,16 @@
|
|
|
4520
4654
|
/**
|
|
4521
4655
|
* An array of background colors:
|
|
4522
4656
|
* Default to:
|
|
4523
|
-
*
|
|
4524
|
-
|
|
4525
|
-
|
|
4526
|
-
|
|
4527
|
-
|
|
4528
|
-
|
|
4529
|
-
|
|
4530
|
-
|
|
4531
|
-
|
|
4532
|
-
|
|
4657
|
+
* ```
|
|
4658
|
+
* [
|
|
4659
|
+
* 'rgba(130, 170, 255, 0.4)',
|
|
4660
|
+
* 'rgba(139, 191, 216, 0.4)',
|
|
4661
|
+
* 'rgba(150, 216, 192, 0.4)',
|
|
4662
|
+
* 'rgba(156, 229, 161, 0.4)',
|
|
4663
|
+
* 'rgba(162, 241, 130, 0.4)',
|
|
4664
|
+
* 'rgba(169, 255, 101, 0.4)'
|
|
4665
|
+
* ]
|
|
4666
|
+
* ```
|
|
4533
4667
|
*/
|
|
4534
4668
|
backgroundColors: [
|
|
4535
4669
|
'rgba(130, 170, 255, 0.4)',
|
|
@@ -4553,8 +4687,8 @@
|
|
|
4553
4687
|
/**
|
|
4554
4688
|
* An array with options for the labels.
|
|
4555
4689
|
*
|
|
4556
|
-
* @type
|
|
4557
|
-
* @extends
|
|
4690
|
+
* @type {Array<object>}
|
|
4691
|
+
* @extends annotations.crookedLine.labelOptions
|
|
4558
4692
|
* @apioption annotations.fibonacci.typeOptions.labels
|
|
4559
4693
|
*/
|
|
4560
4694
|
labels: []
|
|
@@ -4748,10 +4882,11 @@
|
|
|
4748
4882
|
/**
|
|
4749
4883
|
* A pitchfork annotation.
|
|
4750
4884
|
*
|
|
4751
|
-
* @extends annotations.infinityLine
|
|
4752
4885
|
* @sample highcharts/annotations-advanced/pitchfork/
|
|
4753
4886
|
* Pitchfork
|
|
4754
|
-
*
|
|
4887
|
+
*
|
|
4888
|
+
* @extends annotations.infinityLine
|
|
4889
|
+
* @product highstock
|
|
4755
4890
|
* @optionparent annotations.pitchfork
|
|
4756
4891
|
*/
|
|
4757
4892
|
{
|
|
@@ -4759,7 +4894,7 @@
|
|
|
4759
4894
|
/**
|
|
4760
4895
|
* Inner background options.
|
|
4761
4896
|
*
|
|
4762
|
-
* @extends
|
|
4897
|
+
* @extends annotations.crookedLine.shapeOptions
|
|
4763
4898
|
* @excluding height, r, type, width
|
|
4764
4899
|
*/
|
|
4765
4900
|
innerBackground: {
|
|
@@ -4769,7 +4904,7 @@
|
|
|
4769
4904
|
/**
|
|
4770
4905
|
* Outer background options.
|
|
4771
4906
|
*
|
|
4772
|
-
* @extends
|
|
4907
|
+
* @extends annotations.crookedLine.shapeOptions
|
|
4773
4908
|
* @excluding height, r, type, width
|
|
4774
4909
|
*/
|
|
4775
4910
|
outerBackground: {
|
|
@@ -4793,7 +4928,7 @@
|
|
|
4793
4928
|
* @class
|
|
4794
4929
|
* @extends Annotation
|
|
4795
4930
|
* @memberOf Highcharts
|
|
4796
|
-
|
|
4931
|
+
*/
|
|
4797
4932
|
function VerticalLine() {
|
|
4798
4933
|
H.Annotation.apply(this, arguments);
|
|
4799
4934
|
}
|
|
@@ -4890,11 +5025,12 @@
|
|
|
4890
5025
|
/**
|
|
4891
5026
|
* A vertical line annotation.
|
|
4892
5027
|
*
|
|
4893
|
-
* @extends annotations.crookedLine
|
|
4894
|
-
* @excluding labels, shapes, controlPointOptions
|
|
4895
5028
|
* @sample highcharts/annotations-advanced/vertical-line/
|
|
4896
5029
|
* Vertical line
|
|
4897
|
-
*
|
|
5030
|
+
*
|
|
5031
|
+
* @extends annotations.crookedLine
|
|
5032
|
+
* @excluding labels, shapes, controlPointOptions
|
|
5033
|
+
* @product highstock
|
|
4898
5034
|
* @optionparent annotations.verticalLine
|
|
4899
5035
|
*/
|
|
4900
5036
|
{
|
|
@@ -4926,7 +5062,7 @@
|
|
|
4926
5062
|
/**
|
|
4927
5063
|
* Connector options.
|
|
4928
5064
|
*
|
|
4929
|
-
* @extends
|
|
5065
|
+
* @extends annotations.crookedLine.shapeOptions
|
|
4930
5066
|
* @excluding height, r, type, width
|
|
4931
5067
|
*/
|
|
4932
5068
|
connector: {
|
|
@@ -4963,9 +5099,7 @@
|
|
|
4963
5099
|
/** @lends Annotation.Measure# */
|
|
4964
5100
|
{
|
|
4965
5101
|
/**
|
|
4966
|
-
*
|
|
4967
5102
|
* Init annotation object.
|
|
4968
|
-
*
|
|
4969
5103
|
*/
|
|
4970
5104
|
init: function () {
|
|
4971
5105
|
Annotation.prototype.init.apply(this, arguments);
|
|
@@ -5064,8 +5198,7 @@
|
|
|
5064
5198
|
/**
|
|
5065
5199
|
* Add label with calculated values (min, max, average, bins).
|
|
5066
5200
|
*
|
|
5067
|
-
* @param {
|
|
5068
|
-
*
|
|
5201
|
+
* @param {boolean} resize - the flag for resize shape
|
|
5069
5202
|
*/
|
|
5070
5203
|
addValues: function (resize) {
|
|
5071
5204
|
var options = this.options.typeOptions,
|
|
@@ -5116,8 +5249,7 @@
|
|
|
5116
5249
|
}
|
|
5117
5250
|
},
|
|
5118
5251
|
/**
|
|
5119
|
-
*
|
|
5120
|
-
*
|
|
5252
|
+
* Crosshair, background (rect)
|
|
5121
5253
|
*/
|
|
5122
5254
|
addShapes: function () {
|
|
5123
5255
|
this.addCrosshairs();
|
|
@@ -5316,9 +5448,10 @@
|
|
|
5316
5448
|
this.options.typeOptions.point.y = this.startYMin;
|
|
5317
5449
|
},
|
|
5318
5450
|
calculations: {
|
|
5319
|
-
|
|
5320
|
-
|
|
5321
|
-
|
|
5451
|
+
/**
|
|
5452
|
+
* Set starting points
|
|
5453
|
+
* @private
|
|
5454
|
+
*/
|
|
5322
5455
|
init: function () {
|
|
5323
5456
|
var options = this.options.typeOptions,
|
|
5324
5457
|
chart = this.chart,
|
|
@@ -5366,12 +5499,12 @@
|
|
|
5366
5499
|
}
|
|
5367
5500
|
|
|
5368
5501
|
},
|
|
5369
|
-
|
|
5370
|
-
|
|
5371
|
-
|
|
5372
|
-
|
|
5373
|
-
|
|
5374
|
-
|
|
5502
|
+
/**
|
|
5503
|
+
* Set current xAxisMin, xAxisMax, yAxisMin, yAxisMax.
|
|
5504
|
+
* Calculations of measure values (min, max, average, bins).
|
|
5505
|
+
* @private
|
|
5506
|
+
* @param {Boolean} resize - flag if shape is resized
|
|
5507
|
+
*/
|
|
5375
5508
|
recalculate: function (resize) {
|
|
5376
5509
|
var calc = this.calculations,
|
|
5377
5510
|
options = this.options.typeOptions,
|
|
@@ -5396,27 +5529,27 @@
|
|
|
5396
5529
|
}
|
|
5397
5530
|
|
|
5398
5531
|
},
|
|
5399
|
-
|
|
5400
|
-
|
|
5401
|
-
|
|
5402
|
-
|
|
5403
|
-
|
|
5404
|
-
|
|
5405
|
-
|
|
5406
|
-
|
|
5532
|
+
/**
|
|
5533
|
+
* Set current xAxisMin, xAxisMax, yAxisMin, yAxisMax.
|
|
5534
|
+
* Calculations of measure values (min, max, average, bins).
|
|
5535
|
+
* @private
|
|
5536
|
+
* @param {Object} axis - x or y axis reference
|
|
5537
|
+
* @param {Number} value - point's value (x or y)
|
|
5538
|
+
* @param {Number} offset - amount of pixels
|
|
5539
|
+
*/
|
|
5407
5540
|
getPointPos: function (axis, value, offset) {
|
|
5408
5541
|
return axis.toValue(
|
|
5409
5542
|
axis.toPixels(value) + offset
|
|
5410
5543
|
);
|
|
5411
5544
|
},
|
|
5412
|
-
|
|
5413
|
-
|
|
5414
|
-
|
|
5415
|
-
|
|
5416
|
-
|
|
5417
|
-
|
|
5418
|
-
|
|
5419
|
-
|
|
5545
|
+
/**
|
|
5546
|
+
* Update position of start points
|
|
5547
|
+
* (startXMin, startXMax, startYMin, startYMax)
|
|
5548
|
+
* @private
|
|
5549
|
+
* @param {Boolean} redraw - flag if shape is redraw
|
|
5550
|
+
* @param {Boolean} resize - flag if shape is resized
|
|
5551
|
+
* @param {Boolean} cpIndex - index of controlPoint
|
|
5552
|
+
*/
|
|
5420
5553
|
updateStartPoints: function (redraw, resize, cpIndex, dx, dy) {
|
|
5421
5554
|
var options = this.options.typeOptions,
|
|
5422
5555
|
selectType = options.selectType,
|
|
@@ -5459,19 +5592,21 @@
|
|
|
5459
5592
|
this.offsetY = 0;
|
|
5460
5593
|
}
|
|
5461
5594
|
},
|
|
5462
|
-
|
|
5463
|
-
|
|
5464
|
-
|
|
5595
|
+
/**
|
|
5596
|
+
* Default formatter of label's content
|
|
5597
|
+
* @private
|
|
5598
|
+
*/
|
|
5465
5599
|
defaultFormatter: function () {
|
|
5466
5600
|
return 'Min: ' + this.min +
|
|
5467
5601
|
'<br>Max: ' + this.max +
|
|
5468
5602
|
'<br>Average: ' + this.average +
|
|
5469
5603
|
'<br>Bins: ' + this.bins;
|
|
5470
5604
|
},
|
|
5471
|
-
|
|
5472
|
-
|
|
5473
|
-
|
|
5474
|
-
|
|
5605
|
+
/**
|
|
5606
|
+
* Set values for xAxisMin, xAxisMax, yAxisMin, yAxisMax, also
|
|
5607
|
+
* when chart is inverted
|
|
5608
|
+
* @private
|
|
5609
|
+
*/
|
|
5475
5610
|
getExtremes: function (xAxisMin, xAxisMax, yAxisMin, yAxisMax) {
|
|
5476
5611
|
return {
|
|
5477
5612
|
xAxisMin: Math.min(xAxisMax, xAxisMin),
|
|
@@ -5480,9 +5615,10 @@
|
|
|
5480
5615
|
yAxisMax: Math.max(yAxisMax, yAxisMin)
|
|
5481
5616
|
};
|
|
5482
5617
|
},
|
|
5483
|
-
|
|
5484
|
-
|
|
5485
|
-
|
|
5618
|
+
/**
|
|
5619
|
+
* Definitions of calculations (min, max, average, bins)
|
|
5620
|
+
* @private
|
|
5621
|
+
*/
|
|
5486
5622
|
min: function () {
|
|
5487
5623
|
var min = Infinity,
|
|
5488
5624
|
series = this.chart.series,
|
|
@@ -5931,11 +6067,13 @@
|
|
|
5931
6067
|
return chartNavigation;
|
|
5932
6068
|
});
|
|
5933
6069
|
_registerModule(_modules, 'annotations/navigationBindings.js', [_modules['parts/Globals.js'], _modules['mixins/navigation.js']], function (H, chartNavigationMixin) {
|
|
5934
|
-
|
|
5935
|
-
* (c) 2009-2017 Highsoft, Black Label
|
|
6070
|
+
/* *
|
|
5936
6071
|
*
|
|
5937
|
-
*
|
|
5938
|
-
|
|
6072
|
+
* (c) 2009-2017 Highsoft, Black Label
|
|
6073
|
+
*
|
|
6074
|
+
* License: www.highcharts.com/license
|
|
6075
|
+
*
|
|
6076
|
+
* */
|
|
5939
6077
|
|
|
5940
6078
|
var doc = H.doc,
|
|
5941
6079
|
win = H.win,
|
|
@@ -6148,13 +6286,15 @@
|
|
|
6148
6286
|
});
|
|
6149
6287
|
|
|
6150
6288
|
objectEach(options.events || {}, function (callback, eventName) {
|
|
6151
|
-
|
|
6152
|
-
|
|
6153
|
-
|
|
6154
|
-
|
|
6155
|
-
|
|
6156
|
-
|
|
6157
|
-
|
|
6289
|
+
if (H.isFunction(callback)) {
|
|
6290
|
+
navigation.eventsToUnbind.push(
|
|
6291
|
+
addEvent(
|
|
6292
|
+
navigation,
|
|
6293
|
+
eventName,
|
|
6294
|
+
callback
|
|
6295
|
+
)
|
|
6296
|
+
);
|
|
6297
|
+
}
|
|
6158
6298
|
});
|
|
6159
6299
|
|
|
6160
6300
|
navigation.eventsToUnbind.push(
|
|
@@ -7269,13 +7409,15 @@
|
|
|
7269
7409
|
|
|
7270
7410
|
});
|
|
7271
7411
|
_registerModule(_modules, 'annotations/popup.js', [_modules['parts/Globals.js']], function (H) {
|
|
7272
|
-
|
|
7273
|
-
* Popup generator for Stock tools
|
|
7412
|
+
/* *
|
|
7274
7413
|
*
|
|
7275
|
-
*
|
|
7414
|
+
* Popup generator for Stock tools
|
|
7276
7415
|
*
|
|
7277
|
-
*
|
|
7278
|
-
|
|
7416
|
+
* (c) 2009-2017 Sebastian Bochan
|
|
7417
|
+
*
|
|
7418
|
+
* License: www.highcharts.com/license
|
|
7419
|
+
*
|
|
7420
|
+
* */
|
|
7279
7421
|
|
|
7280
7422
|
var addEvent = H.addEvent,
|
|
7281
7423
|
createElement = H.createElement,
|
|
@@ -7318,13 +7460,11 @@
|
|
|
7318
7460
|
};
|
|
7319
7461
|
|
|
7320
7462
|
H.Popup.prototype = {
|
|
7321
|
-
|
|
7463
|
+
/**
|
|
7322
7464
|
* Initialize the popup. Create base div and add close button.
|
|
7323
|
-
*
|
|
7465
|
+
* @private
|
|
7324
7466
|
* @param {HTMLDOMElement} - container where popup should be placed
|
|
7325
|
-
*
|
|
7326
7467
|
* @return {HTMLDOMElement} - return created popup's div
|
|
7327
|
-
*
|
|
7328
7468
|
*/
|
|
7329
7469
|
init: function (parentDiv) {
|
|
7330
7470
|
|
|
@@ -7338,9 +7478,9 @@
|
|
|
7338
7478
|
// add close button
|
|
7339
7479
|
this.addCloseBtn();
|
|
7340
7480
|
},
|
|
7341
|
-
|
|
7481
|
+
/**
|
|
7342
7482
|
* Create HTML element and attach click event (close popup).
|
|
7343
|
-
*
|
|
7483
|
+
* @private
|
|
7344
7484
|
*/
|
|
7345
7485
|
addCloseBtn: function () {
|
|
7346
7486
|
var _self = this,
|
|
@@ -7357,13 +7497,11 @@
|
|
|
7357
7497
|
});
|
|
7358
7498
|
});
|
|
7359
7499
|
},
|
|
7360
|
-
|
|
7500
|
+
/**
|
|
7361
7501
|
* Create two columns (divs) in HTML.
|
|
7362
|
-
*
|
|
7502
|
+
* @private
|
|
7363
7503
|
* @param {HTMLDOMElement} - container of columns
|
|
7364
|
-
*
|
|
7365
7504
|
* @return {Object} - reference to two HTML columns
|
|
7366
|
-
*
|
|
7367
7505
|
*/
|
|
7368
7506
|
addColsContainer: function (container) {
|
|
7369
7507
|
var rhsCol,
|
|
@@ -7389,15 +7527,14 @@
|
|
|
7389
7527
|
rhsCol: rhsCol
|
|
7390
7528
|
};
|
|
7391
7529
|
},
|
|
7392
|
-
|
|
7530
|
+
/**
|
|
7393
7531
|
* Create input with label.
|
|
7394
|
-
*
|
|
7532
|
+
* @private
|
|
7395
7533
|
* @param {String} - chain of fields i.e params.styles.fontSize
|
|
7396
7534
|
* @param {String} - indicator type
|
|
7397
7535
|
* @param {HTMLDOMElement} - container where elements should be added
|
|
7398
7536
|
* @param {String} - dafault value of input i.e period value is 14,
|
|
7399
7537
|
* extracted from defaultOptions (ADD mode) or series options (EDIT mode)
|
|
7400
|
-
*
|
|
7401
7538
|
*/
|
|
7402
7539
|
addInput: function (option, type, parentDiv, value) {
|
|
7403
7540
|
var optionParamList = option.split('.'),
|
|
@@ -7430,15 +7567,14 @@
|
|
|
7430
7567
|
parentDiv
|
|
7431
7568
|
).setAttribute(PREFIX + 'data-name', option);
|
|
7432
7569
|
},
|
|
7433
|
-
|
|
7570
|
+
/**
|
|
7434
7571
|
* Create button.
|
|
7435
|
-
*
|
|
7572
|
+
* @private
|
|
7436
7573
|
* @param {HTMLDOMElement} - container where elements should be added
|
|
7437
7574
|
* @param {String} - text placed as button label
|
|
7438
7575
|
* @param {String} - add | edit | remove
|
|
7439
7576
|
* @param {Function} - on click callback
|
|
7440
7577
|
* @param {HTMLDOMElement} - container where inputs are generated
|
|
7441
|
-
*
|
|
7442
7578
|
* @return {HTMLDOMElement} - html button
|
|
7443
7579
|
*/
|
|
7444
7580
|
addButton: function (parentDiv, label, type, callback, fieldsDiv) {
|
|
@@ -7463,12 +7599,11 @@
|
|
|
7463
7599
|
|
|
7464
7600
|
return button;
|
|
7465
7601
|
},
|
|
7466
|
-
|
|
7602
|
+
/**
|
|
7467
7603
|
* Get values from all inputs and create JSON.
|
|
7468
|
-
*
|
|
7604
|
+
* @private
|
|
7469
7605
|
* @param {HTMLDOMElement} - container where inputs are created
|
|
7470
7606
|
* @param {String} - add | edit | remove
|
|
7471
|
-
*
|
|
7472
7607
|
* @return {Object} - fields
|
|
7473
7608
|
*/
|
|
7474
7609
|
getFields: function (parentDiv, type) {
|
|
@@ -7510,12 +7645,11 @@
|
|
|
7510
7645
|
|
|
7511
7646
|
return fieldsOutput;
|
|
7512
7647
|
},
|
|
7513
|
-
|
|
7648
|
+
/**
|
|
7514
7649
|
* Reset content of the current popup and show.
|
|
7515
|
-
*
|
|
7650
|
+
* @private
|
|
7516
7651
|
* @param {Chart} - chart
|
|
7517
7652
|
* @param {Function} - on click callback
|
|
7518
|
-
*
|
|
7519
7653
|
* @return {Object} - fields
|
|
7520
7654
|
*/
|
|
7521
7655
|
showPopup: function () {
|
|
@@ -7540,21 +7674,20 @@
|
|
|
7540
7674
|
popupDiv.appendChild(popupCloseBtn);
|
|
7541
7675
|
popupDiv.style.display = 'block';
|
|
7542
7676
|
},
|
|
7543
|
-
|
|
7677
|
+
/**
|
|
7544
7678
|
* Hide popup.
|
|
7545
|
-
*
|
|
7679
|
+
* @private
|
|
7546
7680
|
*/
|
|
7547
7681
|
closePopup: function () {
|
|
7548
7682
|
this.popup.container.style.display = 'none';
|
|
7549
7683
|
},
|
|
7550
|
-
|
|
7684
|
+
/**
|
|
7551
7685
|
* Create content and show popup.
|
|
7552
|
-
*
|
|
7686
|
+
* @private
|
|
7553
7687
|
* @param {String} - type of popup i.e indicators
|
|
7554
7688
|
* @param {Chart} - chart
|
|
7555
7689
|
* @param {Object} - options
|
|
7556
7690
|
* @param {Function} - on click callback
|
|
7557
|
-
*
|
|
7558
7691
|
*/
|
|
7559
7692
|
showForm: function (type, chart, options, callback) {
|
|
7560
7693
|
|
|
@@ -7583,23 +7716,22 @@
|
|
|
7583
7716
|
this.annotations.addForm.call(this, chart, options, callback, true);
|
|
7584
7717
|
}
|
|
7585
7718
|
},
|
|
7586
|
-
|
|
7719
|
+
/**
|
|
7587
7720
|
* Return lang definitions for popup.
|
|
7588
|
-
*
|
|
7721
|
+
* @private
|
|
7589
7722
|
* @return {Object} - elements translations.
|
|
7590
7723
|
*/
|
|
7591
7724
|
getLangpack: function () {
|
|
7592
7725
|
return H.getOptions().lang.navigation.popup;
|
|
7593
7726
|
},
|
|
7594
7727
|
annotations: {
|
|
7595
|
-
|
|
7728
|
+
/**
|
|
7596
7729
|
* Create annotation simple form. It contains two buttons
|
|
7597
7730
|
* (edit / remove) and text label.
|
|
7598
|
-
*
|
|
7731
|
+
* @private
|
|
7599
7732
|
* @param {Chart} - chart
|
|
7600
7733
|
* @param {Object} - options
|
|
7601
7734
|
* @param {Function} - on click callback
|
|
7602
|
-
*
|
|
7603
7735
|
*/
|
|
7604
7736
|
addToolbar: function (chart, options, callback) {
|
|
7605
7737
|
var _self = this,
|
|
@@ -7656,15 +7788,14 @@
|
|
|
7656
7788
|
|
|
7657
7789
|
button.className += ' ' + PREFIX + 'annotation-edit-button';
|
|
7658
7790
|
},
|
|
7659
|
-
|
|
7791
|
+
/**
|
|
7660
7792
|
* Create annotation simple form.
|
|
7661
7793
|
* It contains fields with param names.
|
|
7662
|
-
*
|
|
7794
|
+
* @private
|
|
7663
7795
|
* @param {Chart} - chart
|
|
7664
7796
|
* @param {Object} - options
|
|
7665
7797
|
* @param {Function} - on click callback
|
|
7666
7798
|
* @param {Boolean} - if it is a form declared for init annotation
|
|
7667
|
-
*
|
|
7668
7799
|
*/
|
|
7669
7800
|
addForm: function (chart, options, callback, isInit) {
|
|
7670
7801
|
var popupDiv = this.popup.container,
|
|
@@ -7707,16 +7838,15 @@
|
|
|
7707
7838
|
popupDiv
|
|
7708
7839
|
);
|
|
7709
7840
|
},
|
|
7710
|
-
|
|
7841
|
+
/**
|
|
7711
7842
|
* Create annotation's form fields.
|
|
7712
|
-
*
|
|
7843
|
+
* @private
|
|
7713
7844
|
* @param {HTMLDOMElement} - div where inputs are placed
|
|
7714
7845
|
* @param {Chart} - chart
|
|
7715
7846
|
* @param {String} - name of parent to create chain of names
|
|
7716
7847
|
* @param {Object} - options
|
|
7717
7848
|
* @param {Array} - storage - array where all items are stored
|
|
7718
7849
|
* @param {Boolean} - isRoot - recursive flag for root
|
|
7719
|
-
*
|
|
7720
7850
|
*/
|
|
7721
7851
|
addFormFields: function (
|
|
7722
7852
|
parentDiv,
|
|
@@ -7796,14 +7926,13 @@
|
|
|
7796
7926
|
}
|
|
7797
7927
|
},
|
|
7798
7928
|
indicators: {
|
|
7799
|
-
|
|
7929
|
+
/**
|
|
7800
7930
|
* Create indicator's form. It contains two tabs (ADD and EDIT) with
|
|
7801
7931
|
* content.
|
|
7802
|
-
*
|
|
7932
|
+
* @private
|
|
7803
7933
|
* @param {Chart} - chart
|
|
7804
7934
|
* @param {Object} - options
|
|
7805
7935
|
* @param {Function} - on click callback
|
|
7806
|
-
*
|
|
7807
7936
|
*/
|
|
7808
7937
|
addForm: function (chart, options, callback) {
|
|
7809
7938
|
|
|
@@ -7866,14 +7995,13 @@
|
|
|
7866
7995
|
buttonParentDiv
|
|
7867
7996
|
);
|
|
7868
7997
|
},
|
|
7869
|
-
|
|
7998
|
+
/**
|
|
7870
7999
|
* Create HTML list of all indicators (ADD mode) or added indicators
|
|
7871
8000
|
* (EDIT mode).
|
|
7872
|
-
*
|
|
8001
|
+
* @private
|
|
7873
8002
|
* @param {Chart} - chart
|
|
7874
8003
|
* @param {HTMLDOMElement} - container where list is added
|
|
7875
8004
|
* @param {String} - 'edit' or 'add' mode
|
|
7876
|
-
*
|
|
7877
8005
|
*/
|
|
7878
8006
|
addIndicatorList: function (chart, parentDiv, listType) {
|
|
7879
8007
|
var _self = this,
|
|
@@ -7947,15 +8075,13 @@
|
|
|
7947
8075
|
indicatorList.childNodes[0].click();
|
|
7948
8076
|
}
|
|
7949
8077
|
},
|
|
7950
|
-
|
|
8078
|
+
/**
|
|
7951
8079
|
* Extract full name and type of requested indicator.
|
|
7952
|
-
*
|
|
8080
|
+
* @private
|
|
7953
8081
|
* @param {Series} - series which name is needed.
|
|
7954
8082
|
* (EDIT mode - defaultOptions.series, ADD mode - indicator series).
|
|
7955
8083
|
* @param {String} - indicator type like: sma, ema, etc.
|
|
7956
|
-
*
|
|
7957
8084
|
* @return {Object} - series name and type like: sma, ema, etc.
|
|
7958
|
-
*
|
|
7959
8085
|
*/
|
|
7960
8086
|
getNameType: function (series, type) {
|
|
7961
8087
|
var options = series.options,
|
|
@@ -7976,15 +8102,14 @@
|
|
|
7976
8102
|
type: seriesType
|
|
7977
8103
|
};
|
|
7978
8104
|
},
|
|
7979
|
-
|
|
8105
|
+
/**
|
|
7980
8106
|
* List all series with unique ID. Its mandatory for indicators to set
|
|
7981
8107
|
* correct linking.
|
|
7982
|
-
*
|
|
8108
|
+
* @private
|
|
7983
8109
|
* @param {String} - indicator type like: sma, ema, etc.
|
|
7984
8110
|
* @param {String} - type of select i.e series or volume.
|
|
7985
8111
|
* @param {Chart} - chart
|
|
7986
8112
|
* @param {HTMLDOMElement} - element where created HTML list is added
|
|
7987
|
-
*
|
|
7988
8113
|
*/
|
|
7989
8114
|
listAllSeries: function (type, optionName, chart, parentDiv) {
|
|
7990
8115
|
var selectName = PREFIX + optionName + '-type-' + type,
|
|
@@ -8036,18 +8161,17 @@
|
|
|
8036
8161
|
}
|
|
8037
8162
|
});
|
|
8038
8163
|
},
|
|
8039
|
-
|
|
8164
|
+
/**
|
|
8040
8165
|
* Create typical inputs for chosen indicator. Fields are extracted from
|
|
8041
8166
|
* defaultOptions (ADD mode) or current indicator (ADD mode). Two extra
|
|
8042
8167
|
* fields are added:
|
|
8043
8168
|
* - hidden input - contains indicator type (required for callback)
|
|
8044
8169
|
* - select - list of series which can be linked with indicator
|
|
8045
|
-
*
|
|
8170
|
+
* @private
|
|
8046
8171
|
* @param {Chart} - chart
|
|
8047
8172
|
* @param {Series} - indicator
|
|
8048
8173
|
* @param {String} - indicator type like: sma, ema, etc.
|
|
8049
8174
|
* @param {HTMLDOMElement} - element where created HTML list is added
|
|
8050
|
-
*
|
|
8051
8175
|
*/
|
|
8052
8176
|
addFormFields: function (chart, series, seriesType, rhsColWrapper) {
|
|
8053
8177
|
var fields = series.params || series.options.params,
|
|
@@ -8108,17 +8232,16 @@
|
|
|
8108
8232
|
rhsColWrapper
|
|
8109
8233
|
);
|
|
8110
8234
|
},
|
|
8111
|
-
|
|
8235
|
+
/**
|
|
8112
8236
|
* Recurent function which lists all fields, from params object and
|
|
8113
8237
|
* create them as inputs. Each input has unique `data-name` attribute,
|
|
8114
8238
|
* which keeps chain of fields i.e params.styles.fontSize.
|
|
8115
|
-
*
|
|
8239
|
+
* @private
|
|
8116
8240
|
* @param {Chart} - chart
|
|
8117
8241
|
* @param {String} - name of parent to create chain of names
|
|
8118
8242
|
* @param {Series} - fields - params which are based for input create
|
|
8119
8243
|
* @param {String} - indicator type like: sma, ema, etc.
|
|
8120
8244
|
* @param {HTMLDOMElement} - element where created HTML list is added
|
|
8121
|
-
*
|
|
8122
8245
|
*/
|
|
8123
8246
|
addParamInputs: function (chart, parentNode, fields, type, parentDiv) {
|
|
8124
8247
|
var _self = this,
|
|
@@ -8153,9 +8276,9 @@
|
|
|
8153
8276
|
}
|
|
8154
8277
|
});
|
|
8155
8278
|
},
|
|
8156
|
-
|
|
8279
|
+
/**
|
|
8157
8280
|
* Get amount of indicators added to chart.
|
|
8158
|
-
*
|
|
8281
|
+
* @private
|
|
8159
8282
|
* @return {Number} - Amount of indicators
|
|
8160
8283
|
*/
|
|
8161
8284
|
getAmount: function () {
|
|
@@ -8177,11 +8300,10 @@
|
|
|
8177
8300
|
}
|
|
8178
8301
|
},
|
|
8179
8302
|
tabs: {
|
|
8180
|
-
|
|
8303
|
+
/**
|
|
8181
8304
|
* Init tabs. Create tab menu items, tabs containers
|
|
8182
|
-
*
|
|
8305
|
+
* @private
|
|
8183
8306
|
* @param {Chart} - reference to current chart
|
|
8184
|
-
*
|
|
8185
8307
|
*/
|
|
8186
8308
|
init: function (chart) {
|
|
8187
8309
|
var tabs = this.tabs,
|
|
@@ -8201,12 +8323,11 @@
|
|
|
8201
8323
|
// activate first tab
|
|
8202
8324
|
tabs.selectTab.call(this, firstTab, 0);
|
|
8203
8325
|
},
|
|
8204
|
-
|
|
8326
|
+
/**
|
|
8205
8327
|
* Create tab menu item
|
|
8206
|
-
*
|
|
8328
|
+
* @private
|
|
8207
8329
|
* @param {String} - `add` or `edit`
|
|
8208
8330
|
* @param {Number} - Disable tab when 0
|
|
8209
|
-
*
|
|
8210
8331
|
* @return {HTMLDOMElement} - created HTML tab-menu element
|
|
8211
8332
|
*/
|
|
8212
8333
|
addMenuItem: function (tabName, disableTab) {
|
|
@@ -8234,11 +8355,10 @@
|
|
|
8234
8355
|
|
|
8235
8356
|
return menuItem;
|
|
8236
8357
|
},
|
|
8237
|
-
|
|
8358
|
+
/**
|
|
8238
8359
|
* Create tab content
|
|
8239
|
-
*
|
|
8360
|
+
* @private
|
|
8240
8361
|
* @return {HTMLDOMElement} - created HTML tab-content element
|
|
8241
|
-
*
|
|
8242
8362
|
*/
|
|
8243
8363
|
addContentItem: function () {
|
|
8244
8364
|
var popupDiv = this.popup.container;
|
|
@@ -8252,11 +8372,10 @@
|
|
|
8252
8372
|
popupDiv
|
|
8253
8373
|
);
|
|
8254
8374
|
},
|
|
8255
|
-
|
|
8375
|
+
/**
|
|
8256
8376
|
* Add click event to each tab
|
|
8257
|
-
*
|
|
8377
|
+
* @private
|
|
8258
8378
|
* @param {Number} - Disable tab when 0
|
|
8259
|
-
*
|
|
8260
8379
|
*/
|
|
8261
8380
|
switchTabs: function (disableTab) {
|
|
8262
8381
|
var _self = this,
|
|
@@ -8282,12 +8401,11 @@
|
|
|
8282
8401
|
});
|
|
8283
8402
|
});
|
|
8284
8403
|
},
|
|
8285
|
-
|
|
8404
|
+
/**
|
|
8286
8405
|
* Set tab as visible
|
|
8287
|
-
*
|
|
8406
|
+
* @private
|
|
8288
8407
|
* @param {HTMLDOMElement} - current tab
|
|
8289
8408
|
* @param {Number} - Index of tab in menu
|
|
8290
|
-
*
|
|
8291
8409
|
*/
|
|
8292
8410
|
selectTab: function (tab, index) {
|
|
8293
8411
|
var allTabs = this.popup.container
|
|
@@ -8296,9 +8414,9 @@
|
|
|
8296
8414
|
tab.className += ' ' + PREFIX + 'tab-item-active';
|
|
8297
8415
|
allTabs[index].className += ' ' + PREFIX + 'tab-item-show';
|
|
8298
8416
|
},
|
|
8299
|
-
|
|
8417
|
+
/**
|
|
8300
8418
|
* Set all tabs as invisible.
|
|
8301
|
-
*
|
|
8419
|
+
* @private
|
|
8302
8420
|
*/
|
|
8303
8421
|
deselectAll: function () {
|
|
8304
8422
|
var popupDiv = this.popup.container,
|