0

I have a fairly simple chart

    var d1 = [['A', 5], ['B', 7], ['C', 8], ['D', 9], ['E', 0], ['F', 10], ['G', 5], ];

    $.plot(".appointments_chart", [d1],
    {
        xaxis: {
            mode: "categories",
            tickLength: 0,
            panRange: [null, null]
        },
        yaxis: {
            panRange: false
        },
        pan: {
            interactive: true
        }
    });

What I want is when the initial chart is displayed there are only three points on the X Axis, C, D & E and the user can pan forwards or backwards to see the others. Is this possible?

4

1 回答 1

1

我的获取方式是这样的...

var d1 = [['C', 8], ['D', 9], ['E', 0]];
var options = {
    xaxis: {
        mode: "categories",
        tickLength: 0,
        panRange: [null, null]
    },
    yaxis: {
        panRange: false
    },
    pan: {
        interactive: true
    }
}
$.plot(".appointments_chart", d1, options );

// something big happened, let's add them all..
var d2 = [['A', 5], ['B', 7], ['F', 10], ['G', 5]];
$.plot(".appointments_chart", $.merge(d1,d2), options );
于 2013-08-22T03:53:00.753 回答