diff --git a/debug_toolbar/panels/sql/panel.py b/debug_toolbar/panels/sql/panel.py index aaea2e648..5e61b0aee 100644 --- a/debug_toolbar/panels/sql/panel.py +++ b/debug_toolbar/panels/sql/panel.py @@ -215,12 +215,8 @@ def duplicate_key(query): query["rgb_color"] = self._databases[alias]["rgb_color"] try: query["width_ratio"] = (query["duration"] / self._sql_time) * 100 - query["width_ratio_relative"] = ( - 100.0 * query["width_ratio"] / (100.0 - width_ratio_tally) - ) except ZeroDivisionError: query["width_ratio"] = 0 - query["width_ratio_relative"] = 0 query["start_offset"] = width_ratio_tally query["end_offset"] = query["width_ratio"] + query["start_offset"] width_ratio_tally += query["width_ratio"] diff --git a/debug_toolbar/static/debug_toolbar/css/toolbar.css b/debug_toolbar/static/debug_toolbar/css/toolbar.css index e0a0f21ae..ef26b7e69 100644 --- a/debug_toolbar/static/debug_toolbar/css/toolbar.css +++ b/debug_toolbar/static/debug_toolbar/css/toolbar.css @@ -421,39 +421,21 @@ #djDebug .djdt-timeline { width: 30%; } -#djDebug .djDebugTimeline { - position: relative; - height: 100%; - min-height: 100%; -} -#djDebug div.djDebugLineChart { - position: absolute; - left: 0; - right: 0; - top: 0; - bottom: 0; - vertical-align: middle; -} -#djDebug div.djDebugLineChart strong { - text-indent: -10000em; - display: block; - font-weight: normal; - vertical-align: middle; - background-color: #ccc; -} -#djDebug div.djDebugLineChartWarning strong { - background-color: #900; +#djDebug svg.djDebugLineChart { + width: 100%; + height: 1.5em; } -#djDebug .djDebugInTransaction div.djDebugLineChart strong { - background-color: #d3ff82; +#djDebug svg.djDebugLineChartWarning rect { + fill: #900; } -#djDebug .djDebugStartTransaction div.djDebugLineChart strong { - border-left: 1px solid #94b24d; + +#djDebug svg.djDebugLineChartInTransaction rect { + fill: #d3ff82; } -#djDebug .djDebugEndTransaction div.djDebugLineChart strong { - border-right: 1px solid #94b24d; +#djDebug svg.djDebugLineChart line { + stroke: #94b24d; } #djDebug .djdt-panelContent ul.djdt-stats { diff --git a/debug_toolbar/static/debug_toolbar/js/toolbar.timer.js b/debug_toolbar/static/debug_toolbar/js/toolbar.timer.js index fe8ee7310..517994115 100644 --- a/debug_toolbar/static/debug_toolbar/js/toolbar.timer.js +++ b/debug_toolbar/static/debug_toolbar/js/toolbar.timer.js @@ -15,17 +15,17 @@ function addRow(stat, endStat) { if (endStat) { // Render a start through end bar row.innerHTML = '