/** * Override this method to specify the color to draw the given area. */ @Override public Paint getItemPaint(int row, int column) { return super.getItemPaint(row, column); }
ar.setSeriesPaint(0, ColorPalette.YELLOW); // Blocked ar.setSeriesPaint(1, ColorPalette.RED); // Failures ar.setSeriesPaint(2, ColorPalette.GREY); // Not Run ar.setSeriesPaint(3, ColorPalette.BLUE); // Pass
if (!isSeriesVisible(row)) { return; double[] stack1 = getStackValues(dataset, row, column, state.getVisibleSeriesArray()); double xx1 = domainAxis.getCategoryMiddle(column, getColumnCount(), dataArea, plot.getDomainAxisEdge()); double[] stack0 = getStackValues(dataset, row, Math.max(column - 1, 0), state.getVisibleSeriesArray()); double xx0 = domainAxis.getCategoryStart(column, getColumnCount(), dataArea, plot.getDomainAxisEdge()); double[] stack2 = getStackValues(dataset, row, Math.min(column + 1, itemCount - 1), state.getVisibleSeriesArray()); double xx2 = domainAxis.getCategoryEnd(column, getColumnCount(), dataArea, plot.getDomainAxisEdge()); double[] stackLeft = averageStackValues(stack0, stack1); double[] stackRight = averageStackValues(stack1, stack2); double[] adjStackLeft = adjustedStackValues(stack0, stack1); double[] adjStackRight = adjustedStackValues(stack1, stack2); Paint itemPaint = getItemPaint(row, column); g2.setPaint(itemPaint); g2.fill(left);
/** * Returns a stacked area renderer. */ private AreaRenderer getStackedAreaRenderer() { StackedAreaRenderer renderer = new StackedAreaRenderer(); for ( int i = 0; i < COLORS.length; i++ ) { renderer.setSeriesPaint( i, COLORS[i] ); } return renderer; }
ValueAxis valueAxis = new NumberAxis(valueAxisLabel); StackedAreaRenderer renderer = new StackedAreaRenderer(); if (tooltips) { renderer.setBaseToolTipGenerator( new StandardCategoryToolTipGenerator()); renderer.setBaseItemURLGenerator( new StandardCategoryURLGenerator());
ValueAxis valueAxis = new NumberAxis(valueAxisLabel); StackedAreaRenderer renderer = new StackedAreaRenderer(); if (tooltips) { renderer.setDefaultToolTipGenerator( new StandardCategoryToolTipGenerator()); renderer.setDefaultItemURLGenerator( new StandardCategoryURLGenerator());
private static JFreeChart createAreaChart( final CategoryDatasetChartDefinition chartDefinition ) { // TODO Make the following accessible from the chartDefinition String categoryAxisLabel = null; String valueAxisLabel = null; boolean tooltips = true; boolean urls = true; // ----------------------------------------------------------- String title = chartDefinition.getTitle(); boolean legend = chartDefinition.isLegendIncluded(); CategoryAxis categoryAxis = new CategoryAxis( categoryAxisLabel ); ValueAxis valueAxis = new NumberAxis( valueAxisLabel ); AreaRenderer renderer = chartDefinition.isStacked() ? new StackedAreaRenderer() : new AreaRenderer(); if ( tooltips ) { renderer.setBaseToolTipGenerator( new StandardCategoryToolTipGenerator() ); } if ( urls ) { renderer.setBaseItemURLGenerator( new StandardCategoryURLGenerator() ); } CategoryPlot plot = new CategoryPlot( chartDefinition, categoryAxis, valueAxis, renderer ); JFreeChartEngine.updatePlot( plot, chartDefinition ); JFreeChart chart = new JFreeChart( title, JFreeChart.DEFAULT_TITLE_FONT, plot, legend ); return chart; }
ar.setSeriesPaint(0,ColorPalette.RED); // Failures. ar.setSeriesPaint(1,ColorPalette.YELLOW); // Skips. ar.setSeriesPaint(2,ColorPalette.BLUE); // Total.
if (!isSeriesVisible(row)) { return; double[] stack1 = getStackValues(dataset, row, column, state.getVisibleSeriesArray()); double xx1 = domainAxis.getCategoryMiddle(column, getColumnCount(), dataArea, plot.getDomainAxisEdge()); double[] stack0 = getStackValues(dataset, row, Math.max(column - 1, 0), state.getVisibleSeriesArray()); double xx0 = domainAxis.getCategoryStart(column, getColumnCount(), dataArea, plot.getDomainAxisEdge()); double[] stack2 = getStackValues(dataset, row, Math.min(column + 1, itemCount - 1), state.getVisibleSeriesArray()); double xx2 = domainAxis.getCategoryEnd(column, getColumnCount(), dataArea, plot.getDomainAxisEdge()); double[] stackLeft = averageStackValues(stack0, stack1); double[] stackRight = averageStackValues(stack1, stack2); double[] adjStackLeft = adjustedStackValues(stack0, stack1); double[] adjStackRight = adjustedStackValues(stack1, stack2); Paint itemPaint = getItemPaint(row, column); g2.setPaint(itemPaint); g2.fill(left);
ar.setSeriesPaint(0,ColorPalette.RED); // Failures. ar.setSeriesPaint(1,ColorPalette.YELLOW); // Skips. ar.setSeriesPaint(2,ColorPalette.BLUE); // Total.
/** * Override this method to specify the color to draw the given area. */ @Override public Paint getItemPaint(int row, int column) { return super.getItemPaint(row, column); }
ar.setSeriesPaint(0,ColorPalette.RED); // Failures. ar.setSeriesPaint(1,ColorPalette.YELLOW); // Skips. ar.setSeriesPaint(2,ColorPalette.BLUE); // Total.
/** * Override this method to specify the color to draw the given area. */ @Override public Paint getItemPaint(int row, int column) { return super.getItemPaint(row, column); }
ar.setSeriesPaint(0,ColorPalette.RED); // Failures. ar.setSeriesPaint(1,ColorPalette.YELLOW); // Skips. ar.setSeriesPaint(2,ColorPalette.BLUE); // Total.
/** * Override this method to specify the color to draw the given area. */ @Override public Paint getItemPaint(int row, int column) { return super.getItemPaint(row, column); }
ar.setSeriesPaint(0, ColorPalette.RED); // error ar.setSeriesPaint(1, ColorPalette.BLUE); // info ar.setSeriesPaint(2, ColorPalette.YELLOW); // warning
/** * Override this method to specify the color to draw the given area. */ @Override public Paint getItemPaint(int row, int column) { return super.getItemPaint(row, column); }
ar.setSeriesPaint(0,ColorPalette.RED); // Failures. ar.setSeriesPaint(1,ColorPalette.YELLOW); // Skips. ar.setSeriesPaint(2,ColorPalette.BLUE); // Total.
renderer.setSeriesPaint(2, RED); renderer.setSeriesPaint(1, VIOLET); renderer.setSeriesPaint(0, YELLOW);
renderer.setSeriesPaint(2, RED); renderer.setSeriesPaint(1, VIOLET); renderer.setSeriesPaint(0, YELLOW);