Hide all text on y axis dc.js bar chart
Asked Answered
H

2

5

I am creating a DC.JS based dashboard, but would like to figure out how to hide all of the text on the y axis of the bar chart as well as style the text on the x axis.

Thanks

Fig 1

Hairsplitter answered 16/3, 2014 at 20:4 Comment(0)
T
12

You should decrease ticks to zero: yourChart.yAxis().ticks(0);

Note that this does not return a reference to your chart, so you cannot chain this method. You must put it on a separate line. Like this:

var yourChart = dc.barChart('#your-chart').width(1024).height(50);
yourChart.yAxis().ticks(0);
Tanberg answered 6/5, 2014 at 6:39 Comment(0)
F
2

you should decrease ticks for axis yourChart.yAxis().ticks(0);

Frayne answered 17/3, 2014 at 14:13 Comment(4)
Can you explain why this is the solution?Palate
Hi Pronix, I have tried this before, but it resulted in none of the graphs being displayed. I have attempted to resolve the issue using CSS, #dc-bar-chart .axis.y { opacity: 0.0; } But this creates a gap between the axis label and the where the bars start..Hairsplitter
for me it is working correct - disappear all text for y axis. it is standart d3.js options - if not working , require set debugger; to d3.js for understand what missed.Frayne
@TomWhitaker note the answer above, I almost downvoted until I read the part that said 'you cannot chain this method as it doesn't return a reference'. This worked for me after putting it on an entirely new line.Kopple

© 2022 - 2024 — McMap. All rights reserved.