# Columns and graphviz chart problem

**URL:** <https://discuss.streamlit.io/t/columns-and-graphviz-chart-problem/8092>\
**Category:** Using Streamlit\
**Created:** [December 17, 2020, 8:50pm UTC](https://discuss.streamlit.io/t/columns-and-graphviz-chart-problem/8092 "2020-12-17T20:50:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ddutt](https://avatars.discourse-cdn.com/v4/letter/d/8e7dd6/32.png) [@ddutt](https://discuss.streamlit.io/u/ddutt)\
**Post date:** [December 17, 2020, 8:50pm UTC](https://discuss.streamlit.io/t/columns-and-graphviz-chart-problem/8092/1 "2020-12-17T20:50:23Z")

</div>

Hi,

I’m using st.beta\_columns to display two graphs side by side, but what I get instead is that the second graph is drawn on top of the first.

Here is a simple sample code to demonstrate the problem. I tried putting the columns inside a container, but no dice. If I don’t use columns, the graphs get drawn one below the other, correctly.

Appreciate any help,

## Dinesh

```
import streamlit as st
from graphviz import Digraph

def graph1():

    t = Digraph('TrafficLights', filename='traffic_lights.gv', engine='neato')

    t.attr('node', shape='box')
    for i in (2, 1):
        t.node('gy%d' % i)
        t.node('yr%d' % i)
        t.node('rg%d' % i)

    t.attr('node', shape='circle', fixedsize='true', width='0.9')
    for i in (2, 1):
        t.node('green%d' % i)
        t.node('yellow%d' % i)
        t.node('red%d' % i)
        t.node('safe%d' % i)

    for i, j in [(2, 1), (1, 2)]:
        t.edge('gy%d' % i, 'yellow%d' % i)
        t.edge('rg%d' % i, 'green%d' % i)
        t.edge('yr%d' % i, 'safe%d' % j)
        t.edge('yr%d' % i, 'red%d' % i)
        t.edge('safe%d' % i, 'rg%d' % i)
        t.edge('green%d' % i, 'gy%d' % i)
        t.edge('yellow%d' % i, 'yr%d' % i)
        t.edge('red%d' % i, 'rg%d' % i)

    t.attr(overlap='false')
    t.attr(label=r'PetriNet Model TrafficLights\n'
                 r'Extracted from ConceptBase and layed out by Graphviz')
    t.attr(fontsize='12')

    return t

def graph2():
    g = Digraph('G', filename='cluster_edge.gv')
    g.attr(compound='true')

    with g.subgraph(name='cluster0') as c:
        c.edges(['ab', 'ac', 'bd', 'cd'])

    with g.subgraph(name='cluster1') as c:
        c.edges(['eg', 'ef'])

    g.edge('b', 'f', lhead='cluster1')
    g.edge('d', 'e')
    g.edge('c', 'g', ltail='cluster0', lhead='cluster1')
    g.edge('c', 'e', ltail='cluster0')
    g.edge('d', 'h')

    return g

def _main():
    col1, mid, col2 = st.beta_columns([2, 1, 2])
    with col1:
        pl1 = st.empty()
    with col2:
        pl2 = st.empty()

    g1 = graph1()
    g2 = graph2()

    pl1.graphviz_chart(g1, use_container_width=True)
    pl2.graphviz_chart(g2, use_container_width=True)

if __name__ == ' __main__':
    _main()
```

---

<div class="post-metadata">

**Author:** ![randyzwitch](https://sea2.discourse-cdn.com/streamlit/user_avatar/discuss.streamlit.io/randyzwitch/32/58772_2.png) [@randyzwitch](https://discuss.streamlit.io/u/randyzwitch)\
**Post date:** [December 18, 2020, 4:25pm UTC](https://discuss.streamlit.io/t/columns-and-graphviz-chart-problem/8092/2 "2020-12-18T16:25:53Z")

</div>

Hi @ddutt -

I can confirm that this doesn’t work as expected on my computer, could you open a GitHub issue about this?

Best,  
Randy

---

<div class="post-metadata">

**Author:** ![ddutt](https://avatars.discourse-cdn.com/v4/letter/d/8e7dd6/32.png) [@ddutt](https://discuss.streamlit.io/u/ddutt)\
**Post date:** [December 18, 2020, 7:21pm UTC](https://discuss.streamlit.io/t/columns-and-graphviz-chart-problem/8092/3 "2020-12-18T19:21:16Z")

</div>

Done. [https://github.com/streamlit/streamlit/issues/2485](https://github.com/streamlit/streamlit/issues/2485)

Thanks,

Dinesh

---

<div class="post-metadata">

**Author:** ![randyzwitch](https://sea2.discourse-cdn.com/streamlit/user_avatar/discuss.streamlit.io/randyzwitch/32/58772_2.png) [@randyzwitch](https://discuss.streamlit.io/u/randyzwitch)\
**Post date:** [January 12, 2022, 10:03pm UTC](https://discuss.streamlit.io/t/columns-and-graphviz-chart-problem/8092/4 "2022-01-12T22:03:46Z")

</div>


