score:1
Accepted answer
you can use the ticks(number)
method on the axis to tell it to draw fewer ticks; the default is to draw approximately 10 ticks. the actual number of ticks is adjusted to get round-number intervals between tick values, which is why you were getting 12 ticks using the default behaviour.
for your case you want to use
y.axis = d3.svg.axis().ticks(6).scale(y).orient("left")
Source: stackoverflow.com
Related Query
- How to give a better Y axis label / scale in d3 chart?
- How to use different orientation for axis label in a parallel coordinate chart
- How can I fix my chart so that the scale of the x axis is defined by a group of labels?
- How to make axis label of stacked bar chart in the middle of ticks chart in D3?
- D3 Line chart - display value label on Y axis tick and a not scale
- how to set the domain and scale on an axis on a nvd3.js multiBarChart
- add y axis label to NVD3 Multi-Bar Chart
- How to style slider on chart in D3.js and show label of dynamic y-value?
- Y axis label not displaying large numbers - Multi-Bar Chart
- dimple.js How can I change the labels of a chart axis without changing the data?
- dc.js bar chart with ordinal x axis scale doesn't render correctly
- How to modify axis labels in d3 for a stacked bar chart when the axis labels are mapped as part of the scale's domain
- d3.js: How to add value below the label in donut chart
- How to create Stacked Line Chart D3, Multiple Y Axis and common X Axis
- How to remove weekends dates from x axis in dc js chart
- How to set the label for each vertical axis in a parallel coordinates visualization?
- D3.js axis label overlapping axis scale
- How to line up x axis on stacked bar chart with a line overlay in d3.js
- How to cut y axis to make the chart look better?
- C3.js change label position of Line Chart Y axis to center up of Y axis
- D3.js v7 - How to make Y axis labels always show on screen for a scrollable chart
- How to trigger onmouseover event on chart label in D3
- how to make the x axis scrollable in a d3 line chart graph
- How to add svg rectangles as background behind axis tick labels in d3js if ticks are inside chart
- Give outerspacepadding at x axis with time scale in d3 js
- How do I centre the Y axis in a D3 Tornado Chart
- Creating a radial chart with a different color for each axis label
- how to display data from 1st point on words on y axis for line chart in d3.js
- D3 bar chart sorting - axis label sorting logic explanation needed
- How can I wrap the long label text in the bubble chart in d3?
More Query from same tag
- Using selectAll() to create new elements while preserving existing elements
- d3.js v3 time scale: How to change default hour in label to specific hour
- Using .filter() in d3.js to return data from corresponding x-axis point on multiple charts
- d3 js not working well
- Why use keys filter instead of columns.slice()?
- Zoomable time series in d3.js
- Can't highlight text in foreign object when d3 drag is attached
- Getting access to individual area elements with d3
- How can I dynamically update text labels in d3?
- D3.js Enter Animation
- How do I bind data based on what D3.JS Element is clicked?
- Zoom touch on mobile with d3
- DC.JS how to animate the order of the rows in a rowchart?
- D3.js: How to add distribution line(s) to histograms in version 4
- selecting points for plotting in d3 js
- d3 - Add single line to grouped bar graph
- D3 and SVG namespaces for custom svg elements or attributes to be valid?
- SVG D3 Filtering
- Creating world choropleth map with D3
- d3.js bar chart with pos & neg bars (win/loss) for each record
- ASP.NET vs creating/opening .HTML file in C#
- Why isn't d3 text appearing on bar chart when using new dataset?
- d3.js link seperation in tree layout
- How to get an non-overlapped circle packing d3 js chart?
- d3js: How to stop all transitions?
- Dynamic Arrowhead Color
- How can I reference this data in this JSON file?
- How do I debug / catch errors for D3
- d3.conventions not a function at script.js
- Using D3, how can I update circles on a map after panning?