2016-12-02 2 views
0

x 축에 정확한 날짜를 표시하려하지만 아래 이미지와 같이 항상 범위 형식으로 표시됩니다. 해결책을 제안하십시오.nvd3.js의 x 축에 정확한 날짜를 표시하는 방법은 무엇입니까?

는 I는 $scope.options 파라미터에 대해서 설명했다 : I가 scaleExtent: [1, 10] 변하는 값으로이를 해결 한

$scope.options = { 
chart: { 
type: 'historicalBarChart', 
height: 450, 
margin : { 
top: 20, 
right: 20, 
bottom: 65, 
left: 50 
}, 
x: function(d){return d[0];}, 
y: function(d){return d[1];}, 
showValues: true, 
valueFormat: function(d){ 
return d3.format(',')(d); 
}, 
duration: 1, 
xAxis: { 
axisLabel: 'Date', 
tickFormat: function(d) { 
return d3.time.format('%d-%m-%y')(new Date(d)) 
}, 
}, 
yAxis: { 
axisLabel: 'Body Weight', 
axisLabelDistance: -10, 
tickFormat: function(d){ 
return d3.format(',')(d); 
} 
}, 
tooltip: { 
keyFormatter: function(d) { 
return d3.time.format('%x')(new Date(d)); 
} 
}, 
zoom: { 
enabled: true, 
scaleExtent: [1, 10], 
useFixedDomain: false, 
useNiceScale: false, 
horizontalOff: false, 
verticalOff: true, 
unzoomEventType: 'dblclick.zoom' 
} 
} 
}; 

enter image description here

답변

0

. 이 옵션은 눈금을 표시하는 그래프를 만듭니다. x-axis

관련 문제