⚡ Saving the graphs as file
- WIP, Saved graphs are currently empty pictures for some reason
This commit is contained in:
		
							parent
							
								
									b8c9b58cc2
								
							
						
					
					
						commit
						e5be34dd55
					
				
							
								
								
									
										18
									
								
								Analyser.py
									
									
									
									
									
								
							
							
						
						
									
										18
									
								
								Analyser.py
									
									
									
									
									
								
							| 
						 | 
				
			
			@ -56,18 +56,18 @@ class Analyser:
 | 
			
		|||
			countryTimeData = countryTimeData.sort_values('dateRep')
 | 
			
		||||
			countryTimeData['cases'] = countryTimeData['cases'].cumsum()
 | 
			
		||||
 | 
			
		||||
			print(countryTimeData.head())
 | 
			
		||||
			print(countryTimeData)
 | 
			
		||||
 | 
			
		||||
			countryTimeData.plot(ax=ax, x='dateRep', y='cases')
 | 
			
		||||
 | 
			
		||||
			plt.show(block=True)
 | 
			
		||||
			filePath = ('graphs/casesGraph_' + country + '_' + datetime.now().strftime('%Y-%m-%d'))
 | 
			
		||||
			plt.savefig(filePath)
 | 
			
		||||
 | 
			
		||||
			# TODO Change return
 | 
			
		||||
			return 'abc'
 | 
			
		||||
			return filePath
 | 
			
		||||
		else:
 | 
			
		||||
			print('Unknown country')
 | 
			
		||||
			# TODO Change return
 | 
			
		||||
			return 'abc'
 | 
			
		||||
			return '-1'
 | 
			
		||||
 | 
			
		||||
	def getCaseIncreaseGraph(self, country):
 | 
			
		||||
		"""
 | 
			
		||||
| 
						 | 
				
			
			@ -90,13 +90,13 @@ class Analyser:
 | 
			
		|||
			countryTimeData.plot(ax=ax, x='dateRep', y='cases')
 | 
			
		||||
 | 
			
		||||
			plt.show(block=True)
 | 
			
		||||
			filePath = ('graphs/casesIncreaseGraph_' + country + '_' + datetime.now().strftime('%Y-%m-%d'))
 | 
			
		||||
			plt.savefig(filePath)
 | 
			
		||||
 | 
			
		||||
			# TODO Change return
 | 
			
		||||
			return 'abc'
 | 
			
		||||
			return filePath
 | 
			
		||||
		else:
 | 
			
		||||
			print('Unknown country')
 | 
			
		||||
			# TODO Change return
 | 
			
		||||
			return 'abc'
 | 
			
		||||
			return '-1'
 | 
			
		||||
 | 
			
		||||
	def getTotalCases(self, country, date=datetime.now().strftime('%Y-%m-%d')) -> int:
 | 
			
		||||
		"""
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue
	
	Block a user