Skip to content

Commit

Permalink
fix: graph height
Browse files Browse the repository at this point in the history
  • Loading branch information
believer committed Apr 13, 2024
1 parent 5868a7a commit 7c4845a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion handlers/stats.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ func constructGraphFromData(data []types.GraphData) ([]types.Bar, error) {
elementsInGraph = graphWidth / len(data)
// Calcualte the bar Height
// Subtract 46 from the graph height to make room for the labels
barHeight = clamp(int(float64(row.Value)/float64(maxCount.Value)*float64(graphHeight-46)), 2, graphHeight-40)
barHeight = clamp(int(float64(row.Value)/float64(maxCount.Value)*float64(graphHeight-46)), 2, graphHeight-46)
barWidth = int(float64(graphWidth)/float64(len(data))) - 5

// Space the bars evenly across the graph
Expand Down

0 comments on commit 7c4845a

Please sign in to comment.