条形图不会加载图表

时间:2019-09-25 16:42:42

标签: python plotly

我的代码:

# Create website bar chart
website_fig = go.Bar(
        x=[
            today      + " - " + one_week,
            one_week   + " - " + two_week,
            two_week   + " - " + three_week,
            three_week + " - " + four_week,
        ],
        y=[
            product_data[today + " - " + one_week][network],
            product_data[one_week + " - " + two_week][network],
            product_data[two_week + " - " + three_week][network],
            product_data[three_week + " - " + four_week][network]
        ],
        name="Website statistic"
    )

y中的值为3, 0, 0, 0。我已经打印了。使用type(value)尝试了它们的类型,它是class int。图表以-1, -0.5, 0, 0.5, 1 y轴呈现。 x轴很好。我尝试将y的值替换为硬编码的3,0,0,0,并且可以正常工作。试图使用int(value)将它们设置为整数,并尝试将它们分别乘以1 int(value) * 1value * 1

谢谢您的每一个建议!整个代码为here

0 个答案:

没有答案