Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
chartTable.add(this.xAxis, 2, 2);
this.xAxis.showEndTickLabels(true);
this.xAxis.margin(xConfigs.margin);
if (xConfigs.tickingStep) {
if (this.xScale instanceof Scales.Linear && typeof xConfigs.tickingStep === 'number') {
const xScaleTickGenerator = Scales.TickGenerators.intervalTickGenerator(xConfigs.tickingStep);
this.xScale.tickGenerator(xScaleTickGenerator);
if (xConfigs.axisMin && typeof xConfigs.axisMin === 'number') {
this.xScale.domainMin(xConfigs.axisMin);
}
if (xConfigs.axisMax && typeof xConfigs.axisMax === 'number') {
this.xScale.domainMax(xConfigs.axisMax);
}
} else if (this.xScale instanceof Scales.Time && typeof xConfigs.tickingStep !== 'number') {
if (xConfigs.axisMin) {
this.xScale.domainMin(parseAxisMinMaxToDate(xConfigs.axisMin));
}
if (xConfigs.axisMax) {
this.xScale.domainMax(parseAxisMinMaxToDate(xConfigs.axisMax));
}
}
}
if (this.xAxis instanceof Axes.Time && xConfigs.timeFormat) {
const tickingStep = typeof xConfigs.tickingStep !== 'number' ? xConfigs.tickingStep : {};
this.xAxis.axisConfigurations([ setTimeAxisTickingFormat(xConfigs.timeFormat, tickingStep || {}) ]);
}
}
this.yScale = new Scales.Linear();
this.yAxis = getAxis(yConfigs, this.yScale) as Axes.Numeric;
chartTable.add(this.xAxis, 2, 2);
this.xAxis.showEndTickLabels(true);
this.xAxis.margin(xConfigs.margin);
if (xConfigs.tickingStep) {
if (this.xScale instanceof Scales.Linear && typeof xConfigs.tickingStep === 'number') {
const xScaleTickGenerator = Scales.TickGenerators.intervalTickGenerator(xConfigs.tickingStep);
this.xScale.tickGenerator(xScaleTickGenerator);
if (xConfigs.axisMin && typeof xConfigs.axisMin === 'number') {
this.xScale.domainMin(xConfigs.axisMin);
}
if (xConfigs.axisMax && typeof xConfigs.axisMax === 'number') {
this.xScale.domainMax(xConfigs.axisMax);
}
} else if (this.xScale instanceof Scales.Time && typeof xConfigs.tickingStep !== 'number') {
if (xConfigs.axisMin) {
this.xScale.domainMin(parseAxisMinMaxToDate(xConfigs.axisMin));
}
if (xConfigs.axisMax) {
this.xScale.domainMax(parseAxisMinMaxToDate(xConfigs.axisMax));
}
}
}
if (this.xAxis instanceof Axes.Time && xConfigs.timeFormat) {
const tickingStep = typeof xConfigs.tickingStep !== 'number' ? xConfigs.tickingStep : {};
this.xAxis.axisConfigurations([ setTimeAxisTickingFormat(xConfigs.timeFormat, tickingStep || {}) ]);
}
}
this.yScale = new Scales.Linear();
this.yAxis = getAxis(yConfigs, this.yScale) as Axes.Numeric;