2

I am using the existing example from angular nvd3 and try to hide the y-axis and remove the ticks from x-axis.So, I have gone through the document and added showYAxis="false" and added ticks: null in x-axis object. But, I am not able to hide the y-axis as well as remove the ticks from x-axis. Kindly, find the below link and let me know my mistake. For y -axis:

 <nvd3 options="options" data="data" showYAxis="false"></nvd3> 

For hiding x-axis ticks

 xAxis: {
    axisLabel: 'X Axis',
    ticks: null
  },

http://plnkr.co/edit/6t5bky?p=preview

beaver
  • 16,227
  • 2
  • 31
  • 57
Karthik
  • 470
  • 7
  • 20

2 Answers2

3

You can remove Y-axis using css styles.

.nv-y text {
  display: none;
}

You can remove the grid lines as,

.tick {
  display: none;
}

Update:

You can remove the class text in the above style to see the effect.

.nv-y {
    display: none;
}

If you want to display names on the X-Axis for each bar and without grid lines then add line class in the above style as,

.tick line {
      display: none;
    }

Reference: Stackoverflow

Working Plunker

P.S: I have used nvd3 charts but never tried to hide any axis or grid lines. Chart seems to be good without grid lines .. :)

Community
  • 1
  • 1
Amarnath
  • 8,121
  • 10
  • 51
  • 79
2

it's really easy to get that fixed using the charts options that's already exist on angular NVD3. to get the y-axis just add showYAxis: false, and to hide x-axis ticks just add

tickFormat: function(d) {
      return null
    },

into your xAxis options. here is a forked plunker with the options that you are looking for ;)

Mohamed NAOUALI
  • 1,972
  • 1
  • 20
  • 28