def barchart_data(): if request.method == 'POST': picked_idx = [request.json['picked_sn'] - 1] selected_idx = request.json['selected_sn'] selected_idx = [num - 1 for num in selected_idx] barchart_data = calc_barchart_data(picked_idx, selected_idx) return barchart_data