private static createAxisX()

in src/visual.ts [547:595]


    private static createAxisX(
        isScalar: boolean,
        series: Series[],
        originalScale: GenericScale,
        formatterOptions: ValueFormatterOptions,
        dateFormat: XAxisDateFormat,
        position: XAxisPosition,
        widthOfXAxisLabel: number,
        locale: string): XAxisProperties[] {

        let scales = Visual.getXAxisScales(series, isScalar, originalScale);
        let xAxisProperties = [];
        xAxisProperties.length = scales.length;

        for (let i: number = 0, rotate = false; i < xAxisProperties.length; i++) {
            let values = Visual.getXAxisValuesToDisplay(<any>scales[i], rotate, isScalar, dateFormat, widthOfXAxisLabel);

            if (!rotate
                && position === XAxisPosition.Bottom
                && values.length < Visual.MinimumTicksToRotate) {
                let rotatedValues = Visual.getXAxisValuesToDisplay(<any>scales[i], true, isScalar, dateFormat, widthOfXAxisLabel);
                if (rotatedValues.length > values.length) {
                    rotate = true;
                    i = -1;
                    continue;
                }
            }

            xAxisProperties[i] = <XAxisProperties>{ values: values, scale: scales[i], rotate: rotate };
        }

        formatterOptions.tickCount = xAxisProperties.length && xAxisProperties.map(x => x.values.length).reduce((a, b) => a + b) * 5;
        formatterOptions.value = originalScale.domain()[0];
        formatterOptions.value2 = originalScale.domain()[1];
        formatterOptions.cultureSelector = locale;

        xAxisProperties.forEach((properties: XAxisProperties) => {
            let values: (Date | number)[] = properties.values.filter((value: Date | number) => value !== null);

            let formatter = valueFormatter.create(formatterOptions);
            properties.axis = axisBottom(properties.scale)
                .scale(properties.scale)
                .tickValues(values)
                .tickSizeOuter(0)
                .tickFormat(formatter.format);
        });

        return xAxisProperties;
    }