fix: render usage timeline bars correctly

This commit is contained in:
a.tolmachev
2026-04-01 09:48:04 +03:00
parent 516c3d2814
commit ab289165b5
2 changed files with 20 additions and 1 deletions
+6
View File
@@ -145,6 +145,12 @@ document.addEventListener('DOMContentLoaded', function () {
var node = chartTemplate.content.cloneNode(true);
var okHeight = maxValue ? Math.round((point.calls_ok / maxValue) * 160) : 0;
var errorHeight = maxValue ? Math.round((point.calls_error / maxValue) * 160) : 0;
if (point.calls_ok > 0) {
okHeight = Math.max(okHeight, 6);
}
if (point.calls_error > 0) {
errorHeight = Math.max(errorHeight, 6);
}
node.querySelector('.chart-bar.success').style.height = okHeight + 'px';
node.querySelector('.chart-bar.success').dataset.tip = formatCount(point.calls_ok) + ' ok';
node.querySelector('.chart-bar.error').style.height = errorHeight + 'px';