Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
private createAxes(xConfigs: AxisConfig, yConfigs: AxisConfig, chartTable: Table) {
this.xScale = getScale(xConfigs.type);
if (this.xScale instanceof Scales.Category) {
this.xScale.innerPadding(xConfigs.innerPadding as number);
this.xScale.outerPadding(xConfigs.outerPadding as number);
}
this.xAxis = getAxis(xConfigs, this.xScale);
if (xConfigs.show) {
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);
private createAxes(xConfigs: AxisConfig, yConfigs: AxisConfig, chartTable: Table) {
this.xScale = getScale(xConfigs.type);
if (this.xScale instanceof Scales.Category) {
this.xScale.innerPadding(xConfigs.innerPadding as number);
this.xScale.outerPadding(xConfigs.outerPadding as number);
}
this.xAxis = getAxis(xConfigs, this.xScale);
if (xConfigs.show) {
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);