flot.js导航插件平移功能不起作用

时间:2014-05-26 11:31:11

标签: javascript jquery flot

我试图通过按钮触发器在我的flot图表中实现平移,但是我无法让它工作。如果没有指定缩放范围,它可以不工作吗?以下是我的代码片段:

var plot = $.plot('#' + historicIdentity, data, {
                    xaxis: {
                        min: minDate,
                        max: maxDate,
                        mode: "time",
                        tickSize: setTickSize,
                        monthNames: ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"]
                    },
                    yaxis: {
                        tickFormatter: customFormatter,
                        min:yMin,
                        max:yMax,
                        tickSize:0.40,
                        panRange: [-10, 20]

                     },
                    pan: {
                        interactive: false
                    },
                    series: {
                        lines: {
                            show: true,
                            fill: true
                        },
                        points: {
                            show: false
                        }
                    },
                    grid: {
                        borderWidth: 1,
                        hoverable: true
                    }
                });
                $('a.button').on('click',function(e){
                    e.preventDefault();
                    plot.pan({top: 10000});

                });

我做错了什么?

0 个答案:

没有答案