Search code examples
htmldjango-templatesbokeh

Bokeh graphs in django not plotting horizontally


I want two graphs to show up next to each other on my webservice. I use;

<link rel="stylesheet" href="https://cdn.bokeh.org/bokeh/release/bokeh-0.9.0.min.css" type="text/css" />
    </body>
        {{ div | safe }}
    </body>
        <script type="text/javascript" src="https://cdn.bokeh.org/bokeh/release/bokeh-0.13.0.min.js"></script>
        <script type="text/javascript">
            Bokeh.set_log_level("info");
        </script>
        {{ script | safe }}

Where div and script are defined by:

from bokeh.layouts import row
script, div = components(row(fig1, fig2))

And fig1 and fig2 are bokeh plots. It seems that whatever I do, the plots always shows up vertically but I need them to show up horizontally. I even tried making two different div and scripts for different placeholders but that didn't work either. I must be missing something obvious because it simply cannot be true that it is so difficult to plot horizontally in Bokeh/ through html.


Solution

  • Ok, of course I found out 2 minutes after posting this. Seems I used an old CSS file. It works with:

    <link rel="stylesheet" href="https://cdn.bokeh.org/bokeh/release/bokeh-0.13.0.min.css" type="text/css" />