缩放我是相当新的背景虚化,努力实现以下几点:动态指标,而在Python散景
我有包含格式DD-MM-YYYY日期行的数据集。 计算日期并绘制。 放大时,我想让Bokeh显示个人日期(已工作)。 缩小时,我只想要使用Bokeh来显示月份(或甚至进一步缩小的年份)。知道索引变得非常混乱,因为个别日期越来越近,缩小得越多。
有没有办法让Bokeh根据放大或缩小的距离来改变索引中显示的内容?
这里是我的代码:
import pandas as pd
from bokeh.charts import TimeSeries
from bokeh.io import output_file, show, gridplot
transactionssent = dict(pd.melt(df,value_vars=['datesent']).groupby('value').size())
transactionssent2 = pd.DataFrame.from_dict(transactionssent, orient= 'index')
transactionssent2.columns = ['Amount']
transactionssent2.index.rename('Date sent', inplace= True)
ts = TimeSeries(transactionssent2, x='index', y='Amount')
ts.xaxis.axis_label = 'Date sent'
如果有人知道请点我在正确的方向。
感谢和问候, 斯特凡
谢谢!这绝对解决了我的问题!重新格式化我的数据(我使用德语风格的日期)后,我的图形看起来更好用'bokeh.plotting.figure' –