Using datetime in a (stacked) bar chart

Hello,

I am creating a stacked bar chart with the charts API. As far as I know it’s not possible to use the datetime format with charts. Is there any other possiblity to work with datetime in the bar chart (especially on the y-axis)?

Best,
Charlotte

Nevermind, I found yscale = ‘datetime’. I find it confusing that it is named differently to the figure interface (where it is y_axis_type).

Also there is no explanation in the reference guide.

···

2017-05-04 15:29 GMT+02:00 C [email protected]:

Hello,

I am creating a stacked bar chart with the charts API. As far as I know it’s not possible to use the datetime format with charts. Is there any other possiblity to work with datetime in the bar chart (especially on the y-axis)?

Best,
Charlotte

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

To unsubscribe from this topic, visit https://groups.google.com/a/continuum.io/d/topic/bokeh/cwNCDzumdxw/unsubscribe.

To unsubscribe from this group and all its topics, 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/e6e21a3b-7be6-4a3f-a3e8-e3b1e9de7a6c%40continuum.io.

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

However my hovertool is still displaying the @height values in [ms] (which is the format in my dataframe). Is there any way to change this?

···

2017-05-04 15:41 GMT+02:00 Charlotte Meier [email protected]:

Nevermind, I found yscale = ‘datetime’. I find it confusing that it is named differently to the figure interface (where it is y_axis_type).

Also there is no explanation in the reference guide.

2017-05-04 15:29 GMT+02:00 C [email protected]:

Hello,

I am creating a stacked bar chart with the charts API. As far as I know it’s not possible to use the datetime format with charts. Is there any other possiblity to work with datetime in the bar chart (especially on the y-axis)?

Best,
Charlotte

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

To unsubscribe from this topic, visit https://groups.google.com/a/continuum.io/d/topic/bokeh/cwNCDzumdxw/unsubscribe.

To unsubscribe from this group and all its topics, 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/e6e21a3b-7be6-4a3f-a3e8-e3b1e9de7a6c%40continuum.io.

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

Hi Charlotte,

What are you trying to do ?
For me, the best thing with Chart (or any graphic lib) it to prepare the max in the dataframe and display the results.

You can use Datetime with TimeSeries, for Bars maybe just convert to string your datetime data ?

alEx

···

2017-05-04 15:41 GMT+02:00 Charlotte Meier [email protected]:

Nevermind, I found yscale = ‘datetime’. I find it confusing that it is named differently to the figure interface (where it is y_axis_type).

Also there is no explanation in the reference guide.

2017-05-04 15:29 GMT+02:00 C [email protected]:

Hello,

I am creating a stacked bar chart with the charts API. As far as I know it’s not possible to use the datetime format with charts. Is there any other possiblity to work with datetime in the bar chart (especially on the y-axis)?

Best,
Charlotte

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

To unsubscribe from this topic, visit https://groups.google.com/a/continuum.io/d/topic/bokeh/cwNCDzumdxw/unsubscribe.

To unsubscribe from this group and all its topics, 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/e6e21a3b-7be6-4a3f-a3e8-e3b1e9de7a6c%40continuum.io.

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

Hello Alex,

I get my data in ms as int values. So my dataframe kind of looks like this:

Phase | Unit | Time
0 1 606850
1 1 113974
0 2 755950
1 2 126667

Then I created a stacked bar chart like this:

bar = Bar(source,
          values='Time',
          label = 'Unit',
          stack='Phase',
          tools=HoverTool(),
          yscale='datetime'

          )

tooltips = [
          ('Time', '@height ')
       ]
hover = bar.select(dict(type=HoverTool))
hover.tooltips =(tooltips)

Now my y-axis show the time in min:sec, but my tooltips are still in ms.

Cheers!

Charlotte

···

2017-05-04 16:36 GMT+02:00 Alex Schmitt [email protected]:

Hi Charlotte,

What are you trying to do ?
For me, the best thing with Chart (or any graphic lib) it to prepare the max in the dataframe and display the results.

You can use Datetime with TimeSeries, for Bars maybe just convert to string your datetime data ?

alEx

On Thu, May 4, 2017 at 3:44 PM Charlotte Meier [email protected] wrote:

However my hovertool is still displaying the @height values in [ms] (which is the format in my dataframe). Is there any way to change this?

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/CAADJVVoeKWWxd0N1h-bN0NCXo36zp0kdi98mFJmEr04jAADwhQ%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 a topic in the Google Groups “Bokeh Discussion - Public” group.

To unsubscribe from this topic, visit https://groups.google.com/a/continuum.io/d/topic/bokeh/cwNCDzumdxw/unsubscribe.

To unsubscribe from this group and all its topics, 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/CAJjPzf9bKz1%3D6pqO1qOLtGayYWp%2B6N4rsb30rrnt%2B3wemnvSEg%40mail.gmail.com.

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

2017-05-04 15:41 GMT+02:00 Charlotte Meier [email protected]:

Nevermind, I found yscale = ‘datetime’. I find it confusing that it is named differently to the figure interface (where it is y_axis_type).

Also there is no explanation in the reference guide.

2017-05-04 15:29 GMT+02:00 C [email protected]:

Hello,

I am creating a stacked bar chart with the charts API. As far as I know it’s not possible to use the datetime format with charts. Is there any other possiblity to work with datetime in the bar chart (especially on the y-axis)?

Best,
Charlotte

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

To unsubscribe from this topic, visit https://groups.google.com/a/continuum.io/d/topic/bokeh/cwNCDzumdxw/unsubscribe.

To unsubscribe from this group and all its topics, 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/e6e21a3b-7be6-4a3f-a3e8-e3b1e9de7a6c%40continuum.io.

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

Hi,

This PR:

  https://github.com/bokeh/bokeh/pull/6183

was merged last week to master, and provides the ability to customize the formatting of any tooltip field. The feature will be in the next "dev build" (out sometime this week) and in the next full 0.12.6 release.

As an aside, I should also mention that the bokeh.charts API is in the process of being moved to its own separate project and repo, "bkcharts". This is to promote the long term maintainability of Bokeh by making the core library smaller and more stable.

Thanks,

Bryan

···

On May 4, 2017, at 06:44, Charlotte Meier <[email protected]> wrote:

However my hovertool is still displaying the @height values in [ms] (which is the format in my dataframe). Is there any way to change this?

2017-05-04 15:41 GMT+02:00 Charlotte Meier <[email protected]>:
Nevermind, I found yscale = 'datetime'. I find it confusing that it is named differently to the figure interface (where it is y_axis_type).
Also there is no explanation in the reference guide.

2017-05-04 15:29 GMT+02:00 C <[email protected]>:
Hello,

I am creating a stacked bar chart with the charts API. As far as I know it's not possible to use the datetime format with charts. Is there any other possiblity to work with datetime in the bar chart (especially on the y-axis)?

Best,
Charlotte

--
You received this message because you are subscribed to a topic in the Google Groups "Bokeh Discussion - Public" group.
To unsubscribe from this topic, visit https://groups.google.com/a/continuum.io/d/topic/bokeh/cwNCDzumdxw/unsubscribe.
To unsubscribe from this group and all its topics, 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/e6e21a3b-7be6-4a3f-a3e8-e3b1e9de7a6c%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/CAADJVVoeKWWxd0N1h-bN0NCXo36zp0kdi98mFJmEr04jAADwhQ%40mail.gmail.com.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.