net.sf.dynamicreports.report.builder.chart.Charts Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of dynamicreports-core Show documentation
Show all versions of dynamicreports-core Show documentation
DynamicReports is an open source Java reporting library based on
JasperReports. It allows to create dynamic report designs and it doesn't
need a visual report designer.
You can very quickly create reports and produce documents that can be
displayed, printed or exported into many popular formats such as PDF,
Excel, Word and others.
The newest version!
/*
* DynamicReports - Free Java reporting library for creating reports dynamically
*
* Copyright (C) 2010 - 2018 Ricardo Mariaca and the Dynamic Reports Contributors
*
* This file is part of DynamicReports.
*
* DynamicReports is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* DynamicReports is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with DynamicReports. If not, see .
*/
package net.sf.dynamicreports.report.builder.chart;
import net.sf.dynamicreports.report.builder.DynamicReports;
import net.sf.dynamicreports.report.builder.FieldBuilder;
import net.sf.dynamicreports.report.builder.VariableBuilder;
import net.sf.dynamicreports.report.builder.column.ValueColumnBuilder;
import net.sf.dynamicreports.report.definition.expression.DRIExpression;
import java.awt.Paint;
/**
* A set of methods of creating and customizing charts
*
* @author Ricardo Mariaca
*
*/
public class Charts {
/**
* axisFormat.
*
* @return a {@link net.sf.dynamicreports.report.builder.chart.AxisFormatBuilder} object.
*/
public static AxisFormatBuilder axisFormat() {
return new AxisFormatBuilder();
}
/**
* paintScale.
*
* @param label a {@link java.lang.String} object.
* @param value a double.
* @param paint a {@link java.awt.Paint} object.
* @return a {@link net.sf.dynamicreports.report.builder.chart.PaintScaleBuilder} object.
*/
public static PaintScaleBuilder paintScale(String label, double value, Paint paint) {
return new PaintScaleBuilder(label, value, paint);
}
// category serie
/**
* serie.
*
* @param column a {@link net.sf.dynamicreports.report.builder.column.ValueColumnBuilder} object.
* @return a {@link net.sf.dynamicreports.report.builder.chart.CategoryChartSerieBuilder} object.
*/
public static CategoryChartSerieBuilder serie(ValueColumnBuilder column) {
return new CategoryChartSerieBuilder(column);
}
/**
* serie.
*
* @param fieldName a {@link java.lang.String} object.
* @param valueClass a {@link java.lang.Class} object.
* @return a {@link net.sf.dynamicreports.report.builder.chart.CategoryChartSerieBuilder} object.
*/
public static CategoryChartSerieBuilder serie(String fieldName, Class valueClass) {
return serie(DynamicReports.field(fieldName, valueClass));
}
/**
* serie.
*
* @param field a {@link net.sf.dynamicreports.report.builder.FieldBuilder} object.
* @return a {@link net.sf.dynamicreports.report.builder.chart.CategoryChartSerieBuilder} object.
*/
public static CategoryChartSerieBuilder serie(FieldBuilder field) {
return new CategoryChartSerieBuilder(field);
}
/**
* serie.
*
* @param valueExpression a {@link net.sf.dynamicreports.report.definition.expression.DRIExpression} object.
* @return a {@link net.sf.dynamicreports.report.builder.chart.CategoryChartSerieBuilder} object.
*/
public static CategoryChartSerieBuilder serie(DRIExpression valueExpression) {
return new CategoryChartSerieBuilder(valueExpression);
}
/**
* serie.
*
* @param variable a {@link net.sf.dynamicreports.report.builder.VariableBuilder} object.
* @return a {@link net.sf.dynamicreports.report.builder.chart.CategoryChartSerieBuilder} object.
*/
public static CategoryChartSerieBuilder serie(VariableBuilder variable) {
return new CategoryChartSerieBuilder(variable);
}
// grouped category serie
/**
* groupedSerie.
*
* @param column a {@link net.sf.dynamicreports.report.builder.column.ValueColumnBuilder} object.
* @return a {@link net.sf.dynamicreports.report.builder.chart.GroupedCategoryChartSerieBuilder} object.
*/
public static GroupedCategoryChartSerieBuilder groupedSerie(ValueColumnBuilder column) {
return new GroupedCategoryChartSerieBuilder(column);
}
/**
* groupedSerie.
*
* @param fieldName a {@link java.lang.String} object.
* @param valueClass a {@link java.lang.Class} object.
* @return a {@link net.sf.dynamicreports.report.builder.chart.GroupedCategoryChartSerieBuilder} object.
*/
public static GroupedCategoryChartSerieBuilder groupedSerie(String fieldName, Class valueClass) {
return groupedSerie(DynamicReports.field(fieldName, valueClass));
}
/**
* groupedSerie.
*
* @param field a {@link net.sf.dynamicreports.report.builder.FieldBuilder} object.
* @return a {@link net.sf.dynamicreports.report.builder.chart.GroupedCategoryChartSerieBuilder} object.
*/
public static GroupedCategoryChartSerieBuilder groupedSerie(FieldBuilder field) {
return new GroupedCategoryChartSerieBuilder(field);
}
/**
* groupedSerie.
*
* @param valueExpression a {@link net.sf.dynamicreports.report.definition.expression.DRIExpression} object.
* @return a {@link net.sf.dynamicreports.report.builder.chart.GroupedCategoryChartSerieBuilder} object.
*/
public static GroupedCategoryChartSerieBuilder groupedSerie(DRIExpression valueExpression) {
return new GroupedCategoryChartSerieBuilder(valueExpression);
}
/**
* groupedSerie.
*
* @param variable a {@link net.sf.dynamicreports.report.builder.VariableBuilder} object.
* @return a {@link net.sf.dynamicreports.report.builder.chart.GroupedCategoryChartSerieBuilder} object.
*/
public static GroupedCategoryChartSerieBuilder groupedSerie(VariableBuilder variable) {
return new GroupedCategoryChartSerieBuilder(variable);
}
// xy serie
/**
* xySerie.
*
* @param column a {@link net.sf.dynamicreports.report.builder.column.ValueColumnBuilder} object.
* @return a {@link net.sf.dynamicreports.report.builder.chart.XyChartSerieBuilder} object.
*/
public static XyChartSerieBuilder xySerie(ValueColumnBuilder column) {
return new XyChartSerieBuilder(column);
}
/**
* xySerie.
*
* @param fieldName a {@link java.lang.String} object.
* @param valueClass a {@link java.lang.Class} object.
* @return a {@link net.sf.dynamicreports.report.builder.chart.XyChartSerieBuilder} object.
*/
public static XyChartSerieBuilder xySerie(String fieldName, Class valueClass) {
return xySerie(DynamicReports.field(fieldName, valueClass));
}
/**
* xySerie.
*
* @param field a {@link net.sf.dynamicreports.report.builder.FieldBuilder} object.
* @return a {@link net.sf.dynamicreports.report.builder.chart.XyChartSerieBuilder} object.
*/
public static XyChartSerieBuilder xySerie(FieldBuilder field) {
return new XyChartSerieBuilder(field);
}
/**
* xySerie.
*
* @param valueExpression a {@link net.sf.dynamicreports.report.definition.expression.DRIExpression} object.
* @return a {@link net.sf.dynamicreports.report.builder.chart.XyChartSerieBuilder} object.
*/
public static XyChartSerieBuilder xySerie(DRIExpression valueExpression) {
return new XyChartSerieBuilder(valueExpression);
}
/**
* xySerie.
*
* @param variable a {@link net.sf.dynamicreports.report.builder.VariableBuilder} object.
* @return a {@link net.sf.dynamicreports.report.builder.chart.XyChartSerieBuilder} object.
*/
public static XyChartSerieBuilder xySerie(VariableBuilder variable) {
return new XyChartSerieBuilder(variable);
}
// xyz serie
/**
* xyzSerie.
*
* @return a {@link net.sf.dynamicreports.report.builder.chart.XyzChartSerieBuilder} object.
*/
public static XyzChartSerieBuilder xyzSerie() {
return new XyzChartSerieBuilder();
}
// gantt serie
/**
* ganttSerie.
*
* @return a {@link net.sf.dynamicreports.report.builder.chart.GanttChartSerieBuilder} object.
*/
public static GanttChartSerieBuilder ganttSerie() {
return new GanttChartSerieBuilder();
}
// charts
/**
* areaChart.
*
* @return a {@link net.sf.dynamicreports.report.builder.chart.AreaChartBuilder} object.
*/
public static AreaChartBuilder areaChart() {
return new AreaChartBuilder();
}
/**
* stackedAreaChart.
*
* @return a {@link net.sf.dynamicreports.report.builder.chart.StackedAreaChartBuilder} object.
*/
public static StackedAreaChartBuilder stackedAreaChart() {
return new StackedAreaChartBuilder();
}
/**
* barChart.
*
* @return a {@link net.sf.dynamicreports.report.builder.chart.BarChartBuilder} object.
*/
public static BarChartBuilder barChart() {
return new BarChartBuilder();
}
/**
* layeredBarChart.
*
* @return a {@link net.sf.dynamicreports.report.builder.chart.LayeredBarChartBuilder} object.
*/
public static LayeredBarChartBuilder layeredBarChart() {
return new LayeredBarChartBuilder();
}
/**
* waterfallBarChart.
*
* @return a {@link net.sf.dynamicreports.report.builder.chart.WaterfallBarChartBuilder} object.
*/
public static WaterfallBarChartBuilder waterfallBarChart() {
return new WaterfallBarChartBuilder();
}
/**
* stackedBarChart.
*
* @return a {@link net.sf.dynamicreports.report.builder.chart.StackedBarChartBuilder} object.
*/
public static StackedBarChartBuilder stackedBarChart() {
return new StackedBarChartBuilder();
}
/**
* groupedStackedBarChart.
*
* @return a {@link net.sf.dynamicreports.report.builder.chart.GroupedStackedBarChartBuilder} object.
*/
public static GroupedStackedBarChartBuilder groupedStackedBarChart() {
return new GroupedStackedBarChartBuilder();
}
/**
* bar3DChart.
*
* @return a {@link net.sf.dynamicreports.report.builder.chart.Bar3DChartBuilder} object.
*/
public static Bar3DChartBuilder bar3DChart() {
return new Bar3DChartBuilder();
}
/**
* stackedBar3DChart.
*
* @return a {@link net.sf.dynamicreports.report.builder.chart.StackedBar3DChartBuilder} object.
*/
public static StackedBar3DChartBuilder stackedBar3DChart() {
return new StackedBar3DChartBuilder();
}
/**
* lineChart.
*
* @return a {@link net.sf.dynamicreports.report.builder.chart.LineChartBuilder} object.
*/
public static LineChartBuilder lineChart() {
return new LineChartBuilder();
}
/**
* pieChart.
*
* @return a {@link net.sf.dynamicreports.report.builder.chart.PieChartBuilder} object.
*/
public static PieChartBuilder pieChart() {
return new PieChartBuilder();
}
/**
* pie3DChart.
*
* @return a {@link net.sf.dynamicreports.report.builder.chart.Pie3DChartBuilder} object.
*/
public static Pie3DChartBuilder pie3DChart() {
return new Pie3DChartBuilder();
}
/**
* timeSeriesChart.
*
* @return a {@link net.sf.dynamicreports.report.builder.chart.TimeSeriesChartBuilder} object.
*/
public static TimeSeriesChartBuilder timeSeriesChart() {
return new TimeSeriesChartBuilder();
}
/**
* differenceChart.
*
* @return a {@link net.sf.dynamicreports.report.builder.chart.DifferenceChartBuilder} object.
*/
public static DifferenceChartBuilder differenceChart() {
return new DifferenceChartBuilder();
}
/**
* xyAreaChart.
*
* @return a {@link net.sf.dynamicreports.report.builder.chart.XyAreaChartBuilder} object.
*/
public static XyAreaChartBuilder xyAreaChart() {
return new XyAreaChartBuilder();
}
/**
* xyBarChart.
*
* @return a {@link net.sf.dynamicreports.report.builder.chart.XyBarChartBuilder} object.
*/
public static XyBarChartBuilder xyBarChart() {
return new XyBarChartBuilder();
}
/**
* xyLineChart.
*
* @return a {@link net.sf.dynamicreports.report.builder.chart.XyLineChartBuilder} object.
*/
public static XyLineChartBuilder xyLineChart() {
return new XyLineChartBuilder();
}
/**
* xyStepChart.
*
* @return a {@link net.sf.dynamicreports.report.builder.chart.XyStepChartBuilder} object.
*/
public static XyStepChartBuilder xyStepChart() {
return new XyStepChartBuilder();
}
/**
* scatterChart.
*
* @return a {@link net.sf.dynamicreports.report.builder.chart.ScatterChartBuilder} object.
*/
public static ScatterChartBuilder scatterChart() {
return new ScatterChartBuilder();
}
/**
* spiderChart.
*
* @return a {@link net.sf.dynamicreports.report.builder.chart.SpiderChartBuilder} object.
*/
public static SpiderChartBuilder spiderChart() {
return new SpiderChartBuilder();
}
/**
* multiAxisChart.
*
* @return a {@link net.sf.dynamicreports.report.builder.chart.MultiAxisChartBuilder} object.
*/
public static MultiAxisChartBuilder multiAxisChart() {
return new MultiAxisChartBuilder();
}
/**
* multiAxisChart.
*
* @param charts a {@link net.sf.dynamicreports.report.builder.chart.AbstractBaseChartBuilder} object.
* @return a {@link net.sf.dynamicreports.report.builder.chart.MultiAxisChartBuilder} object.
*/
public static MultiAxisChartBuilder multiAxisChart(AbstractBaseChartBuilder... charts) {
return new MultiAxisChartBuilder().charts(charts);
}
/**
* xyBlockChart.
*
* @param defaultLowerBound a double.
* @param defaultUpperBound a double.
* @param defaultPaint a {@link java.awt.Paint} object.
* @return a {@link net.sf.dynamicreports.report.builder.chart.XyBlockChartBuilder} object.
*/
public static XyBlockChartBuilder xyBlockChart(double defaultLowerBound, double defaultUpperBound, Paint defaultPaint) {
return new XyBlockChartBuilder(defaultLowerBound, defaultUpperBound, defaultPaint);
}
/**
* bubbleChart.
*
* @return a {@link net.sf.dynamicreports.report.builder.chart.BubbleChartBuilder} object.
*/
public static BubbleChartBuilder bubbleChart() {
return new BubbleChartBuilder();
}
/**
* candlestickChart.
*
* @return a {@link net.sf.dynamicreports.report.builder.chart.CandlestickChartBuilder} object.
*/
public static CandlestickChartBuilder candlestickChart() {
return new CandlestickChartBuilder();
}
/**
* highLowChart.
*
* @return a {@link net.sf.dynamicreports.report.builder.chart.HighLowChartBuilder} object.
*/
public static HighLowChartBuilder highLowChart() {
return new HighLowChartBuilder();
}
/**
* meterChart.
*
* @return a {@link net.sf.dynamicreports.report.builder.chart.MeterChartBuilder} object.
*/
public static MeterChartBuilder meterChart() {
return new MeterChartBuilder();
}
/**
* meterInterval.
*
* @return a {@link net.sf.dynamicreports.report.builder.chart.MeterIntervalBuilder} object.
*/
public static MeterIntervalBuilder meterInterval() {
return new MeterIntervalBuilder();
}
/**
* thermometerChart.
*
* @return a {@link net.sf.dynamicreports.report.builder.chart.ThermometerChartBuilder} object.
*/
public static ThermometerChartBuilder thermometerChart() {
return new ThermometerChartBuilder();
}
/**
* ganttChart.
*
* @return a {@link net.sf.dynamicreports.report.builder.chart.GanttChartBuilder} object.
*/
public static GanttChartBuilder ganttChart() {
return new GanttChartBuilder();
}
}