shiro
shiro

Reputation: 255

jquery flot x-axis labeling location

please refer to http://jsfiddle.net/UEePE/1029/

How can I put the x-axis to the top of the chart instead at the bottom of the chart?

Upvotes: 0

Views: 2870

Answers (3)

ShankarSangoli
ShankarSangoli

Reputation: 69915

You can specify the position to top.

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
});

Working Demo

Upvotes: 1

Diode
Diode

Reputation: 25165

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

see : http://jsfiddle.net/diode/7FfMd/2/

Upvotes: 1

Steve Wellens
Steve Wellens

Reputation: 20638

Like this:

http://jsfiddle.net/jsGLP/

Upvotes: 1

Related Questions