all files / chart/series/ range-column-series.js

96.55% Statements 56/58
87.5% Branches 28/32
100% Functions 17/17
96.36% Lines 53/55
11 statements, 6 functions, 9 branches Ignored     
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          100× 100× 100×   159× 159× 1224× 1224×   159×   1226× 1226× 1226× 1226× 1202× 1202× 1202×   1202× 1202× 1202× 1202×                       41538×            
/* istanbul ignore next */ 
var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
define(["require", "exports", "../../common/utils/helper", "./column-base"], function (require, exports, helper_1, column_base_1) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    var RangeColumnSeries = (function (_super) {
        __extends(RangeColumnSeries, _super);
        function RangeColumnSeries() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this.sideBySideInfo = [];
            return _this;
        }
        RangeColumnSeries.prototype.render = function (series) {
            this.sideBySideInfo[series.index] = this.getSideBySideInfo(series);
            for (var _i = 0, _a = series.points; _i < _a.length; _i++) {
                var rangePoint = _a[_i];
                this.renderPoint(series, rangePoint, this.sideBySideInfo[series.index]);
            }
            this.renderMarker(series);
        };
        RangeColumnSeries.prototype.renderPoint = function (series, rangePoint, sideBySideInfo) {
            var rect;
            rangePoint.symbolLocations = [];
            rangePoint.regions = [];
            if (rangePoint.visible && helper_1.withInRange(series.points[rangePoint.index - 1], rangePoint, series.points[rangePoint.index + 1], series)) {
                rect = this.getRectangle(rangePoint.xValue + sideBySideInfo.start, rangePoint.high, rangePoint.xValue + sideBySideInfo.end, rangePoint.low, series);
                rect.width = series.columnWidthInPixel ? series.columnWidthInPixel : rect.width;
                rect.x = series.columnWidthInPixel ? rect.x - (((series.columnWidthInPixel / 2) * series.rectCount) -
                    (series.columnWidthInPixel * series.index)) : rect.x;
                var argsData = this.triggerEvent(series, rangePoint, series.interior, { width: series.border.width, color: series.border.color });
                Eif (!argsData.cancel) {
                    this.updateSymbolLocation(rangePoint, rect, series);
                    this.drawRectangle(series, rangePoint, rect, argsData);
                }
            }
        };
        RangeColumnSeries.prototype.updateDirection = function (series, point) {
            var _loop_1 = function (i) {
                this_1.renderPoint(series, series.points[point[i]], this_1.sideBySideInfo[series.index]);
                Eif (series.marker && series.marker.visible) {
                    series.points[point[i]].symbolLocations.map(function (location, index) {
                        series.chart.markerRender.renderMarker(series, series.points[point[i]], location, index, true);
                    });
                }
                Iif (series.marker.dataLabel.visible && series.chart.dataLabelModule) {
                    series.chart.dataLabelModule.commonId = series.chart.element.id + '_Series_' + series.index + '_Point_';
                    series.chart.dataLabelModule.renderDataLabel(series, series.points[point[i]], null, series.marker.dataLabel);
                }
            };
            var this_1 = this;
            for (var i = 0; i < point.length; i++) {
                _loop_1(i);
            }
        };
        RangeColumnSeries.prototype.getModuleName = function () {
            return 'RangeColumnSeries';
        };
        RangeColumnSeries.prototype.doAnimation = function (series) {
            this.animate(series);
        };
        RangeColumnSeries.prototype.destroy = function () {
        };
        return RangeColumnSeries;
    }(column_base_1.ColumnBase));
    exports.RangeColumnSeries = RangeColumnSeries;
});