/** * Initializes the upper plot. * * @return An instance of {@link XYPlot}. */ private XYPlot initializeUpperPlot() { loadedClasses = new YIntervalSeriesImproved("loaded classes"); totalLoadedClasses = new YIntervalSeriesImproved("total loaded classes"); YIntervalSeriesCollection yintervalseriescollection = new YIntervalSeriesCollection(); yintervalseriescollection.addSeries(loadedClasses); yintervalseriescollection.addSeries(totalLoadedClasses); DeviationRenderer renderer = new DeviationRenderer(true, false); renderer.setBaseShapesVisible(true); renderer.setSeriesStroke( 0, new BasicStroke(3.0f, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND)); renderer.setSeriesFillPaint(0, new Color(255, 200, 200)); renderer.setSeriesOutlineStroke(0, new BasicStroke(2.0f)); renderer.setSeriesShape(0, new Ellipse2D.Double(-2.5, -2.5, 5.0, 5.0)); renderer.setBaseToolTipGenerator( new StandardXYToolTipGenerator( StandardXYToolTipGenerator.DEFAULT_TOOL_TIP_FORMAT, DateFormat.getDateTimeInstance(), NumberFormat.getNumberInstance())); final NumberAxis rangeAxis = new NumberAxis("Classes"); rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits()); rangeAxis.setAutoRangeMinimumSize(2000.0d); rangeAxis.setRangeType(RangeType.POSITIVE); rangeAxis.setAutoRangeIncludesZero(true); final XYPlot subplot = new XYPlot(yintervalseriescollection, null, rangeAxis, renderer); subplot.setAxisOffset(new RectangleInsets(5.0, 5.0, 5.0, 5.0)); subplot.setRangeAxisLocation(AxisLocation.TOP_OR_LEFT); subplot.setRangeCrosshairVisible(true); return subplot; }
private IntervalXYDataset getHistrogrammedDataAttributes( String[] attributes, long barsize, long timesize) { IntervalXYDataset dataset = null; if (no_intervals) { dataset = new XYSeriesCollection(); } else { dataset = new YIntervalSeriesCollection(); } for (int index = 0; index < attributes.length; index++) { Histogram histogram = new Histogram(barsize); String attribute = attributes[index]; for (ProcessInstance pi : mylog.getInstances()) { Date begin; try { begin = pi.getAuditTrailEntryList().get(0).getTimestamp(); } catch (Exception e) { Message.add(e.getMessage(), Message.ERROR); return null; } // starting time of process instance int j = 0; for (AuditTrailEntry ate : pi.getListOfATEs()) { if (ate.getAttributes().containsKey(attribute)) { Double val; val = Double.valueOf(ate.getAttributes().get(attribute)); if (xbox.getSelectedIndex() == 2) { histogram.addValue(j, val); } if (xbox.getSelectedIndex() == 3) { histogram.addValue(timediff(begin, ate.getTimestamp()), val); } j++; } } } if (no_intervals) { ((XYSeriesCollection) dataset).addSeries(histogram.getXYSeries(attribute, timesize)); } else { ((YIntervalSeriesCollection) dataset) .addSeries(histogram.getYIntervalSeries(attribute, timesize)); } } return dataset; }