2016-12-02 18 views
0

私はx軸上に正確な日付を表示しようとしていますが、常に下の画像のような範囲形式で表示されます。ソリューションを提案してください。nvd3.jsのx軸に正確な日付を表示する方法は?

Iは$scope.optionsにパラメータについて説明している:

$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

IはscaleExtent: [1, 10]の値を変更することによってそれを解決しました。このオプションは、縮尺を示すグラフを作成しますx-axis

関連する問題