From 07bf4faee321dec6091ed0a5df6a375f447ab54e Mon Sep 17 00:00:00 2001 From: akmhmgc Date: Sat, 13 Aug 2022 10:57:15 +0900 Subject: [PATCH] Add tickValues option --- index.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/index.js b/index.js index 5d57348..b3aba8d 100644 --- a/index.js +++ b/index.js @@ -19,6 +19,8 @@ function line({ isCurve: _isCurve = true, tickSize: _tickSize = 5, tickPadding: _tickPadding = 5, + xTickValues: _xTickValues = null, + yTickValues: _yTickValues = null, } = {}) { const d3n = new D3Node({ selector: _selector, @@ -46,9 +48,11 @@ function line({ .rangeRound([height, 0]); const xAxis = d3.axisBottom(xScale) .tickSize(_tickSize) + .tickValues(_xTickValues) .tickPadding(_tickPadding); const yAxis = d3.axisLeft(yScale) .tickSize(_tickSize) + .tickValues(_yTickValues) .tickPadding(_tickPadding); const lineChart = d3.line()