react-native-chart-kit icon indicating copy to clipboard operation
react-native-chart-kit copied to clipboard

I don't want to display null value in LineChart, how do I achieve it?

Open harshspandya opened this issue 2 years ago • 9 comments

I am using LineChart for graph integration. In requirement, I don't to show dot or line draw for null value.

  1. is it possible?
  2. how to achieve this scenario?

harshspandya avatar May 02 '22 05:05 harshspandya

Similar issue here and I'm wondering if anyone has solved it for this library.

For example say I have a line chart of data spanning 1 week. I generated data Monday, Tuesday and Friday, but not other days.

I would love to keep the other days in the X-axis, so my chart reflects the entire week, but have the line chart skip days that are "null" and not treat those as "0" on the chart. In this case that would mean drawing a line directly from Tuesday to Friday, to skip over the missing data of Wednesday and Thursday.

Example below of how it behaves now with [null, null, 1, 1, null, null, 1]

image

UpQuark avatar Jul 29 '22 17:07 UpQuark

Looking for a solution to this problem as well. I have a chart with 12 months from Jan to Dec on the x axis and with [1 , 2, 3, 4, 5] as a dataset. The line is spread out from Jan to Sept. Thats 9 month spread with only 5 items data. So I am looking to set my data set as [1, 2, 3, 4, 5, null, null, null, null, null, null, null] without having the line show as 0 on the y axis for the null values.

Mister-Zeng avatar Oct 28 '22 01:10 Mister-Zeng

Has this been solved?

YubinKim16 avatar Aug 17 '23 19:08 YubinKim16

any updates?

wangjh7 avatar Sep 19 '23 09:09 wangjh7

the question is relevant!

theyanniss23002 avatar Dec 28 '23 09:12 theyanniss23002

Has anyone come up with a solution? Please let us know

mtshrmn avatar Mar 11 '24 19:03 mtshrmn