gt: 		barModel = initBarModel(idMatch);
context: package bean;
  
  import java.util.ArrayList;
  import java.util.Collections;
  import java.util.HashMap;
  import java.util.List;
  import java.util.Map;
  import java.util.Map.Entry;
  
  import javax.ejb.EJB;
  import javax.enterprise.context.SessionScoped;
  import javax.faces.bean.ApplicationScoped;
  import javax.faces.bean.ManagedBean;
  
  import org.primefaces.model.chart.Axis;
  import org.primefaces.model.chart.AxisType;
  import org.primefaces.model.chart.BarChartModel;
  import org.primefaces.model.chart.ChartSeries;
  
  import domain.MatchSingle;
  import domain.Point;
  import domain.SetMatch;
  import enumeration.PointType;
  import services.implementes.PointServices;
  import services.interfaces.PointServicesLocal;
  import services.interfaces.SetServicesLocal;
  import services.interfaces.basic.ServicesBasicLocal;
  
  @ManagedBean
  @ApplicationScoped
  public class Statistics {
  	static String SET = "SET ";
  	private BarChartModel barModel;
  
  	@EJB
  	PointServicesLocal pointServices = new PointServices();
  	@EJB
  	ServicesBasicLocal<MatchSingle> servicesBasicMatch;
  	@EJB
  	SetServicesLocal setServices;
  
  	@EJB
  	ServicesBasicLocal<SetMatch> servicesBasicSets;
  
  	List<SetMatch> setsMatch;
  	String playerOne = null;
  	String playerTwo = null;
  	MatchSingle match = null;
  
  	List<Point> listPointPlayer1 = new ArrayList<>();
  	List<Point> listPointPlayer2 = new ArrayList<>();
  
  	Map<PointType, Integer> listPointPlayer1Regroupe;
  	Map<PointType, Integer> listPointPlayer2Regroupe;
  
  	String setNumber;
  	int i = 0;
  
  	public String getSetNumber() {
  
  		return SET + (++i) + "";
  	}
  
  	public String getPlayerOne() {
  		return playerOne;
  	}
  
  	public String getPlayerTwo() {
  		return playerTwo;
  	}
  
  	public List<Point> getListPointPlayer1() {
  		return listPointPlayer1;
  	}
  
  	public List<Point> getListPointPlayer2() {
  		return listPointPlayer2;
  	}
  
  	public String init(Integer id) {
  
  		createBarModels(id);
  		return "matchDetails.jsf?faces-redirect=true";
  
  	}
  
  	public BarChartModel getBarModel() {
  
  		return barModel;
  	}
  
  	/**
  	 * @return BarChartModel
  	 * @param
  	 */
  	private BarChartModel initBarModel(Integer idMatch) {
  
  		BarChartModel model = new BarChartModel();
  
  		ChartSeries playertwoChart = new ChartSeries();
  
  		ChartSeries playerOneChart = new ChartSeries();
  
  		match = servicesBasicMatch.findById(idMatch, MatchSingle.class);
  		System.out.println("matchid    " + match.getPlayer().getId());
  
  		List<Point> points = pointServices.findAllPointsByMatch(idMatch);
  		System.out.println(points.size());
  
  		if (match instanceof MatchSingle) {
  			playerOne = ((MatchSingle) match).getPlayer().getFullName();
  			playerTwo = ((MatchSingle) match).getPlayer2().getFullName();
  		}
  
  		playerOneChart.setLabel(playerOne);
  
  		playertwoChart.setLabel(playerTwo);
  
  		for (Point point : points) {
  
  			if (point.getPlayer().getFullName().equals(playerOne)) {
  
  				listPointPlayer1.add(point);
  
  			} else if ((point.getPlayer().getFullName().equals(playerTwo))) {
  
  				listPointPlayer2.add(point);
  			}
  		}
  
  		listPointPlayer1Regroupe = CountPointByType(listPointPlayer1);
  		listPointPlayer2Regroupe = CountPointByType(listPointPlayer2);
  		for (Entry<PointType, Integer> entry : listPointPlayer1Regroupe.entrySet()) {
  
  			playerOneChart.set(entry.getKey(), entry.getValue().intValue());
  		}
  		for (Entry<PointType, Integer> entry : listPointPlayer2Regroupe.entrySet()) {
  
  			playertwoChart.set(entry.getKey(), entry.getValue().intValue());
  		}
  
  		model.addSeries(playerOneChart);
  		model.addSeries(playertwoChart);
  
  		return model;
  	}
  
  	public MatchSingle getMatch() {
  
  		return match;
  	}
  
  	public void setBarModel(BarChartModel barModel) {
  		this.barModel = barModel;
  	}
  
  	public void setSetsMatch(List<SetMatch> setsMatch) {
  		this.setsMatch = setsMatch;
  	}
  
  	public void setPlayerOne(String playerOne) {
  		this.playerOne = playerOne;
  	}
  
  	public void setPlayerTwo(String playerTwo) {
  		this.playerTwo = playerTwo;
  	}
  
  	public void setMatch(MatchSingle match) {
  		this.match = match;
  	}
  
  	public void setListPointPlayer1(List<Point> listPointPlayer1) {
  		this.listPointPlayer1 = listPointPlayer1;
  	}
  
  	public void setListPointPlayer2(List<Point> listPointPlayer2) {
  		this.listPointPlayer2 = listPointPlayer2;
  	}
  
  	public void setSetNumber(String setNumber) {
  		this.setNumber = setNumber;
  	}
  
  	private Map<PointType, Integer> CountPointByType(List<Point> listPointPlayer1) {
  		Map<PointType, Integer> mapPoint = new HashMap<>();
  
  		Integer countAce = 0;
  		Integer countBACKHAND = 0;
  		Integer countDOUBLE_FAULT = 0;
  		Integer countFAULT = 0;
  		Integer countFIRST_SERVE = 0;
  		Integer countFOREHAND = 0;
  		Integer countSLICE = 0;
  
  		for (Point point : listPointPlayer1) {
  			if (point != null) {
  				switch (point.getPointType()) {
  				case ACE:
  					countAce++;
  					break;
  				case BACKHAND:
  					countBACKHAND++;
  					break;
  
  				case DOUBLE_FAULT:
  					countDOUBLE_FAULT++;
  					break;
  				case FAULT:
  					countFAULT++;
  					break;
  				case FIRST_SERVE:
  					countFIRST_SERVE++;
  					break;
  
  				case FOREHAND:
  					countFOREHAND++;
  					break;
  
  				case SLICE:
  					countSLICE++;
  					break;
  
  				default:
  					break;
  				}
  			}
  		}
  
  		mapPoint.put(PointType.ACE, countAce);
  		mapPoint.put(PointType.BACKHAND, countBACKHAND);
  
  		mapPoint.put(PointType.DOUBLE_FAULT, countDOUBLE_FAULT);
  		mapPoint.put(PointType.FAULT, countFAULT);
  		mapPoint.put(PointType.FIRST_SERVE, countFIRST_SERVE);
  
  		mapPoint.put(PointType.FOREHAND, countFOREHAND);
  
  		mapPoint.put(PointType.SLICE, countSLICE);
  
  		System.out.println("MAp :: " + mapPoint.toString());
  		return mapPoint;
  	}
  
  	private void createBarModels(Integer id) {
  		createBarModel(id);
  
  	}
  
  	/**
  	 * @return Void
  	 */
  	private void createBarModel(Integer idMatch) {
  
  