I'm trying to build an organizational chart, but I need to enter more than one piece of information in the chart and insert people's photos. I will put it below as I did and I would like to know how I can put their photo and title under the names of people. Thanks in advance for the help!
import sqlite3, pandas as pd, networkx as nx
con = sqlite3.connect('people.db')
qry="""
SELECT a1.id, a1.name as a1, a2.name as a2, a1.position as a3
FROM people a1
INNER JOIN people a2 ON a1.manager_id = a2.id
"""
emps=pd.read_sql(qry, con)
emps.rename(
columns={'a2' :'manager', 'a1' :'person', 'a3':'position'},
inplace=True
)
edgelist=emps[['person', 'manager',]]
print(edgelist)
orgchart=nx.from_pandas_edgelist(edgelist, source='manager', target='person')
p=nx.drawing.nx_pydot.to_pydot(orgchart)
p.write_png('orgchart.png')
In each circle I would like to put the name and below the position and photo. And if possible I would like to change the layout from circle to square.
Thank You!
Tried to read de docs, but nothing.