I’m trying to do offline charts using Python. If displayed in a browser, charts are rendering correctly. But if I write the chart to a png file, it’s truncating the table.
fig = make_subplots(
rows=2, cols=1,
shared_xaxes=True,
print_grid=True,
vertical_spacing=0.1,
subplot_titles=('Account Summary', 'Portfolio Summary'),
specs=[[{"type": "table"}],
[{"type": "table"}]]
)
# Accounts and their performance summary
fig.add_trace(
go.Table(
header=dict(
values=['Account', 'Strategy', 'Start Date', 'Days Running', 'Last Transaction', 'Type', 'Last PnL %',
'% Net Profit', 'Compounding Interest', '% of Portfolio'],
font=dict(size=10),
align="center"
),
cells=dict(
values=convert_col_rows(accounttable),
font=dict(size=9))
),
row=1, col=1)
# Total portfolio summary
fig.add_trace(
go.Table(
header=dict(
values=['Days', '% Daily Compound Interest', '% Porfolio Net Profit'],
font=dict(size=10),
align="center"
),
cells=dict(
values=convert_col_rows(summarytable),
font=dict(size=9))
),
row=2, col=1)
fig.update_layout(
width=1200,
height=1200,
showlegend=False,
font=dict(size=10),
)
fig.layout.template = 'plotly_dark'
fig.write_image(f'report02.png')