/** * Creates and returns a default instance of an XY bar chart. * <P> * The chart object returned by this method uses an {@link XYPlot} instance * as the plot, with a {@link DateAxis} for the domain axis, a * {@link NumberAxis} as the range axis, and a {@link XYBarRenderer} as the * renderer. * * @param title the chart title ({@code null} permitted). * @param xAxisLabel a label for the X-axis ({@code null} permitted). * @param dateAxis make the domain axis display dates? * @param yAxisLabel a label for the Y-axis ({@code null} permitted). * @param dataset the dataset for the chart ({@code null} permitted). * * @return An XY bar chart. * * @since 1.0.16 */ public static JFreeChart createXYBarChart(String title, String xAxisLabel, boolean dateAxis, String yAxisLabel, IntervalXYDataset dataset) { return createXYBarChart(title, xAxisLabel, dateAxis, yAxisLabel, dataset, PlotOrientation.VERTICAL, true, true, false); }
public static JFreeChart createXYBarChart(String title, String xAxisLabel, boolean dateAxis, String yAxisLabel, IntervalXYDataset dataset, PlotOrientation orientation, boolean legend, boolean tooltips, boolean urls) { JFreeChart chart = ChartFactory.createXYBarChart(title, xAxisLabel, dateAxis, yAxisLabel, dataset, orientation, legend, tooltips, urls); setXYBarChartDefaults(chart); return chart; }
JFreeChart chart = ChartFactory.createXYBarChart( "Start: " + metric.startTime + " End: " + metric.endTime + " Message Count: " + metric.messageCount, "Test Second",
private JFreeChart createChart(final String title, final List<XYSeries> series) { final XYSeriesCollection data = new XYSeriesCollection(); for (XYSeries xys : series) { data.addSeries(xys); } final JFreeChart chart = ChartFactory.createXYBarChart(title, null, false, null, data, PlotOrientation.VERTICAL, false, true, false); setTheme(chart); // chart.getXYPlot().setForegroundAlpha(0.50f); return chart; }
public JFreeChart createBarChart(String title, IntervalXYDataset dataset) { JFreeChart chart = ChartFactory.createXYBarChart(title, "Date", true, "Count", dataset, PlotOrientation.VERTICAL, true, true, false); XYPlot plot = (XYPlot) chart.getPlot(); ClusteredXYBarRenderer r = new ClusteredXYBarRenderer(0.0, false); plot.setRenderer(r); r.setDrawBarOutline(false); return chart; }
/** * It creates a chart for the given dataset and adds the chart to the panel. * * @param dataset The dataset that will provide the values for the chart. */ private void addChart() { JFreeChart chart = ChartFactory.createXYBarChart(getTitle(), "Buckets (sec)", false, "Count", dataset, PlotOrientation.VERTICAL, true, true, false); chart.addProgressListener(locker); XYPlot plot = (XYPlot) chart.getPlot(); XYItemRenderer renderer = plot.getRenderer(); renderer.setToolTipGenerator(dataset); groupActivatingPanel = new GroupActivatingPanel(dataset, locker); org.jfree.chart.ChartPanel chartPanel = new org.jfree.chart.ChartPanel(chart); JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, groupActivatingPanel,chartPanel); splitPane.setDividerLocation(200); mainPanel().add(BorderLayout.CENTER, splitPane); }
/** * It creates a chart for the given dataset and adds the chart to the panel. * * @param dataset The dataset that will provide the values for the chart. */ private void addChart() { JFreeChart chart = ChartFactory.createXYBarChart(getTitle(), "Elapsed Time (sec)", false, "Time" + unitSuffix(), dataset, PlotOrientation.VERTICAL, true, true, false); chart.addProgressListener(locker); XYPlot plot = (XYPlot) chart.getPlot(); XYItemRenderer renderer = plot.getRenderer(); renderer.setToolTipGenerator(dataset); groupActivatingTable = new GroupActivatingPanel(dataset, locker); org.jfree.chart.ChartPanel chartPanel = new org.jfree.chart.ChartPanel(chart); JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, groupActivatingTable, chartPanel); splitPane.setDividerLocation(200); mainPanel().add(BorderLayout.CENTER, splitPane); }
public static JFreeChart chartSchedule(Collection<? extends Vehicle> vehicles, DescriptionCreator descriptionCreator, PaintSelector paintSelector) { // data TaskSeriesCollection dataset = createScheduleDataset(vehicles, descriptionCreator); XYTaskDataset xyTaskDataset = new XYTaskDataset(dataset); // chart JFreeChart chart = ChartFactory.createXYBarChart("Schedules", "Time", false, "Vehicles", xyTaskDataset, PlotOrientation.HORIZONTAL, false, true, false); XYPlot plot = (XYPlot)chart.getPlot(); // Y axis String[] series = new String[vehicles.size()]; int i = 0; for (Vehicle v : vehicles) { series[i++] = v.getId().toString(); } SymbolAxis symbolAxis = new SymbolAxis("Vehicles", series); symbolAxis.setGridBandsVisible(false); plot.setDomainAxis(symbolAxis); // X axis plot.setRangeAxis(new DateAxis("Time", TimeZone.getTimeZone("GMT"), Locale.getDefault())); // Renderer XYBarRenderer xyBarRenderer = new ChartTaskRenderer(dataset, paintSelector); xyBarRenderer.setUseYInterval(true); plot.setRenderer(xyBarRenderer); return chart; }
public JFreeChart createChart(Ofxchart ofxChart) { JFreeChart chart = ChartFactory.createXYBarChart( "XYBarChartDemo6", "X", false, "Y", createDataset(ofxChart), PlotOrientation.VERTICAL, false, false, false ); XYPlot plot = (XYPlot) chart.getPlot(); XYBarRenderer renderer = (XYBarRenderer) plot.getRenderer(); logger.debug("Dont know if this works ..."); renderer.setBarPainter(new StandardXYBarPainter()); renderer.setUseYInterval(true); plot.setRenderer(renderer); // workaround to update axis range return chart; } }
public JFreeChart createChart(PlotParameters params) throws PlotException { JFreeChart chart; XYSeriesCollection dataset = new XYSeriesCollection(); dataset.addSeries(getXYSeries()); switch (params.type) { case LINE: chart = ChartFactory.createXYLineChart(params.title, params.xAxisLabel, params.yAxisLabel, dataset, params.orientation, params.showLegend, false, false); break; case BAR: chart = ChartFactory.createXYBarChart(params.title, params.xAxisLabel, false, params.yAxisLabel, dataset, params.orientation, params.showLegend, false, false); break; case SCATTER: chart = ChartFactory.createScatterPlot(params.title, params.xAxisLabel, params.yAxisLabel, dataset, params.orientation, params.showLegend, false, false); break; default: throw new PlotException("unsupported plot type"); } return chart; } }
public JFreeChart createChart(PlotParameters params) throws PlotException { JFreeChart chart; XYSeriesCollection dataset = new XYSeriesCollection(); dataset.addSeries(getXYSeries()); switch (params.type) { case LINE: chart = ChartFactory.createXYLineChart(params.title, params.xAxisLabel, params.yAxisLabel, dataset, params.orientation, params.showLegend, false, false); break; case BAR: chart = ChartFactory.createXYBarChart(params.title, params.xAxisLabel, false, params.yAxisLabel, dataset, params.orientation, params.showLegend, false, false); break; case SCATTER: chart = ChartFactory.createScatterPlot(params.title, params.xAxisLabel, params.yAxisLabel, dataset, params.orientation, params.showLegend, false, false); break; default: throw new PlotException("unsupported plot type"); } return chart; } }
chart = ChartFactory.createTimeSeriesChart(null, null, null, dataset, true, false, false); }else { chart = ChartFactory.createXYBarChart(null, null, true, null, dataset, PlotOrientation.VERTICAL, true, false, false);
public JFreeChart createChart(PlotParameters params) throws PlotException { JFreeChart chart; XYSeriesCollection dataset = new XYSeriesCollection(); dataset.addSeries(vertexConnectivity.getXYSeries()); dataset.addSeries(edgeConnectivity.getXYSeries()); switch (params.type) { case LINE: chart = ChartFactory.createXYLineChart(params.title, params.xAxisLabel, params.yAxisLabel, dataset, params.orientation, params.showLegend, false, false); break; case BAR: chart = ChartFactory.createXYBarChart(params.title, params.xAxisLabel, false, params.yAxisLabel, dataset, params.orientation, params.showLegend, false, false); break; case SCATTER: chart = ChartFactory.createScatterPlot(params.title, params.xAxisLabel, params.yAxisLabel, dataset, params.orientation, params.showLegend, false, false); break; default: throw new PlotException("unsupported plot type"); } return chart; }
public JFreeChart createChart(PlotParameters params) throws PlotException { JFreeChart chart; XYSeriesCollection dataset = new XYSeriesCollection(); dataset.addSeries(vertexConnectivity.getXYSeries()); dataset.addSeries(edgeConnectivity.getXYSeries()); switch (params.type) { case LINE: chart = ChartFactory.createXYLineChart(params.title, params.xAxisLabel, params.yAxisLabel, dataset, params.orientation, params.showLegend, false, false); break; case BAR: chart = ChartFactory.createXYBarChart(params.title, params.xAxisLabel, false, params.yAxisLabel, dataset, params.orientation, params.showLegend, false, false); break; case SCATTER: chart = ChartFactory.createScatterPlot(params.title, params.xAxisLabel, params.yAxisLabel, dataset, params.orientation, params.showLegend, false, false); break; default: throw new PlotException("unsupported plot type"); } return chart; }
protected JFreeChart createChart( final IntervalXYDataset dataset, final String title, final String units ) { final JFreeChart chart = ChartFactory.createXYBarChart( title, "Distance [" + units + "]", false, "Count", dataset, PlotOrientation.VERTICAL, false, // legend false, false ); 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; }
public JFreeChart createChart(Chart chart) { ChartModel model = (ChartModel) chart.getModel(); if (model instanceof CategoryModel) { return ChartFactory.createBarChart( chart.getTitle(), chart.getXAxis(), chart.getYAxis(), CategoryModelToCategoryDataset((CategoryModel)model), getOrientation(chart.getOrient()), chart.isShowLegend(), chart.isShowTooltiptext(), true); } else if (model instanceof XYModel) { return ChartFactory.createXYBarChart( chart.getTitle(), chart.getXAxis(), false, chart.getYAxis(), (IntervalXYDataset) XYModelToXYDataset((XYModel)model), getOrientation(chart.getOrient()), chart.isShowLegend(), chart.isShowTooltiptext(), true); } else { throw new UiException("model must be a org.zkoss.zul.CategoryModel or a org.zkoss.zul.XYModel"); } } }
final XYChartBuilder cb = new XYChartBuilder(ChartFactory.createXYBarChart(null, null, false, null, null, PlotOrientation.VERTICAL, false, false, false)); int counter = 0;
chart = ChartFactory.createXYBarChart( ChartLabelResolver.getTitle(ofxChart), ChartLabelResolver.getAxisLabelX(ofxChart),
chart = ChartFactory.createXYBarChart( ChartLabelResolver.getTitle(ofxChart), ChartLabelResolver.getAxisLabelY(ofxChart),
ChartFactory.createXYBarChart( (String)evaluateExpression(getChart().getTitleExpression()), (String)evaluateExpression(((JRBarPlot)getPlot()).getCategoryAxisLabelExpression()),