all files / chart/series/ multi-colored-line-series.js

94.29% Statements 66/70
90.48% Branches 38/42
92.86% Functions 13/14
94.03% Lines 63/67
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 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97          24×   28× 28× 28× 28× 28× 28× 28× 28× 28× 310× 310× 310× 301× 301× 301× 267× 176× 176× 176×     91×       34×           301× 301× 301×         28× 10×   28× 28× 26×     24× 24×   24× 24× 24×           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", "@syncfusion/ej2-svg-base", "./multi-colored-base"], function (require, exports, helper_1, ej2_svg_base_1, multi_colored_base_1) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    var MultiColoredLineSeries = (function (_super) {
        __extends(MultiColoredLineSeries, _super);
        function MultiColoredLineSeries() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        MultiColoredLineSeries.prototype.render = function (series, xAxis, yAxis, isInverted, pointAnimate, pointUpdate) {
            var previous = null;
            var startPoint = 'M';
            var visiblePoints = this.enableComplexProperty(series);
            var options = [];
            var direction = '';
            var lastPoint;
            var segmentPoint = null;
            var segments = this.sortSegments(series, series.segments);
            for (var _i = 0, visiblePoints_1 = visiblePoints; _i < visiblePoints_1.length; _i++) {
                var point = visiblePoints_1[_i];
                point.regions = [];
                if (point.visible && helper_1.withInRange(visiblePoints[point.index - 1], point, visiblePoints[point.index + 1], series)) {
                    lastPoint = point;
                    direction += this.getLineDirection(previous, point, series, isInverted, helper_1.getPoint, startPoint);
                    if (previous != null) {
                        if (this.setPointColor(point, previous, series, series.segmentAxis === 'X', segments)) {
                            options.push(new ej2_svg_base_1.PathOption(series.chart.element.id + '_Series_' + series.index + '_Point_' + previous.index, 'none', series.width, series.setPointColor(previous, series.interior), series.opacity, series.dashArray, direction));
                            startPoint = 'M';
                            direction = '';
                        }
                        else {
                            startPoint = 'L';
                        }
                    }
                    else {
                        Iif (this.setPointColor(point, segmentPoint, series, series.segmentAxis === 'X', segments) && direction !== '') {
                            options.push(new ej2_svg_base_1.PathOption(series.chart.element.id + '_Series_' + series.index + '_Point_' + segmentPoint.index, 'none', series.width, series.setPointColor(segmentPoint, series.interior), series.opacity, series.dashArray, direction));
                            startPoint = 'M';
                            direction = '';
                        }
                    }
                    previous = point;
                    segmentPoint = point;
                    this.storePointLocation(point, series, isInverted, helper_1.getPoint);
                }
                else {
                    previous = (series.emptyPointSettings.mode === 'Drop') ? previous : null;
                    startPoint = (series.emptyPointSettings.mode === 'Drop') ? startPoint : 'M';
                    point.symbolLocations = [];
                }
            }
            if (direction !== '') {
                options.push(new ej2_svg_base_1.PathOption(series.chart.element.id + '_Series_' + series.index, 'none', series.width, series.setPointColor(lastPoint, series.interior), series.opacity, series.dashArray, direction));
            }
            this.applySegmentAxis(series, options, segments, pointAnimate);
            if (!pointUpdate) {
                this.renderMarker(series);
            }
        };
        MultiColoredLineSeries.prototype.updateDirection = function (series, point) {
            this.render(series, series.xAxis, series.yAxis, series.chart.requireInvertedAxis, false, true);
            for (var i = 0; i < point.length; i++) {
                Eif (series.marker && series.marker.visible) {
                    series.chart.markerRender.renderMarker(series, series.points[point[i]], series.points[point[i]].symbolLocations[0], null, true);
                }
                Eif (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);
                }
            }
        };
        MultiColoredLineSeries.prototype.doAnimation = function (series) {
            this.doLinearAnimation(series, series.animation);
        };
        MultiColoredLineSeries.prototype.getModuleName = function () {
            return 'MultiColoredLineSeries';
        };
        MultiColoredLineSeries.prototype.destroy = function () {
        };
        return MultiColoredLineSeries;
    }(multi_colored_base_1.MultiColoredSeries));
    exports.MultiColoredLineSeries = MultiColoredLineSeries;
});