My web application has visualization function for user see chart(Average, Standard Deviation) by from ...day
to ...day
(Start Date to End Date), where(Production line) then request to SQL for connect database. This is visualization form. :
After request of user my web app will show about 31 charts and I add 3 buttons for download file every chart in web look like this. (example. number 1,2 of chart) :
And this is my javascript for create chart and , etc in file .html
(spc_chart.html) but don't yet pass dataframe to .html
:
I have all pandas dataframe of Avg Chart Data, Std Chart Data, Raw Data(use calculate for Avg,Std) in 3 arrays(name is: ChartDataAvg, ChartDataStd, RawData).
I just know that how to download file must will add href="/..."
at each of button and set @app.route('/...')
in python then send SQL to each def of @app.route('/...')
and pass dataframe to web after calculated. ref(Flask: Download a csv file on clicking a button) But I don't know how to pass SQL request of user from def in another @app.route(/...)
.
Is there any way to pass all pandas dataframe to button for download file in each of the chart 1, 2, 3,... or send SQL to def in another app.route
???