gpt4 book ai didi

javascript - Angular NVD-3 图 : Axis Labels and Axis Numbers Cut Off and Outside of Viewing Window

转载 作者:行者123 更新时间:2023-12-03 04:04:33 25 4
gpt4 key购买 nike

目前我正在使用 Angular-nvd3 图形来显示数据。但是,堆叠面积图 nvd3 图形类型正在切断数字和轴标签。模板图可查看here 。 y 轴数字和标签是主要关注点。下面是图形选项代码和问题的图像。

有没有办法减小尺寸,防止y轴数字和标签被 chop ?

$scope.optionsStacked = {
chart: {
type: 'stackedAreaChart',
height: 450,
margin : {
top: 20,
right: 20,
bottom: 30,
left: 40
},
x: function(d){return d[0];},
y: function(d){return d[1]/100;},
useVoronoi: false,
clipEdge: true,
duration: 100,
useInteractiveGuideline: true,
xAxis: {
axisLabel: 'Time (Years)',
axisLabelDistance: -8,
showMaxMin: false,
tickFormat: function(d) {
return d3.time.format('%Y')(new Date(d))
},
showMaxMin: true
},
yAxis: {
axisLabel: 'arb units',
axisLabelDistance: -4,
tickFormat: function(d){
return d3.format(',.2f')(d);
}
},
zoom: {
enabled: true,
scaleExtent: [1, 10],
useFixedDomain: false,
useNiceScale: false,
horizontalOff: false,
verticalOff: true,
unzoomEventType: 'dblclick.zoom'
}
}
};

enter image description here

最佳答案

尝试增加margin.left。它将为 y 轴值腾出空间。

关于javascript - Angular NVD-3 图 : Axis Labels and Axis Numbers Cut Off and Outside of Viewing Window,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44618158/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com