From b5ab089fb383610596b60f92343e045311e0866b Mon Sep 17 00:00:00 2001 From: zhiyang7 Date: Mon, 27 Dec 2021 18:00:04 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=88=87=E6=8D=A2=E6=8C=89?= =?UTF-8?q?=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- static/charts.html | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/static/charts.html b/static/charts.html index 0a1d51a..9943260 100644 --- a/static/charts.html +++ b/static/charts.html @@ -4,6 +4,11 @@ +
@@ -14,9 +19,9 @@ 'landlord_front': '地主对家', 'landlord_up': '地主上家', } - $(document).ready(function () { + function load_charts(model_type){ $.ajax({ - url: "metrics?type=lite_resnet", + url: "metrics?type=" + model_type, success: function (result) { result = result.result var i = 0 @@ -62,7 +67,7 @@ if (result[rank][position].hasOwnProperty(frame)) { return [[frame, (parseFloat(result[rank][position][frame].wp) * 100)]] } else { - return [[frame, '-']] + return [[frame, null]] } }) }, { @@ -78,7 +83,7 @@ if (result[rank][position].hasOwnProperty(frame)) { return [[frame, parseFloat(result[rank][position][frame].adp)]] } else { - return [[frame, '-']] + return [[frame, null]] } }) }] @@ -96,9 +101,6 @@ }, opposite: true }]; - json.tooltip = { - shared: true - }; json.legend = { layout: 'vertical', align: 'right', @@ -110,6 +112,12 @@ } } }); + } + $(document).ready(function () { + load_charts("lite_resnet"); + $("#model_type").on('change', function(){ + load_charts($("#model_type").val()) + }) });