我有一个从Goole sheets中获取输入的图。
在运行main.py和在web上托管时,我得到了两种不同比例的绘图。
可以让任何人知道原因和解决方案吗?
cmplot = figure(plot_width = 600 , plot_height = 400, name = "com_meetings_plot")
cmplot.vbar_stack(stackers= ['pm','fp' ,'nd'] , x = 'yr', source = com_meetings_data
,color=("#5ac18e","#F3F781","#F781BE"), width = 0.5, line_color = "black")
cmplot.toolbar_location = None
cmplot.xaxis.axis_label = "Year"
cmplot.yaxis.axis_label = "Number of Meetings"图表的日期
[{'Year': 2015, 'Planned_Meetings': 12, 'Actual_Meetings': 12, 'Further Plan': 0, 'Meetings Conducted': 12, 'Not Done': 0}, {'Year': 2016, 'Planned_Meetings': 12, 'Actual_Meetings': 8, 'Further Plan': 0, 'Meetings Conducted': 8, 'Not Done': 4}, {'Year': 2017, 'Planned_Meetings': 12, 'Actual_Meetings': 12, 'Further Plan': 0, 'Meetings Conducted': 12, 'Not Done': 0}, {'Year': 2018, 'Planned_Meetings': 12, 'Actual_Meetings': 12, 'Further Plan': 0, 'Meetings Conducted': 12, 'Not Done': 0}, {'Year': 2019, 'Planned_Meetings': 12, 'Actual_Meetings': 11, 'Further Plan': 0, 'Meetings Conducted': 11, 'Not Done': 1}, {'Year': 2020, 'Planned_Meetings': 12, 'Actual_Meetings': 3, 'Further Plan': 9, 'Meetings Conducted': 3, 'Not Done': 0}]HTML代码如下
<div class="col-md-6";>
<div class="card">
<div class="card-body">
<div class = "x_title">
<h3 class="card-title">Commitiee Meetings</h3>
<p class="card-text">Number of Meetings plan vs actual</p>
<div class="clearfix"></div>
</div>
{{ embed(roots.com_meetings_plot) }}
</div>
</div>
</div>
</div>我得到了几种类型的图表
发布于 2020-03-15 02:08:22
我根据@EugenePakhomv的线索找到了解决方案。
我使用的是df["Product"]而不是df.iloc函数。
即使问题已经解决,我也不确定是什么原因导致应用程序在使用iloc时失败。
https://stackoverflow.com/questions/60668290
复制相似问题