Datetime Formatting in HoverTool

I’ve got a timeseries for which I’d like to use the HoverTool to display information about.

I’ve used the trick whereby I plot a scatter plot with alpha=0 on top of my timeseries which works great. The problem is that rather than showing a formatted date the hover tool displays numbers like 1.459e12 which is pretty uninformative.

Is there any way to specify the formatting of the values in the hover tool.?

Also, I’m plotting two series like below and have two “invisible” scatter plots for the hover tool.

The hover tool only seems to be picking up one set of values. Is there any way to make it show both values?

i.e. have the tool display

series1: 59.4

series2: 82.9

date: 01-Jan-2015


plt.line(

series1.index, series1.values,

color='blue',

legend='series1',

tools=tools,

)

plt.line(

series2.index, series2.values,

color='red',

legend='series2',

tools=tools,

)

plt.scatter(series1.index, series1.values, size=4, color='black', alpha=0)

plt.scatter(series2.index, series2.values, size=4, color='black', alpha=0)

formats = {

'months': ["%b-%y"],

'days': ["%d-%b"],

}

plt.xaxis()[0].formatter = DatetimeTickFormatter(formats=formats)

hover = plt.curplot().select(dict(type=HoverTool))

hover.tooltips = OrderedDict([("value", "$y"),("date", "$x")])

Thanks,

Dave

Hi, this is a needed improvement to the hover tool, an issue was just opened a few days ago:

  hover.tooltip convenience function for 'datetime' info · Issue #1239 · bokeh/bokeh · GitHub

Also, I am in the process of improving selections/inspections in a new PR

  selection manager and tools/events refactor by bryevdv · Pull Request #1244 · bokeh/bokeh · GitHub

Some of this will address and clarify the use of hover like tools with multiple and different glyphs. I would expect to see both these in the 0.7 release.

Bryan

···

On Sep 24, 2014, at 12:32 PM, [email protected] wrote:

I've got a timeseries for which I'd like to use the HoverTool to display information about.

I've used the trick whereby I plot a scatter plot with `alpha=0` on top of my timeseries which works great. The problem is that rather than showing a formatted date the hover tool displays numbers like 1.459e12 which is pretty uninformative.

Is there any way to specify the formatting of the values in the hover tool.?

Also, I'm plotting two series like below and have two "invisible" scatter plots for the hover tool.
The hover tool only seems to be picking up one set of values. Is there any way to make it show both values?

i.e. have the tool display

series1: 59.4
series2: 82.9
   date: 01-Jan-2015

    plt.line(
        series1.index, series1.values,
        color='blue',
        legend='series1',
        tools=tools,
    )
    plt.line(
        series2.index, series2.values,
        color='red',
        legend='series2',
        tools=tools,
    )
    plt.scatter(series1.index, series1.values, size=4, color='black', alpha=0)
    plt.scatter(series2.index, series2.values, size=4, color='black', alpha=0)
    formats = {
        'months': ["%b-%y"],
        'days': ["%d-%b"],
    }
    plt.xaxis()[0].formatter = DatetimeTickFormatter(formats=formats)
    hover = plt.curplot().select(dict(type=HoverTool))
    hover.tooltips = OrderedDict([("value", "$y"),("date", "$x")])

Thanks,
Dave

--
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/ca73ba88-097b-498e-9f44-cb0d847ceff7%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

I have a related question. Has anyone tried to use hover tool with date columns in the data source. I’m trying to figure out the best way to format the date?

That is the feature request issue I linked:

  hover.tooltip convenience function for 'datetime' info · Issue #1239 · bokeh/bokeh · GitHub

unless I am misunderstanding.

Bryan

···

On Sep 24, 2014, at 12:46 PM, Tom Denniston <[email protected]> wrote:

I have a related question. Has anyone tried to use hover tool with date columns in the data source. I'm trying to figure out the best way to format the date?

--
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/CADep5SLonUe9q%2B_3rTXQSVaOkDUAR1J%3D45u%3DZBPHa90r3GUFbw%40mail.gmail.com\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

Although it is not a grey solution, a current workaround until that feature is implemented, is to add a new column to the data source with the dates pre formatted and display that in the hover tool.

Bryan

···

On Sep 24, 2014, at 12:46 PM, Tom Denniston <[email protected]> wrote:

I have a related question. Has anyone tried to use hover tool with date columns in the data source. I'm trying to figure out the best way to format the date?

--
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/CADep5SLonUe9q%2B_3rTXQSVaOkDUAR1J%3D45u%3DZBPHa90r3GUFbw%40mail.gmail.com\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

Sorry. I missed that part. Comment withdrawn.

···

On Wednesday, September 24, 2014, Bryan Van de Ven [email protected] wrote:

That is the feature request issue I linked:

    [https://github.com/ContinuumIO/bokeh/issues/1239](https://github.com/ContinuumIO/bokeh/issues/1239)

unless I am misunderstanding.

Bryan

On Sep 24, 2014, at 12:46 PM, Tom Denniston [email protected] wrote:

I have a related question. Has anyone tried to use hover tool with date columns in the data source. I’m trying to figure out the best way to format the date?

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/CADep5SLonUe9q%2B_3rTXQSVaOkDUAR1J%3D45u%3DZBPHa90r3GUFbw%40mail.gmail.com.

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

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/B619D215-803A-4E35-9C1B-75CD47D013BF%40continuum.io.

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

No worries, this was a fairly big oversight on the hover tool, hope to have it fixed soon!

···

On Sep 24, 2014, at 1:26 PM, Tom Denniston <[email protected]> wrote:

Sorry. I missed that part. Comment withdrawn.

On Wednesday, September 24, 2014, Bryan Van de Ven <[email protected]> wrote:
That is the feature request issue I linked:

        hover.tooltip convenience function for 'datetime' info · Issue #1239 · bokeh/bokeh · GitHub

unless I am misunderstanding.

Bryan

On Sep 24, 2014, at 12:46 PM, Tom Denniston <[email protected]> wrote:

> I have a related question. Has anyone tried to use hover tool with date columns in the data source. I'm trying to figure out the best way to format the date?
>
> --
> 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/CADep5SLonUe9q%2B_3rTXQSVaOkDUAR1J%3D45u%3DZBPHa90r3GUFbw%40mail.gmail.com\.
> For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

--
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/B619D215-803A-4E35-9C1B-75CD47D013BF%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

--
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/CADep5SLuv8zxnRKbgqF_ZT-tJCm_BKZTMOHmFnmtzYxk4cLFVw%40mail.gmail.com\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

Preliminary support for dates are is on master and out latest devel builds.
You can see the sprint example to know how to use it: https://github.com/bokeh/bokeh/blob/master/examples/glyphs/sprint.py

Cheers.

Damian

···

On Wednesday, September 24, 2014 2:31:50 PM UTC-3, Bryan Van de ven wrote:

No worries, this was a fairly big oversight on the hover tool, hope to have it fixed soon!

On Sep 24, 2014, at 1:26 PM, Tom Denniston [email protected] wrote:

Sorry. I missed that part. Comment withdrawn.

On Wednesday, September 24, 2014, Bryan Van de Ven [email protected] wrote:

That is the feature request issue I linked:

    [https://github.com/ContinuumIO/bokeh/issues/1239](https://github.com/ContinuumIO/bokeh/issues/1239)

unless I am misunderstanding.

Bryan

On Sep 24, 2014, at 12:46 PM, Tom Denniston [email protected] wrote:

I have a related question. Has anyone tried to use hover tool with date columns in the data source. I’m trying to figure out the best way to format the date?

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/CADep5SLonUe9q%2B_3rTXQSVaOkDUAR1J%3D45u%3DZBPHa90r3GUFbw%40mail.gmail.com.

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

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/B619D215-803A-4E35-9C1B-75CD47D013BF%40continuum.io.

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


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/CADep5SLuv8zxnRKbgqF_ZT-tJCm_BKZTMOHmFnmtzYxk4cLFVw%40mail.gmail.com.

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

Hi

Any update on this? I am desperately trying to format a timestamp nicely in the hover - it currently looks like a unix timestamp.

Cathy

···

On Tuesday, 16 December 2014 19:34:44 UTC, Damian Avila wrote:

Preliminary support for dates are is on master and out latest devel builds.
You can see the sprint example to know how to use it: https://github.com/bokeh/bokeh/blob/master/examples/glyphs/sprint.py

Cheers.

Damian

On Wednesday, September 24, 2014 2:31:50 PM UTC-3, Bryan Van de ven wrote:

No worries, this was a fairly big oversight on the hover tool, hope to have it fixed soon!

On Sep 24, 2014, at 1:26 PM, Tom Denniston [email protected] wrote:

Sorry. I missed that part. Comment withdrawn.

On Wednesday, September 24, 2014, Bryan Van de Ven [email protected] wrote:

That is the feature request issue I linked:

    [https://github.com/ContinuumIO/bokeh/issues/1239](https://github.com/ContinuumIO/bokeh/issues/1239)

unless I am misunderstanding.

Bryan

On Sep 24, 2014, at 12:46 PM, Tom Denniston [email protected] wrote:

I have a related question. Has anyone tried to use hover tool with date columns in the data source. I’m trying to figure out the best way to format the date?

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/CADep5SLonUe9q%2B_3rTXQSVaOkDUAR1J%3D45u%3DZBPHa90r3GUFbw%40mail.gmail.com.

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

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/B619D215-803A-4E35-9C1B-75CD47D013BF%40continuum.io.

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


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/CADep5SLuv8zxnRKbgqF_ZT-tJCm_BKZTMOHmFnmtzYxk4cLFVw%40mail.gmail.com.

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

I’m not sure, b ut the
work around is just to make another column in your data source with your date
formatted as you want it
to display and then reference that in your tooltips.

···

On 2/16/16 3:19 AM, Catmo wrote:

Hi

      Any update on this? I am desperately trying to format a

timestamp nicely in the hover - it currently looks like a unix
timestamp.

      Cathy


        On Tuesday, 16 December 2014 19:34:44 UTC, Damian Avila

wrote:

            Preliminary support for dates are is on

master and out latest devel builds.
You can see the sprint example to know how to use
it: https://github.com/bokeh/bokeh/blob/master/examples/glyphs/sprint.py

Cheers.

Damian

              On Wednesday, September 24, 2014 2:31:50 PM UTC-3,

Bryan Van de ven wrote:

                No worries, this was a

fairly big oversight on the hover tool, hope to have
it fixed soon!

                On Sep 24, 2014, at 1:26 PM, Tom Denniston <.

  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/32d0eb0a-f79f-4d3b-bcc6-3d8e2d864ec2%40continuum.io?utm_medium=email&utm_source=footer)      .

For more options, visit .


Sarah Bird
Developer, Bokeh

    [
      ![Continuum Analytics](http://docs.continuum.io/_static/img/ContinuumWordmark.png)
    ](http://continuum.io)

tom.de@alum.dartmouth org>
wrote:

                > Sorry.  I missed that part.  Comment withdrawn.

                >

                > On Wednesday, September 24, 2014, Bryan Van de

Ven <[email protected] >
wrote:

                > That is the feature request issue I linked:

                >

                >         [https://github.com/ContinuumIO/bokeh/issues/1239](https://github.com/ContinuumIO/bokeh/issues/1239)

                >

                > unless I am misunderstanding.

                >

                > Bryan

                >

                >

                > On Sep 24, 2014, at 12:46 PM, Tom Denniston

<[email protected] >
wrote:

                >

                > > I have a related question.  Has anyone

tried to use hover tool with date columns in the
data source. I’m trying to figure out the best way
to format the date?

                > >

                > > --

                > > 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
                .

To view this discussion on the web visit [email protected]
https://groups.google.com/a/continuum.io/d/msgid/bokeh/CADep5SLonUe9q%2B_3rTXQSVaOkDUAR1J%3D45u%3DZBPHa90r3GUFbw%40mail.gmail. com.

                > > For more options, visit [](https://groups.google.com/a/continuum.io/d/optout)[https://groups.google.com/a/](https://groups.google.com/a/)                    continuum.io/d/optout.

                >

                > --

                > 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
                .

To view this discussion on the web visit [email protected]
https://groups.google.com/a/continuum.io/d/msgid/bokeh/B619D215-803A-4E35-9C1B- 75CD47D013BF%40continuum.io.

                > For more options, visit [](https://groups.google.com/a/continuum.io/d/optout)[https://groups.google.com/a/](https://groups.google.com/a/)                    continuum.io/d/optout.

                >

                > --

                > 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
                .

To view this discussion on the web visit [email protected]
https://groups.google.com/a/continuum.io/d/msgid/bokeh/CADep5SLuv8zxnRKbgqF_ZT-tJCm_BKZTMOHmFnmtzYxk4cLFVw%40mail. gmail.com.

                > For more options, visit [](https://groups.google.com/a/continuum.io/d/optout)[https://groups.google.com/a/](https://groups.google.com/a/)                    continuum.io/d/optout.

              [https://groups.google.com/a/continuum.io/d/msgid/bokeh/32d0eb0a-f79f-4d3b-bcc6-3d8e2d864ec2%40continuum.io](https://groups.google.com/a/continuum.io/d/msgid/bokeh/32d0eb0a-f79f-4d3b-bcc6-3d8e2d864ec2%40continuum.io)

https://groups.google.com/a/continuum.io/d/optout

So this feature (to format unix timestamp as datetime in the hovertool) is requested since 2+ years, and not yet implemented in the latest bokeh release?

The workaround with adding a separate column to the ColumnDataSource where this info is stored as formatted text string is not appealing to me.

So, why not using the custom tooltip option? For example, this works for my purpose:

hover = HoverTool(
tooltips=“”"


time_start:


time_end:




“”"
)

``

Still, I would prefer to have a formatting option in the native tooltip feature.

Artur

···

On Tuesday, February 16, 2016 at 12:19:17 PM UTC+1, Catmo wrote:

Hi

Any update on this? I am desperately trying to format a timestamp nicely in the hover - it currently looks like a unix timestamp.

Cathy

On Tuesday, 16 December 2014 19:34:44 UTC, Damian Avila wrote:

Preliminary support for dates are is on master and out latest devel builds.
You can see the sprint example to know how to use it: https://github.com/bokeh/bokeh/blob/master/examples/glyphs/sprint.py

Cheers.

Damian

On Wednesday, September 24, 2014 2:31:50 PM UTC-3, Bryan Van de ven wrote:

No worries, this was a fairly big oversight on the hover tool, hope to have it fixed soon!

On Sep 24, 2014, at 1:26 PM, Tom Denniston [email protected] wrote:

Sorry. I missed that part. Comment withdrawn.

On Wednesday, September 24, 2014, Bryan Van de Ven [email protected] wrote:

That is the feature request issue I linked:

    [https://github.com/ContinuumIO/bokeh/issues/1239](https://github.com/ContinuumIO/bokeh/issues/1239)

unless I am misunderstanding.

Bryan

On Sep 24, 2014, at 12:46 PM, Tom Denniston [email protected] wrote:

I have a related question. Has anyone tried to use hover tool with date columns in the data source. I’m trying to figure out the best way to format the date?

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/CADep5SLonUe9q%2B_3rTXQSVaOkDUAR1J%3D45u%3DZBPHa90r3GUFbw%40mail.gmail.com.

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

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/B619D215-803A-4E35-9C1B-75CD47D013BF%40continuum.io.

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


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/CADep5SLuv8zxnRKbgqF_ZT-tJCm_BKZTMOHmFnmtzYxk4cLFVw%40mail.gmail.com.

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

Do we have a solution for this yet? My date looks like a unix timestamp. What should I do? The link above to the example is broken.
I even tried: hover.formatters = { “start”: “datetime”} but no luck :frowning:

···

On Wednesday, February 8, 2017 at 7:01:06 AM UTC-8, Artur Scholz wrote:

So this feature (to format unix timestamp as datetime in the hovertool) is requested since 2+ years, and not yet implemented in the latest bokeh release?

The workaround with adding a separate column to the ColumnDataSource where this info is stored as formatted text string is not appealing to me.

So, why not using the custom tooltip option? For example, this works for my purpose:

hover = HoverTool(
tooltips=“”"


time_start:


time_end:




“”"
)

``

Still, I would prefer to have a formatting option in the native tooltip feature.

Artur

On Tuesday, February 16, 2016 at 12:19:17 PM UTC+1, Catmo wrote:

Hi

Any update on this? I am desperately trying to format a timestamp nicely in the hover - it currently looks like a unix timestamp.

Cathy

On Tuesday, 16 December 2014 19:34:44 UTC, Damian Avila wrote:

Preliminary support for dates are is on master and out latest devel builds.
You can see the sprint example to know how to use it: https://github.com/bokeh/bokeh/blob/master/examples/glyphs/sprint.py

Cheers.

Damian

On Wednesday, September 24, 2014 2:31:50 PM UTC-3, Bryan Van de ven wrote:

No worries, this was a fairly big oversight on the hover tool, hope to have it fixed soon!

On Sep 24, 2014, at 1:26 PM, Tom Denniston [email protected] wrote:

Sorry. I missed that part. Comment withdrawn.

On Wednesday, September 24, 2014, Bryan Van de Ven [email protected] wrote:

That is the feature request issue I linked:

    [https://github.com/ContinuumIO/bokeh/issues/1239](https://github.com/ContinuumIO/bokeh/issues/1239)

unless I am misunderstanding.

Bryan

On Sep 24, 2014, at 12:46 PM, Tom Denniston [email protected] wrote:

I have a related question. Has anyone tried to use hover tool with date columns in the data source. I’m trying to figure out the best way to format the date?

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/CADep5SLonUe9q%2B_3rTXQSVaOkDUAR1J%3D45u%3DZBPHa90r3GUFbw%40mail.gmail.com.

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

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/B619D215-803A-4E35-9C1B-75CD47D013BF%40continuum.io.

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


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/CADep5SLuv8zxnRKbgqF_ZT-tJCm_BKZTMOHmFnmtzYxk4cLFVw%40mail.gmail.com.

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

Hi,

This was implemented a long time ago:

  https://bokeh.pydata.org/en/latest/docs/user_guide/tools.html#formatting-tooltip-fields

If setting .formatters is not working for you then more code would be needed to see what the usage error might be.

Bryan

···

On Mar 15, 2018, at 13:37, jenny <[email protected]> wrote:

Do we have a solution for this yet? My date looks like a unix timestamp. What should I do? The link above to the example is broken.
I even tried: hover.formatters = { "start": "datetime"} but no luck :frowning:

On Wednesday, February 8, 2017 at 7:01:06 AM UTC-8, Artur Scholz wrote:
So this feature (to format unix timestamp as datetime in the hovertool) is requested since 2+ years, and not yet implemented in the latest bokeh release?

The workaround with adding a separate column to the ColumnDataSource where this info is stored as formatted text string is not appealing to me.

So, why not using the custom tooltip option? For example, this works for my purpose:

hover = HoverTool(
            tooltips="""
            <div>
                <p>time_start: <span id="_time_start"></span><p>
                <p>time_end: <span id="_time_end"></span><p>
            </div>
            <script>
            function fun(unix_timestamp) {
                var d1 = new Date(unix_timestamp);
                return d1.toISOString()
            }
            document.getElementById("_time_start").innerHTML = fun(@time_start);
            document.getElementById("_time_end").innerHTML = fun(@time_end);
            </script>
            """
        )

Still, I would prefer to have a formatting option in the native tooltip feature.

Artur

On Tuesday, February 16, 2016 at 12:19:17 PM UTC+1, Catmo wrote:
Hi

Any update on this? I am desperately trying to format a timestamp nicely in the hover - it currently looks like a unix timestamp.

Cathy

On Tuesday, 16 December 2014 19:34:44 UTC, Damian Avila wrote:
Preliminary support for dates are is on master and out latest devel builds.
You can see the sprint example to know how to use it: https://github.com/bokeh/bokeh/blob/master/examples/glyphs/sprint.py

Cheers.

Damian

On Wednesday, September 24, 2014 2:31:50 PM UTC-3, Bryan Van de ven wrote:
No worries, this was a fairly big oversight on the hover tool, hope to have it fixed soon!

On Sep 24, 2014, at 1:26 PM, Tom Denniston <[email protected]> wrote:

> Sorry. I missed that part. Comment withdrawn.
>
> On Wednesday, September 24, 2014, Bryan Van de Ven <[email protected]> wrote:
> That is the feature request issue I linked:
>
> hover.tooltip convenience function for 'datetime' info · Issue #1239 · bokeh/bokeh · GitHub
>
> unless I am misunderstanding.
>
> Bryan
>
>
> On Sep 24, 2014, at 12:46 PM, Tom Denniston <[email protected]> wrote:
>
> > I have a related question. Has anyone tried to use hover tool with date columns in the data source. I'm trying to figure out the best way to format the date?
> >
> > --
> > 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 bokeh+un...@continuum.io.
> > To post to this group, send email to bo...@continuum.io.
> > To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/CADep5SLonUe9q%2B_3rTXQSVaOkDUAR1J%3D45u%3DZBPHa90r3GUFbw%40mail.gmail.com\.
> > For more options, visit https://groups.google.com/a/continuum.io/d/optout\.
>
> --
> 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 bokeh+un...@continuum.io.
> To post to this group, send email to bo...@continuum.io.
> To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/B619D215-803A-4E35-9C1B-75CD47D013BF%40continuum.io\.
> For more options, visit https://groups.google.com/a/continuum.io/d/optout\.
>
> --
> 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 bokeh+un...@continuum.io.
> To post to this group, send email to bo...@continuum.io.
> To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/CADep5SLuv8zxnRKbgqF_ZT-tJCm_BKZTMOHmFnmtzYxk4cLFVw%40mail.gmail.com\.
> For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

--
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/9612a887-637b-450d-88a5-6da70df8688d%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.