-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgraph.py
29 lines (29 loc) · 1.1 KB
/
graph.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!C:\Users\user\AppData\Local\Programs\Python\Python38\python.exe
print("Content-type:text/html\r\n\r\n")
import cgi
import mysql.connector
db=mysql.connector.connect(host="localhost",user="root",passwd="",db="ardent_pr")
cur=db.cursor()
db.commit()
import matplotlib.pyplot as plt
from random import *
import mpld3
y=[]
x=['sell','profit','revenu','student left','rating']
for i in range(5):
r=randint(1,10)
y.append(r)
plt.xlabel('subjects')
plt.ylabel('rate')
plt.title('every day rates')
plt.bar(x,y, width=0.3)
plt.grid(True , color='b')
plt.savefig('C:\xampp\htdocs\ardent project/ graph1.png', dpi=300,bbox_inches='tight')
plt.show()
print("""
<html>
<body>
<img src="a3.png">
</body>
</html>
""")