Search in sources :

Example 6 with Serie

use of org.ff4j.audit.chart.Serie in project ff4j by ff4j.

the class AbstractEventRepository method renderBarChart.

/**
 * Convert hicount into pieChart.
 *
 * @param hitRatio
 *      current hist ratio
 * @return
 *      pie chart
 */
private BarChart renderBarChart(String title, Map<String, MutableHitCount> hitRatio, List<String> colors) {
    BarChart barChart = new BarChart(title);
    int idxColor = 0;
    for (String key : hitRatio.keySet()) {
        Serie<Integer> bar = new Serie<Integer>(key, new Double(hitRatio.get(key).get()).intValue(), colors.get(idxColor));
        barChart.getChartBars().add(bar);
        idxColor++;
    }
    orderBarDecrecent(barChart);
    return barChart;
}
Also used : BarChart(org.ff4j.audit.chart.BarChart) Serie(org.ff4j.audit.chart.Serie)

Aggregations

Serie (org.ff4j.audit.chart.Serie)6 Test (org.junit.Test)3 MutableHitCount (org.ff4j.audit.MutableHitCount)2 BarChart (org.ff4j.audit.chart.BarChart)2 PieChart (org.ff4j.audit.chart.PieChart)2 TimeSeriesChart (org.ff4j.audit.chart.TimeSeriesChart)2 SimpleDateFormat (java.text.SimpleDateFormat)1 Date (java.util.Date)1 Map (java.util.Map)1 TreeMap (java.util.TreeMap)1 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)1 Event (org.ff4j.audit.Event)1 EventBuilder (org.ff4j.audit.EventBuilder)1 EventSeries (org.ff4j.audit.EventSeries)1