Khanh Pham
Khanh Pham

Reputation: 2973

Hide label x-axis but still keep vertical axis jquery flot

I'm finding about jquery flot. And i want to hide label x-axis but i want to keep vertical axis.

Here my demo code: my demo

Here my picture what i expected (remove all lable x-axis). enter image description here

Hope everybody can help me. Thank you very much.

Update:

I updated my code as labelWidth and labelHeight, but it it still appear.

xaxis: {
  mode: "time",
  timezone: "browser",
  ticks: 6,
  labelWidth: 0,
  labelHeight: 0,
  ticks: [
    now_hour,
    now_hour + 3600000*1,
    now_hour + 3600000*2,
    now_hour + 3600000*3,
    now_hour + 3600000*4,
    now_hour + 3600000*5,
    now_hour + 3600000*6 
  ],
  timeformat: "%H:%M"
}

Update: Follow as Stargazer's answer. It worked as well.

We just update css.

.tickLabels .xAxis { 
 color:transparent !important; 
}

Upvotes: 1

Views: 1298

Answers (2)

Mike
Mike

Reputation: 328

I don't know about previous versions but v3.0.0 this works:

  xaxis: {
    showTickLabels: 'none'
  }

Check the source code of this expample https://www.flotcharts.org/flot/examples/axes-labels/index.html

Upvotes: 0

Stargazer
Stargazer

Reputation: 488

Add to .css file:

.tickLabels .xAxis { 
  color:transparent !important; 
}

jsFiddle

Upvotes: 2

Related Questions