This commit is contained in:
Violet Voronetzky 2019-12-04 18:43:34 +02:00
Родитель 18b5b89f44
Коммит 15bfd27d39
1 изменённых файлов: 3 добавлений и 3 удалений

Просмотреть файл

@ -32,13 +32,13 @@ export abstract class Chart {
public draw(): void {
const highchartsOptions = _.merge({}, this.basicHighchartsOptions, this.themeOptions);
this.destroyExistingChar();
this.destroyExistingChart();
this.highchartsChart = Highcharts.chart(this.options.elementId, highchartsOptions);
}
public changeTheme(newTheme: ChartTheme): void {
if(this.options.chartOptions.chartTheme !== newTheme) {
this.destroyExistingChar();
this.destroyExistingChart();
// Update new theme options
this.themeOptions = Themes.getThemeOptions(newTheme);
@ -249,7 +249,7 @@ export abstract class Chart {
return xAxisColumn.name;
}
private destroyExistingChar(): void {
private destroyExistingChart(): void {
if(this.highchartsChart) {
this.highchartsChart.destroy();
}