Dash Download __full__ Graph May 2026

Sometimes you want to give users a standalone version of the chart that remains interactive (zoomable/pannable) outside of your Dash app. This is done by writing the figure to a buffer and sending it through dcc.Download .

from dash import Dash, dcc, html, Input, Output import pandas as pd app = Dash(__name__) # Sample Data df = pd.DataFrame("x": [1, 2, 3], "y": [4, 1, 2]) app.layout = html.Div([ html.Button("Download Data", id="btn-download"), dcc.Download(id="download-dataframe-csv"), dcc.Graph(id="graph", figure="data": ["x": df["x"], "y": df["y"]]) ]) @app.callback( Output("download-dataframe-csv", "data"), Input("btn-download", "n_clicks"), prevent_initial_call=True, ) def func(n_clicks): # Returns the CSV string via the dcc.send_data_frame helper return dcc.send_data_frame(df.to_csv, "graph_data.csv") if __name__ == "__main__": app.run(debug=True) Use code with caution. 3. Downloading the Graph as an Interactive HTML File dash download graph

By default, every dcc.Graph component in Dash includes a (the toolbar that appears when you hover over the chart). This bar contains a camera icon that allows users to instantly download the current view of the graph as a PNG file. Sometimes you want to give users a standalone

For many users, "downloading a graph" actually means downloading the data that powers it. The dcc.Download component is the standard way to trigger a file download from a Python callback. Example: Download Graph Data as CSV For many users, "downloading a graph" actually means

To do this, you link a button to a callback that converts your data (usually a Pandas DataFrame) into a downloadable format.

Helper function specifically for Pandas users to export CSV/Excel. Used if the file already exists on your server's disk.