React-native-svg-charts: Define a value from which the yAxis should start.

Created on 24 Jan 2018  路  3Comments  路  Source: JesperLekland/react-native-svg-charts

What is the problem?

yAxis always starts from 0 and that create a useless area under the chart, if all the values are bigger than 0.

When does it happen?

I have a chart with values 20.000卤200.
The chart is rendered correctly but I would like yAxis to start from 19.000 instead of 0.

What platform?

  • [x] iOS
  • [x] Android

React Native version: 0.49

Code to reproduce

<AreaChart
    style={{ flex: 1 }}
    dataPoints={performance}
    contentInset={{ top: 10, bottom: 10, left: 10, right: 10 }}
    curve={shape.curveNatural}
    svg={{
    fill: 'rgba(134, 65, 244, 0.2)',
    stroke: 'rgb(134, 65, 244)',
    }}
/>

screenshot_1516813945

Thank you in advance :)

All 3 comments

Hi @themathiou! Good timing I must say. v2.2.0 was released today with fixes for your problem! Enjoy :)

Hehe! Awesome! I'll test it and I'll let you know. Thank you

Works as expected.
Also if a value is smaller than gridMin the grid is automatically adjusted.
Great 馃憤

screenshot_1516815999

Was this page helpful?
0 / 5 - 0 ratings