Package net.sf.jasperreports.charts.util
Class ChartsApiWriter
- java.lang.Object
-
- net.sf.jasperreports.charts.util.ChartsApiWriter
-
- All Implemented Interfaces:
ChartVisitor
public class ChartsApiWriter extends Object implements ChartVisitor
A writer that generates the Java code required to produce a given report template programmatically, using the JasperReports API.- Author:
- Teodor Danciu (teodord@users.sourceforge.net)
-
-
Constructor Summary
Constructors Constructor Description ChartsApiWriter(JRApiWriterVisitor visitor)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
visitChart(JRChart chart)
void
writeAreaChart(JRChart chart, String chartName)
void
writeAxisFormat(String indent, JRFont axisLabelFont, Color axisLabelColor, JRFont axisTickLabelFont, Color axisTickLabelColor, String axisTickLabelMask, Boolean axisVerticalTickLabels, Color axisLineColor, String parentName, String axisNameSuffix, boolean isToSet)
Writes out the axis format block for a chart axis.void
writeBar3DChart(JRChart chart, String chartName)
Deprecated.To be removed.void
writeBar3DPlot(JRBar3DPlot plot, String chartName)
Deprecated.To be removed.void
writeBarChart(JRChart chart, String chartName)
void
writeBubbleChart(JRChart chart, String chartName)
void
writeCandlestickChart(JRChart chart, String chartName)
void
writeCategoryAxisFormat(String indent, JRFont axisLabelFont, Color axisLabelColor, JRFont axisTickLabelFont, Color axisTickLabelColor, String axisTickLabelMask, Boolean axisVerticalTickLabels, Double labelRotation, Color axisLineColor, String parentName)
Writes out the category axis format block.void
writeChartTag(JRChart chart, String chartName)
void
writeDataRange(JRDataRange dataRange, String parentName, String dataRangeSuffix)
Writes a data range block to the output stream.void
writeGanttChart(JRChart chart, String chartName)
void
writeHighLowChart(JRChart chart, String chartName)
void
writeHighLowDataset(JRHighLowDataset dataset, String parentName, String datasetNameSuffix)
void
writeItemLabel(JRItemLabel itemLabel, String parentName, String itemLabelSuffix)
Writes the description of how to display item labels in a category plot.void
writeLineChart(JRChart chart, String chartName)
void
writeMeterChart(JRChart chart, String chartName)
Writes the definition of a meter chart to the output stream.void
writeMultiAxisChart(JRChart chart, String chartName)
Writes the definition of a multiple axis chart to the output stream.void
writePie3DChart(JRChart chart, String chartName)
Deprecated.To be removed.void
writePieChart(JRChart chart, String chartName)
void
writePieDataset(JRPieDataset dataset, String parentName, String datasetNameSuffix)
void
writeScatterChart(JRChart chart, String chartName)
void
writeStackedAreaChart(JRChart chart, String chartName)
void
writeStackedBar3DChart(JRChart chart, String chartName)
Deprecated.To be removed.void
writeStackedBarChart(JRChart chart, String chartName)
void
writeThermometerChart(JRChart chart, String chartName)
Writes the description of a thermometer chart to the output stream.void
writeTimeSeriesChart(JRChart chart, String chartName)
void
writeValueDataset(JRValueDataset dataset, String parentName, String datasetNameSuffix)
Writes the description of a value dataset to the output stream.void
writeValueDisplay(JRValueDisplay valueDisplay, String parentName)
Writes the description of how to display a value in a valueDataset.void
writeXyAreaChart(JRChart chart, String chartName)
void
writeXyBarChart(JRChart chart, String chartName)
void
writeXyLineChart(JRChart chart, String chartName)
-
-
-
Constructor Detail
-
ChartsApiWriter
public ChartsApiWriter(JRApiWriterVisitor visitor)
-
-
Method Detail
-
visitChart
public void visitChart(JRChart chart)
- Specified by:
visitChart
in interfaceChartVisitor
-
writePieDataset
public void writePieDataset(JRPieDataset dataset, String parentName, String datasetNameSuffix)
-
writeValueDataset
public void writeValueDataset(JRValueDataset dataset, String parentName, String datasetNameSuffix)
Writes the description of a value dataset to the output stream.- Parameters:
dataset
- the value dataset to persist
-
writeValueDisplay
public void writeValueDisplay(JRValueDisplay valueDisplay, String parentName)
Writes the description of how to display a value in a valueDataset.- Parameters:
valueDisplay
- the description to save
-
writeItemLabel
public void writeItemLabel(JRItemLabel itemLabel, String parentName, String itemLabelSuffix)
Writes the description of how to display item labels in a category plot.- Parameters:
itemLabel
- the description to save
-
writeDataRange
public void writeDataRange(JRDataRange dataRange, String parentName, String dataRangeSuffix)
Writes a data range block to the output stream.- Parameters:
dataRange
- the range to write
-
writePie3DChart
public void writePie3DChart(JRChart chart, String chartName)
Deprecated.To be removed.
-
writeCategoryAxisFormat
public void writeCategoryAxisFormat(String indent, JRFont axisLabelFont, Color axisLabelColor, JRFont axisTickLabelFont, Color axisTickLabelColor, String axisTickLabelMask, Boolean axisVerticalTickLabels, Double labelRotation, Color axisLineColor, String parentName)
Writes out the category axis format block.- Parameters:
axisLabelFont
- font to use for the axis labelaxisLabelColor
- color to use for the axis labelaxisTickLabelFont
- font to use for the label of each tick markaxisTickLabelColor
- color to use for the label of each tick markaxisTickLabelMask
- formatting mask to use for the label of each tick markaxisVerticalTickLabels
- flag to render tick labels at 90 degreeslabelRotation
- label rotation angleaxisLineColor
- the color to use for the axis line and any tick marks
-
writeAxisFormat
public void writeAxisFormat(String indent, JRFont axisLabelFont, Color axisLabelColor, JRFont axisTickLabelFont, Color axisTickLabelColor, String axisTickLabelMask, Boolean axisVerticalTickLabels, Color axisLineColor, String parentName, String axisNameSuffix, boolean isToSet)
Writes out the axis format block for a chart axis.- Parameters:
axisLabelFont
- font to use for the axis labelaxisLabelColor
- color to use for the axis labelaxisTickLabelFont
- font to use for the label of each tick markaxisTickLabelColor
- color to use for the label of each tick markaxisTickLabelMask
- formatting mask to use for the label of each tick markaxisVerticalTickLabels
- flag to render tick labels at 90 degreesaxisLineColor
- the color to use for the axis line and any tick marks
-
writeBar3DPlot
public void writeBar3DPlot(JRBar3DPlot plot, String chartName)
Deprecated.To be removed.
-
writeBar3DChart
public void writeBar3DChart(JRChart chart, String chartName)
Deprecated.To be removed.
-
writeStackedBar3DChart
public void writeStackedBar3DChart(JRChart chart, String chartName)
Deprecated.To be removed.
-
writeHighLowDataset
public void writeHighLowDataset(JRHighLowDataset dataset, String parentName, String datasetNameSuffix)
-
writeMeterChart
public void writeMeterChart(JRChart chart, String chartName)
Writes the definition of a meter chart to the output stream.- Parameters:
chart
- the meter chart to write
-
writeThermometerChart
public void writeThermometerChart(JRChart chart, String chartName)
Writes the description of a thermometer chart to the output stream.- Parameters:
chart
- the thermometer chart to write
-
writeMultiAxisChart
public void writeMultiAxisChart(JRChart chart, String chartName)
Writes the definition of a multiple axis chart to the output stream.- Parameters:
chart
- the multiple axis chart to write
-
-