UNPKG

prodap-chatbot-domain

Version:

Classes utilizadas na resposta de todas as Intents do Assistente Virtual

46 lines 1.64 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const ChartTypes_1 = require("./ChartTypes"); const ChartAbstract_1 = require("./ChartAbstract"); const ChartData_1 = require("./ChartData"); const legends_1 = require("./legends"); class StackedVerticalBarChart extends ChartAbstract_1.default { constructor({ titleAxisX, titleAxisY, chartProps, data, legendList, showLegend, }) { super(chartProps, ChartTypes_1.default.STACKED_VERTICAL_BAR_CHART, ''); this.data = []; this.legendList = []; this.titleAxisX = titleAxisX; this.titleAxisY = titleAxisY; this.chartData = []; this.legendData = []; this.rules = []; this.chartColorScale = []; this.chart = true; this.showLegend = showLegend || chartProps.showLegend; const values = data; const dataRules = legendList; if (dataRules) { dataRules.forEach((r) => { this.rules.push(r); r.subtitle = r.label; this.legendData.push(new legends_1.default(r)); }); } if (values) { values.forEach((value) => { const bar = value.map((row) => new ChartData_1.default(row)); this.chartData.push(bar); }); } } addData(...rows) { this.data = this.data.concat(rows); return this; } addLegend(...legend) { this.legendList = this.legendList.concat(legend); return this; } } exports.default = StackedVerticalBarChart; //# sourceMappingURL=StackedVerticalBarChart.js.map