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

Data not showing in Scatter plot #5234

Closed
cima007 opened this Issue Apr 20, 2016 · 6 comments

Comments

Projects
None yet
3 participants
@cima007

cima007 commented Apr 20, 2016

Expected behaviour

Show a scatter plot with data

Actual behaviour

The graph is sending a message of no data, but there actually is data

Live demo of the issue

https://jsfiddle.net/cima007/k80Lcf19/4/
if you click the first serie it will show the whole data.

Affected browser(s)

Tried only in chrome

Solution

I found that when the first data point (x) of a serie has a value of NULL, the whole graph doesn't show anything, when i correct this in the php code (replacing null for a 0), it worked like always.

hope it helps someone :)

@jon-a-nygaard

This comment has been minimized.

Show comment
Hide comment
@jon-a-nygaard

jon-a-nygaard Apr 21, 2016

Collaborator

@cima007 Hi, could you provide a JSFiddle of your issue? It will be of great help for debugging.

Collaborator

jon-a-nygaard commented Apr 21, 2016

@cima007 Hi, could you provide a JSFiddle of your issue? It will be of great help for debugging.

@TorsteinHonsi

This comment has been minimized.

Show comment
Hide comment
@TorsteinHonsi

TorsteinHonsi Apr 21, 2016

Collaborator

I tried reproducing based on your description at http://jsfiddle.net/highcharts/yLqs279d/, can you modify this to demonstrate your issue?

Collaborator

TorsteinHonsi commented Apr 21, 2016

I tried reproducing based on your description at http://jsfiddle.net/highcharts/yLqs279d/, can you modify this to demonstrate your issue?

@jon-a-nygaard

This comment has been minimized.

Show comment
Hide comment
@jon-a-nygaard

jon-a-nygaard Apr 21, 2016

Collaborator

@cima007 Nevermind, I understand the issue now, it can be seen in this example: http://jsfiddle.net/jon_a_nygaard/58gxxhsn/
I believe no-data-to-display only checks if the first value in the data array has valid data, and assumes it is empty otherwise.

Collaborator

jon-a-nygaard commented Apr 21, 2016

@cima007 Nevermind, I understand the issue now, it can be seen in this example: http://jsfiddle.net/jon_a_nygaard/58gxxhsn/
I believe no-data-to-display only checks if the first value in the data array has valid data, and assumes it is empty otherwise.

@jon-a-nygaard

This comment has been minimized.

Show comment
Hide comment
@jon-a-nygaard

jon-a-nygaard Apr 21, 2016

Collaborator

@cima007 x values can not have the value null, it is not considered as valid. But x values can be undefined, then it will be automatically incremented. This information was missing from our API and we will update it to avoid uncertainty around how it behaves.

We would also like to ask if you consider this behavior to be correct, or should x=null be handled different in your opinion?

Collaborator

jon-a-nygaard commented Apr 21, 2016

@cima007 x values can not have the value null, it is not considered as valid. But x values can be undefined, then it will be automatically incremented. This information was missing from our API and we will update it to avoid uncertainty around how it behaves.

We would also like to ask if you consider this behavior to be correct, or should x=null be handled different in your opinion?

@jon-a-nygaard jon-a-nygaard added the Docs label Apr 21, 2016

@cima007

This comment has been minimized.

Show comment
Hide comment
@cima007

cima007 Apr 21, 2016

Thanks for the quick reply.
I updated my comment with the live demo.
The x value should not be null, but i have seen a lot of databases that are far from the ideal behavior in a variety of industries.
I had the opportunity to ask experts in data science (C. Hidalgo, R. Baeza ) and they say, that you should always graph your data (whatever you have) as soon as possible. So you can work in the constant improvement of the records, for a better understanding of the reality.

With that in mind, i think that when i have a null point in a scatter plot, the graph should tell me there is something wrong with that point in particular, (a message or highlight). Which lets the user find out where does that mistake comes from, even if x and y are null.

Obviously it's an ideal, i love highcharts and the way it works, but like any program ther is space for improvement :)

cima007 commented Apr 21, 2016

Thanks for the quick reply.
I updated my comment with the live demo.
The x value should not be null, but i have seen a lot of databases that are far from the ideal behavior in a variety of industries.
I had the opportunity to ask experts in data science (C. Hidalgo, R. Baeza ) and they say, that you should always graph your data (whatever you have) as soon as possible. So you can work in the constant improvement of the records, for a better understanding of the reality.

With that in mind, i think that when i have a null point in a scatter plot, the graph should tell me there is something wrong with that point in particular, (a message or highlight). Which lets the user find out where does that mistake comes from, even if x and y are null.

Obviously it's an ideal, i love highcharts and the way it works, but like any program ther is space for improvement :)

@TorsteinHonsi

This comment has been minimized.

Show comment
Hide comment
@TorsteinHonsi

TorsteinHonsi Apr 22, 2016

Collaborator

I second that. The chart shouldn't break even though we have an invalid value.

Collaborator

TorsteinHonsi commented Apr 22, 2016

I second that. The chart shouldn't break even though we have an invalid value.

TorsteinHonsi added a commit that referenced this issue May 4, 2016

Addition to #5234, filter the array only if necessary.
We don't want to run the expensive filter operation unless the array actually contains invalid items.

tregoning pushed a commit to tregoning/highcharts that referenced this issue Jun 30, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment