浏览代码

Don't use hard-coded number of ticks

sbkwgh 8 年之前
父节点
当前提交
4358173c05
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/components/widgets/LineChart.vue

+ 1 - 1
src/components/widgets/LineChart.vue

@@ -111,7 +111,7 @@
 				this.setYFunc()
 			
 				d3.select(this.$refs.y_axis).call(d3.axisLeft(this.y.nice()))
-				d3.select(this.$refs.x_axis).call(d3.axisBottom(this.x).tickSize(0).ticks(7))
+				d3.select(this.$refs.x_axis).call(d3.axisBottom(this.x).tickSize(0).ticks(this.data.length))
 			},
 			showTooltip (e, i) {
 				this.tooltipShow = true