all files / circular-gauge/axes/ axis-panel.js

98.04% Statements 499/509
86.39% Branches 457/529
100% Functions 48/48
98.23% Lines 499/508
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 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780   670× 670× 670× 670× 670× 670× 670× 670× 670× 670×   703× 703×   703× 703× 703× 703× 703× 703× 703× 735× 735× 735× 1243×     735×   735× 735×   15× 15× 15× 15× 15× 15× 15× 15× 15× 15× 15× 15× 15× 15× 15×             11×                       15×   12× 12× 12× 12× 12×   12×       735× 735×       735× 735× 735× 735×     703× 703× 735× 735×     703× 703× 703× 703× 735× 735×     703× 735× 735× 735×     735× 735× 735× 735× 847×     847× 847×   735×   735× 735×   1470×   1470× 12×   1458× 404×   1054× 1054× 1054×   1054× 1054× 1054× 1054× 1054× 1054× 2820× 2820× 2820× 1054×   1766×   1054×   1470× 1470× 1470×     1470× 1470× 1470× 1470× 1470× 1470× 1458× 21010× 21010×           21010× 21010× 20824×     21010× 21010×   1458× 1458× 21010×     1470× 1470× 1470× 22×           22× 22× 22×     22× 22×   1470×   703× 703× 703× 703× 703× 703× 703× 703× 703× 703× 703× 703× 735× 735× 735× 735× 735× 735×   735×   735× 735× 735× 735× 735× 735×   735×       735×     735×       735×     735× 32×   735× 735× 735× 735×     710× 710× 710× 710× 710× 710×       710×     710× 710× 710× 742×     742×   742× 742× 742× 742×   742× 742×     742× 742× 742× 742× 742× 103×   742×   710×             710× 710× 13×     61× 61× 52×     992×     52× 52× 52×             33× 33× 30×         52×     30× 30× 30× 30×     30×           141× 141× 141× 141× 141× 141× 141× 141× 25×       116×               141×   13× 13× 13× 13× 13× 13× 13× 13× 12× 12× 12× 12× 12× 12× 12×     141× 141× 141× 141× 141× 141×                                                       108× 108× 103×         103×     103× 74× 74× 74× 74× 29× 29×     45× 45×   74×     74×   74×   74× 74× 16×   74× 18×   74×   74×   74× 74× 32×   74× 74×     29× 10× 10× 10× 10× 10× 10× 10× 10×   10×     19× 19× 19× 19× 19× 19× 19× 19× 19×   19×           108×   115× 115× 109×             106×                             115× 109× 109×         12× 12× 12× 12×                         13× 13× 13× 13× 13× 13× 13× 13× 13× 13× 13× 13× 13× 13× 13× 13× 69× 69× 12× 12×   57×   48×     39× 13× 13× 13× 13×       26× 13× 13×           13× 13× 13×         13× 13×         13× 13× 13× 13× 13× 13× 13× 13× 13× 13×       13×     1470× 1470×               1470× 20846× 20846× 20846×   20846×       653× 653× 653× 653×   653× 653× 653×   653× 653× 653× 653× 653× 653× 653×        
define(["require", "exports", "@syncfusion/ej2-base", "../utils/helper-common", "../utils/helper-axis-panel", "../model/constants", "./axis-renderer", "./pointer-renderer", "../utils/helper-pointer-renderer"], function (require, exports, ej2_base_1, helper_common_1, helper_axis_panel_1, constants_1, axis_renderer_1, pointer_renderer_1, helper_pointer_renderer_1) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    var AxisLayoutPanel = (function () {
        function AxisLayoutPanel(gauge) {
            this.axisOption = [];
            this.prevAnimatedMajorTickValue = [];
            this.prevAnimatedMajorTickIndex = [];
            this.prevAnimatedMinorTickValue = [];
            this.prevAnimatedMinorTickIndex = [];
            this.allowAxisCount = [];
            this.rangeAnimationCount = 0;
            this.gauge = gauge;
            this.axisRenderer = new axis_renderer_1.AxisRenderer(gauge);
            this.pointerRenderer = new pointer_renderer_1.PointerRenderer(gauge);
        }
        AxisLayoutPanel.prototype.measureAxis = function (rect) {
            this.measureAxisSize(this.gauge, rect);
            this.calculateAxesRadius();
        };
        AxisLayoutPanel.prototype.calculateAxesRadius = function () {
            var _this = this;
            var totalRadius;
            var currentRadius;
            var rangeMaximumRadius = 0;
            var xMarginDiff = this.gauge.margin.left + this.gauge.margin.right;
            var yMarginDiff = this.gauge.margin.top + this.gauge.margin.bottom;
            var _loop_1 = function (axis) {
                totalRadius = (Math.min(axis.rect.width, axis.rect.height) / 2);
                currentRadius = axis.radius != null ? helper_common_1.stringToNumber(axis.radius, totalRadius) : totalRadius;
                rangeMaximumRadius = Math.max.apply(Math, axis.ranges.map(function (value) {
                    return value.radius ?
                        (value.radius.indexOf('%') < 0 ? 100 : parseInt(value.radius, 10)) : 0;
                }));
                currentRadius = (rangeMaximumRadius > 100 && axis.radius == null) ?
                    (currentRadius * 100) / rangeMaximumRadius : currentRadius;
                axis.currentRadius = currentRadius - axis.nearSize;
                if (this_1.gauge.moveToCenter && this_1.gauge.axes.length === 1 &&
                    ej2_base_1.isNullOrUndefined(this_1.gauge.centerXpoint) && ej2_base_1.isNullOrUndefined(this_1.gauge.centerYpoint)) {
                    var endAngle = void 0;
                    var startAngle = axis.startAngle;
                    var startPoint = helper_common_1.getLocationFromAngle(startAngle - 90, currentRadius, this_1.gauge.midPoint);
                    endAngle = axis.endAngle;
                    endAngle -= helper_common_1.isCompleteAngle(startAngle, endAngle) ? 0.0001 : 0;
                    var endPoint = helper_common_1.getLocationFromAngle(endAngle - 90, currentRadius, this_1.gauge.midPoint);
                    var xDiff = void 0;
                    var yDiff = void 0;
                    var startXDiff = void 0;
                    var endXDiff = void 0;
                    var startYDiff = void 0;
                    var endYDiff = void 0;
                    var newPoint = void 0;
                    Eif (startAngle > endAngle ? Math.abs(startAngle - endAngle) > 90 ? true : false : true) {
                        if ((startAngle >= 270 && startAngle <= 360) && ((endAngle > 270 && endAngle <= 360) ||
                            (endAngle >= 0 && endAngle <= 180))) {
                            startXDiff = Math.abs(this_1.gauge.gaugeRect.x - Math.abs(startPoint.x - this_1.gauge.gaugeRect.x));
                            newPoint = (endAngle <= 360 && endAngle >= 270) ? this_1.gauge.midPoint : (endAngle <= 90) ? endPoint :
                                helper_common_1.getLocationFromAngle(90 - 90, currentRadius, this_1.gauge.midPoint);
                            endXDiff = Math.abs(newPoint.x - this_1.gauge.gaugeRect.width);
                            startPoint = (endAngle <= 360 && endAngle >= 270) ? endPoint :
                                helper_common_1.getLocationFromAngle(360 - 90, currentRadius, this_1.gauge.midPoint);
                            startYDiff = Math.abs(startPoint.y - this_1.gauge.gaugeRect.y);
                            endPoint = (endAngle <= 360 && endAngle >= 270 || (endAngle >= 0 && endAngle < 90)) ?
                                this_1.gauge.midPoint : (endAngle >= 90 && endAngle <= 180) ? endPoint :
                                helper_common_1.getLocationFromAngle(180 - 90, currentRadius, this_1.gauge.midPoint);
                            endYDiff = Math.abs(endPoint.y - (this_1.gauge.gaugeRect.y + this_1.gauge.gaugeRect.height));
                        }
                        else if ((startAngle >= 0 && startAngle < 90) && (endAngle >= 0 && endAngle <= 270)) {
                            startYDiff = Math.abs(startPoint.y - this_1.gauge.gaugeRect.y);
                            newPoint = (endAngle >= 180) ? helper_common_1.getLocationFromAngle(180 - 90, currentRadius, this_1.gauge.midPoint) :
                                endPoint;
                            endYDiff = Math.abs(newPoint.y - (this_1.gauge.gaugeRect.y + this_1.gauge.gaugeRect.height));
                            startPoint = (endAngle >= 180) ? endPoint : this_1.gauge.midPoint;
                            startXDiff = Math.abs(this_1.gauge.gaugeRect.x - Math.abs(startPoint.x - this_1.gauge.gaugeRect.x));
                            endPoint = (endAngle >= 90) ? helper_common_1.getLocationFromAngle(90 - 90, currentRadius, this_1.gauge.midPoint) : endPoint;
                            endXDiff = Math.abs(endPoint.x - this_1.gauge.gaugeRect.width);
                        }
                        else if ((startAngle >= 90 && startAngle < 180) && (endAngle > 90 && endAngle <= 360)) {
                            newPoint = (endAngle <= 180) ? this_1.gauge.midPoint : (endAngle >= 270) ?
                                helper_common_1.getLocationFromAngle(270 - 90, currentRadius, this_1.gauge.midPoint) : endPoint;
                            startXDiff = Math.abs(newPoint.x - this_1.gauge.gaugeRect.x);
                            endXDiff = Math.abs(startPoint.x - this_1.gauge.gaugeRect.width);
                            startPoint = (endAngle > 270) ? helper_common_1.getLocationFromAngle(endAngle - 90, currentRadius, this_1.gauge.midPoint) :
                                this_1.gauge.midPoint;
                            startYDiff = Math.abs(this_1.gauge.gaugeRect.y - startPoint.y);
                            endPoint = (endAngle >= 180) ? helper_common_1.getLocationFromAngle(180 - 90, currentRadius, this_1.gauge.midPoint) : endPoint;
                            endYDiff = Math.abs(endPoint.y - (this_1.gauge.gaugeRect.y + this_1.gauge.gaugeRect.height));
                        }
                        else Eif ((startAngle >= 180 && startAngle <= 270) && ((endAngle <= 360 && endAngle >= 270) ||
                            (endAngle <= 180 && endAngle >= 0))) {
                            newPoint = (endAngle > 180 && endAngle < 270) ? endPoint :
                                helper_common_1.getLocationFromAngle(270 - 90, currentRadius, this_1.gauge.midPoint);
                            startXDiff = Math.abs(this_1.gauge.gaugeRect.x - Math.abs(newPoint.x - this_1.gauge.gaugeRect.x));
                            newPoint = (endAngle >= 180 && endAngle <= 360) ? this_1.gauge.midPoint : (endAngle <= 90) ? endPoint :
                                helper_common_1.getLocationFromAngle(0, currentRadius, this_1.gauge.midPoint);
                            endXDiff = Math.abs(newPoint.x - this_1.gauge.gaugeRect.width);
                            newPoint = (endAngle > 180 && endAngle < 270) ? this_1.gauge.midPoint : (endAngle >= 270 && endAngle <= 360) ?
                                endPoint : helper_common_1.getLocationFromAngle(360 - 90, currentRadius, this_1.gauge.midPoint);
                            startYDiff = Math.abs(newPoint.y - this_1.gauge.gaugeRect.y);
                            endPoint = (endAngle <= 360 && endAngle >= 270 || (endAngle >= 0 && endAngle < 90)) ?
                                startPoint : ((270 - startAngle) < (endAngle - 90)) ? endPoint : startPoint;
                            endYDiff = Math.abs(endPoint.y - (this_1.gauge.gaugeRect.y + this_1.gauge.gaugeRect.height));
                        }
                        if ((!ej2_base_1.isNullOrUndefined(startXDiff) && !ej2_base_1.isNullOrUndefined(endXDiff) && !ej2_base_1.isNullOrUndefined(startYDiff) &&
                            !ej2_base_1.isNullOrUndefined(endYDiff)) && ((startXDiff > 0 || endXDiff > 0) && (startYDiff > 0 || endYDiff > 0))) {
                            xDiff = Math.abs((startXDiff + endXDiff) - xMarginDiff);
                            yDiff = Math.abs((startYDiff + endYDiff) - yMarginDiff);
                            this_1.gauge.midPoint.x = this_1.gauge.midPoint.x - (startXDiff / 2) + (endXDiff / 2);
                            this_1.gauge.midPoint.y = this_1.gauge.midPoint.y - (startYDiff / 2) + (endYDiff / 2);
                            totalRadius = (Math.min(this_1.gauge.gaugeRect.width, this_1.gauge.gaugeRect.height) / 2) +
                                (Math.min(xDiff, yDiff) / 2);
                            axis.currentRadius = (axis.radius != null ? helper_common_1.stringToNumber(axis.radius, totalRadius) : totalRadius) - axis.nearSize;
                        }
                    }
                }
                axis.visibleRange.interval = this_1.calculateNumericInterval(axis, axis.rect);
                var args = {
                    cancel: false, name: constants_1.radiusCalculate, currentRadius: axis.currentRadius, gauge: this_1.gauge,
                    midPoint: this_1.gauge.midPoint, axis: axis
                };
                this_1.gauge.trigger('radiusCalculate', args, function () {
                    axis.currentRadius = args.currentRadius;
                    _this.gauge.midPoint = args.midPoint;
                    _this.calculateVisibleLabels(axis);
                });
            };
            var this_1 = this;
            for (var _i = 0, _a = this.gauge.axes; _i < _a.length; _i++) {
                var axis = _a[_i];
                _loop_1(axis);
            }
        };
        AxisLayoutPanel.prototype.measureAxisSize = function (gauge, rect) {
            var _this = this;
            var sum;
            this.computeSize(gauge.axes, rect);
            gauge.axes.map(function (axis, index) {
                sum = helper_axis_panel_1.calculateSum(index, _this.farSizes.length - 1, _this.farSizes);
                axis.rect = new helper_common_1.Rect(rect.x + sum, rect.y + sum, rect.width - (sum * 2), rect.height - (sum * 2));
            });
        };
        AxisLayoutPanel.prototype.calculateAxisValues = function (rect) {
            for (var _i = 0, _a = this.gauge.axes; _i < _a.length; _i++) {
                var axis = _a[_i];
                this.calculateVisibleRange(axis, rect);
                this.calculateVisibleLabels(axis);
            }
        };
        AxisLayoutPanel.prototype.calculateVisibleRange = function (axis, rect) {
            var interval = axis.majorTicks.interval;
            var minimumValue = Math.min(axis.minimum === null ? 0 : axis.minimum, axis.maximum !== null ? axis.maximum : 100);
            var maximumValue = Math.max(axis.minimum, axis.maximum === null ? 100 : axis.maximum);
            axis.pointers.map(function (pointer) {
                pointer.currentValue = pointer.value !== null ?
                    pointer.value < minimumValue ? minimumValue : pointer.value > maximumValue ? maximumValue : pointer.value
                    : minimumValue;
                minimumValue = axis.minimum === null ? Math.min(pointer.currentValue, minimumValue) : minimumValue;
                maximumValue = axis.maximum === null ? Math.max(pointer.currentValue, maximumValue) : maximumValue;
            });
            minimumValue = (minimumValue === maximumValue) ?
                (interval !== null ? minimumValue - interval : minimumValue - 1) : minimumValue;
            axis.visibleRange = { min: minimumValue, max: maximumValue, interval: interval };
            axis.visibleRange.interval = this.calculateNumericInterval(axis, rect);
        };
        AxisLayoutPanel.prototype.calculateNumericInterval = function (axis, rect) {
            var allowComponentRender = ((!ej2_base_1.isNullOrUndefined(axis.minimum) && !ej2_base_1.isNullOrUndefined(axis.maximum)
                && axis.minimum !== axis.maximum) || (ej2_base_1.isNullOrUndefined(axis.minimum) || ej2_base_1.isNullOrUndefined(axis.maximum)));
            if (!allowComponentRender) {
                return 0;
            }
            else if (axis.majorTicks.interval !== null) {
                return axis.majorTicks.interval;
            }
            var totalAngle = axis.endAngle - axis.startAngle;
            totalAngle = totalAngle <= 0 ? (totalAngle + 360) : totalAngle;
            return this.calculateNiceInterval(axis.visibleRange.max, axis.visibleRange.min, axis.currentRadius ? axis.currentRadius : (rect.width / 2), totalAngle);
        };
        AxisLayoutPanel.prototype.calculateNiceInterval = function (maxValue, minValue, radius, degree) {
            var delta = maxValue - minValue;
            var circumference = 2 * Math.PI * radius * (degree / 360);
            var desiredIntervalsCount = Math.max((circumference * ((0.533 * 3) / 100)), 1);
            var niceInterval = delta / desiredIntervalsCount;
            var minInterval = Math.pow(10, Math.floor(Math.log(niceInterval) / Math.log(10)));
            for (var _i = 0, _a = [10, 5, 2, 1]; _i < _a.length; _i++) {
                var interval = _a[_i];
                var currentInterval = minInterval * interval;
                if (desiredIntervalsCount < (delta / currentInterval)) {
                    break;
                }
                niceInterval = currentInterval;
            }
            return niceInterval;
        };
        AxisLayoutPanel.prototype.calculateVisibleLabels = function (axis) {
            var style = axis.labelStyle;
            var customLabelFormat = style.format && style.format.match('{value}') !== null;
            var format = this.gauge.intl.getNumberFormat({
                format: helper_common_1.getLabelFormat(style.format), useGrouping: this.gauge.useGroupingSeparator
            });
            var argsData;
            axis.visibleLabels = [];
            var roundValue;
            var interval = axis.visibleRange.interval;
            var max = axis.visibleRange.max;
            if ((ej2_base_1.isNullOrUndefined(axis.minimum) && ej2_base_1.isNullOrUndefined(axis.maximum)) || axis.minimum !== axis.maximum) {
                var _loop_2 = function (i) {
                    roundValue = axis.roundingPlaces ? parseFloat(i.toFixed(axis.roundingPlaces)) : i;
                    argsData = {
                        cancel: false, name: constants_1.axisLabelRender, axis: axis,
                        text: customLabelFormat ? style.format.replace(new RegExp('{value}', 'g'), format(roundValue)) :
                            format(roundValue),
                        value: roundValue
                    };
                    var axisLabelRenderSuccess = function (argsData) {
                        if (!argsData.cancel) {
                            axis.visibleLabels.push(new helper_common_1.VisibleLabels(argsData.text, i));
                        }
                    };
                    axisLabelRenderSuccess.bind(this_2);
                    this_2.gauge.trigger(constants_1.axisLabelRender, argsData, axisLabelRenderSuccess);
                };
                var this_2 = this;
                for (var i = axis.visibleRange.min; (i <= max && interval); i += interval) {
                    _loop_2(i);
                }
            }
            var lastLabel = axis.visibleLabels.length ? axis.visibleLabels[axis.visibleLabels.length - 1].value : null;
            var maxVal = axis.visibleRange.max;
            if (!ej2_base_1.isNullOrUndefined(lastLabel) && lastLabel !== maxVal && axis.showLastLabel === true) {
                argsData = {
                    cancel: false, name: constants_1.axisLabelRender, axis: axis,
                    text: customLabelFormat ? style.format.replace(new RegExp('{value}', 'g'), format(maxVal)) :
                        format(maxVal),
                    value: maxVal
                };
                var axisLabelRenderSuccess = function (argsData) {
                    Eif (!argsData.cancel) {
                        axis.visibleLabels.push(new helper_common_1.VisibleLabels(argsData.text, maxVal));
                    }
                };
                axisLabelRenderSuccess.bind(this);
                this.gauge.trigger(constants_1.axisLabelRender, argsData, axisLabelRenderSuccess);
            }
            this.getMaxLabelWidth(this.gauge, axis);
        };
        AxisLayoutPanel.prototype.computeSize = function (axes, rect) {
            var lineSize;
            var outerHeight;
            var innerHeight;
            var heightForCross;
            var axisPadding = 5;
            var majorTickOffset = 0;
            var minorTickOffset = 0;
            var labelOffset = 0;
            var labelPadding = 10;
            this.farSizes = [];
            this.calculateAxisValues(rect);
            for (var _i = 0, axes_1 = axes; _i < axes_1.length; _i++) {
                var axis = axes_1[_i];
                lineSize = (axis.lineStyle.width / 2);
                outerHeight = 0;
                innerHeight = 0;
                heightForCross = axis.majorTicks.position === 'Cross' ? axis.majorTicks.height / 2 : heightForCross;
                heightForCross = (axis.minorTicks.position === 'Cross' && heightForCross < axis.minorTicks.height / 2) ?
                    axis.minorTicks.height / 2 : heightForCross;
                heightForCross = (axis.labelStyle.position === 'Cross' && heightForCross < axis.maxLabelSize.height / 2) ?
                    axis.maxLabelSize.height / 2 : heightForCross;
                lineSize = lineSize < heightForCross ? heightForCross : lineSize;
                majorTickOffset = axis.majorTicks.offset;
                minorTickOffset = axis.minorTicks.offset;
                labelOffset = axis.labelStyle.offset;
                labelPadding = axis.labelStyle.shouldMaintainPadding ? 10 : 0;
                outerHeight += !(axis.majorTicks.position === 'Outside' && axis.minorTicks.position === 'Outside' &&
                    axis.labelStyle.position === 'Outside') ? axisPadding : 0;
                outerHeight += (axis.majorTicks.position === 'Outside' ? (axis.majorTicks.height + lineSize) : 0) +
                    (axis.labelStyle.position === 'Outside' ? (axis.maxLabelSize.height + labelOffset + labelPadding) : 0) +
                    ((axis.minorTicks.position === 'Outside' && !(axis.majorTicks.position === 'Outside')) ?
                        (axis.minorTicks.height + lineSize) : 0) + lineSize;
                outerHeight += (axis.majorTicks.position === 'Outside' && axis.minorTicks.position === 'Outside') ?
                    Math.max(majorTickOffset, minorTickOffset) : (axis.majorTicks.position === 'Outside' ?
                    majorTickOffset : axis.minorTicks.position === 'Outside' ? minorTickOffset : 0);
                innerHeight += ((axis.majorTicks.position === 'Inside') ? (axis.majorTicks.height + lineSize) : 0) +
                    ((axis.labelStyle.position === 'Inside') ? (axis.maxLabelSize.height + labelOffset + labelPadding) : 0) +
                    ((axis.minorTicks.position === 'Inside' && axis.majorTicks.position === 'Outside') ?
                        (axis.minorTicks.height + lineSize) : 0) + lineSize;
                innerHeight += ((axis.majorTicks.position === 'Inside') && (axis.minorTicks.position === 'Inside')) ?
                    Math.max(majorTickOffset, minorTickOffset) : ((axis.majorTicks.position === 'Inside') ?
                    majorTickOffset : (axis.minorTicks.position === 'Inside') ? minorTickOffset : 0);
                if (this.farSizes[this.farSizes.length - 1]) {
                    this.farSizes[this.farSizes.length - 1] += (innerHeight + outerHeight);
                }
                axis.nearSize = outerHeight - axisPadding;
                axis.farSize = innerHeight;
                outerHeight = (this.gauge.axes.length === (this.farSizes.length + 1)) ? 0 : outerHeight;
                this.farSizes.push(outerHeight);
            }
        };
        AxisLayoutPanel.prototype.renderAxes = function (animate) {
            var _this = this;
            Iif (animate === void 0) { animate = true; }
            var gauge = this.gauge;
            var renderer = this.axisRenderer;
            var element;
            var axesElements = gauge.renderer.createGroup({
                'id': gauge.element.id + '_AxesCollection',
                'clip-path': 'url(#' + gauge.element.id + '_GaugeAreaClipRect_' + ')'
            });
            var annotationElement = ej2_base_1.createElement('div', {
                id: gauge.element.id + '_Secondary_Element'
            });
            annotationElement.style.position = 'relative';
            gauge.element.appendChild(annotationElement);
            gauge.axes.map(function (axis, index) {
                element = gauge.renderer.createGroup({
                    id: gauge.element.id + '_Axis_Group_' + index
                });
                _this.gauge.allowComponentRender = ((!ej2_base_1.isNullOrUndefined(axis.minimum) && !ej2_base_1.isNullOrUndefined(axis.maximum)
                    && axis.minimum !== axis.maximum) || (ej2_base_1.isNullOrUndefined(axis.minimum) || ej2_base_1.isNullOrUndefined(axis.maximum)));
                renderer.checkAngles(axis);
                renderer.drawAxisOuterLine(axis, index, element, gauge);
                Eif (gauge.allowRangePreRender) {
                    renderer.drawAxisRange(axis, index, element);
                }
                renderer.drawAxisLine(axis, index, element, gauge);
                Iif (!gauge.allowRangePreRender) {
                    renderer.drawAxisRange(axis, index, element);
                }
                renderer.drawMajorTickLines(axis, index, element, gauge);
                renderer.drawMinorTickLines(axis, index, element, gauge);
                renderer.drawAxisLabels(axis, index, element, gauge);
                _this.pointerRenderer.drawPointers(axis, index, element, gauge, animate);
                if (gauge.annotationsModule) {
                    gauge.annotationsModule.renderAnnotation(axis, index, gauge);
                }
                axesElements.appendChild(element);
            });
            gauge.svgObject.appendChild(gauge.renderer.drawClipPath({
                'id': gauge.element.id + '_GaugeAreaClipRect_',
                'x': 0, 'y': 0,
                'width': gauge.availableSize.width,
                'height': gauge.availableSize.height,
                'fill': 'transparent', 'stroke': 'transparent'
            }));
            gauge.svgObject.appendChild(axesElements);
            if (gauge.allowLoadingAnimation) {
                this.durationSplitUp((gauge.animationDuration === 0 && ej2_base_1.animationMode === 'Enable') ? 3000 : gauge.animationDuration, axesElements);
            }
        };
        AxisLayoutPanel.prototype.labelElementAnimation = function (element, axisIndex) {
            var _this = this;
            if (element) {
                new ej2_base_1.Animation({}).animate(element, {
                    duration: this.gauge.loadingAnimationDuration[axisIndex],
                    progress: function () {
                        element.style.visibility = 'visible';
                    },
                    end: function () {
                        element.style.visibility = 'visible';
                        var axisElement = document.getElementById(_this.gauge.element.id + '_Axis_Labels_' + axisIndex);
                        if (_this.gauge.axes[axisIndex].showLastLabel && parseInt(element.id.split('Label_')[1], 10) === (axisElement.childElementCount - 2)) {
                            axisElement.style.visibility = 'visible';
                            element = document.getElementById(_this.gauge.element.id + '_Axis_' + axisIndex + '_Label_' + (axisElement.childElementCount - 1));
                            Eif (element) {
                                element.style.visibility = 'visible';
                            }
                        }
                    }
                });
            }
        };
        AxisLayoutPanel.prototype.elementLabelAnimation = function (element, axisIndex, tickIndex, gauge) {
            var _this = this;
            if (element) {
                new ej2_base_1.Animation({}).animate(element, {
                    duration: gauge.axes[axisIndex].labelStyle.font.size != null &&
                        (gauge.axes[axisIndex].labelStyle.font.size === '0px' || gauge.axes[axisIndex].labelStyle.font.size === '0') ? 0 :
                        ((gauge.loadingAnimationDuration[axisIndex] / this.axisOption[axisIndex].axisLabelCount)),
                    progress: function () {
                        element.style.visibility = 'visible';
                    },
                    end: function () {
                        tickIndex += 1;
                        _this.elementLabelAnimation(document.getElementById(gauge.element.id + '_Axis_' + axisIndex + '_Label_' + tickIndex), axisIndex, tickIndex, gauge);
                        var axisElement = document.getElementById(_this.gauge.element.id + '_Axis_Labels_' + axisIndex);
                        if (_this.gauge.axes[axisIndex].showLastLabel && parseInt(element.id.split('Label_')[1], 10) === (axisElement.childElementCount - 2)) {
                            element = document.getElementById(_this.gauge.element.id + '_Axis_' + axisIndex + '_Label_' + (axisElement.childElementCount - 1));
                            Eif (element) {
                                element.style.visibility = 'visible';
                            }
                            axisElement.style.visibility = 'visible';
                        }
                        if (_this.rangeAnimationCount === 0 && (_this.axisOption[axisIndex].axisLabelCount - 1) === tickIndex) {
                            axisElement.style.visibility = 'visible';
                            _this.rangeAnimationCount++;
                            _this.rangeAnimation(gauge);
                        }
                    }
                });
            }
        };
        AxisLayoutPanel.prototype.axisLineCalculation = function (axisElement, axis, value, gauge) {
            var checkMinValue = value === axis.visibleRange.min;
            var location = gauge.midPoint;
            var isClockWise = axis.direction === 'ClockWise';
            var axisWidth = axis.lineStyle.width / 2;
            var startAngle = helper_common_1.getAngleFromValue(axis.visibleRange.min, axis.visibleRange.max, axis.visibleRange.min, axis.startAngle, axis.endAngle, isClockWise);
            var endAngle = helper_common_1.getAngleFromValue(value, axis.visibleRange.max, axis.visibleRange.min, axis.startAngle, axis.endAngle, isClockWise);
            Eif (isClockWise) {
                if (startAngle > endAngle) {
                    endAngle = Math.round(startAngle) === Math.round(endAngle) && !checkMinValue ?
                        Math.round(endAngle) - 0.5 : Math.round(endAngle);
                }
                else {
                    endAngle = startAngle === endAngle && !checkMinValue ? endAngle + 1 : endAngle;
                }
            }
            else {
                endAngle = Math.round(startAngle) === Math.round(endAngle) && !checkMinValue ?
                    [startAngle, startAngle = (endAngle > startAngle ? endAngle + 0.5 : endAngle - 1)][0]
                    : [startAngle, startAngle = endAngle][0];
            }
            axisElement.setAttribute('d', helper_pointer_renderer_1.getCompleteArc(location, startAngle, endAngle, (axis.currentRadius + axisWidth), (axis.currentRadius - axisWidth), checkMinValue));
        };
        AxisLayoutPanel.prototype.axisLineAnimation = function (axisIndex, duration, gauge) {
            var _this = this;
            var axis = gauge.axes[axisIndex];
            this.prevAnimatedMajorTickValue.push(axis.minimum);
            this.prevAnimatedMinorTickValue.push(axis.minimum);
            this.prevAnimatedMinorTickIndex.push(0);
            this.prevAnimatedMajorTickIndex.push(0);
            this.prevAnimatedTickType = 'major';
            if (this.axisOption[axisIndex].isAxisLine) {
                var axisElement_1 = document.getElementById(gauge.element.id + '_AxisLine_' + axisIndex);
                var start_1 = axis.visibleRange.min;
                var end_1 = axis.visibleRange.max;
                var pointerValue_1;
                var timeStamp_1;
                var val_1 = Math.abs(start_1 - end_1);
                new ej2_base_1.Animation({}).animate(axisElement_1, {
                    duration: duration,
                    progress: function (arg) {
                        axisElement_1.style.visibility = 'visible';
                        axisElement_1.setAttribute('fill', axis.lineStyle.color);
                        axisElement_1.setAttribute('stroke-width', '0');
                        timeStamp_1 = (arg.timeStamp / arg.duration);
                        pointerValue_1 = end_1 > start_1 ? start_1 + (timeStamp_1 * val_1) : start_1 - (timeStamp_1 * val_1);
                        _this.axisLineCalculation(axisElement_1, axis, pointerValue_1, gauge);
                    },
                    end: function () {
                        axisElement_1.setAttribute('fill', 'transparent');
                        axisElement_1.setAttribute('stroke-width', axis.lineStyle.width.toString());
                        axisElement_1.setAttribute('d', helper_common_1.getPathArc(gauge.midPoint, axis.startAngle - 90, axis.endAngle - 90, axis.currentRadius));
                        axisElement_1.style.visibility = 'visible';
                        _this.axisAnimation(axisIndex, duration, gauge);
                    }
                });
            }
            else Eif (this.axisOption[axisIndex].isMajorTick || this.axisOption[axisIndex].isMinorTick) {
                Eif (this.axisOption[axisIndex].isMajorTick || (this.axisOption[axisIndex].isMajorTick &&
                    this.axisOption[axisIndex].isMinorTick)) {
                    this.tickElementAnimation(document.getElementById(gauge.element.id + '_Axis_Major_TickLine_' + axisIndex + '_' + 0), document.getElementById(gauge.element.id + '_Axis_' + axisIndex + '_Label_' + 0), duration, axisIndex, this.axisOption[axisIndex].isMajorTick &&
                        this.axisOption[axisIndex].isMinorTick
                        ? 0 : -1, 'major', this.axisOption[axisIndex], gauge);
                }
                else if (this.axisOption[axisIndex].isMinorTick) {
                    this.tickElementAnimation(document.getElementById(gauge.element.id + '_Axis_Minor_TickLine_' + axisIndex + '_' + 0), document.getElementById(gauge.element.id + '_Axis_' + axisIndex + '_Label_' + 0), duration, axisIndex, -1, 'minor', this.axisOption[axisIndex], gauge);
                }
            }
            else if (!this.axisOption[axisIndex].isAxisLine) {
                this.labelRangeAnimation(gauge, axisIndex);
            }
        };
        AxisLayoutPanel.prototype.axisAnimation = function (axisIndex, duration, gauge) {
            var _this = this;
            var axisElement = document.getElementById(gauge.element.id + '_AxisLine_' + axisIndex);
            var axisOption = this.axisOption[axisIndex];
            new ej2_base_1.Animation({}).animate(axisElement, {
                duration: (this.axisOption[axisIndex].majorTickCount === 0 ? 0
                    : duration / this.axisOption[axisIndex].majorTickCount),
                progress: function () {
                    axisElement.style.visibility = 'visible';
                },
                end: function () {
                    if (axisOption.isMajorTick) {
                        _this.tickElementAnimation(document.getElementById(gauge.element.id + '_Axis_Major_TickLine_' + axisIndex + '_' + 0), document.getElementById(gauge.element.id + '_Axis_' + axisIndex + '_Label_' + 0), duration, axisIndex, axisOption.isMajorTick && axisOption.isMinorTick ? 0 : -1, 'major', axisOption, gauge);
                    }
                    else if (axisOption.isMinorTick) {
                        _this.tickElementAnimation(document.getElementById(gauge.element.id + '_Axis_Minor_TickLine_' + axisIndex + '_' + 0), document.getElementById(gauge.element.id + '_Axis_' + axisIndex + '_Label_' + 0), duration, axisIndex, -1, 'minor', axisOption, gauge);
                    }
                    _this.labelRangeAnimation(gauge, axisIndex);
                }
            });
        };
        AxisLayoutPanel.prototype.tickElementAnimation = function (tickElement, labelElement, duration, axisIndex, tickIndex, type, axis, gauge) {
            var _this = this;
            if (tickElement && this.gauge.isAnimationProgress) {
                new ej2_base_1.Animation({}).animate(tickElement, {
                    duration: (axis.isMinorTick ? axis.minorTickCount === 0 ? 0
                        : (duration / axis.minorTickCount) / this.allowAxisCount[axisIndex] :
                        axis.majorTickCount === 0 ? 0 : (duration / axis.majorTickCount) / this.allowAxisCount[axisIndex]),
                    progress: function () {
                        tickElement.style.visibility = 'visible';
                    },
                    end: function () {
                        if (axis.isMajorTick && axis.isMinorTick && gauge.allowLoadingAnimation && _this.gauge.isAnimationProgress) {
                            tickElement.style.visibility = 'visible';
                            var currentTickValue = parseFloat(tickElement.getAttribute('data-interval'));
                            _this.prevAnimatedTickType = type;
                            if (type === 'major') {
                                _this.prevAnimatedMajorTickValue[axisIndex] = currentTickValue;
                                _this.prevAnimatedMajorTickIndex[axisIndex] = tickIndex;
                            }
                            else {
                                _this.prevAnimatedMinorTickValue[axisIndex] = currentTickValue;
                                _this.prevAnimatedMinorTickIndex[axisIndex] = tickIndex;
                            }
                            var minorTickInterval = (gauge.axes[axisIndex].minorTicks.interval != null
                                ? gauge.axes[axisIndex].minorTicks.interval :
                                (gauge.axes[axisIndex].visibleRange.interval / 2));
                            var minorTickValue = minorTickInterval < gauge.axes[axisIndex].visibleRange.interval ? currentTickValue +
                                minorTickInterval : _this.prevAnimatedMinorTickValue[axisIndex] + minorTickInterval;
                            var majorTickValue = _this.prevAnimatedMajorTickValue[axisIndex]
                                + gauge.axes[axisIndex].visibleRange.interval;
                            type = minorTickValue < majorTickValue ? 'minor' : 'major';
                            if (type === 'major' && axis.majorTickCount !== axis.minorTickCount && tickIndex !== 0 && _this.prevAnimatedTickType === 'minor') {
                                tickIndex = _this.prevAnimatedMajorTickIndex[axisIndex];
                            }
                            if (type === 'minor' && axis.majorTickCount !== axis.minorTickCount && tickIndex !== 0 && _this.prevAnimatedTickType === 'major') {
                                tickIndex = _this.prevAnimatedMinorTickIndex[axisIndex];
                            }
                            tickIndex = type === 'minor' ? axis.majorTickCount === axis.minorTickCount ? tickIndex : (currentTickValue ===
                                _this.prevAnimatedMajorTickValue[axisIndex] ? tickIndex : tickIndex + 1) : tickIndex + 1;
                            tickElement = type === 'minor' ? document.getElementById(gauge.element.id + '_Axis_Minor_TickLine_' + axisIndex + '_' + tickIndex) :
                                document.getElementById(gauge.element.id + '_Axis_Major_TickLine_' + axisIndex + '_' + tickIndex);
                            labelElement = type === 'minor' ? null : document.getElementById(gauge.element.id + '_Axis_' + axisIndex + '_Label_' + tickIndex);
                            if (type === 'major' || tickIndex === 0) {
                                _this.labelElementAnimation(document.getElementById(gauge.element.id + '_Axis_' + axisIndex + '_Label_' + tickIndex), axisIndex);
                            }
                            _this.tickElementAnimation(tickElement, labelElement, duration, axisIndex, tickIndex, type, axis, gauge);
                            if (_this.rangeAnimationCount === 0 && type === 'minor' && (tickIndex === axis.minorTickCount - 1 || tickIndex === axis.minorTickCount) && (gauge.axes.length - 1) === axisIndex) {
                                _this.rangeAnimationCount++;
                                _this.rangeAnimation(gauge);
                            }
                        }
                        else if (gauge.allowLoadingAnimation && axis.isMajorTick && _this.gauge.isAnimationProgress) {
                            tickElement.style.visibility = 'visible';
                            type = 'major';
                            tickIndex = tickIndex + 1;
                            tickElement = document.getElementById(gauge.element.id + '_Axis_Major_TickLine_' + axisIndex + '_' + tickIndex);
                            labelElement = document.getElementById(gauge.element.id + '_Axis_' + axisIndex + '_Label_' + tickIndex);
                            _this.tickElementAnimation(tickElement, labelElement, duration, axisIndex, tickIndex, type, axis, gauge);
                            Eif (type === 'major' || tickIndex === 0) {
                                _this.labelElementAnimation(document.getElementById(gauge.element.id + '_Axis_' + axisIndex + '_Label_' + tickIndex), axisIndex);
                            }
                            if (_this.rangeAnimationCount === 0 && type === 'major' && tickIndex === axis.majorTickCount - 1 && (gauge.axes.length - 1) === axisIndex) {
                                _this.rangeAnimationCount++;
                                _this.rangeAnimation(gauge);
                            }
                        }
                        else Eif (gauge.allowLoadingAnimation && _this.gauge.isAnimationProgress && axis.isMinorTick) {
                            tickElement.style.visibility = 'visible';
                            type = 'minor';
                            tickIndex = tickIndex + 1;
                            tickElement = document.getElementById(gauge.element.id + '_Axis_Minor_TickLine_' + axisIndex + '_' + tickIndex);
                            labelElement = document.getElementById(gauge.element.id + '_Axis_' + axisIndex + '_Label_' + tickIndex);
                            _this.tickElementAnimation(tickElement, labelElement, duration, axisIndex, tickIndex, type, axis, gauge);
                            Eif (type === 'minor') {
                                _this.labelElementAnimation(document.getElementById(gauge.element.id + '_Axis_' + axisIndex + '_Label_' + tickIndex), axisIndex);
                            }
                            if (_this.rangeAnimationCount === 0 && type === 'minor' && tickIndex === axis.minorTickCount - 1 && (gauge.axes.length - 1) === axisIndex) {
                                _this.rangeAnimationCount++;
                                _this.rangeAnimation(gauge);
                            }
                        }
                    }
                });
            }
            this.labelRangeAnimation(gauge, axisIndex);
        };
        AxisLayoutPanel.prototype.labelRangeAnimation = function (gauge, axisIndex) {
            var options = this.axisOption[axisIndex];
            if (!ej2_base_1.isNullOrUndefined(options)) {
                if (!options.isMajorTick && !options.isMinorTick && options.isAxisLabel) {
                    Eif (options.axisLabelCount > 0) {
                        Iif (gauge.axes[axisIndex].labelStyle.hiddenLabel === 'First') {
                            this.elementLabelAnimation(document.getElementById(gauge.element.id + '_Axis_' + axisIndex + '_Label_' + 1), axisIndex, 0, gauge);
                        }
                        else {
                            this.elementLabelAnimation(document.getElementById(gauge.element.id + '_Axis_' + axisIndex + '_Label_' + 0), axisIndex, 0, gauge);
                        }
                    }
                }
                else Iif ((this.rangeAnimationCount === 0 && !options.isMajorTick &&
                    !options.isMinorTick && !options.isAxisLabel && options.isRange)
                    || this.rangeAnimationCount === 0 && this.gauge.isAnimationProgress
                        && !options.isMajorTick && !options.isMinorTick && !options.isAxisLabel && options.isRange) {
                    this.rangeAnimationCount++;
                    this.rangeAnimation(gauge);
                }
            }
        };
        AxisLayoutPanel.prototype.rangeAnimation = function (gauge) {
            for (var j = 0; j < gauge.axes.length; j++) {
                var rangesElement = document.getElementById(gauge.element.id + '_Axis_Ranges_' + j);
                Eif (!ej2_base_1.isNullOrUndefined(rangesElement) && gauge.allowLoadingAnimation) {
                    this.rangeElementAnimation(rangesElement, j, gauge);
                }
            }
        };
        AxisLayoutPanel.prototype.rangeElementAnimation = function (rangeElement, axisIndex, gauge) {
            var _this = this;
            var height = 0;
            var opacity = 1;
            var isRangeAbsent = rangeElement.childElementCount > 0 &&
                gauge.axes[axisIndex].ranges[0].start !== gauge.axes[axisIndex].ranges[0].end;
            new ej2_base_1.Animation({}).animate(rangeElement, {
                duration: isRangeAbsent ? gauge.loadingAnimationDuration[axisIndex] : 0,
                progress: function (args) {
                    if (args.timeStamp > args.delay) {
                        height = ((args.timeStamp - args.delay) / args.duration);
                        rangeElement['style']['opacity'] = (opacity * height);
                    }
                },
                end: function () {
                    rangeElement['style']['opacity'] = opacity;
                    var axisElement = document.getElementById(_this.gauge.element.id + '_Axis_Labels_' + axisIndex);
                    Eif (!ej2_base_1.isNullOrUndefined(axisElement)) {
                        axisElement.style.visibility = 'visible';
                    }
                    Eif (gauge.allowLoadingAnimation && axisIndex === 0) {
                        _this.axisOption = [];
                        gauge.axes.map(function (axis, axisindex) {
                            axis.pointers.map(function (pointer, pointerIndex) {
                                var pointerElement = document.getElementById(gauge.element.id + '_Axis_' + axisindex + '_Pointer_' + pointerIndex);
                                Eif (!ej2_base_1.isNullOrUndefined(pointerElement) && _this.gauge.isAnimationProgress) {
                                    pointer.previousValue = !_this.gauge.isPropertyChange ? axis.minimum : pointer.previousValue;
                                    gauge.gaugeAxisLayoutPanel.pointerRenderer.doPointerAnimation(pointerElement, pointer, axis, axisIndex);
                                }
                            });
                            if (axis.pointers.length === 0 && _this.gauge.isAnimationProgress) {
                                Eif (_this.gauge.loadingAnimationDuration[axisIndex] > 0 &&
                                    !ej2_base_1.isNullOrUndefined(_this.gauge.annotationsModule)) {
                                    _this.gauge.annotationsModule.annotationAnimation(_this.gauge);
                                }
                            }
                            else {
                                _this.gauge.isOverAllAnimationComplete = true;
                            }
                        });
                    }
                }
            });
        };
        AxisLayoutPanel.prototype.durationSplitUp = function (duration, axesElements) {
            var splitUpCount = 0;
            this.gauge.loadingAnimationDuration = [];
            for (var i = 0; i < axesElements.childElementCount; i++) {
                splitUpCount = 0;
                var axisCount = 0;
                var element = axesElements.children[i];
                var isAxisLine = false;
                var isMajorTick = false;
                var majorTickCount = 0;
                var labelCount = 0;
                var isMinorTick = false;
                var minorTickCount = 0;
                var isLabel = false;
                var isrange = false;
                var isPointer = false;
                for (var j = 0; j < element.childElementCount; j++) {
                    var elementId = element.children[j]['id'];
                    if (elementId.indexOf('_AxisLine_') > 0) {
                        isAxisLine = true;
                        splitUpCount++;
                    }
                    else if (elementId.indexOf('MajorTickLines') > 0) {
                        isMajorTick = true;
                        axisCount++;
                        majorTickCount = element.children[j].childElementCount;
                        splitUpCount++;
                    }
                    else if (elementId.indexOf('MinorTickLines') > 0) {
                        isMinorTick = true;
                        axisCount++;
                        minorTickCount = element.children[j].childElementCount;
                        if (!isMajorTick) {
                            splitUpCount++;
                        }
                    }
                    else if (elementId.indexOf('_Axis_Labels_') > 0) {
                        isLabel = true;
                        axisCount++;
                        labelCount = element.children[j].childElementCount;
                        if (!isMajorTick && !isMinorTick && this.gauge.axes[i].labelStyle.font.size != null &&
                            (this.gauge.axes[i].labelStyle.font.size !== '0px' && this.gauge.axes[i].labelStyle.font.size !== '0')) {
                            splitUpCount++;
                        }
                    }
                    else if (elementId.indexOf('_Axis_Ranges_') > 0) {
                        isrange = true;
                        if (this.gauge.axes[i].ranges.length === 1
                            && (!ej2_base_1.isNullOrUndefined(this.gauge.axes[i].ranges)
                                && this.gauge.axes[i].ranges[0].start === 0
                                && this.gauge.axes[i].ranges[0].end === 0)) {
                            splitUpCount++;
                        }
                    }
                    else Eif (elementId.indexOf('_Axis_Pointers_') > 0) {
                        isPointer = true;
                        if (this.gauge.axes[i].pointers.length > 0 && this.gauge.axes[i].pointers.length !== 1 &&
                            this.gauge.axes[i].pointers[0].value !== this.gauge.axes[i].minimum) {
                            splitUpCount++;
                        }
                    }
                }
                this.allowAxisCount.push(axisCount === 0 ? 1 : axisCount);
                this.axisOption.push({
                    isAxisLine: isAxisLine, isMajorTick: isMajorTick, isMinorTick: isMinorTick,
                    isAxisLabel: isLabel, isPointer: isPointer, isRange: isrange,
                    axisLabelCount: labelCount, majorTickCount: majorTickCount, minorTickCount: minorTickCount
                });
                isAxisLine = false;
                isMajorTick = false;
                majorTickCount = 0;
                isMinorTick = false;
                labelCount = 0;
                minorTickCount = 0;
                isLabel = false;
                isrange = false;
                isPointer = false;
                if (this.gauge.axes[i].annotations != null
                    && this.gauge.axes[i].annotations.length > 0
                    && !ej2_base_1.isNullOrUndefined(this.gauge.annotationsModule)) {
                    splitUpCount++;
                }
                this.gauge.loadingAnimationDuration.push(splitUpCount === 0 ? duration : duration / splitUpCount);
            }
        };
        AxisLayoutPanel.prototype.getMaxLabelWidth = function (gauge, axis) {
            axis.maxLabelSize = new helper_common_1.Size(0, 0);
            var textStyle = {
                size: axis.labelStyle.font.size || this.gauge.themeStyle.fontSize,
                color: axis.labelStyle.font.color || this.gauge.themeStyle.labelColor,
                fontFamily: axis.labelStyle.font.fontFamily || this.gauge.themeStyle.labelFontFamily,
                fontWeight: axis.labelStyle.font.fontWeight || this.gauge.themeStyle.fontWeight,
                fontStyle: axis.labelStyle.font.fontStyle,
                opacity: axis.labelStyle.font.opacity
            };
            for (var _i = 0, _a = axis.visibleLabels; _i < _a.length; _i++) {
                var label = _a[_i];
                label.size = helper_common_1.measureText(label.text, textStyle);
                axis.maxLabelSize.width = label.size.width > axis.maxLabelSize.width ?
                    label.size.width : axis.maxLabelSize.width;
                axis.maxLabelSize.height = label.size.height > axis.maxLabelSize.height ?
                    label.size.height : axis.maxLabelSize.height;
            }
        };
        AxisLayoutPanel.prototype.destroy = function () {
            this.gauge = null;
            this.farSizes = [];
            Eif (!ej2_base_1.isNullOrUndefined(this.axisRenderer)) {
                this.axisRenderer.destroy();
            }
            this.axisRenderer = null;
            Eif (!ej2_base_1.isNullOrUndefined(this.pointerRenderer)) {
                this.pointerRenderer.destroy();
            }
            this.pointerRenderer = null;
            this.axisOption = null;
            this.prevAnimatedMajorTickValue = null;
            this.prevAnimatedMajorTickIndex = null;
            this.prevAnimatedMinorTickIndex = null;
            this.prevAnimatedMinorTickValue = null;
            this.allowAxisCount = null;
        };
        return AxisLayoutPanel;
    }());
    exports.AxisLayoutPanel = AxisLayoutPanel;
});