public void onSelect$poste_travail() throws SQLException { message.setValue(""); String poste = (String) map_poste.get((String) poste_travail.getSelectedItem().getLabel()); CategoryModel catmodel = new SimpleCategoryModel(); List charts = new ArrayList<CategoryModel>(); StatMoyFamillePosteBean cpb; Iterator it; StatCotationEmployeModel cotationMoel = new StatCotationEmployeModel(); List sect_items = cotationMoel.getListPosteMoyFam(poste); it = sect_items.iterator(); if (sect_items.size() > 0) { mychart.setVisible(true); while (it.hasNext()) { cpb = (StatMoyFamillePosteBean) it.next(); catmodel.setValue(cpb.getFamille(), "Familles de compétence", cpb.getMoy_famille()); // catmodel.setValue("IMI","indice de maitrise individuel",3); mychart.setModel(catmodel); } catmodel.setValue("IMG", "Indice de maitrise global", cotationMoel.getIMGParPoste(poste)); mychart.setModel(catmodel); ChartEngine d = mychart.getEngine(); image = d.drawChart(mychart); } else { message.setVisible(true); message.setValue("Pas de résultat à afficher"); mychart.setVisible(false); } }
@Override public void doAfterCompose(Component comp) throws Exception { super.doAfterCompose(comp); ChartModel model = createCategoryModel((List<RequestActivity>) getParam("RequestActivity")); chart.setModel(model); }