/** * Resets the display. */ @Override void resetUI() { super.resetUI(); XYPlot xyPlot = mChart.getXYPlot(); xyPlot.getRangeAxis().setVisible(false); mTooltipGenerator = new CustomXYToolTipGenerator(); @SuppressWarnings("unchecked") List<String>[] mTooltipsTmp = new List[NUM_SERIES]; mTooltips = mTooltipsTmp; XYBarRenderer br = new XYBarRenderer(); br.setUseYInterval(true); mDatasets = new TimePeriodValues[NUM_SERIES]; TimePeriodValuesCollection tpvc = new YIntervalTimePeriodValuesCollection(1); xyPlot.setDataset(tpvc); xyPlot.setRenderer(br); for (int i = 0; i < NUM_SERIES; i++) { br.setSeriesPaint(i, SERIES_COLORS[i]); mDatasets[i] = new TimePeriodValues(SERIES_NAMES[i]); tpvc.addSeries(mDatasets[i]); mTooltips[i] = new ArrayList<String>(); mTooltipGenerator.addToolTipSeries(mTooltips[i]); br.setSeriesToolTipGenerator(i, mTooltipGenerator); } }
/** * Resets the display. */ @Override void resetUI() { super.resetUI(); XYPlot xyPlot = mChart.getXYPlot(); XYBarRenderer br = new XYBarRenderer(); mDatasetsSync = new TimePeriodValues[NUM_AUTHS]; @SuppressWarnings("unchecked") List<String> mTooltipsSyncTmp[] = new List[NUM_AUTHS]; mTooltipsSync = mTooltipsSyncTmp; mTooltipGenerators = new CustomXYToolTipGenerator[NUM_AUTHS]; TimePeriodValuesCollection tpvc = new TimePeriodValuesCollection(); xyPlot.setDataset(tpvc); xyPlot.setRenderer(0, br); XYLineAndShapeRenderer ls = new XYLineAndShapeRenderer(); ls.setBaseLinesVisible(false); mDatasetsSyncTickle = new TimeSeries[NUM_AUTHS]; TimeSeriesCollection tsc = new TimeSeriesCollection(); xyPlot.setDataset(1, tsc); xyPlot.setRenderer(1, ls); mDatasetError = new TimeSeries("Errors", FixedMillisecond.class); xyPlot.setDataset(2, new TimeSeriesCollection(mDatasetError)); XYLineAndShapeRenderer errls = new XYLineAndShapeRenderer(); errls.setBaseLinesVisible(false); errls.setSeriesPaint(0, Color.RED); xyPlot.setRenderer(2, errls); for (int i = 0; i < NUM_AUTHS; i++) { br.setSeriesPaint(i, AUTH_COLORS[i]); ls.setSeriesPaint(i, AUTH_COLORS[i]); mDatasetsSync[i] = new TimePeriodValues(AUTH_NAMES[i]); tpvc.addSeries(mDatasetsSync[i]); mTooltipsSync[i] = new ArrayList<String>(); mTooltipGenerators[i] = new CustomXYToolTipGenerator(); br.setSeriesToolTipGenerator(i, mTooltipGenerators[i]); mTooltipGenerators[i].addToolTipSeries(mTooltipsSync[i]); mDatasetsSyncTickle[i] = new TimeSeries(AUTH_NAMES[i] + " tickle", FixedMillisecond.class); tsc.addSeries(mDatasetsSyncTickle[i]); ls.setSeriesShape(i, ShapeUtilities.createUpTriangle(2.5f)); } }
/** * Check to ensure that this class implements PublicCloneable. */ public void testPublicCloneable() { CustomXYToolTipGenerator g1 = new CustomXYToolTipGenerator(); assertTrue(g1 instanceof PublicCloneable); }