import * as Highcharts from 'highcharts';
import { BaseHighChartsRender } from "../types/BaseHighChartsRender";
export class BarChartStrategy extends BaseHighChartsRender {
  buildOptions(series, xAxis, yAxis, options) {
    return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ chart: Object.assign(Object.assign({ type: 'bar' }, (options.width && { width: options.width })), (options.height && { height: options.height })), title: this.parseTitle(options.title) }, (options.subTitle && { subtitle: this.parseSubTitle(options.subTitle) })), (yAxis && { yAxis: this.parseAxis(yAxis) })), (xAxis && { xAxis: this.parseAxis(xAxis) })), { series: this.parseSerie(series) }), this.buildResposiveConfig()), this.buildDefaultChartOptions()), { tooltip: this.buildFormatterTooltip(series), legend: {
        enabled: options.legendEnabled,
      } }), (options.onClickSerie && {
      plotOptions: {
        series: {
          cursor: 'pointer',
          point: {
            events: {
              click: this.buildOnClickCallBack(options.onClickSerie),
            }
          }
        }
      }
    }));
  }
  render(container, series, xAxis, yAxis, options) {
    this.chart = Highcharts.chart(container, this.buildOptions(series, xAxis, yAxis, options));
  }
  destroy() {
    var _a;
    (_a = this.chart) === null || _a === void 0 ? void 0 : _a.destroy();
  }
}
