jquery flot x轴标记位置

时间:2012-01-17 18:39:46

标签: jquery charts flot

请参阅http://jsfiddle.net/UEePE/1029/

如何将x轴放在图表的顶部而不是图表的底部?

3 个答案:

答案 0 :(得分:1)

您可以指定positiontop

var data = [[-373597200000, 315.71], [-370918800000, 317.45], [-368326800000, 317.50],  [-99968400000, 319.79]]; 

$.plot($("#placeholder"), data, {
        yaxis: {
        },
        xaxis: { mode: "time",
                 ticks: 18,
                 minTickSize: [1, "month"], 
                 tickLength: 1,
                 min: (new Date("2000/01/01")).getTime(),
                 max: (new Date("2001/07/02")).getTime(),
                 position: "top" //<<-------------- will set X axis to top
},
        "lines": {"show": "true"},
        "points": {"show": "true"},
        clickable:true,hoverable: true
});

正在使用 Demo

答案 1 :(得分:1)

答案 2 :(得分:1)

  xaxis: { postion:"top",...

请参阅:http://jsfiddle.net/diode/7FfMd/2/