答案 0 :(得分:0)
此处链接了一个相关问题:How to increase tick label width in d3.js axis
最终它引导我到这段代码(我的脚本中已经定义了padding
):
var padding = 25;
var margin = {top: 20, right: 40, bottom: 30, left: 60},
width = 560 - margin.left - margin.right,
height = 300 - margin.top - margin.bottom;
操纵这些值(边距和填充)最终给了我想要的结果:Y轴标签可见: