Skip to content

request: special representation for null values #2941

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
RichardNeill opened this issue Aug 22, 2018 · 2 comments
Closed

request: special representation for null values #2941

RichardNeill opened this issue Aug 22, 2018 · 2 comments

Comments

@RichardNeill
Copy link

Consider a bar chart, there is currently no way to distinguish between "this bar is zero height", and "there is no bar here". Currently, plotly does the most sensible thing it can: e.g. x=4,y=0 will be plotted (except for a bar chart where the height is invisible), whereas x=4,y=null will be ignored.

I'd like to propose an additional idea for null-handling, as a new option for the layout:
shownullmarker: true
nullmarker { symbol: 'triangle-up' }

If this is set, then

  • regardless of chart type (bar,line,bubble etc), a null value will be plotted as if it had y=0, but with the different markersymbol
  • connectgaps should still ignore nulls (this is one of the problems with casting null to zero!)
  • the tooltip should label it as "[Null]" rather than "0".
  • the symbol should default to a different color (I suggest f8f8f8 with 222222 border).
  • null points are excluded from spikelines.

Thanks very much.

@gvwilson
Copy link
Contributor

Hi - this issue has been sitting for a while, so as part of our effort to tidy up our public repositories I'm going to close it. If it's still a concern, we'd be grateful if you could open a new issue (with a short reproducible example if appropriate) so that we can add it to our stack. Cheers - @gvwilson

@RichardNeill
Copy link
Author

RichardNeill commented Jun 14, 2024

Hello. Yes, this issue is still relevant. Please re-open.

As a workaround, I add a text label "zero" just above the axis for the "zero-height" bars, and then I am happy to leave the "null" bars as not plotted.

i.e.
if (y === 0){
textposition = "outside"; text="zero"; textcolor="#88888"
}

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

No branches or pull requests

2 participants