Python Bokeh:ColumnDataSource未在Vbar上渲染

Python Bokeh:ColumnDataSource未在Vbar上渲染,python,python-3.x,pandas,bokeh,Python,Python 3.x,Pandas,Bokeh,尝试将以下内容读入vbar bokeh图表,但它不会呈现任何超出空白数字的内容 Index | Sub Call Type | Calls |Total AHT 0 | Standard Checklist | 33111 |00:07:27 1 | About FSS | 9447 |00:04:40 尝试执行以下操作: import pandas as pd from bokeh.io import show, output_fil

尝试将以下内容读入vbar bokeh图表,但它不会呈现任何超出空白数字的内容

Index | Sub Call Type      | Calls   |Total AHT
0     | Standard Checklist | 33111   |00:07:27
1     | About FSS          | 9447    |00:04:40
尝试执行以下操作:

import pandas as pd
from bokeh.io import show, output_file
from bokeh.plotting import figure, ColumnDataSource

data = pd.read_csv("Desktop/Graph.csv")

output_file("bar_pandas.html")

source = ColumnDataSource(data=data)

p = figure(plot_height=350,title="Business Heatmap FYTD")

p.vbar(x="Sub Call Type",top="Calls",width=0.5,source=source)

show(p)

感谢您的帮助

您忘了指定数据是正确的。这可以通过
x\u range=list(分类)

import pandas as pd
from bokeh.io import show, output_file
from bokeh.plotting import figure, ColumnDataSource

data = pd.DataFrame.from_dict({"Sub Call Type": ["Standard Checklist", "About FFS"], "Calls": [33111, 9447], "Total AHT": ["00:07:27", "00:04:40"]})

output_file("bar_pandas.html")

source = ColumnDataSource(data=data)

p = figure(plot_height=350,title="Business Heatmap FYTD", x_range=data["Sub Call Type"])

p.vbar(x="Sub Call Type",top="Calls",width=0.5,source=source)

show(p)