Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (!xAxis) {
throw new Error('Please specify the xAxis!');
}
if (!yAxis) {
throw new Error('Please specify the yAxis!');
}
const backgroundChart = this.backgroundChart;
let type = backgroundChart.type || geom.get('type');
const color = backgroundChart.color || 'grey';
if (!_.isArray(type)) {
type = [type];
}
const padding = parsePadding(this.padding);
const bgChart = new Plot({
containerDOM: this.container,
width: this.domWidth,
height: this.height,
padding: [0, padding[1], 0, padding[3]],
animate: false,
});
bgChart.data(data);
bgChart.scale(scales);
bgChart.axis(false);
bgChart.tooltip(false);
bgChart.legend(false);
_.each(type, (eachType) => {
bgChart
.area()
.position(`${xAxis}*${yAxis}`)
.color(color)