Class 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)
    • Method Detail

      • 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
      • writePieChart

        public void writePieChart​(JRChart chart,
                                  String chartName)
      • 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 label
        axisLabelColor - color to use for the axis label
        axisTickLabelFont - font to use for the label of each tick mark
        axisTickLabelColor - color to use for the label of each tick mark
        axisTickLabelMask - formatting mask to use for the label of each tick mark
        axisVerticalTickLabels - flag to render tick labels at 90 degrees
        labelRotation - label rotation angle
        axisLineColor - 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 label
        axisLabelColor - color to use for the axis label
        axisTickLabelFont - font to use for the label of each tick mark
        axisTickLabelColor - color to use for the label of each tick mark
        axisTickLabelMask - formatting mask to use for the label of each tick mark
        axisVerticalTickLabels - flag to render tick labels at 90 degrees
        axisLineColor - the color to use for the axis line and any tick marks
      • writeBar3DPlot

        public void writeBar3DPlot​(JRBar3DPlot plot,
                                   String chartName)
        Deprecated.
        To be removed.
      • writeBarChart

        public void writeBarChart​(JRChart chart,
                                  String chartName)
      • writeBar3DChart

        public void writeBar3DChart​(JRChart chart,
                                    String chartName)
        Deprecated.
        To be removed.
      • writeBubbleChart

        public void writeBubbleChart​(JRChart chart,
                                     String chartName)
      • writeStackedBarChart

        public void writeStackedBarChart​(JRChart chart,
                                         String chartName)
      • writeStackedBar3DChart

        public void writeStackedBar3DChart​(JRChart chart,
                                           String chartName)
        Deprecated.
        To be removed.
      • writeLineChart

        public void writeLineChart​(JRChart chart,
                                   String chartName)
      • writeTimeSeriesChart

        public void writeTimeSeriesChart​(JRChart chart,
                                         String chartName)
      • writeHighLowChart

        public void writeHighLowChart​(JRChart chart,
                                      String chartName)
      • writeGanttChart

        public void writeGanttChart​(JRChart chart,
                                    String chartName)
      • writeCandlestickChart

        public void writeCandlestickChart​(JRChart chart,
                                          String chartName)
      • writeAreaChart

        public void writeAreaChart​(JRChart chart,
                                   String chartName)
      • writeScatterChart

        public void writeScatterChart​(JRChart chart,
                                      String chartName)
      • writeXyAreaChart

        public void writeXyAreaChart​(JRChart chart,
                                     String chartName)
      • writeXyBarChart

        public void writeXyBarChart​(JRChart chart,
                                    String chartName)
      • writeXyLineChart

        public void writeXyLineChart​(JRChart chart,
                                     String chartName)
      • 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
      • writeStackedAreaChart

        public void writeStackedAreaChart​(JRChart chart,
                                          String chartName)
      • writeChartTag

        public void writeChartTag​(JRChart chart,
                                  String chartName)