Jquery 海图上的多重X轴

Jquery 海图上的多重X轴,jquery,charts,highcharts,Jquery,Charts,Highcharts,我正在尝试使用Highcharts实现附加图表。我已经能够在我的图表上用线条绘制条形图。但我无法用日期和月份划分多个X轴。有没有人实施过这样的图表。请提供帮助我不确定您是否需要多个xAxis,而是需要一个勾号标签格式化程序,它将在每个月初更改标签: var lastMonth = null; $('#container').highcharts({ xAxis: { type: 'datetime', labels: {


我正在尝试使用Highcharts实现附加图表。我已经能够在我的图表上用线条绘制条形图。但我无法用日期和月份划分多个X轴。有没有人实施过这样的图表。请提供帮助

我不确定您是否需要多个xAxis,而是需要一个勾号标签格式化程序,它将在每个月初更改标签:

var lastMonth = null;    
$('#container').highcharts({
    xAxis: {
        type: 'datetime', 
        labels: {
            formatter: function () {
                var thisMonth = Highcharts.dateFormat("%b", this.value);
                if (lastMonth != thisMonth){
                    lastMonth = thisMonth;
                    return Highcharts.dateFormat("%b %e", this.value);
                } else {
                    return Highcharts.dateFormat("%e", this.value);
                }
            }
        }
    },
    ....
生成如下轴(小提琴):


实际上,您可以使用两个XAX,如下所示:


我刚刚将第二个xAxis连接到第一个xAxis,每个xAxis都有不同的标签格式化程序

我已经用格式化程序尝试过了。但我的要求没有什么不同。我希望我的日期按月份分组。日期和月份都需要像屏幕截图中所示那样单独显示。从某种程度上说,这就是我想要的。但是你知道我怎样才能得到一个月的首发时间吗。在你的小提琴手身上,没有一月之前的月份,那是因为时间间隔。上个月有什么工作要做吗?请随意发布您的示例:)
    xAxis: [{
        type: 'datetime',
        labels: {
            formatter: function () {
                return Highcharts.dateFormat("%e", this.value);
            }
        }
    }, {
        linkedTo: 0,
        type: 'datetime',
        tickLength: 0,
        lineWidth: 0,
        tickInterval: 30 * 24 * 3600 * 1000,
        labels: {
            formatter: function () {
                return Highcharts.dateFormat("%b %e", this.value);
            }
        }
    }],