React-vis: Allow axes to start from 0

Created on 25 Nov 2017  路  4Comments  路  Source: uber/react-vis

enhancement

Most helpful comment

You can start the chart at zero by adding a Mark series at 0,0 and set its display to none.
<MarkSeries data={[{ x: 0, y: 0 }]} style={{ display: 'none' }} />

All 4 comments

Hey @zavrick
Can you provide some more details about what's going on? Axes should certainly be able to start from zero, and there are a variety of ways to make this happen (such as setting xDomain to include zero) or use tickValues!

https://github.com/uber/react-vis/issues/675

I think this may be what he is referring to. I'm having the same issue @mcnuttandrew

You can make the axes start from 0 by providing your own axis ticks, starting at 0.

Something like this:

let ticks = []; for( let i = 0; i <= 10; ++i ){ ticks.push( parseInt( maxtickValue / 10 ) * i ); } //... <YAxis tickValues={ticks} />

You can start the chart at zero by adding a Mark series at 0,0 and set its display to none.
<MarkSeries data={[{ x: 0, y: 0 }]} style={{ display: 'none' }} />

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cang-afero picture cang-afero  路  4Comments

wroughtec picture wroughtec  路  4Comments

stroemdev picture stroemdev  路  4Comments

ZKruse picture ZKruse  路  4Comments

jckr picture jckr  路  5Comments