org.jfree.chart.renderer.xy.ClusteredXYBarRenderer Java Examples
The following examples show how to use
org.jfree.chart.renderer.xy.ClusteredXYBarRenderer.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ClusteredXYBarRendererTests.java From astor with GNU General Public License v2.0 | 5 votes |
/** * Two objects that are equal are required to return the same hashCode. */ public void testHashcode() { ClusteredXYBarRenderer r1 = new ClusteredXYBarRenderer(); ClusteredXYBarRenderer r2 = new ClusteredXYBarRenderer(); assertTrue(r1.equals(r2)); int h1 = r1.hashCode(); int h2 = r2.hashCode(); assertEquals(h1, h2); }
Example #2
Source File: ClusteredXYBarRendererTests.java From astor with GNU General Public License v2.0 | 5 votes |
/** * Two objects that are equal are required to return the same hashCode. */ public void testHashcode() { ClusteredXYBarRenderer r1 = new ClusteredXYBarRenderer(); ClusteredXYBarRenderer r2 = new ClusteredXYBarRenderer(); assertTrue(r1.equals(r2)); int h1 = r1.hashCode(); int h2 = r2.hashCode(); assertEquals(h1, h2); }
Example #3
Source File: HistogramChart.java From mzmine3 with GNU General Public License v2.0 | 4 votes |
public HistogramChart() { super(ChartFactory.createHistogram("", // title "", // x-axis label "", // y-axis label null, // data set PlotOrientation.VERTICAL, // orientation true, // create legend false, // generate tooltips false // generate URLs )); // initialize the chart by default time series chart from factory chart = getChart(); // title chartTitle = chart.getTitle(); chartTitle.setFont(titleFont); chartTitle.setMargin(5, 0, 0, 0); chartSubTitle = new TextTitle(); chartSubTitle.setFont(subTitleFont); chartSubTitle.setMargin(5, 0, 0, 0); chart.addSubtitle(chartSubTitle); // legend constructed by ChartFactory LegendTitle legend = chart.getLegend(); legend.setItemFont(legendFont); legend.setFrame(BlockBorder.NONE); chart.setBackgroundPaint(Color.white); // disable maximum size (we don't want scaling) // setMaximumDrawWidth(Integer.MAX_VALUE); // setMaximumDrawHeight(Integer.MAX_VALUE); // set the plot properties plot = chart.getXYPlot(); plot.setBackgroundPaint(Color.white); plot.setAxisOffset(new RectangleInsets(5.0, 5.0, 5.0, 5.0)); plot.setDatasetRenderingOrder(DatasetRenderingOrder.REVERSE); plot.setSeriesRenderingOrder(SeriesRenderingOrder.FORWARD); // set grid properties plot.setDomainGridlinePaint(gridColor); plot.setRangeGridlinePaint(gridColor); // set crosshair (selection) properties plot.setDomainCrosshairVisible(false); plot.setRangeCrosshairVisible(true); // set the logarithmic axis NumberAxis axisDomain = new HistogramDomainAxis(); axisDomain.setMinorTickCount(1); axisDomain.setAutoRange(true); NumberAxis axisRange = new NumberAxis(); axisRange.setMinorTickCount(1); axisRange.setAutoRange(true); plot.setDomainAxis(axisDomain); plot.setRangeAxis(axisRange); ClusteredXYBarRenderer renderer = new ClusteredXYBarRenderer(); renderer.setMargin(marginSize); renderer.setShadowVisible(false); plot.setRenderer(renderer); // this.setMinimumSize(new Dimension(400, 400)); // this.setDismissDelay(Integer.MAX_VALUE); // this.setInitialDelay(0); // reset zoom history ZoomHistory history = getZoomHistory(); if (history != null) history.clear(); }
Example #4
Source File: StlPlotter.java From stl-java with Apache License 2.0 | 4 votes |
private JFreeChart createChart() { final CombinedDomainXYPlot plot = new CombinedDomainXYPlot(new DateAxis("Time")); final XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer(true, false); final ClusteredXYBarRenderer barRenderer = new ClusteredXYBarRenderer(); final GradientPaint black = new GradientPaint(0.0f, 0.0f, Color.black, 0.0f, 0.0f, Color.black); final TimeSeries seriests = new TimeSeries("Series"); final TimeSeries seasonalts = new TimeSeries("Seasonal"); final TimeSeries trendts = new TimeSeries("Trend"); final TimeSeries remainderts = new TimeSeries("Remainder"); final TimeSeries[] tsArray = new TimeSeries[]{seriests, seasonalts, trendts}; final String[] labels = new String[]{"Series", "Seasonal", "Trend"}; for (int i = 0; i < series.length; i++) { final Date d = new Date((long) times[i]); RegularTimePeriod rtp = RegularTimePeriod.createInstance(this.timePeriod, d, TimeZone.getDefault()); seriests.addOrUpdate(rtp, series[i]); seasonalts.addOrUpdate(rtp, seasonal[i]); trendts.addOrUpdate(rtp, trend[i]); remainderts.addOrUpdate(rtp, remainder[i]); } plot.setGap(10.0); renderer.setSeriesPaint(0, black); barRenderer.setSeriesPaint(0, black); plot.setOrientation(PlotOrientation.VERTICAL); for (int i = 0; i < tsArray.length; i++) { final XYDataset ts = new TimeSeriesCollection(tsArray[i]); final XYPlot p = new XYPlot(ts, new DateAxis(labels[i]), new NumberAxis(labels[i]), renderer); plot.add(p); } final XYDataset rts = new TimeSeriesCollection(remainderts); final XYDataset sts = new TimeSeriesCollection(seriests); final XYDataset tts = new TimeSeriesCollection(trendts); final XYPlot rplot = new XYPlot(rts, new DateAxis(), new NumberAxis("Remainder"), barRenderer); final XYPlot seriesAndTrend = new XYPlot(sts, new DateAxis(), new NumberAxis("S & T"), renderer); seriesAndTrend.setDataset(1, tts); seriesAndTrend.setRenderer(1, renderer); plot.add(rplot); plot.add(seriesAndTrend); return new JFreeChart(this.title, JFreeChart.DEFAULT_TITLE_FONT, plot, true); }
Example #5
Source File: HistogramChart.java From mzmine2 with GNU General Public License v2.0 | 4 votes |
public HistogramChart() { super(null, true); // initialize the chart by default time series chart from factory chart = ChartFactory.createHistogram("", // title "", // x-axis label "", // y-axis label null, // data set PlotOrientation.VERTICAL, // orientation true, // create legend false, // generate tooltips false // generate URLs ); // title chartTitle = chart.getTitle(); chartTitle.setFont(titleFont); chartTitle.setMargin(5, 0, 0, 0); chartSubTitle = new TextTitle(); chartSubTitle.setFont(subTitleFont); chartSubTitle.setMargin(5, 0, 0, 0); chart.addSubtitle(chartSubTitle); // legend constructed by ChartFactory LegendTitle legend = chart.getLegend(); legend.setItemFont(legendFont); legend.setFrame(BlockBorder.NONE); chart.setBackgroundPaint(Color.white); setChart(chart); // disable maximum size (we don't want scaling) setMaximumDrawWidth(Integer.MAX_VALUE); setMaximumDrawHeight(Integer.MAX_VALUE); // set the plot properties plot = chart.getXYPlot(); plot.setBackgroundPaint(Color.white); plot.setAxisOffset(new RectangleInsets(5.0, 5.0, 5.0, 5.0)); plot.setDatasetRenderingOrder(DatasetRenderingOrder.REVERSE); plot.setSeriesRenderingOrder(SeriesRenderingOrder.FORWARD); // set grid properties plot.setDomainGridlinePaint(gridColor); plot.setRangeGridlinePaint(gridColor); // set crosshair (selection) properties plot.setDomainCrosshairVisible(false); plot.setRangeCrosshairVisible(true); // set the logarithmic axis NumberAxis axisDomain = new HistogramDomainAxis(); axisDomain.setMinorTickCount(1); axisDomain.setAutoRange(true); NumberAxis axisRange = new NumberAxis(); axisRange.setMinorTickCount(1); axisRange.setAutoRange(true); plot.setDomainAxis(axisDomain); plot.setRangeAxis(axisRange); ClusteredXYBarRenderer renderer = new ClusteredXYBarRenderer(); renderer.setMargin(marginSize); renderer.setShadowVisible(false); plot.setRenderer(renderer); this.setMinimumSize(new Dimension(400, 400)); this.setDismissDelay(Integer.MAX_VALUE); this.setInitialDelay(0); // reset zoom history ZoomHistory history = getZoomHistory(); if (history != null) history.clear(); }
Example #6
Source File: ClusteredXYBarRendererTests.java From astor with GNU General Public License v2.0 | 4 votes |
/** * Verify that this class implements {@link PublicCloneable}. */ public void testPublicCloneable() { ClusteredXYBarRenderer r1 = new ClusteredXYBarRenderer(); assertTrue(r1 instanceof PublicCloneable); }