Y轴标签未显示大数字-多条形图 [英] Y axis label not displaying large numbers - Multi-Bar Chart

查看:82
本文介绍了Y轴标签未显示大数字-多条形图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在多条形图"中,我需要在Y轴标签上显示较大的数字.目前,它显示的字符数不超过七个:

In my Multi-Bar Chart, I need to show larger numbers on the Y axis labels. Currently it's not showing more than seven characters:

我该怎么做?

推荐答案

设置chart.margin().left = 120这将为您提供足够的空间来显示10,000,000.

Set chart.margin().left = 120 This will give you plenty of space to display 10,000,000.

nv.addGraph(function() {
  var chart = nv.models.discreteBarChart()
      .x(function(d) { return d.label })
      .y(function(d) { return d.value })
      .staggerLabels(true)
      .tooltips(false)
      .showValues(true)

  chart.forceY([10000000]);
  chart.margin().left = 120
  d3.select('#chart svg')
      .datum(data)
    .transition().duration(500)
      .call(chart);


  nv.utils.windowResize(chart.update);

  return chart;
});

JSFiddle: http://jsfiddle.net/marrok/Ev3UN/1/

JSFiddle: http://jsfiddle.net/marrok/Ev3UN/1/

这篇关于Y轴标签未显示大数字-多条形图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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