javascript - xaxis 定制中的 Highcharts 日期

标签 javascript jquery highcharts

我们如何将日期格式化为这种格式

enter image description here

现在是这样的:

enter image description here

xAxis: {
            type: 'datetime'
        }

JS Fiddle here

最佳答案

我刚刚更改了您的 xAxis 的代码

这里是:

xAxis: [{
            type: 'datetime',
            labels: {
            formatter: function() {

                return Highcharts.dateFormat('%e', this.value);

            }
        },

        tickInterval: 1 * 24 * 3600 * 1000
        },
        {   lineWidth: 0,
           minorGridLineWidth: 0,
           lineColor: 'transparent',
           minorTickLength: 0,
           tickLength: 0,
            type: 'datetime',
            labels: {
            formatter: function() {
                return Highcharts.dateFormat('%b', this.value);

            }
        },

        tickInterval: 30 *24 * 3600 * 1000
        }]

有关详细信息,请点击此 jsFiddle 链接 http://jsfiddle.net/3nLmxs89/1/

关于javascript - xaxis 定制中的 Highcharts 日期,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25970395/

相关文章:

javascript - 如何一键运行多个JavaScript函数

javascript - TouchableOpacity 和按钮在 react native 模态中不起作用?

javascript - 检测用户何时与 IFrame JavaScript 交互

javascript - 删除带有热图的 Highchart 顶线

Javascript - 如何检查网址是否与地址栏中的网址大致相同?

javascript - 在渲染中使用箭头函数的替代方法具有相同的效果

javascript - 在 onclick 上使用 jquery 缩放坐标上的图像

javascript - Litebox 插件不起作用

javascript - Highcharts 数组 :

css - Highcharts.js - 将文本放在 donut 的中心