简体   繁体   中英

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 ). 在此处输入图片说明

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

Add to .css file:

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

jsFiddle

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM