Stock chart transfer between server/website

I'm coding a private webapp that can pick some data from a source (yfinance, panda, ...) and generates a time series. Basically, I want to be able to click on any of the Dow Jones stocks with an HTML btn or whatever, which will send a request to my backend server to generate such chart using python, R or any alternative.

Two possibilities:

  • I generate the chart and figures on the client's side, by sending the data from the server to the client on a JSON format (which seems really unproductive).

  • Or, I make all computations on backend, following an HTTP request from the client, generate the chart and send it to the client (my computer).

The question is, can I send such chart, from the server to the client without uploading it as a png and transmit the link through AJAX etc. May I get the output of a python function and send it ?

To summarize: Can a .png file might be sent from a server to an online webapp, any ideas ?

Thanks for your comments, this is a technical question and this might be useful for future requests. Also, I plan to code everything using Django framework.

Planning everything so nothing has been built yet.

Back to Top