Add emojis for graphs in hourly breakdown tooltip (#2464)

This commit is contained in:
RumovZ 2023-04-17 08:16:10 +02:00 committed by GitHub
parent 8abcb77d95
commit e361bb9514
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 4 deletions

View file

@ -149,6 +149,10 @@ statistics-intervals-day-single =
# hour range, eg "From 14:00-15:00" # hour range, eg "From 14:00-15:00"
statistics-hours-range = From { $hourStart }:00~{ $hourEnd }:00 statistics-hours-range = From { $hourStart }:00~{ $hourEnd }:00
statistics-hours-correct = { $correct }/{ $total } correct ({ $percent }%) statistics-hours-correct = { $correct }/{ $total } correct ({ $percent }%)
# the emoji depicts the graph displaying this number
statistics-hours-reviews = 📊 { $reviews } reviews
# the emoji depicts the graph displaying this number
statistics-hours-correct-reviews = 📈 { $percent }% correct ({ $reviews })
statistics-hours-title = Hourly Breakdown statistics-hours-title = Hourly Breakdown
statistics-hours-subtitle = Review success rate for each hour of the day. statistics-hours-subtitle = Review success rate for each hour of the day.
# shown when graph is empty # shown when graph is empty

View file

@ -170,12 +170,12 @@ export function renderHours(
hourStart: d.hour, hourStart: d.hour,
hourEnd: d.hour + 1, hourEnd: d.hour + 1,
}); });
const correct = tr.statisticsHoursCorrect({ const reviews = tr.statisticsHoursReviews({ reviews: d.totalCount });
correct: d.correctCount, const correct = tr.statisticsHoursCorrectReviews({
total: d.totalCount,
percent: d.totalCount ? (d.correctCount / d.totalCount) * 100 : 0, percent: d.totalCount ? (d.correctCount / d.totalCount) * 100 : 0,
reviews: d.correctCount,
}); });
return `${hour}<br>${correct}`; return `${hour}<br>${reviews}<br>${correct}`;
} }
// hover/tooltip // hover/tooltip