Highcharts label format with tickPositioner in a datetime x Axis

百般思念 提交于 2019-12-01 20:35:30

It's little hacky, but you need also calculate information about labels and add them, for example: http://jsfiddle.net/AVhaL/

        tickPositioner: function (min, max) {
            var ticks = this.getLinearTickPositions(this.tickInterval, min, max),
                tLen = ticks.length;

            ticks.info = {
                unitName: "week",
                higherRanks: {},
                totalRange: ticks[tLen - 1] - ticks[0]
            };
            return ticks;
        }

So according to totalRange, you need to pass unitName - it's information which format should be taken from dateTimeLabelFormats.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!