chart = ChartFactory.createXYAreaChart("", labelX, labelY, ds, PlotOrientation.VERTICAL, showLegend, false, false);
/** * Creates an area chart using an {@link XYDataset}. * <P> * The chart object returned by this method uses an {@link XYPlot} instance * as the plot, with a {@link NumberAxis} for the domain axis, a * {@link NumberAxis} as the range axis, and a {@link XYAreaRenderer} as * the renderer. * * @param title the chart title ({@code null} permitted). * @param xAxisLabel a label for the X-axis ({@code null} permitted). * @param yAxisLabel a label for the Y-axis ({@code null} permitted). * @param dataset the dataset for the chart ({@code null} permitted). * * @return An XY area chart. * * @since 1.0.16 */ public static JFreeChart createXYAreaChart(String title,String xAxisLabel, String yAxisLabel, XYDataset dataset) { return createXYAreaChart(title, xAxisLabel, yAxisLabel, dataset, PlotOrientation.VERTICAL, true, true, false); }
public static JFreeChart createXYAreaChart(String title, String xAxisLabel, String yAxisLabel, XYDataset dataset, PlotOrientation orientation, boolean legend, boolean tooltips, boolean urls) { JFreeChart chart = ChartFactory.createXYAreaChart(title, xAxisLabel, yAxisLabel, dataset, orientation, legend, tooltips, urls); setXYAreaChartDefaults(chart); return chart; }
private JFreeChart createChart(XYDataset dataset) { // JFreeChart chart = ChartFactory.createTimeSeriesChart(null, null, null, dataset, false, true, false); JFreeChart chart = ChartFactory.createXYAreaChart(null, null, null, dataset, VERTICAL, false, true, false); chart.setBackgroundPaint(new JPanel().getBackground()); 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(XYDatasetWithGroups dataset) { assert dataset != null; JFreeChart chart = ChartFactory.createXYAreaChart(getTitle(), "Buckets (sec)", "Count", dataset, PlotOrientation.VERTICAL, true, true, false); // null so that we can get it compiled; we'll get back to this... GroupActivatingPanel table = new GroupActivatingPanel(dataset, null); JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, table, new org.jfree.chart.ChartPanel(chart)); splitPane.setDividerLocation(200); mainPanel().add(BorderLayout.CENTER, splitPane); }
break; default: chart = ChartFactory.createXYAreaChart(plotTitle, xAxis, yAxis, collection, orientation, show, toolTips, urls); break;
/** * Creates a XY graph from the specified data set. * * @param dataset * the values to display * @return the created graph */ public JFreeChart createXYChart(final XYDataset dataset) { JFreeChart chart = ChartFactory.createXYAreaChart( null, // chart title null, // unused "count", // range axis label dataset, // data PlotOrientation.VERTICAL, // orientation false, // include legend true, // tooltips false // urls ); chart.setBackgroundPaint(Color.white); XYPlot plot = chart.getXYPlot(); plot.setRenderer(new XYDifferenceRenderer(ColorPalette.BLUE, ColorPalette.RED, false)); plot.setRangeGridlinesVisible(true); plot.setRangeGridlinePaint(Color.black); NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis(); rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits()); setPlotProperties(plot); return chart; }
/** * Creates a XY graph from the specified data set. * * @param dataset * the values to display * @return the created graph */ public JFreeChart createXYChart(final XYDataset dataset) { JFreeChart chart = ChartFactory.createXYAreaChart( null, // chart title null, // unused "count", // range axis label dataset, // data PlotOrientation.VERTICAL, // orientation false, // include legend true, // tooltips false // urls ); chart.setBackgroundPaint(Color.white); XYPlot plot = chart.getXYPlot(); plot.setRenderer(new XYDifferenceRenderer(ColorPalette.BLUE, ColorPalette.RED, false)); plot.setRangeGridlinesVisible(true); plot.setRangeGridlinePaint(Color.black); NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis(); rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits()); setPlotProperties(plot); return chart; }
public JFreeChart createChart(Chart chart) { ChartModel model = (ChartModel) chart.getModel(); if (model instanceof CategoryModel) { return ChartFactory.createAreaChart( chart.getTitle(), chart.getXAxis(), chart.getYAxis(), CategoryModelToCategoryDataset((CategoryModel)model), getOrientation(chart.getOrient()), chart.isShowLegend(), chart.isShowTooltiptext(), true); } else if (model instanceof XYModel) { return ChartFactory.createXYAreaChart( chart.getTitle(), chart.getXAxis(), chart.getYAxis(), 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"); } } }
ChartFactory.createXYAreaChart( (String)evaluateExpression(getChart().getTitleExpression() ), (String)evaluateExpression(((JRAreaPlot)getPlot()).getCategoryAxisLabelExpression() ),