问题
I am using Bokeh plots in a couple of my Django views. The plots are rendering the data correctly, but they are weirdly skewed when rendered on my page.
The html looks like this:
<div class="container">
<h4 class="text-center"> Resource Usage </h4>
{% for label,div in divs.items %}
<h3 class="text-center"><u> Satellite {{ label }}</u></h3>
</br>
<div class="container">
{{ div | safe }}
</div>
{% endfor %}
</div>
</div>
{{ script | safe }}
Where the div
code looks like this:
'<div class="plotdiv" id="b367d397-25cc-4fa2-9b92-e0d0a8f155fa"></div>'
I'm just trying Bokeh's base example here but am getting something that looks like this:
Can anyone tell me why that offset is happening?
回答1:
After a discussion on Bokeh's Google group, the problem was that I applied CSS styling to tables that I have elsewhere in my page and that was affecting how the Bokeh plots were being displayed. Once I removed the table styling the plots displayed correctly.
来源:https://stackoverflow.com/questions/32833193/bokeh-plot-not-displaying-correctly