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

100% Statements 41/41
100% Branches 20/20
100% Functions 12/12
100% Lines 38/38
9 statements, 5 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        137×   271× 271× 271× 271× 271× 271× 271× 2193× 2193× 2193× 2193× 2093× 2093× 2093× 2089× 2089×         10×     20665×        
/* istanbul ignore next */ 
var __extends = (this && this.__extends) || (function () {
    var 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 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 StackingColumnSeries = (function (_super) {
        __extends(StackingColumnSeries, _super);
        function StackingColumnSeries() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        StackingColumnSeries.prototype.render = function (series) {
            series.isRectSeries = true;
            var origin = Math.max(series.yAxis.visibleRange.min, 0);
            var sideBySideInfo = this.getSideBySideInfo(series);
            var rect;
            var argsData;
            var stackedValue = series.stackedValues;
            for (var _i = 0, _a = series.points; _i < _a.length; _i++) {
                var point = _a[_i];
                point.symbolLocations = [];
                point.regions = [];
                if (point.visible && helper_1.withInRange(series.points[point.index - 1], point, series.points[point.index + 1], series)) {
                    rect = this.getRectangle(point.xValue + sideBySideInfo.start, stackedValue.endValues[point.index], point.xValue + sideBySideInfo.end, stackedValue.startValues[point.index], series);
                    argsData = this.triggerEvent(series, point, series.interior, { width: series.border.width, color: series.border.color });
                    if (!argsData.cancel) {
                        this.drawRectangle(series, point, rect, argsData);
                        this.updateSymbolLocation(point, rect, series);
                    }
                }
            }
        };
        StackingColumnSeries.prototype.doAnimation = function (series) {
            this.animate(series);
        };
        StackingColumnSeries.prototype.destroy = function (chart) {
        };
        StackingColumnSeries.prototype.getModuleName = function () {
            return 'StackingColumnSeries';
        };
        return StackingColumnSeries;
    }(column_base_1.ColumnBase));
    exports.StackingColumnSeries = StackingColumnSeries;
});