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()) + }) });