From 1b454b4a0aa55b26d54902ab4db509340d57e7c6 Mon Sep 17 00:00:00 2001 From: as6325400 Date: Fri, 25 Oct 2024 11:20:15 +0800 Subject: [PATCH] do not display anything for 0 attempts. --- .../templates/jury/analysis/contest_overview.html.twig | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/webapp/templates/jury/analysis/contest_overview.html.twig b/webapp/templates/jury/analysis/contest_overview.html.twig index 1e3a70f3ed..0c0943a91e 100644 --- a/webapp/templates/jury/analysis/contest_overview.html.twig +++ b/webapp/templates/jury/analysis/contest_overview.html.twig @@ -345,6 +345,15 @@ nv.addGraph(function() { d3.select('#graph_problems svg') .datum(problem_stats) .call(chart); + // Hide bars with 0 height after rendering + chart.dispatch.on('renderEnd', function() { + d3.selectAll('#graph_problems .nv-bar').each(function(d) { + if (d.value === 0) { + d3.select(this).attr('height', 0); + d3.select(this).attr('y', chart.yAxis.scale()(0)); + } + }); + }); nv.utils.windowResize(chart.update); return chart; });