【发布时间】:2015-11-18 05:18:53
【问题描述】:
我想从辅助 y 轴的值中去掉减号。 下面是显示相同的图表。 Nvd3 Multibar-Horizontal Chart
代码:
var app = angular.module('myApp', ['nvd3']);
app.controller('myCtrl', function($scope) {
$scope.options = {
chart: {
type: 'multiBarHorizontalChart',
height: 350,
x: function(d){
console.log(d.value);
return d.label;},
y: function(d){return d.value;},
//yErr: function(d){ return [-Math.abs(d.value * Math.random() * 0.3), Math.abs(d.value * Math.random() * 0.3)] },
showControls: true,
showValues: true,
duration:"500",
stacked: true,
xAxis: {
showMaxMin: false
},
axisLabelDistance:50,
yAxis: {
axisLabel: 'Values',
tickFormat: function(d){
return d3.format(',f')(Math.abs(d));
}
},
valueFormat:d3.format(".0f"),
},
};
我已删除 x 轴值的减号,但机器人能够将其从辅助 y 轴上删除。请帮我解决这个问题。
【问题讨论】:
-
你能提供一把小提琴吗?
标签: javascript angularjs d3.js graph nvd3.js