private JFreeChart createChart(final String title, final String categoryAxisLabel, final String valueAxisLabel, final CategoryDataset dataset) { return ChartFactory.createStackedBarChart(title, categoryAxisLabel, valueAxisLabel, dataset, PlotOrientation.VERTICAL, true, // legend? false, // tooltips? false // URLs? ); }
getYaxis(), dataset, PlotOrientation.VERTICAL, hasLegend(), true, false); case STACKED_BAR: return ChartFactory.createStackedBarChart(getURLTitle(), null, getYaxis(), dataset, PlotOrientation.VERTICAL, hasLegend(), true, false); case STACKED_BAR_3D:
/** * Creates a stacked bar 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 a {@link StackedBarRenderer} * as the renderer. * * @param title the chart title ({@code null} permitted). * @param domainAxisLabel the label for the category axis * ({@code null} permitted). * @param rangeAxisLabel the label for the value axis * ({@code null} permitted). * @param dataset the dataset for the chart ({@code null} permitted). * * @return A stacked bar chart. * * @since 1.0.16 */ public static JFreeChart createStackedBarChart(String title, String domainAxisLabel, String rangeAxisLabel, CategoryDataset dataset) { return createStackedBarChart(title, domainAxisLabel, rangeAxisLabel, dataset, PlotOrientation.VERTICAL, true, true, false); }
public static JFreeChart createStackedBarChart(String title, String categoryAxisLabel, String valueAxisLabel, CategoryDataset dataset, PlotOrientation orientation, boolean legend, boolean tooltips, boolean urls) { JFreeChart chart = ChartFactory.createStackedBarChart(title, categoryAxisLabel, valueAxisLabel, dataset, orientation, legend, tooltips, urls); setBarChartDefaults(chart); return chart; }
protected JFreeChart createChart(ChartDefinition chartDefinition, CategoryDataset dataset, PlotOrientation plotOrientation) { return ChartFactory.createStackedBarChart( chartDefinition.getName(), chartDefinition.getXAxisName(), chartDefinition.getYAxisName(), dataset, plotOrientation, true, true, true); }
/** * Creates a stacked block graph from the specified data set. * * @param dataset * the values to display * @return the created graph */ public JFreeChart createBlockChart(final CategoryDataset dataset) { JFreeChart chart = ChartFactory.createStackedBarChart( 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); setCategoryPlotProperties(chart.getCategoryPlot()); return chart; }
/** * Creates a stacked block graph from the specified data set. * * @param dataset * the values to display * @param yAxisLabel * label of the range axis, i.e. y axis * @return the created graph */ public JFreeChart createBlockChart(final CategoryDataset dataset, final String yAxisLabel) { JFreeChart chart = ChartFactory.createStackedBarChart( null, // chart title null, // unused yAxisLabel, // range axis label dataset, // data PlotOrientation.VERTICAL, // orientation false, // include legend true, // tooltips false // urls ); chart.setBackgroundPaint(Color.white); setCategoryPlotProperties(chart.getCategoryPlot()); return chart; }
chart = ChartFactory.createStackedBarChart(null, null, null, barChartDataset, plotOrientation, false, false, false);
chart = ChartFactory.createStackedBarChart(null, null, null, barChartDataset, plotOrientation, false, false, false);
public JFreeChart createChart(Chart chart) { ChartModel model = (ChartModel) chart.getModel(); if (!(model instanceof CategoryModel)) { throw new UiException("model must be a org.zkoss.zul.CategoryModel"); } return ChartFactory.createStackedBarChart( chart.getTitle(), chart.getXAxis(), chart.getYAxis(), CategoryModelToCategoryDataset((CategoryModel)model), getOrientation(chart.getOrient()), chart.isShowLegend(), chart.isShowTooltiptext(), true); } }
public static JFreeChart createStackedBarChart(String title, List<List<Double>> bars, List<String> zoneLabels, String xLabel, String yLabel, ColorTheme theme) { DefaultCategoryDataset ds = new DefaultCategoryDataset(); Integer barId = 0; int maxStack = 0; for (List<Double> bar : bars) { int i = 0; maxStack = Math.max(maxStack, bar.size()); for (double value : bar) { ds.addValue(value, zoneLabels.get(i), barId); i++; } barId++; } JFreeChart chart = ChartFactory.createStackedBarChart(title, xLabel, yLabel, ds, PlotOrientation.VERTICAL, true, false, false); formatColorTheme(chart, theme); formatBars(chart); CategoryPlot plot = (CategoryPlot) chart.getPlot(); plot.getDomainAxis().setCategoryMargin(0); plot.getDomainAxis().setLowerMargin(0); plot.getDomainAxis().setUpperMargin(0); Color[] colors = generateJetSpectrum(maxStack); for (int i = 0; i < maxStack; i++) { plot.getRenderer().setSeriesPaint(i, colors[i]); plot.getRenderer().setSeriesOutlinePaint(i, Color.white); } return chart; }
chart = ChartFactory.createStackedBarChart(null, null, null, barChartDataset, plotOrientation, false, false, false);
private JFreeChart getStackedBarChart( BaseChart chart, CategoryDataset dataSet, boolean horizontal ) { JFreeChart stackedBarChart = ChartFactory.createStackedBarChart( chart.getName(), chart.getDomainAxisLabel(), chart.getRangeAxisLabel(), dataSet, PlotOrientation.VERTICAL, !chart.isHideLegend(), false, false ); setBasicConfig( stackedBarChart, chart ); CategoryPlot plot = (CategoryPlot) stackedBarChart.getPlot(); plot.setOrientation( horizontal ? PlotOrientation.HORIZONTAL : PlotOrientation.VERTICAL ); plot.setRenderer( getStackedBarRenderer() ); CategoryAxis xAxis = plot.getDomainAxis(); xAxis.setCategoryLabelPositions( CategoryLabelPositions.UP_45 ); return stackedBarChart; }
chart = ChartFactory.createStackedBarChart(null, null, null, barChartDataset, plotOrientation, false, false, false);
chart = ChartFactory.createStackedBarChart(null, null, null, barChartDataset, PlotOrientation.VERTICAL, false, false, false);
@Override protected JFreeChart createGraph() { DefaultCategoryDataset dataset = createDataset(); JFreeChart chart = ChartFactory.createStackedBarChart(getTitle(), getXAxisTitle(), getYAxisTitle(), dataset, PlotOrientation.VERTICAL, true, true, false); final CategoryPlot plot = chart.getCategoryPlot(); int index = dataset.getRowIndex(NO_FAILURE); if (index >= 0) { plot.getRenderer().setSeriesVisibleInLegend(index, false); } CategoryAxis domainAxis = plot.getDomainAxis(); domainAxis.setCategoryLabelPositions(CategoryLabelPositions.UP_90); domainAxis.setCategoryMargin(0); final NumberAxis rangeAxis = (NumberAxis)plot.getRangeAxis(); rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits()); return chart; }
public static ChartHelper generateStackedBarChart(CategoryDataset dataset, String chartTitle, String yLabel, String xLabel, List domainMarkers) { boolean legend = false; boolean tooltips = false; boolean urls = false; JFreeChart chart = ChartFactory.createStackedBarChart(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); plot.getRenderer().setSeriesOutlinePaint(1, COLOR_YELLOW_OUTLINE); plot.getRenderer().setSeriesPaint(1, COLOR_YELLOW_PAINT); plot.getRenderer().setSeriesOutlinePaint(0, COLOR_CYAN_OUTLINE); plot.getRenderer().setSeriesPaint(0, COLOR_CYAN_PAINT); return new ChartHelper(chart); }
public ChartHelper generateChart() { boolean legend = false; boolean tooltips = false; boolean urls = false; JFreeChart chart = ChartFactory.createStackedBarChart(null, null, yLabel, dataset, PlotOrientation.VERTICAL, legend, tooltips, urls); setStackedBarChartDefaults(chart, i18nBean); CategoryPlot plot = chart.getCategoryPlot(); NumberAxis axis = (NumberAxis) plot.getRangeAxis(); TickUnitSource units = NumberAxis.createIntegerTickUnits(); axis.setStandardTickUnits(units); CategoryAxis catAxis = plot.getDomainAxis(); catAxis.setCategoryLabelPositions(CategoryLabelPositions.UP_45); plot.getRenderer().setSeriesOutlinePaint(1, ChartDefaults.GREEN_DIFF); plot.getRenderer().setSeriesPaint(1, ChartDefaults.GREEN_DIFF); plot.getRenderer().setSeriesOutlinePaint(0, ChartDefaults.RED_DIFF); plot.getRenderer().setSeriesPaint(0, ChartDefaults.RED_DIFF); return new ChartHelper(chart); }
ChartFactory.createStackedBarChart( (String)evaluateExpression(getChart().getTitleExpression()), (String)evaluateExpression(((JRBarPlot)getPlot()).getCategoryAxisLabelExpression()),