Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VictoryArea/VictoryLine should support graphing with gaps in the y data #1159

Open
4 tasks done
scottdickerson opened this issue Oct 24, 2018 · 13 comments
Open
4 tasks done
Labels
Issue: Accepted The submitted issue has been confirmed by the Victory core team Type: Enhancement ✏️ An enhancement or feature proposal that will be addressed after the next release

Comments

@scottdickerson
Copy link
Contributor

scottdickerson commented Oct 24, 2018

Bugs and Questions

Checklist

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

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

  • I am using the latest version of Victory

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

The Problem

I'm trying to support time ranges of data, and sometimes this data has sparse values but I want the chart to make the data actually render across the whole time range. When I pass data with null values for days in-between value days, the graph will not render for either VictoryArea or VictoryLine graphs with a custom theme

Here's an example of the type of data I want to render:
const data = [

{ x: '10/21/2018', y0: 59, y: 60 },
{ x: '10/22/2018', y0: null, y: null },
{ x: '10/23/2018', y0: 2, y: 3 },
{ x: '10/24/2018', y0: null, y: null },
];

Reproduction

Graph with interim null values
https://codesandbox.io/s/xo818yl3yz

If you remove the custom stroke color in the theme it works..
https://codesandbox.io/s/qly4kxv726

@scottdickerson
Copy link
Contributor Author

FYI, Passing a 0 for the interim value is an obvious workaround, but doesn't have the same meaning. I'm graphing sensor data and really need to let the user know that the sensors didn't collect any data on October 22nd. Furthermore, when I actually inspect the graph that has rendered in Chrome, it appears that it's actually rendered something in the graph svg for this data, it's just not visible for some reason.

@boygirl
Copy link
Contributor

boygirl commented Oct 25, 2018

@scottdickerson This looks like a regression. I will take a look

@scottdickerson
Copy link
Contributor Author

any pointers into where this problem might be @boygirl? I can work on a PR

@scottdickerson
Copy link
Contributor Author

I can't seem to reproduce this anymore actually...

@scottdickerson
Copy link
Contributor Author

scottdickerson commented Jan 16, 2019

I found out the secret to reproduce, see above, I updated the repro links to sandbox

@boygirl
Copy link
Contributor

boygirl commented Jan 16, 2019

Weeeeeird! This will definitely help fix the issue. Thanks for doing the leg work

@doheto
Copy link

doheto commented Sep 2, 2020

Hello !

is this solved ? why is it not possible to skip null values or ignore them ?

@becca-bailey
Copy link
Contributor

There might still be a bug here, but I do want to flag a related issue I worked on a while back. By default, Victory will scale the axis linearly, so any missing dates or x-values will still appear in the axis. If you want to skip specific dates that don't have y-values, I would suggest using the scale prop to create a discontinuous scale, as documented here. https://formidable.com/open-source/victory/docs/common-props#scale

@jljorgenson18
Copy link

jljorgenson18 commented Nov 30, 2021

I'm still seeing this problem as well. It's definitely sub-optimal for many types of data, especially if you are plotting multiple lines from a single dataset on a line chart. If both gaps and continuous lines are both desired, perhaps a new prop could be added to handle this.

Edit: Recharts has a prop called "connectNulls" that does this (https://recharts.org/en-US/api/Line#connectNulls). It would be great if there was something similar in Victory

@becca-bailey becca-bailey added the Type: Enhancement ✏️ An enhancement or feature proposal that will be addressed after the next release label Feb 14, 2022
@becca-bailey
Copy link
Contributor

I'll mark this as a feature request, and we can look into mimicking this behavior from recharts.

@codinsonn
Copy link

Sorry to be that guy, but any update on this yet?

@mcdunn51
Copy link

mcdunn51 commented Feb 19, 2024

I'm wondering if this new feature ever got added? I have a chart made with Charts.js (in a web application), that I am trying to replicate using react native. I've almost done it, but i can't see a way to connect missing data points, as there is in Charts.js (see pic). Failing this, if anyone has any ideas regarding how i can accomplish this I would be very grateful.

Chart.js:
Screenshot 2024-02-19 at 16 57 42

Victory-Native:
Screenshot 2024-02-19 at 17 00 47

@carbonrobot
Copy link
Contributor

The community has not implemented this feature yet.

@mcdunn51 Which version of Victory-Native are you using currently?

@carbonrobot carbonrobot added the Issue: Accepted The submitted issue has been confirmed by the Victory core team label Feb 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue: Accepted The submitted issue has been confirmed by the Victory core team Type: Enhancement ✏️ An enhancement or feature proposal that will be addressed after the next release
Projects
None yet
Development

No branches or pull requests

8 participants