List of usage examples for org.jfree.chart.renderer.xy XYBarRenderer setSeriesOutlinePaint
public void setSeriesOutlinePaint(int series, Paint paint)
From source file:mt.DisplayHistogram.java
protected static JFreeChart createChart(final IntervalXYDataset dataset, final String title, final String units) { final JFreeChart chart = ChartFactory.createXYBarChart(title, "Lifetime [" + units + "]", false, "Count", dataset, PlotOrientation.VERTICAL, false, // legend false, false);/* www. java 2 s .c o m*/ NumberAxis range = (NumberAxis) chart.getXYPlot().getDomainAxis(); range.setRange(getMin(), getMax()); XYPlot plot = chart.getXYPlot(); XYBarRenderer renderer = (XYBarRenderer) plot.getRenderer(); renderer.setSeriesPaint(0, Color.red); renderer.setDrawBarOutline(true); renderer.setSeriesOutlinePaint(0, Color.black); renderer.setBarPainter(new StandardXYBarPainter()); return chart; }
From source file:net.imglib2.script.analysis.Histogram.java
static private final void setTheme(final JFreeChart chart) { XYPlot plot = (XYPlot) chart.getPlot(); XYBarRenderer r = (XYBarRenderer) plot.getRenderer(); StandardXYBarPainter bp = new StandardXYBarPainter(); r.setBarPainter(bp);/*from w ww . j a v a2 s . c o m*/ r.setSeriesOutlinePaint(0, Color.lightGray); r.setShadowVisible(false); r.setDrawBarOutline(false); setBackgroundDefault(chart); }
From source file:com.hmsinc.epicenter.webapp.chart.ChartService.java
/** * @param chart//from w ww .jav a2s. c om * @return */ private static XYBarRenderer getTimeSeriesBarRenderer(final AbstractChart chart) { final XYBarRenderer renderer = new XYBarRenderer(); renderer.setMargin(0.2); for (int i = 0; i < chart.getColors().size(); i++) { final Color c = chart.getColors().get(i); renderer.setSeriesPaint(i, new GradientPaint(0f, 0f, c, 0f, 0f, c.brighter().brighter())); renderer.setSeriesOutlinePaint(i, c); } return renderer; }
From source file:beadAnalyzer.DrawPoints.java
protected JFreeChart createChart(final IntervalXYDataset dataset, final String title, final String units) { final JFreeChart chart = ChartFactory.createXYBarChart(title, "Pixel [" + units + "]", false, "Count", dataset, PlotOrientation.VERTICAL, false, // legend false, false);//from w ww . j a va 2 s . c o m NumberAxis range = (NumberAxis) chart.getXYPlot().getDomainAxis(); range.setRange(getMin(), getMax()); XYPlot plot = chart.getXYPlot(); XYBarRenderer renderer = (XYBarRenderer) plot.getRenderer(); renderer.setSeriesPaint(0, Color.red); renderer.setDrawBarOutline(true); renderer.setSeriesOutlinePaint(0, Color.black); renderer.setBarPainter(new StandardXYBarPainter()); return chart; }
From source file:org.knime.knip.core.ui.imgviewer.panels.HistogramBC.java
private final void setTheme(final JFreeChart chart) { final XYPlot plot = (XYPlot) chart.getPlot(); final XYBarRenderer r = (XYBarRenderer) plot.getRenderer(); final StandardXYBarPainter bp = new StandardXYBarPainter(); r.setBarPainter(bp);//from www . j av a2 s . c o m // set Bar Color r.setSeriesPaint(0, Color.gray); r.setSeriesOutlinePaint(0, Color.gray); r.setShadowVisible(false); r.setDrawBarOutline(true); setBackgroundDefault(chart); final NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis(); // rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits()); rangeAxis.setTickLabelsVisible(false); rangeAxis.setTickMarksVisible(false); final NumberAxis domainAxis = (NumberAxis) plot.getDomainAxis(); domainAxis.setTickLabelsVisible(false); domainAxis.setTickMarksVisible(false); }
From source file:sim.util.media.chart.HistogramSeriesAttributes.java
public void rebuildGraphicsDefinitions() { XYBarRenderer renderer = (XYBarRenderer) (((XYPlot) getPlot()).getRenderer()); if (thickness == 0.0) renderer.setDrawBarOutline(false); else {//w w w .j av a2s . com renderer.setSeriesOutlineStroke(getSeriesIndex(), new BasicStroke(thickness)); renderer.setDrawBarOutline(true); } renderer.setSeriesPaint(getSeriesIndex(), reviseColor(fillColor, fillOpacity)); renderer.setSeriesOutlinePaint(getSeriesIndex(), reviseColor(strokeColor, lineOpacity)); repaint(); }
From source file:edu.gmu.cs.sim.util.media.chart.HistogramSeriesAttributes.java
public void rebuildGraphicsDefinitions() { XYBarRenderer renderer = (XYBarRenderer) (((XYPlot) getPlot()).getRenderer()); if (thickness == 0.0) { renderer.setDrawBarOutline(false); } else {/*from w ww.ja v a 2 s. co m*/ renderer.setSeriesOutlineStroke(getSeriesIndex(), new BasicStroke(thickness)); renderer.setDrawBarOutline(true); } renderer.setSeriesPaint(getSeriesIndex(), reviseColor(fillColor, fillOpacity)); renderer.setSeriesOutlinePaint(getSeriesIndex(), reviseColor(strokeColor, lineOpacity)); repaint(); }
From source file:net.sourceforge.processdash.ui.web.psp.TimeLogPhaseWaterfallChart.java
private JFreeChart createChart(IntervalXYDataset dataset, ProcessUtil process, List<String> phases, GapSkipTracker gaps) {// ww w .j av a2 s. c o m JFreeChart result = ChartFactory.createXYBarChart(null, null, true, null, dataset, PlotOrientation.VERTICAL, false, true, false); XYPlot xyplot = (XYPlot) result.getPlot(); DateAxis dateAxis = new DateAxis(null); dateAxis.setTickMarksVisible(false); dateAxis.setTickLabelsVisible(false); dateAxis.setLowerMargin(0.01); dateAxis.setUpperMargin(0.01); setupGaps(gaps, dateAxis, xyplot); xyplot.setDomainAxis(dateAxis); String[] phaseNameList = new String[phases.size()]; for (int i = 0; i < phaseNameList.length; i++) phaseNameList[i] = Translator.translate(phases.get(i)); SymbolAxis symbolaxis = new SymbolAxis(null, phaseNameList); symbolaxis.setGridBandsVisible(false); xyplot.setRangeAxis(symbolaxis); final XYBarRenderer renderer = (XYBarRenderer) xyplot.getRenderer(); renderer.setUseYInterval(true); renderer.setDrawBarOutline(true); renderer.setBaseOutlinePaint(Color.black); new PhaseChartColorer(process, phases) { public void setItemColor(Object key, int pos, Color c) { renderer.setSeriesPaint(pos, c); } }.run(); int exceptionSeries = dataset.getSeriesCount() - 1; renderer.setSeriesPaint(exceptionSeries, EXCEPTION_PAINT); renderer.setSeriesFillPaint(exceptionSeries, EXCEPTION_PAINT); renderer.setSeriesOutlinePaint(exceptionSeries, EXCEPTION_PAINT); renderer.setBaseToolTipGenerator(new TooltipGenerator()); xyplot.setBackgroundPaint(Color.white); xyplot.setDomainGridlinesVisible(false); xyplot.setRangeGridlinePaint(Color.lightGray); xyplot.setDrawingSupplier(DRAWING_SUPPLIER_FACTORY.newDrawingSupplier()); result.setAntiAlias(false); result.setTextAntiAlias(true); parameters.put("title", resources.getString("Title")); return result; }
From source file:com.rapidminer.gui.new_plotter.engine.jfreechart.ChartRendererFactory.java
private static void configureXYBarRenderer(XYBarRenderer renderer, ValueSource valueSource, PlotInstance plotInstance) {// w w w .j av a 2 s . co m StandardXYBarPainter barPainter = new StandardXYBarPainter(); renderer.setBarPainter(barPainter); renderer.setGradientPaintTransformer(null); SeriesFormat seriesFormat = valueSource.getSeriesFormat(); DimensionConfig domainConfig = valueSource.getDomainConfig(); ValueSourceData valueSourceData = plotInstance.getPlotData().getValueSourceData(valueSource); int seriesCount; if (valueSourceData != null) { seriesCount = valueSourceData.getSeriesCount(); } else { seriesCount = 0; } DimensionConfig colorDimensionConfig = plotInstance.getCurrentPlotConfigurationClone() .getDimensionConfig(PlotDimension.COLOR); // don't need shapeDimensionConfig, since the shape can't be represented for bars. // Loop all series and set series format. // Format based on dimension configs will be set later on in initFormatDelegate(). for (int seriesIdx = 0; seriesIdx < seriesCount; ++seriesIdx) { // configure series paint if necessary if (!SeriesFormat.calculateIndividualFormatForEachItem(domainConfig, colorDimensionConfig)) { renderer.setSeriesPaint(seriesIdx, seriesFormat.getAreaFillPaint()); } // configure general style of the bars renderer.setShadowVisible(false); renderer.setSeriesOutlinePaint(seriesIdx, PlotConfiguration.DEFAULT_SERIES_OUTLINE_PAINT); } renderer.setDrawBarOutline(true); }
From source file:desmoj.extensions.visualization2d.engine.modelGrafic.StatisticGrafic.java
/** * Build content for animationType StatisticGrafic.ANIMATION_Histogram * @return//from ww w . j ava2 s.c o m * @throws ModelException */ private JPanel buildHistogramPanel() throws ModelException { XIntervalSeriesCollection dataset = new XIntervalSeriesCollection(); dataset.addSeries(this.statistic.getHistogram()); this.chart = ChartFactory.createXYBarChart(null, "Observation", false, "Count", dataset, PlotOrientation.VERTICAL, false, true, false); this.chart.setBackgroundPaint(Grafic.COLOR_BACKGROUND); XYPlot plot = this.chart.getXYPlot(); plot.setBackgroundPaint(StatisticGrafic.DIAGRAM_BACKGROUND); plot.setDomainGridlinePaint(StatisticGrafic.DIAGRAM_GRID); plot.setRangeGridlinePaint(StatisticGrafic.DIAGRAM_GRID); plot.setDomainCrosshairVisible(true); plot.setRangeCrosshairVisible(true); ValueAxis rangeAxis = (ValueAxis) plot.getRangeAxis(); rangeAxis.setLabelFont(Grafic.FONT_DEFAULT); ValueAxis domainAxis = plot.getDomainAxis(); domainAxis.setLabelFont(Grafic.FONT_DEFAULT); domainAxis.setAutoRange(true); XYBarRenderer renderer = (XYBarRenderer) plot.getRenderer(); renderer.setShadowVisible(false); renderer.setBarPainter(new StandardXYBarPainter()); renderer.setDrawBarOutline(true); renderer.setSeriesPaint(0, StatisticGrafic.DIAGRAM_FORGROUND); renderer.setSeriesOutlinePaint(0, StatisticGrafic.DIAGRAM_BORDER); renderer.setSeriesOutlineStroke(0, new BasicStroke(1.0f)); this.buildHistogramAxisFormat(plot, "Observations"); JPanel out = new ChartPanel(chart); out.setPreferredSize(new Dimension(350, 200)); return out; }