OpenConcerto

Dépôt officiel du code source de l'ERP OpenConcerto
sonarqube

svn://code.openconcerto.org/openconcerto

Rev

Rev 18 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 18 Rev 83
Line 44... Line 44...
44
        for (String label : labels) {
44
        for (String label : labels) {
45
            chart.addLabel(new Label(label));
45
            chart.addLabel(new Label(label));
46
        }
46
        }
47
 
47
 
48
        ChartPanel p = new ChartPanel(chart);
48
        ChartPanel p = new ChartPanel(chart);
49
        this.setOpaque(true);
49
        p.setOpaque(false);
50
        this.setBackground(Color.WHITE);
50
        this.setBackground(Color.WHITE);
51
        this.add(p);
51
        this.add(p);
52
 
-
 
53
    }
52
    }
54
 
53
 
55
    protected void updateDataset(List<String> labels, List<Number> values) {
54
    protected void updateDataset(List<String> labels, List<Number> values) {
56
 
55
 
57
        SQLTable tableVFElement = Configuration.getInstance().getDirectory().getElement("SAISIE_VENTE_FACTURE_ELEMENT").getTable();
56
        SQLTable tableVFElement = Configuration.getInstance().getDirectory().getElement("SAISIE_VENTE_FACTURE_ELEMENT").getTable();
Line 61... Line 60...
61
 
60
 
62
        sel.addSelect(tableVFElement.getField(field));
61
        sel.addSelect(tableVFElement.getField(field));
63
 
62
 
64
        sel.addSelectFunctionStar("COUNT");
63
        sel.addSelectFunctionStar("COUNT");
65
        final SQLDataSource dataSource = Configuration.getInstance().getBase().getDataSource();
64
        final SQLDataSource dataSource = Configuration.getInstance().getBase().getDataSource();
-
 
65
        @SuppressWarnings("unchecked")
66
        List<Object[]> rowsArticle = (List<Object[]>) dataSource.execute(sel.asString() + " GROUP BY \"SAISIE_VENTE_FACTURE_ELEMENT\".\"" + field + "\"", new ArrayListHandler());
66
        List<Object[]> rowsArticle = (List<Object[]>) dataSource.execute(sel.asString() + " GROUP BY \"SAISIE_VENTE_FACTURE_ELEMENT\".\"" + field + "\"", new ArrayListHandler());
67
 
67
 
68
        Collections.sort(rowsArticle, new Comparator<Object[]>() {
68
        Collections.sort(rowsArticle, new Comparator<Object[]>() {
69
            @Override
69
            @Override
70
            public int compare(Object[] o1, Object[] o2) {
70
            public int compare(Object[] o1, Object[] o2) {