Search in sources :

Example 1 with EventStatistics

use of nl.tudelft.watchdog.core.logic.event.EventStatistics in project watchdog by TestRoots.

the class WatchDogView method createDebugEventGanttChart.

private JFreeChart createDebugEventGanttChart() {
    eventStatistics = new EventStatistics(InitializationManager.getInstance().getTrackingEventManager(), selectedDebugInterval);
    GanttCategoryDataset dataset = eventStatistics.createDebugEventGanttChartDataset();
    JFreeChart chart = ChartFactory.createGanttChart("Debug Events During Selected Debug Interval", "Event", "Time", dataset, false, true, false);
    // Scale the chart based on the selected debug interval.
    CategoryPlot plot = chart.getCategoryPlot();
    ValueAxis axis = plot.getRangeAxis();
    axis.setRangeWithMargins(selectedDebugInterval.getStart().getTime() - EventStatistics.PRE_SESSION_TIME_TO_INCLUDE, selectedDebugInterval.getEnd().getTime());
    // Give each event type a different color.
    plot.setRenderer(new WatchDogGanttRenderer());
    return chart;
}
Also used : ValueAxis(org.jfree.chart.axis.ValueAxis) EventStatistics(nl.tudelft.watchdog.core.logic.event.EventStatistics) GanttCategoryDataset(org.jfree.data.gantt.GanttCategoryDataset) JFreeChart(org.jfree.chart.JFreeChart) CategoryPlot(org.jfree.chart.plot.CategoryPlot)

Example 2 with EventStatistics

use of nl.tudelft.watchdog.core.logic.event.EventStatistics in project watchdog by TestRoots.

the class WatchDogView method createDebugEventGanttChart.

private JFreeChart createDebugEventGanttChart() {
    eventStatistics = new EventStatistics(InitializationManager.getInstance(WatchDogUtils.getProject()).getTrackingEventManager(), selectedDebugInterval);
    GanttCategoryDataset dataset = eventStatistics.createDebugEventGanttChartDataset();
    JFreeChart chart = ChartFactory.createGanttChart("Debug Events During Selected Debug Interval", "Event", "Time", dataset, false, true, false);
    // Scale the chart based on the selected debug interval.
    CategoryPlot plot = chart.getCategoryPlot();
    ValueAxis axis = plot.getRangeAxis();
    axis.setRangeWithMargins(selectedDebugInterval.getStart().getTime() - EventStatistics.PRE_SESSION_TIME_TO_INCLUDE, selectedDebugInterval.getEnd().getTime());
    // Give each event type a different color.
    plot.setRenderer(new WatchDogGanttRenderer());
    return chart;
}
Also used : ValueAxis(org.jfree.chart.axis.ValueAxis) EventStatistics(nl.tudelft.watchdog.core.logic.event.EventStatistics) GanttCategoryDataset(org.jfree.data.gantt.GanttCategoryDataset) JFreeChart(org.jfree.chart.JFreeChart) CategoryPlot(org.jfree.chart.plot.CategoryPlot)

Aggregations

EventStatistics (nl.tudelft.watchdog.core.logic.event.EventStatistics)2 JFreeChart (org.jfree.chart.JFreeChart)2 ValueAxis (org.jfree.chart.axis.ValueAxis)2 CategoryPlot (org.jfree.chart.plot.CategoryPlot)2 GanttCategoryDataset (org.jfree.data.gantt.GanttCategoryDataset)2