This Method receives type of Graph is required, the file to work and the axes to graph
@app.route('/graficar',methods=['POST'])
def graficar():
if request.method == 'POST':
tipo=request.form['tipo']
nombre=request.form['nombre']
sep=request.form['sep']
columnaX=request.form['columnaX']
columnaY=request.form['columnaY']
ruta=request.form['fil']
df =pd.read_csv(ruta, sep=sep )
df=df.head(10)
print(df.head(5))
if tipo=='1':
print('Lineal')
plt.plot(df[columnaX],df[columnaY])
plt.xticks(df[columnaX], rotation=75)
plt.xlabel(columnaX)
plt.ylabel(columnaY)
plt.title(nombre)
plt.show()
plt.savefig('img/Grafica.png' )
return render_template("Grafica.html")
HTML,I just send to call the image but it does not show me anything
enter image description here
<div class="col-12">
<h3 class="text-center display-2">Gráfica</h3>
<div class="container ">
<img class="img-fluid" src="img/Grafica.png" alt="Chania" />
</div>
</div>