protected void configurePlot(CategoryPlot plot) { plot.setBackgroundPaint(Color.WHITE); plot.setOutlinePaint(null); plot.setRangeGridlinesVisible(true); plot.setRangeGridlinePaint(Color.black); configureRenderer((LineAndShapeRenderer) plot.getRenderer()); configureDomainAxis(plot); }
chart.setTitle( title ); CategoryPlot plot = (CategoryPlot) chart.getPlot(); plot.setBackgroundPaint( Color.white ); plot.setForegroundAlpha( 0.5f ); plot.setRangeGridlinesVisible( true );
chart.setBackgroundPaint( Color.white ); CategoryPlot plot = (CategoryPlot) chart.getPlot(); plot.setBackgroundPaint( Color.white ); plot.setForegroundAlpha( 0.5f ); plot.setRangeGridlinesVisible( true );
plot.setBackgroundPaint(Color.WHITE); plot.setOutlinePaint(null); plot.setRangeGridlinesVisible(true);
plot.setBackgroundPaint(Color.WHITE); plot.setOutlinePaint(null); plot.setForegroundAlpha(0.8f);
chart.setBackgroundPaint(Color.yellow); // Set the background colour of the chart chart.getTitle().setPaint(Color.blue); // Adjust the colour of the title CategoryPlot p = chart.getCategoryPlot(); // Get the Plot object for a bar graph p.setBackgroundPaint(Color.black); // Modify the plot background p.setRangeGridlinePaint(Color.red); // Modify the colour of the plot gridlines
CategoryPlot cplot = (CategoryPlot)chart.getPlot(); cplot.setBackgroundPaint(SystemColor.inactiveCaption);//change background color //set bar chart color ((BarRenderer)cplot.getRenderer()).setBarPainter(new StandardBarPainter()); BarRenderer r = (BarRenderer)chart.getCategoryPlot().getRenderer(); r.setSeriesPaint(0, Color.blue);
public OverallRelativeAreaPlot(String title , int sizes[] ) { // createAreaChart chart = ChartFactory.createStackedAreaChart( title, // chart title "Size", // domain axis label "Relative Average Speed", // range axis label dataset, // data PlotOrientation.VERTICAL, // orientation true, // include legend true, false ); chart.addSubtitle(new TextTitle("Weighted by Operation Speed. Larger is Better.",new Font("SansSerif", Font.ITALIC, 12))); plot = chart.getCategoryPlot(); sizeNames = new String[sizes.length]; for( int i = 0; i < sizes.length; i++ ) { sizeNames[i] = Integer.toString(sizes[i]); } plot.setRangeGridlinePaint(Color.WHITE); plot.setBackgroundPaint(Color.WHITE); plot.setDomainGridlinesVisible(true); }
private static CategoryPlot createChartFrame(CategoryDataset dataSet) { JFreeChart chart = ChartFactory.createBarChart( "Trading Volume", "Stock", "Volume, USD", dataSet, PlotOrientation.HORIZONTAL, true, true, false); CategoryPlot plot = chart.getCategoryPlot(); plot.setBackgroundPaint(Color.WHITE); plot.setDomainGridlinePaint(Color.DARK_GRAY); plot.setRangeGridlinePaint(Color.DARK_GRAY); plot.getRenderer().setSeriesPaint(0, Color.BLUE); final JFrame frame = new JFrame(); frame.setBackground(Color.WHITE); frame.setDefaultCloseOperation(EXIT_ON_CLOSE); frame.setTitle("Hazelcast Jet Source Builder Sample"); frame.setBounds(WINDOW_X, WINDOW_Y, WINDOW_WIDTH, WINDOW_HEIGHT); frame.setLayout(new BorderLayout()); frame.add(new ChartPanel(chart)); frame.setVisible(true); return plot; } }
public JFreeChart createChart() { JFreeChart chart = ChartFactory.createBoxAndWhiskerChart( title, "Matrix Libraries", "Relative Performance", dataSet, true); CategoryPlot plot = chart.getCategoryPlot(); plot.setDomainGridlinesVisible(true); plot.setBackgroundPaint(new Color(230,230,230)); plot.setDomainGridlinePaint(new Color(50,50,50,50)); plot.setDomainGridlineStroke(new BasicStroke(78f)); chart.getTitle().setFont(new Font("Times New Roman", Font.BOLD, 24)); String foo = "( Higher is Better )"; if( subtitle != null ) foo += " ( "+subtitle+" )"; chart.addSubtitle(new TextTitle(foo,new Font("SansSerif", Font.ITALIC, 12))); NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis(); rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits()); return chart; }
protected void configurePlot(CategoryPlot plot) { plot.setBackgroundPaint(Color.WHITE); plot.setOutlinePaint(null); plot.setRangeGridlinesVisible(true); plot.setRangeGridlinePaint(Color.black); configureRenderer((LineAndShapeRenderer) plot.getRenderer()); configureDomainAxis(plot); }
private void plot() { CategoryPlot plot = chart.getCategoryPlot(); // plot.setDomainGridlinesVisible(true); // plot.setRangeCrosshairVisible(true); // plot.setRangeCrosshairPaint(Color.blue); plot.setRangeGridlinePaint(Color.BLACK); // set the range axis to display integers only... // NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis(); // rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits()); // CategoryAxis domainAxis = (CategoryAxis) plot.getDomainAxis(); // domainAxis.setTickMarkPaint(Color.BLACK); plot.setBackgroundPaint(new Color(230,230,230)); // disable bar outlines... BarRenderer renderer = (BarRenderer) plot.getRenderer(); renderer.setDrawBarOutline(true); renderer.setShadowVisible(false); renderer.setBaseOutlinePaint(Color.BLACK); // renderer.setBaseOutlineStroke(new BasicStroke(2)); // CategoryAxis domainAxis = plot.getDomainAxis(); // domainAxis.setCategoryLabelPositions( // CategoryLabelPositions.createUpRotationLabelPositions( // Math.PI / 6.0)); }
public static void setupPlot(CategoryPlot plot) { plot.setBackgroundPaint(ChartDefaults.transparent); plot.setOutlinePaint(ChartDefaults.transparent); plot.setRangeGridlinePaint(ChartDefaults.gridLineColor); plot.setRangeGridlineStroke(new BasicStroke(0.5f)); plot.setRangeGridlinesVisible(true); plot.setRangeAxisLocation(ChartDefaults.rangeAxisLocation); plot.setDomainGridlinesVisible(false); ChartUtil.setupRangeAxis(plot.getRangeAxis()); ChartUtil.setupDomainAxis(plot.getDomainAxis()); }
public static void setupPlot(CategoryPlot plot) { plot.setBackgroundPaint(ChartDefaults.transparent); plot.setOutlinePaint(ChartDefaults.transparent); plot.setRangeGridlinePaint(ChartDefaults.gridLineColor); plot.setRangeGridlineStroke(new BasicStroke(0.5f)); plot.setRangeGridlinesVisible(true); plot.setRangeAxisLocation(ChartDefaults.rangeAxisLocation); plot.setDomainGridlinesVisible(false); ChartUtil.setupRangeAxis(plot.getRangeAxis()); ChartUtil.setupDomainAxis(plot.getDomainAxis()); }
/** * renders a BarChart consisting of one series for each specified foiID. * * @param foiIdArray * @param observationCollection * @return */ protected CategoryPlot renderFoiBarChart(String foiID, String timeString, ObservedValueTuple tuple) { DefaultCategoryDataset dataset = new DefaultCategoryDataset(); dataset.addValue((Double) tuple.getValue(0), foiID, timeString); JFreeChart chart = ChartFactory.createBarChart3D(null, // String title null, // String categoryAxisLabel null, // String valueAxisLabel dataset, // CategoryDataset dataset PlotOrientation.VERTICAL, false, // boolean legend false, // boolean tooltips false // boolean urls ); CategoryPlot plot = chart.getCategoryPlot(); plot.setBackgroundPaint(Color.white); return plot; }
// create the chart... JFreeChart chart = ChartFactory.createLineChart( "# of Sales by Month", // chart title "Month", // domain axis label "# of Sales", // range axis label dataset, // data PlotOrientation.VERTICAL, // orientation true, // include legend true, // tooltips false // urls ); if(subTitle != null && !subTitle.isEmpty()) chart.addSubtitle(new TextTitle(subTitle)); chart.setBackgroundPaint(Color.BLUE); // Paint p = new GradientPaint(0, 0, Color.white, 1000, 0, Color.green); // chart.setBackgroundPaint(p); CategoryPlot plot = (CategoryPlot) chart.getPlot(); plot.setRangePannable(true); plot.setRangeGridlinesVisible(true); plot.setBackgroundAlpha(1); plot.setBackgroundPaint(Color.BLUE); // Paint p = new GradientPaint(0, 0, Color.white, 1000, 0, Color.green); // plot.setBackgroundPaint(p); NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis(); rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits()); ChartUtilities.applyCurrentTheme(chart);
private JFreeChart createChart(final DefaultStatisticalCategoryDataset dataset) { final CategoryItemRenderer renderer = new StatisticalLineAndShapeRenderer(true, true); //CategoryItemRenderer renderer = new StatisticalBarRenderer(); for (int i = 0; i < dataset.getRowCount(); i++) { renderer.setSeriesStroke(i, new BasicStroke(5f)); } final String numberAxisLabel = _menu._time.getSelectedIndex() == 0 ? "Execution Time (s)" : "Used Memory (%)"; final CategoryPlot plot = new CategoryPlot(dataset, new CategoryAxis("Release"), new NumberAxis(numberAxisLabel), renderer); plot.setBackgroundPaint(Color.lightGray); plot.setDomainGridlinesVisible(true); plot.setDomainGridlinePaint(Color.white); plot.setRangeGridlinesVisible(true); plot.setRangeGridlinePaint(Color.white); plot.setForegroundAlpha(0.8f); return new JFreeChart((String) _menu._ontology.getSelectedItem(), plot); }
public static JFreeChart doCreateSummarizerChart(CategoryDataset dataset, String yAxis, String chartTitle) { final JFreeChart chart = ChartFactory.createBarChart(chartTitle, // chart // title null, // unused yAxis, // range axis label dataset, // data PlotOrientation.VERTICAL, // orientation true, // include legend true, // tooltips true // urls ); chart.setBackgroundPaint(Color.WHITE); final CategoryPlot plot = chart.getCategoryPlot(); plot.setBackgroundPaint(Color.WHITE); plot.setRangeGridlinesVisible(true); plot.setRangeGridlinePaint(Color.BLACK); CategoryAxis domainAxis = plot.getDomainAxis(); domainAxis.setCategoryLabelPositions(CategoryLabelPositions.UP_45); final BarRenderer renderer = (BarRenderer) plot.getRenderer(); renderer.setDrawBarOutline(false); renderer.setBaseStroke(new BasicStroke(4.0f)); renderer.setItemMargin(0); renderer.setMaximumBarWidth(0.05); return chart; }
static private void setBackgroundDefault(final JFreeChart chart) { BasicStroke gridStroke = new BasicStroke(1.0f, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND, 1.0f, new float[]{2.0f, 1.0f}, 0.0f); CategoryPlot plot = (CategoryPlot) chart.getPlot(); plot.setRangeGridlineStroke(gridStroke); plot.setDomainGridlineStroke(gridStroke); plot.setBackgroundPaint(new Color(235, 235, 235)); plot.setRangeGridlinePaint(Color.white); plot.setDomainGridlinePaint(Color.white); plot.setOutlineVisible(false); plot.getDomainAxis().setAxisLineVisible(false); plot.getRangeAxis().setAxisLineVisible(false); plot.getDomainAxis().setLabelPaint(Color.gray); plot.getRangeAxis().setLabelPaint(Color.gray); plot.getDomainAxis().setTickLabelPaint(Color.gray); plot.getRangeAxis().setTickLabelPaint(Color.gray); chart.getTitle().setPaint(Color.gray); }
plot.setBackgroundPaint(Color.lightGray); plot.setForegroundAlpha(0.85F); plot.setRangeGridlinesVisible(true);