【发布时间】:2015-01-18 21:59:29
【问题描述】:
我正在处理项目,我正在使用 NVD3 lineChart,但我无法编辑图表的网格。
这是图表的选项:
chart: {
type: 'lineChart',
height: 430,
margin: {
top: 20,
right: 20,
bottom: 80,
left: 40
},
x: function (d) {
return d.x;
},
y: function (d) {
return d.y;
},
useInteractiveGuideline: true,
xAxis: {
axisLabel: 'Date',
showMaxMin: false,
tickFormat: function (d) {
return d3.time.format('%b %d')(new Date(d));
},
reduceXTicks: false,
ticks: 13
},
yAxis: {
axisLabel: 'People count',
tickFormat: function (d) {
return d3.format('1d')(d);
}
}
},
title: {
enable: true,
text: 'People count Vs Date'
}
例如,如果有 7 个值,我希望有 7 个网格 x 轴。
注意:通过将刻度值编辑为任何数字,网格不会改变。
这是当前图表
https://www.dropbox.com/s/yfin991k0ovycnv/chart.png?dl=0
那么,如何编辑图表网格?
【问题讨论】:
标签: angularjs d3.js nvd3.js linechart