From 56b7adf2245b09b8803a8fc7818bbc5555fed153 Mon Sep 17 00:00:00 2001 From: Marcus Zanona Date: Tue, 16 Jun 2020 17:36:59 +0200 Subject: [PATCH] fix(grid): link vertical grid to ticks on the x axis At the moment `` doesn't render anything as it's referring to the points on the Y axis. This change, updates both `Horizontal` and `Vertical` components so the ticks are based on their axis, but at the same time, respect the `numberOfTicks` property by limiting it to `ticks.length` --- src/grid.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/grid.js b/src/grid.js index ee4bf899..eb6a5785 100644 --- a/src/grid.js +++ b/src/grid.js @@ -5,7 +5,7 @@ import { G, Line } from 'react-native-svg' const Horizontal = ({ ticks = [], y, svg }) => { return ( - {ticks.map((tick) => ( + {y.ticks(ticks.length).map((tick) => ( { const Vertical = ({ ticks = [], x, svg }) => { return ( - {ticks.map((tick, index) => ( + {x.ticks(ticks.length).map((tick, index) => (