private JFreeChart createChart(final String title, final String categoryAxisLabel, final String valueAxisLabel, final CategoryDataset dataset) { return ChartFactory.createBarChart(title, categoryAxisLabel, valueAxisLabel, dataset, PlotOrientation.VERTICAL, true, // legend? false, // tooltips? false // URLs? ); }
@Override public JFreeChart createChart(FacesContext context) { JFreeChart chart; if (!getIs3D()) { chart = ChartFactory.createBarChart(getTitle(), getDomainAxisLabel(), getRangeAxisLabel(), (CategoryDataset) dataset, plotOrientation(getOrientation()), getLegend(), false, false); } else { chart = ChartFactory.createBarChart3D(getTitle(), getDomainAxisLabel(), getRangeAxisLabel(), (CategoryDataset) dataset, plotOrientation(getOrientation()), getLegend(), false, false); } configureTitle(chart.getTitle()); configureLegend(chart.getLegend()); return chart; } }
public static JFreeChart createBarChart(String title, String categoryAxisLabel, String valueAxisLabel, CategoryDataset dataset, PlotOrientation orientation, boolean legend, boolean tooltips, boolean urls) { JFreeChart chart = ChartFactory.createBarChart(title, categoryAxisLabel, valueAxisLabel, dataset, orientation, legend, tooltips, urls); setBarChartDefaults(chart); return chart; }
private JFreeChart createMonthlyChart(CategoryDataset dataset) { JFreeChart chart = ChartFactory.createBarChart( "", // title resourceMap.getString("graphDate.text"), // x-axis label resourceMap.getString("graphCBills.text"), // y-axis label dataset); chart.setBackgroundPaint(Color.WHITE); chart.getLegend().setPosition(RectangleEdge.TOP); return chart; }
@SuppressWarnings("rawtypes") static private final JFreeChart createChart(final Map<? extends Number, ? extends Number> data, final String title, final String xLabel, final String yLabel) { DefaultCategoryDataset dcd = new DefaultCategoryDataset(); for (final Map.Entry<? extends Number, ? extends Number> e : data.entrySet()) { dcd.addValue(e.getValue(), "", (Comparable) e.getKey()); } boolean legend = false; boolean tooltips = true; boolean urls = false; JFreeChart chart = ChartFactory.createBarChart(title, xLabel, yLabel, dcd, PlotOrientation.VERTICAL, legend, tooltips, urls); setBarTheme(chart); return chart; }
public MemoryRelativeBarPlot( String title ) { chart = ChartFactory.createBarChart( title, // chart title "Operation", // domain axis label "Relative Memory", // range axis label dataset, // data PlotOrientation.VERTICAL, // orientation true, // include legend true, // tooltips? false // URLs? ); chart.addSubtitle(new TextTitle("(Smaller is Better)",new Font("SansSerif", Font.ITALIC, 12))); plot(); }
protected JFreeChart createChart(ChartDefinition chartDefinition, CategoryDataset dataset, PlotOrientation plotOrientation) { return ChartFactory.createBarChart( chartDefinition.getName(), chartDefinition.getXAxisName(), chartDefinition.getYAxisName(), dataset, plotOrientation, true, true, true); }
@SuppressWarnings("boxing") static private final JFreeChart createChart(final Collection<? extends Number> data, final String title, final String xLabel, final String yLabel) { DefaultCategoryDataset dcd = new DefaultCategoryDataset(); int k = 1; for (final Number value : data) { dcd.addValue(value, "", k++); } boolean legend = false; boolean tooltips = true; boolean urls = false; JFreeChart chart = ChartFactory.createBarChart(title, xLabel, yLabel, dcd, PlotOrientation.VERTICAL, legend, tooltips, urls); setBarTheme(chart); return chart; }
/** * Sets up the table cell renderer and the bar chart. * * @param plotOrientation */ private void setUpRendererAndChart() { setName("Table.cellRenderer"); setLayout(new BorderLayout()); DefaultCategoryDataset dataset = new DefaultCategoryDataset(); chart = ChartFactory.createBarChart(null, null, null, dataset, PlotOrientation.HORIZONTAL, false, false, false); this.chartPanel = new ChartPanel(chart); this.setLayout(new BoxLayout(this, BoxLayout.LINE_AXIS)); add(chartPanel); }
public static JFreeChart createBarChart(DataTable dataTable) { CategoryDataset cData = createCategoryDataset(dataTable); String dataLabel = getDataLabel(dataTable); String columnLabel = getColumnLabel(dataTable); JFreeChart barChart = ChartFactory.createBarChart(dataTable.getName(), columnLabel, dataLabel, cData, PlotOrientation.VERTICAL, true, true, true); return barChart; }
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; } }
/** * Creates a new JSparkLinesTableCellRenderer. Use this constructor when * creating pie charts where no upper range is used. * * @param currentColorGradient the color gradient * @param maxValue the maximum heat map value */ public JSparklinesHeatMapTableCellRenderer(GradientColorCoding.ColorGradient currentColorGradient, double maxValue) { this.currentColorGradient = currentColorGradient; this.maxValue = maxValue; setName("Table.cellRenderer"); setLayout(new BorderLayout()); DefaultCategoryDataset dataset = new DefaultCategoryDataset(); chart = ChartFactory.createBarChart(null, null, null, dataset, PlotOrientation.VERTICAL, false, false, false); this.chartPanel = new ChartPanel(chart); this.setLayout(new BoxLayout(this, BoxLayout.LINE_AXIS)); add(chartPanel); }
private ChartHelper generateBarChart(CategoryDataset dataset, String chartTitle, String yLabel, String xLabel) { JFreeChart chart = org.jfree.chart.ChartFactory.createBarChart(chartTitle, yLabel, xLabel, dataset, PlotOrientation.VERTICAL, false, false, false); BarRenderer renderer = (BarRenderer) ((CategoryPlot) chart.getPlot()).getRenderer(); renderer.setBarPainter(new StandardBarPainter()); renderer.setShadowVisible(false); return new ChartHelper(chart); } }
public JFreeChart render(Chart ofxChart) { JFreeChart chart = ChartFactory.createBarChart( ChartLabelResolver.getTitle(ofxChart), ChartLabelResolver.getAxisLabelX(ofxChart), ChartLabelResolver.getAxisLabelY(ofxChart), createDataset(ofxChart.getDataSet()), PlotOrientation.VERTICAL, ofxChart.isLegend(), true, // generate tooltips? false // generate URLs? ); return chart; }
public ChartPanel getPlotCanvas() { final JFreeChart chart = ChartFactory.createBarChart( "JBroFuzz Jaccard Index Bar Chart", // chart title "File Name", // domain axis label "Jaccard Similarity Coefficient", // range axis label dataset, // data PlotOrientation.VERTICAL, // orientation false, // include legend true, // tooltips? true // URLs? ); final Plot plot = chart.getPlot(); plot.setBackgroundImage(ImageCreator.IMG_OWASP_MED.getImage()); plot.setBackgroundImageAlignment(Align.TOP_RIGHT); final CategoryItemRenderer renderer = chart.getCategoryPlot().getRenderer(); renderer .setBaseToolTipGenerator(new StandardCategoryToolTipGenerator()); return new ChartPanel(chart); }
public ChartPanel getPlotCanvas() { final JFreeChart chart = ChartFactory.createBarChart( "JBroFuzz Response Size Bar Chart", // chart title "File Name", // domain axis label "Response Size (bytes)", // range axis label dataset, // data PlotOrientation.VERTICAL, // orientation false, // include legend true, // tooltips? true // URLs? ); final Plot plot = chart.getPlot(); plot.setBackgroundImage(ImageCreator.IMG_OWASP_MED.getImage()); plot.setBackgroundImageAlignment(Align.TOP_RIGHT); final CategoryItemRenderer renderer = chart.getCategoryPlot().getRenderer(); renderer.setBaseToolTipGenerator( new StandardCategoryToolTipGenerator()); return new ChartPanel(chart); }
public ChartPanel getPlotCanvas() { final JFreeChart chart = ChartFactory.createBarChart( "JBroFuzz Response Time Bar Chart", // chart title "File Name", // domain axis label "Response Time (ms)", // range axis label dataset, // data PlotOrientation.VERTICAL, // orientation false, // include legend true, // tooltips? true // URLs? ); final Plot plot = chart.getPlot(); plot.setBackgroundImage(ImageCreator.IMG_OWASP_MED.getImage()); plot.setBackgroundImageAlignment(Align.TOP_RIGHT); final CategoryItemRenderer renderer = chart.getCategoryPlot().getRenderer(); renderer.setBaseToolTipGenerator( new StandardCategoryToolTipGenerator()); return new ChartPanel(chart); }
@Override protected JFreeChart createGraph() { CategoryDataset dataset = createDataset(); JFreeChart chart = ChartFactory.createBarChart(graphTitle, "", "Number of failures", dataset, PlotOrientation.HORIZONTAL, false, false, false); NumberAxis domainAxis = new NumberAxis(); domainAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits()); CategoryPlot plot = (CategoryPlot)chart.getPlot(); plot.setRangeAxis(domainAxis); BarRenderer renderer = (BarRenderer)plot.getRenderer(); renderer.setMaximumBarWidth(MAX_BAR_WIDTH); return chart; }
protected void addDefaultBarChart(final DCTable table, final DisplayChartCallback displayChartCallback, final int row, final String measureName) { final ActionListener action = e -> { final DefaultCategoryDataset dataset = new DefaultCategoryDataset(); final int columnCount = table.getColumnCount(); for (int j = 1; j < columnCount; j++) { final String textValue = table.getTextValueAt(row, j); final Number value = NumberUtils.createNumber(textValue); dataset.setValue(value, table.getColumnName(j), ""); } final JFreeChart chart = ChartFactory .createBarChart("", "", measureName, dataset, PlotOrientation.VERTICAL, true, true, false); ChartUtils.applyStyles(chart); final ChartPanel chartPanel = ChartUtils.createPanel(chart, true); displayChartCallback.displayChart(chartPanel); }; final DCPanel panel = createActionableValuePanel(measureName, Alignment.LEFT, action, IMAGE_PATH_BAR_CHART); table.setValueAt(panel, row, 0); }
private JFreeChart createChart(final CategoryDataset dataset) { final JFreeChart chart = ChartFactory.createBarChart( null, null, null, dataset, PlotOrientation.VERTICAL, false, true, false); chart.setBackgroundPaint(Color.white); CategoryPlot localCategoryPlot = (CategoryPlot)chart.getPlot(); localCategoryPlot.setDomainGridlinesVisible(true); CustomBarRenderer localCustomBarRenderer = new CustomBarRenderer(arrayOfPaint); localCustomBarRenderer.setBarPainter(new StandardBarPainter()); localCustomBarRenderer.setDrawBarOutline(true); localCustomBarRenderer.setBaseItemLabelGenerator(new StandardCategoryItemLabelGenerator()); localCustomBarRenderer.setBaseItemLabelsVisible(true); localCategoryPlot.setRenderer(localCustomBarRenderer); chart.addChangeListener(new UpdateChartChangeListener()); return chart; }