I am trying to show the text of excel using hovertool, but it shows question mark when I use @ function
I used hover = HoverTool(tooltips = [(“index”,"$index"),
("(x,y)","($x,$y)"),
(“Product Type”,"@产品类型"),
(“Process Pressure min”,"@x{%F}"),
(“Process Pressure max”,"@y{0,0.00}"),])
The first two work, but the last three do not work.
All data have the same length.
And I am using Bokeh 2.2.3 and Jupyter Notebook 3.8.5
My code:
data1_2 = pd.DataFrame({
'Product Type': ["Solid","Solid","Solid","Solid","Solid","Solid","Solid","Solid","Solid","Solid"],
'Process Pressure max': [58,58,58,58,43,22,29,29,29,7.25],
'Process Pressure min': [10,10,10,10,10,10,-2.9,-2.9,-2.9,0],
})
source1 = ColumnDataSource(data1_2)
hover = HoverTool(tooltips = [("index","$index"),
("(x,y)","($x,$y)"),
("Product Type","@Product Type"),
("Process Pressure min","@x{%F}"),
("Process Pressure max","@y{0,0.00}"),])
tools = [hover,"crosshair,lasso_select,wheel_zoom,pan,reset"]
##########################################################
p1 = figure(plot_width=1600, plot_height=800, tools=tools,title = "Scatter 1 - Process Pressure min&max",
x_axis_label = 'Process Pressure min',y_axis_label = 'Process Pressure max')
p1.circle(x='Process Pressure min', y='Process Pressure max', source = source1,
size = 10, color = 'navy', hover_color = "red", legend = "Ultrasonic")
tab1 = Panel(child = p1, title = "Process Pressure min&max")
tabs = Tabs(tabs=[tab1])
show(tabs)
path = r"C:\Users\Jenny\Desktop\Data Files\Bokeh.html"
output_file(filename = path, title = "2022.02.22")
Where did I code wrong?