"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.defaultXYSeriesSort = defaultXYSeriesSort;
exports.defaultXYLegendSeriesSort = defaultXYLegendSeriesSort;
function defaultXYSeriesSort(a, b) {
    if (a.seriesType !== b.seriesType) {
        return 0;
    }
    if (a.groupId !== b.groupId) {
        return a.insertOrder - b.insertOrder;
    }
    if (a.isStacked && !b.isStacked) {
        return -1;
    }
    if (!a.isStacked && b.isStacked) {
        return 1;
    }
    return a.insertOrder - b.insertOrder;
}
function defaultXYLegendSeriesSort(a, b) {
    if (!a || !b)
        return 0;
    if (a.groupId !== b.groupId) {
        return a.sortOrder - b.sortOrder;
    }
    if (a.isStacked && !b.isStacked) {
        return -1;
    }
    if (!a.isStacked && b.isStacked) {
        return 1;
    }
    return a.sortOrder - b.sortOrder;
}
//# sourceMappingURL=default_series_sort_fn.js.map