Skip to content

Cant print 'None' string in x axis in Scatter plot if first value #1413

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

Closed
ssjunior opened this issue Feb 24, 2017 · 4 comments · Fixed by #3070
Closed

Cant print 'None' string in x axis in Scatter plot if first value #1413

ssjunior opened this issue Feb 24, 2017 · 4 comments · Fixed by #3070

Comments

@ssjunior
Copy link

If the first value in x series is a string 'None' the plot is not rendered.

http://codepen.io/ssjunior/pen/qrBMNG

@ssjunior ssjunior changed the title Cant print 'None' sting in x axis in Scatter plot if first value Cant print 'None' string in x axis in Scatter plot if first value Feb 24, 2017
@etpinard
Copy link
Contributor

That's intended behavior I'm afraid. On this line we explicitly skip string data item 'None'. That is, 'None' is essentially equivalent to null for plotly.js.

This is probably an artefact that we could 🔪 in v2. I suspect in the early days of plotly, the python API didn't convert None values to JSON nulls (cc @alexcjohnson).

@ssjunior
Copy link
Author

Understood. Thanks for explaining.

The most strange is if the None is the second value the graph is rendered normally. This only happens if None is the first value. Take a look below.

http://codepen.io/ssjunior/pen/gmbMZY

In my opinion, does not make sense to have None is this condition. If you have a valid non empty string it should be rendered. FYI the Pie Chart render it normally.

if(typeof ai === 'string' && ai !== '' && ai !== 'None') curvecats++;

I think this condition is not being evaluated correctly too. What happens if ai !=== "" after the first value? By the same logic it will be rendered.

Best regards. :)

@ssjunior
Copy link
Author

If the empty string is not the first value the plot is rendered as suspected. The condition as it is now is kind os useless. :)

http://codepen.io/ssjunior/pen/BWyzXj

@alexcjohnson
Copy link
Collaborator

Removing from v2, as I think we can solve this in a sufficiently backward-compatible way in #3070

@alexcjohnson alexcjohnson removed this from the v2.0.0 milestone Oct 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants