Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
3505 Weergaven

in .py file:

import matplotlib.pyplot as plt

....

datafile=fields.Binary(u'select Excel File',required=True)

@api.multi

def plotfig(self,cr):

file_like=io.BytesIO(base64.b64decode(self.datafile))

table=pandas.read_excel(file_like)

x=table.iloc[:,1]

y=table.iloc[:,2]

plt.plot(x,y)

plt.show()


Now the users can upload "excel" file onto "datafile", and when users click button "plotfig", odoo will read out data from "datafile", plot a figure and show it on odoo server; but because the figure is shown on odoo server, users can't see / save it; so how shall I let users see the figure and save it on users' PC?


Avatar
Annuleer
Gerelateerde posts Antwoorden Weergaven Activiteit
0
jul. 16
2647
0
mei 15
3529
1
mrt. 15
5120
4
dec. 15
6702
1
jun. 24
3147