HoverTool formatting of numbers

Hi,

apologies if this question has already been asked and answered.

I am using Bokeh 0.9.0 and I have some numeric data that I want to display in the hover tool but it seems to switch to scientific notation for values over 1000, so 1000 would display as 1.000e+3.

Is there some way to force the HoverTool to display the raw values?

Thanks,

Adrian.

Hi Adrian,

You do have to specifiy your number format I believe.

Try something like:

@{field}{number format}

when specifying your hover.

see an example here: https://github.com/bokeh/bokeh/blob/master/examples/glyphs/sprint.py#L99

I don’t know what the support is like for scientific notificiation.

···

On Tue, Jul 7, 2015 at 2:12 PM, [email protected] wrote:

Hi,

apologies if this question has already been asked and answered.

I am using Bokeh 0.9.0 and I have some numeric data that I want to display in the hover tool but it seems to switch to scientific notation for values over 1000, so 1000 would display as 1.000e+3.

Is there some way to force the HoverTool to display the raw values?

Thanks,

Adrian.

You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.

To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].

To post to this group, send email to [email protected].

To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/777372c6-3c0d-46c1-979a-f6c9df6c7f2f%40continuum.io.

For more options, visit https://groups.google.com/a/continuum.io/d/optout.

I dug around the source a bit and I found:

https://github.com/bokeh/bokeh/blob/master/bokehjs/src/coffee/util/util.coffee#L13

and also that we use numeral.js

hopefully someone will chip in with something more concrete.

···

On Tue, Jul 7, 2015 at 2:49 PM, Sarah Bird [email protected] wrote:

Hi Adrian,

You do have to specifiy your number format I believe.

Try something like:

@{field}{number format}

when specifying your hover.

see an example here: https://github.com/bokeh/bokeh/blob/master/examples/glyphs/sprint.py#L99

I don’t know what the support is like for scientific notificiation.

On Tue, Jul 7, 2015 at 2:12 PM, [email protected] wrote:

Hi,

apologies if this question has already been asked and answered.

I am using Bokeh 0.9.0 and I have some numeric data that I want to display in the hover tool but it seems to switch to scientific notation for values over 1000, so 1000 would display as 1.000e+3.

Is there some way to force the HoverTool to display the raw values?

Thanks,

Adrian.

You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.

To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].

To post to this group, send email to [email protected].

To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/777372c6-3c0d-46c1-979a-f6c9df6c7f2f%40continuum.io.

For more options, visit https://groups.google.com/a/continuum.io/d/optout.

That’s great, thanks for that Sarah!

Regards,

Adrian.