mirror of
				https://github.com/subsurface/subsurface.git
				synced 2025-02-19 22:16:15 +00:00 
			
		
		
		
	statistics: add enough entries for date axis
We must add one more entries than there are days, because the entries describe the values between histograms. The root cause of the problem here is that a histogram axis is misused for a continuous day-axis. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
		
							parent
							
								
									48659c3f7d
								
							
						
					
					
						commit
						56c91a46b6
					
				
					 2 changed files with 6 additions and 1 deletions
				
			
		|  | @ -1,3 +1,6 @@ | ||||||
|  | statistics: show correct color of selected scatter items when switching to unbinned mode | ||||||
|  | statistics: fix display of month number in continuous date axis | ||||||
|  | statistics: fix range of continuous date axis | ||||||
| desktop: fix dive time display in time shift dialog | desktop: fix dive time display in time shift dialog | ||||||
| 
 | 
 | ||||||
| --- | --- | ||||||
|  |  | ||||||
|  | @ -623,7 +623,9 @@ static std::vector<HistogramAxisEntry> timeRangeToBins(double from, double to) | ||||||
| 		QString format = day_before_month ? QStringLiteral("%1%2%3") | 		QString format = day_before_month ? QStringLiteral("%1%2%3") | ||||||
| 						  : QStringLiteral("%3%2%1"); | 						  : QStringLiteral("%3%2%1"); | ||||||
| 		QString sep = QString(separator); | 		QString sep = QString(separator); | ||||||
| 		for (auto act = day_from; act < day_to; inc(act)) { | 		// Attention: In a histogramm axis, we must add one more entries than
 | ||||||
|  | 		// histogram bins. The entries are the values *between* the histograms.
 | ||||||
|  | 		for (auto act = day_from; act <= day_to; inc(act)) { | ||||||
| 			double val = date_to_double(act[0], act[1], act[2]); | 			double val = date_to_double(act[0], act[1], act[2]); | ||||||
| 			if (act[1] == 0) { | 			if (act[1] == 0) { | ||||||
| 				res.push_back({ QString::number(act[0]), val, true }); | 				res.push_back({ QString::number(act[0]), val, true }); | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue