Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
private createGridlines(chartTable: Table, config: Partial) {
if (config.gridlines) {
const { showXGrid, showYGrid } = config.gridlines;
if (showXGrid || showYGrid) {
const gridlines = new Components.Gridlines(showXGrid ? this.xScale : null, showYGrid ? this.yScale : null);
if (chartTable.has(this.plot)) {
chartTable.remove(this.plot);
const group = new Components.Group([ this.plot, gridlines ]);
chartTable.add(group, 1, 2);
} else {
chartTable.add(gridlines, 1, 2);
}
}
}
}
private createGridlines(chartTable: Table, config: Partial) {
if (config.gridlines) {
const { showXGrid, showYGrid } = config.gridlines;
if (showXGrid || showYGrid) {
const gridlines = new Components.Gridlines(showXGrid ? this.xScale : null, showYGrid ? this.yScale : null);
if (chartTable.has(this.plot)) {
chartTable.remove(this.plot);
const group = new Components.Group([ this.plot, gridlines ]);
chartTable.add(group, 1, 2);
} else {
chartTable.add(gridlines, 1, 2);
}
}
}
}