@SuppressWarnings("unchecked")
    public String getTeamRadarChart() {
        PreparedStatement st = null;
        ResultSet rs = null;
        JSONArray json = new JSONArray();
        try {
            conn = dbconn.getConnection();
            st = conn.prepareStatement("SELECT sum(auton_top)*6 + sum(auton_middle)*4  + sum(auton_bottom)*2 as auton, sum(teleop_top)*3 + sum(teleop_middle)*2 + sum(teleop_bottom) + sum(teleop_pyramid)*5 as teleop, sum(pyramid_level)*10 as climb FROM match_record_2013 where team_id = ?");
            st.setInt(1, getSelectedTeam());
            rs = st.executeQuery();
            if (rs.next()) {
                JSONObject o1 = new JSONObject();
                o1.put("category", "autonomous");
                o1.put("total", rs.getInt("auton"));
                json.add(o1);
                JSONObject o2 = new JSONObject();
                 o2.put("category", "teleop");
                 o2.put("total", rs.getInt("teleop"));
                 json.add(o2);
                JSONObject o3 = new JSONObject();
                 o3.put("category", "climb");
                 o3.put("total", rs.getInt("climb"));
                 json.add(o3);
            }
        } catch (SQLException e) {
            e.printStackTrace();
        } finally {
            try{
                conn.close();
                st.close();
                rs.close();
            }catch (SQLException e) {
                System.out.println("Error closing query");
            }
        }
        return json.toString();
    }