Victory: Bugs - Victory Line

Created on 5 Sep 2018  路  2Comments  路  Source: FormidableLabs/victory

Bugs and Questions

Checklist

  • [x] This is not a victory-native specific issue. (Issues that only appear in victory-native should be opened here)

  • [x] I have read through the FAQ and Guides before asking a question

  • [x] I am using the latest version of Victory

  • [x] I've searched open issues to make sure I'm not opening a duplicate issue

Reproducing the issue: -

interpolation="natural"
data={[
{x: "JAN", y: 0},
{x: "FEB", y: 0},
{x: "MAR", y: 0},
{x: "APR", y: 0},
{x: "MAY", y: 0},
{x: "JUN", y: 0},
{x: "JUL", y: 0},
{x: "AUG", y: 0},
{x: "SEP", y: 100},
{x: "OCT", y: 0},
{x: "NOV", y: 0},
{x: "DEC", y: 0}
]}
/>

screenshot from 2018-09-05 17-50-59

The line is going below axis however expected behaviour is correct when interpolation is set to "linear"

screenshot from 2018-09-05 17-51-27

Most helpful comment

@Harsh1796

Victory calculates a default domain based on data, and does not take the position of the interpolated path into account.

The issue you're seeing can be addressed in a few ways:

1) choose a different interpolation method that creates a path that is more faithful to your data. I suggest monotoneX It looks like this:

screen shot 2018-09-11 at 12 12 00 pm

instead of (natural):

screen shot 2018-09-11 at 12 13 29 pm

2) use groupComponent={<g/>} on VictoryLine so that the path is not clipped. (This method will not work if you have an animating line with changing numbers of data points)

3) set a minDomain that will accommodate the discrepancy between the points and the path.

All 2 comments

@Harsh1796

Victory calculates a default domain based on data, and does not take the position of the interpolated path into account.

The issue you're seeing can be addressed in a few ways:

1) choose a different interpolation method that creates a path that is more faithful to your data. I suggest monotoneX It looks like this:

screen shot 2018-09-11 at 12 12 00 pm

instead of (natural):

screen shot 2018-09-11 at 12 13 29 pm

2) use groupComponent={<g/>} on VictoryLine so that the path is not clipped. (This method will not work if you have an animating line with changing numbers of data points)

3) set a minDomain that will accommodate the discrepancy between the points and the path.

Changing "natural" to "monotoneX" works well!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

iffy picture iffy  路  5Comments

danielberndt picture danielberndt  路  4Comments

tylermassey picture tylermassey  路  5Comments

timhwang21 picture timhwang21  路  4Comments

esutton picture esutton  路  6Comments