react-native-pathjs-charts
react-native-pathjs-charts copied to clipboard
showing error when i give all values as 0
This package is working well when atleast one positive value but when i pass all values as 0 then it showing below error.
Tried 0 values with Scatterplot, Smoothline, and Stockline and while they produce undesirable graphs (basically showing a small portion of x and y gridlines if you have that option enabled showing a tiny inverted t-like shape) they do not produce the same error as above. Radar is similar to Scatterplot/Smoothline/Stockline in not producing anything useful (but then I'm not sure it should produce something other than what it does). Pie produces a whole pie as expected. Bar produces just a label. Tree is not applicable as I'm not sure how one represents "all values as 0" since it expects strings. I've tried all of the chart types and couldn't produce an error. Do you have some example code/configuration that reproduces the behavior?
hi @marzolfb, Thank you for the reply. Actually I am using Bar charts in that we are passing updated values from a API. For below data it is showing an error. data = [ [{ "v": 0, "name": "monday" }, { "v": 0, "name": "tuesday" }], [{ "v": 0, "name": "wednessday" }, { "v": 0, "name": "thursday" }], [{ "v": 0, "name": "friday" }, { "v": 0, "name": "saturday" }] ]
0 value graph showing the same error for me as well. this is a base case isnt it?
@marzolfb take the bar graph example here and replace all the values in the data array to 0.
Looks like it might be the paths.js lib.
I'm running into this issue too
I resolved this by setting the graphOptions.axisY.max value, only issue is this won't work if you don't know what the maximum is..
I'm running into this issue too
Do you have any idea to reslove this problem?
thanks @JoeScho ,for each all value first,if all value is zero ,then make max equles 1.else make max equles null.perfect!
For some reason that still actually displayed a warning for me.. To resolve that I passed some demo data if there was nothing stored.