public calculateAxes()

in src/EnhancedScatterChart.ts [2837:2893]


    public calculateAxes(
        categoryAxisSettings: AxisSettings,
        valueAxisSettings: AxisSettings,
        textProperties: TextProperties,
        scrollbarVisible: boolean = true
    ): IAxisProperties[] {
        const visualOptions: CalculateScaleAndDomainOptions = {
            viewport: this.viewport,
            margin: this.margin,
            forcedXDomain: [
                categoryAxisSettings.start,
                categoryAxisSettings.end,
            ],
            forceMerge: false,
            showCategoryAxisLabel: false,
            showValueAxisLabel: true,
            categoryAxisScaleType: null,
            valueAxisScaleType: null,
            valueAxisDisplayUnits: valueAxisSettings.labelDisplayUnits,
            categoryAxisDisplayUnits: categoryAxisSettings.labelDisplayUnits,
            trimOrdinalDataOnOverflow: false
        };

        visualOptions.forcedYDomain = axis.applyCustomizedDomain(
            [
                valueAxisSettings.start,
                valueAxisSettings.end
            ],
            visualOptions.forcedYDomain
        );

        visualOptions.showCategoryAxisLabel = categoryAxisSettings.showAxisTitle;

        const width: number = this.viewport.width - (this.margin.left + this.margin.right);

        const axes: IAxisProperties[] = this.calculateAxesProperties(visualOptions);

        axes[0].willLabelsFit = axis.LabelLayoutStrategy.willLabelsFit(
            axes[0],
            width,
            measureSvgTextWidth,
            textProperties);

        // If labels do not fit and we are not scrolling, try word breaking
        axes[0].willLabelsWordBreak = (!axes[0].willLabelsFit && !scrollbarVisible)
            && axis.LabelLayoutStrategy.willLabelsWordBreak(
                axes[0],
                this.margin,
                width,
                measureSvgTextWidth,
                estimateSvgTextHeight,
                getTailoredTextOrDefault,
                textProperties
            );

        return axes;
    }