Class ChartObject

java.lang.Object
java.awt.Component
java.awt.Container
java.awt.Panel
quadbase.ChartAPI.QbChartPanel
quadbase.ChartAPI.QbChartBasic
quadbase.ChartAPI.QbChart
quadbase.reportdesigner.ReportAPI.ChartObject
All Implemented Interfaces:
ActionListener, ImageObserver, MenuContainer, Externalizable, Serializable, EventListener, Accessible, IExportConstants, IMiscConstants, quadbase.chartviewer.IChartHolder, quadbase.common.util.IAlertable, quadbase.common.util.internal.IChart, IChart, IChartTypeConstants, IMapConstants

public class ChartObject extends QbChart implements IChart
A ChartObject is a chart that is wrapped by the class ReportChartObject for insertion into a report. While it is recommended to insert charts using Designer, the following snippet can be used as a template for inserting charts via the API.

    // Create ChartObject
    ChartObject chartObj = new ChartObject(...); // Specify arguments for constructor call

    // Create ReportChartObject to wrap chartObj
    ReportChartObject reportChartObject = new ReportChartObject();

    // Change chartObj properties
    ...

    // Wrap reportChartObject around chartObj
    reportChartObject.setChart(chartObj);

The ReportChartObject is then added to a report section. For example,

    report.getTableFooter().addData(reportChartObject);
See Also:
  • Constructor Details

    • ChartObject

      public ChartObject(QbReport qbReport, int dimension, int chartType, boolean doTransposeData, int[] transposeCol, IColumnMap cmap, String template)
      Create an instance of ChartObject that can embedded in a ReportChartObject, which can be used to insert this chart into a report.
      Parameters:
      qbReport - the parent QbReport object
      dimension - either a 2D, or 3D chart. Can be either ChartObject.VIEW2D, or ChartObject.VIEW3D
      chartType - the type of chart desired. Please see IChartTypeConstants.
      doTransposeData - whether to transpose data prior to plotting.
      transposeCol - the indices of the columns to be transposed
      cmap - the column mapping to use. If using ReportData, values should correspond to ReportTable column indices.
      template - the chart template file, ".tpl" to use for look invalid input: '&' feel.
    • ChartObject

      public ChartObject(QbReport qbReport, int dimension, int chartType, boolean doTransposeData, int[] transposeCol, IColumnMap cmap, String template, quadbase.reportdesigner.ReportElements.ReportTableElement panel)
      Creates an instance of ChartObject that can be embedded in a ReportChartObject, which can be used to insert this chart into a report.
      Parameters:
      qbReport - the parent QbReport object
      dimension - either a 2D, or 3D chart. Can be either ChartObject.VIEW2D, or ChartObject.VIEW3D
      chartType - the type of chart desired. Please see IChartTypeConstants.
      doTransposeData - whether to transpose data prior to plotting.
      transposeCol - the indices of the columns to be transposed
      cmap - the column mapping to use. If using ReportData, values should correspond to ReportTable column indices.
      template - the chart template file, ".tpl" to use for look invalid input: '&' feel.
      panel - reportSection/ reportTable element, target section
    • ChartObject

      public ChartObject(QbReport qbReport, int dimension, int chartType, boolean doTransposeData, int[] transposeCol, IColumnMap cmap, String template, quadbase.reportdesigner.ReportElements.ReportTableElement panel, boolean useSummaryData)
      Creates an instance of ChartObject that can be embedded in a ReportChartObject, which can be used to insert this chart into a report.
      Parameters:
      qbReport - the parent QbReport object
      dimension - either a 2D, or 3D chart. Can be either ChartObject.VIEW2D, or ChartObject.VIEW3D
      chartType - the type of chart desired. Please see IChartTypeConstants.
      doTransposeData - whether to transpose data prior to plotting.
      transposeCol - the indices of the columns to be transposed
      cmap - the column mapping to use. If using ReportData, values should correspond to ReportTable column indices.
      template - the chart template file, ".tpl" to use for look invalid input: '&' feel.
      panel - reportSection/ reportTable element, target section
      useSummaryData - for fixed-field crossTab report only - create summary chart
    • ChartObject

      public ChartObject(Object chartInfo)
      Using chartInfo to create ChartObject. User can get chartInfo from implementing IChartModifier. After creating ChartObject successfully, user can change the chart attribute using ChartObject which extends QbChart. Once the modification is done, return back the ChartObject in IChartModifier #modifyChart().
  • Method Details

    • createChartObject

      public static ChartObject createChartObject(QbReport report, String templateFileName)
      Method to create a new ChartObject that does NOT using report section Aggregation data. To load a ChartObject that using section data, please use the method createChartObject(QbReport, String, ReportSection). This method is used to create a ChartObject based on the report and the template, so that the user does not need to know in advance about the chartType, dimension nor the colInfo. The user will need to make sure that the template is applicable to the report.

      This method is currently only used in the QuickDesigner to edit the chart inside the report.

    • createChartObject

      public static ChartObject createChartObject(QbReport report, String templateFileName, ReportSection panel)
      Creates a ChartOject in a specific ReportSection.
      Parameters:
      report - the main report that holding the chart object
      templateFileName - The chart template applicable to the report column settings
      panel - the report section where the chart is to be inserted. If this parameter is set to null, it won't use any section data and the chart can be put in any section of the report
      Returns:
      - a ChartObject using the templateFileName
      null, if an error occurs
    • setNewData

      public quadbase.chart.Chart setNewData(quadbase.chart.ColData[] colData) throws Exception
      For internal use only
      Specified by:
      setNewData in interface quadbase.common.util.internal.IChart
      Overrides:
      setNewData in class QbChart
      Throws:
      Exception