1 package org.codehaus.mojo.dashboard.report.plugin.chart;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 import java.util.Iterator;
20 import java.util.Map;
21 import java.util.ResourceBundle;
22
23 import org.codehaus.mojo.dashboard.report.plugin.beans.CoberturaReportBean;
24
25
26
27
28
29
30 public class CoberturaBarChartStrategy extends AbstractCategoryChartStrategy
31 {
32
33
34
35
36
37
38
39 public CoberturaBarChartStrategy( ResourceBundle bundle, String title, Map datas )
40 {
41 super( bundle, title, datas );
42 }
43
44
45
46
47 public void fillDataset()
48 {
49
50 if( datas != null && !datas.isEmpty())
51 {
52 Iterator iter = datas.keySet().iterator();
53
54 while(iter.hasNext()){
55 String key = (String)iter.next();
56 CoberturaReportBean coberReportBean = (CoberturaReportBean)datas.get( key );
57
58 String linecover = this.bundle.getString( "report.cobertura.label.linecover" );
59 String branchcover = this.bundle.getString( "report.cobertura.label.branchcover" );
60 defaultdataset.addValue( coberReportBean.getLineCoverRate(), linecover, key );
61 defaultdataset.addValue( coberReportBean.getBranchCoverRate(), branchcover, key );
62 }
63 }
64
65 }
66
67
68
69
70 public String getXAxisLabel()
71 {
72 return this.bundle.getString( "report.cobertura.label.coverage" );
73 }
74
75 }