隐藏y轴dc.js条形图上的所有文本 [英] Hide all text on y axis dc.js bar chart

查看:526
本文介绍了隐藏y轴dc.js条形图上的所有文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建一个基于DC.JS的仪表板,但想了解如何隐藏条形图的y轴上的所有文本,以及对x轴上的文本设置样式。

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.

感谢

推荐答案

您应该将ticks减少为零: yourChart.yAxis 0);

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

这篇关于隐藏y轴dc.js条形图上的所有文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆