whychdw
2019-09-09 c0b9ce437d409b89ca0e5388344ca9c5a56d70a4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
'use strict';
 
Object.defineProperty(exports, "__esModule", {
    value: true
});
 
var _Globals = require('../../parts/Globals.js');
 
var _Globals2 = _interopRequireDefault(_Globals);
 
require('../../parts/Utilities.js');
 
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
 
var Annotation = _Globals2.default.Annotation,
    CrookedLine = Annotation.types.crookedLine;
 
/**
 * @class
 * @extends Annotation.CrookedLine
 * @memberOf Annotation
 */
function ElliottWave() {
    CrookedLine.apply(this, arguments);
}
 
_Globals2.default.extendAnnotation(ElliottWave, CrookedLine,
/** Annotation.CrookedLine# */
{
    addLabels: function addLabels() {
        this.getPointsOptions().forEach(function (point, i) {
            var label = this.initLabel(_Globals2.default.merge(point.label, {
                text: this.options.typeOptions.labels[i],
                point: function point(target) {
                    return target.annotation.points[i];
                }
            }), false);
 
            point.label = label.options;
        }, this);
    }
},
 
/**
 * An elliott wave annotation.
 *
 * @sample highcharts/annotations-advanced/elliott-wave/
 *         Elliott wave
 *
 * @extends      annotations.crookedLine
 * @product      highstock
 * @optionparent annotations.elliottWave
 */
{
    typeOptions: {
 
        /**
         * @extends   annotations.crookedLine.labelOptions
         * @apioption annotations.elliottWave.typeOptions.points.label
         */
 
        /**
         * @ignore-options
         */
        labels: ['(0)', '(A)', '(B)', '(C)', '(D)', '(E)'],
        line: {
            strokeWidth: 1
        }
    },
 
    labelOptions: {
        align: 'center',
        allowOverlap: true,
        crop: true,
        overflow: 'none',
        type: 'rect',
        backgroundColor: 'none',
        borderWidth: 0,
        y: -5
    }
});
 
Annotation.types.elliottWave = ElliottWave;
 
exports.default = ElliottWave;