Box Plot-Adding HoverTool Tool Tips

Hi Team,

Please help with this issue.

I’m trying to create a Box Plot with outliers and with Hover tools. The issue i’m facing is explained through the below code snippet

My code looks like this,

columns = ['A','B','C']
df = pd.DataFrame(tickets, columns=columns)
fig = BoxPlot(df, values='A', label='B',
                    color='B', xlabel='A Axis Label', ylabel='B Axis Label', plot_width=700,tools=TOOLS)

#Add tool tip

hover = HoverTool()
hover.tooltips = [
(“C Value”, “@C”)
]
fig.add_tools(hover)

Basically I want the tool tip to show value of column ‘C’ on hover.

But the value is not getting displayed. It is coming as ‘???’

What I found is if I give the column mentioned in ‘label’, in my case column ‘B’ for the tool tip , it works

This works
hover.tooltips = [
(“B Value”, “@B”)
]

I tried using ColumnDataSource etc. But none of the options worked.

What is that I’m doing wrong here. Anyone faced similar issue.


Please suggest.

Regards

Chandra

Currently you can only add tooltips for something that is assigned to an attribute of a chart. The reason this is is because a box plot aggregates values, which means column c could have many different values associated with each box. If you assigned c to some attribute of the chart then it would be in the resultant data and could produce a tooltip for it.

···

On Wednesday, February 10, 2016 at 7:35:15 AM UTC-6, [email protected] wrote:

Hi Team,

Please help with this issue.

I’m trying to create a Box Plot with outliers and with Hover tools. The issue i’m facing is explained through the below code snippet

My code looks like this,

columns = ['A','B','C']
df = pd.DataFrame(tickets, columns=columns)
fig = BoxPlot(df, values='A', label='B',
                    color='B', xlabel='A Axis Label', ylabel='B Axis Label', plot_width=700,tools=TOOLS)


#Add tool tip

hover = HoverTool()
hover.tooltips = [
(“C Value”, “@C”)
]
fig.add_tools(hover)

Basically I want the tool tip to show value of column ‘C’ on hover.

But the value is not getting displayed. It is coming as ‘???’

What I found is if I give the column mentioned in ‘label’, in my case column ‘B’ for the tool tip , it works

This works
hover.tooltips = [
(“B Value”, “@B”)
]

I tried using ColumnDataSource etc. But none of the options worked.

What is that I’m doing wrong here. Anyone faced similar issue.


Please suggest.

Regards

Chandra



Hi,

I have asked a similar question here: Redirecting to Google Groups

It seems that the charts API does not work well with hover tool… correct me if I’ m wrong.

Regards,

PZ

···

On Wednesday, 10 February 2016 15:35:15 UTC+2, [email protected] wrote:

Hi Team,

Please help with this issue.

I’m trying to create a Box Plot with outliers and with Hover tools. The issue i’m facing is explained through the below code snippet

My code looks like this,

columns = ['A','B','C']
df = pd.DataFrame(tickets, columns=columns)
fig = BoxPlot(df, values='A', label='B',
                    color='B', xlabel='A Axis Label', ylabel='B Axis Label', plot_width=700,tools=TOOLS)


#Add tool tip

hover = HoverTool()
hover.tooltips = [
(“C Value”, “@C”)
]
fig.add_tools(hover)

Basically I want the tool tip to show value of column ‘C’ on hover.

But the value is not getting displayed. It is coming as ‘???’

What I found is if I give the column mentioned in ‘label’, in my case column ‘B’ for the tool tip , it works

This works
hover.tooltips = [
(“B Value”, “@B”)
]

I tried using ColumnDataSource etc. But none of the options worked.

What is that I’m doing wrong here. Anyone faced similar issue.


Please suggest.

Regards

Chandra