/** * Creates an area chart with default settings. The chart object returned * by this method uses a {@link CategoryPlot} instance as the plot, with a * {@link CategoryAxis} for the domain axis, a {@link NumberAxis} as the * range axis, and an {@link AreaRenderer} as the renderer. * * @param title the chart title ({@code null} permitted). * @param categoryAxisLabel the label for the category axis * ({@code null} permitted). * @param valueAxisLabel the label for the value axis ({@code null} * permitted). * @param dataset the dataset for the chart ({@code null} permitted). * * @return An area chart. * * @since 1.0.16 */ public static JFreeChart createAreaChart(String title, String categoryAxisLabel, String valueAxisLabel, CategoryDataset dataset) { return createAreaChart(title, categoryAxisLabel, valueAxisLabel, dataset, PlotOrientation.VERTICAL, true, true, false); }
public static JFreeChart createAreaChart(String title, String categoryAxisLabel, String valueAxisLabel, CategoryDataset dataset, PlotOrientation orientation, boolean legend, boolean tooltips, boolean urls) { JFreeChart chart = ChartFactory.createAreaChart(title, categoryAxisLabel, valueAxisLabel, dataset, orientation, legend, tooltips, urls); setAreaChartDefaults(chart); return chart; }
protected JFreeChart createChart(ChartDefinition chartDefinition, CategoryDataset dataset, PlotOrientation plotOrientation) { return ChartFactory.createAreaChart( chartDefinition.getName(), chartDefinition.getXAxisName(), chartDefinition.getYAxisName(), dataset, plotOrientation, true, true, true); }
/** * Generates an area chart from the incoming dataset and stores the image for viewing. * * @param dataset is a jfreechart collection containing the issues in a form that the * charting tool understands. * @param chartTitle identifies the title to be used on the generated chart. * @param yLabel identifies the label to use on the generated charts y-axis. * @param xLabel identifies the label to use on the generated charts x-axis. * @return a string containing the filename of the generated chart. */ public static ChartHelper generateAreaChart(CategoryDataset dataset, String chartTitle, String yLabel, String xLabel) { boolean legend = false; boolean tooltips = false; boolean urls = false; JFreeChart chart = ChartFactory.createAreaChart(chartTitle, yLabel, xLabel, dataset, PlotOrientation.VERTICAL, legend, tooltips, urls); chart.setBackgroundPaint(Color.WHITE); chart.setBorderVisible(false); CategoryPlot plot = chart.getCategoryPlot(); NumberAxis axis = (NumberAxis) plot.getRangeAxis(); TickUnitSource units = NumberAxis.createIntegerTickUnits(); axis.setStandardTickUnits(units); AreaRenderer renderer = (AreaRenderer) plot.getRenderer(); renderer.setSeriesPaint(0, COLOR_RED_PAINT); renderer.setSeriesOutlinePaint(0, new Color(255, 0, 0)); renderer.setSeriesOutlineStroke(0, new BasicStroke(1f)); renderer.setSeriesStroke(0, new BasicStroke(3f)); return new ChartHelper(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"); } } }
final JFreeChart chart = ChartFactory.createAreaChart(
ChartFactory.createAreaChart( (String)evaluateExpression(getChart().getTitleExpression()), (String)evaluateExpression(((JRAreaPlot)getPlot()).getCategoryAxisLabelExpression()),
switch (ChartStyle.forName(getUrlStyle())) { case AREA: return ChartFactory.createAreaChart(getURLTitle(), null, getYaxis(), dataset, PlotOrientation.VERTICAL, hasLegend(), true, false); case BAR: