"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.OjChart = void 0;
const OjChartBase_1 = require("./OjChartBase");
/**
 * The component WebElement for [oj-chart](../../jsdocs/oj.ojChart.html).
 * Do not instantiate this class directly, instead, use
 * [ojChart](../functions/elements.ojChart-1.html).
 */
class OjChart extends OjChartBase_1.OjChartBase {
    /**
     * Dispatches group drill event.
     * @param {Array<string>} groupIds Id of the group axis label. It will be an array of outermost to innermost group data in hierarchical axis.
     */
    async doGroupDrill(groupId) {
        let drilling = await this.getDrilling();
        if (drilling === 'on' || drilling === 'groupsOnly') {
            await this.getDriver().executeScript(`
        let chart = arguments[0];
        chart.getAutomation().dispatchGroupDrill(arguments[1]);
      `, this, groupId);
        }
    }
    /**
     * Dispatches series drill event.
     * @param {string} seriesId The series id of the item.
     */
    async doSeriesDrill(seriesId) {
        let drilling = await this.getDrilling();
        if (drilling === 'on' || drilling === 'seriesOnly') {
            await this.getDriver().executeScript(`
        let chart = arguments[0];
        chart.getAutomation().dispatchSeriesDrill(arguments[1]);
      `, this, seriesId);
        }
    }
    /**
     * Dispatches item drill event.
     * @param {string} seriesId The series id of the item.
     * @param {Array<string>} groupId The group ids of the item.
     * @param {number}itemIndex
     */
    async doItemDrill(seriesId, groupId, itemIndex) {
        let drilling = await this.getDrilling();
        if (drilling === 'on' || drilling === 'itemsOnly') {
            await this.getDriver().executeScript(`
      let chart = arguments[0];
      chart.getAutomation().dispatchItemDrill(arguments[1], arguments[2], arguments[3]);
    `, this, seriesId, groupId, itemIndex);
        }
    }
    /**
     * Dispatches multi series drill in pie chart.
     */
    async doMultiSeriesDrill() {
        let multiSeriesDrill = await this.getMultiSeriesDrilling();
        if (multiSeriesDrill === 'on') {
            await this.getDriver().executeScript(`
      let chart = arguments[0];
      chart.getAutomation().dispatchMultiSeriesDrill();
    `, this);
        }
    }
}
exports.OjChart = OjChart;
//# sourceMappingURL=OjChart.js.map