Charts 关于jqPlot zoom

Charts 关于jqPlot zoom,charts,zooming,jqplot,Charts,Zooming,Jqplot,我正在尝试使用jqPlot在我的项目中创建图表。我遇到的问题是,当我缩放到某个区域时,x轴标签显示为“Jun 01,June 01,June 01,June 02 ,June 02,June 02,June 03”等等。我想要的是“June 01,June 02,June 03”。我该怎么做?很抱歉英语不好。您可以提供这样的刻度间隔值: var plot = $.jqplot('graph', [dataSet], { // ... axes: { xaxis:

我正在尝试使用jqPlot在我的项目中创建图表。我遇到的问题是,当我缩放到某个区域时,x轴标签显示为“Jun 01,June 01,June 01,June 02
,June 02,June 02,June 03”等等。我想要的是“June 01,June 02,June 03”。我该怎么做?很抱歉英语不好。

您可以提供这样的刻度间隔值:

var plot = $.jqplot('graph', [dataSet], {
    // ...
    axes: {
        xaxis: {
            min: 'X', // E.g. '2012-06-01'
            max: 'X',
            tickInterval: '1 day' // Yes, it understands this.
            // ...
        }
    },
    // ...
});

但请记住:为了使tickInterval有效,您必须提供至少一个最小值或最大值。

您可以提供如下的tickInterval值:

var plot = $.jqplot('graph', [dataSet], {
    // ...
    axes: {
        xaxis: {
            min: 'X', // E.g. '2012-06-01'
            max: 'X',
            tickInterval: '1 day' // Yes, it understands this.
            // ...
        }
    },
    // ...
});

但请记住:为了使时间间隔有效,您必须提供至少一个最小值或最大值。

+1表示正确答案。下面是一个演示代码使用的运行示例,谢谢您的回答。但在我设置了时间间隔后,它仍然存在问题。这对我的问题不起作用。非常感谢。@niklaus请在上与我们共享您的代码,以便我们可以使用相同的代码示例。+1是一个好答案。下面是一个演示代码使用的运行示例,谢谢您的回答。但在我设置了时间间隔后,它仍然存在问题。这对我的问题不起作用。非常感谢。@niklaus请在上与我们共享您的代码,以便我们可以使用相同的代码示例。