Skip navigation links
Dashboard

Class XYChartWidget

Inheritance:
  • Field Detail

    • SHAPE_CIRCLE

      public static BBjNumber SHAPE_CIRCLE
    • SHAPE_DIAGONALCROSS

      public static BBjNumber SHAPE_DIAGONALCROSS
    • SHAPE_DIAMOND

      public static BBjNumber SHAPE_DIAMOND
    • SHAPE_DOWNTRIANGLE

      public static BBjNumber SHAPE_DOWNTRIANGLE
    • SHAPE_RECTANGLE

      public static BBjNumber SHAPE_RECTANGLE
    • SHAPE_REGULARCROSS

      public static BBjNumber SHAPE_REGULARCROSS
    • SHAPE_ROUNDRECTANGLE

      public static BBjNumber SHAPE_ROUNDRECTANGLE
    • SHAPE_UPTRIANGLE

      public static BBjNumber SHAPE_UPTRIANGLE
  • Constructor Detail

    • XYChartWidget

      public XYChartWidget(BBjString p_name$, BBjString p_title$, BBjString p_previewText$, BBjString p_previewImage$, BBjString p_chartTitle$, BBjString p_domainTitle$, BBjString p_rangeTitle$, BBjNumber p_orientation, BBjNumber p_legend)

      Create an empty XY Chart specifying all parameters to be filled after creation with setSeriesXYValue()

      Parameters:
      p_name$ The unique name of the chart widget
      p_title$ Title which will display in the title bar
      p_previewText$ A description of the widget used for the preview text in the Customize screen and as the tooltip text on the widget's title
      p_previewImage$ A preview of the chart widget that is shown in the Add/Remove widgets Customize dialog
      p_chartTitle$ The title to be displayed above the pie chart (may be empty)
      p_domainTitle$ The title for the domain axis (may be empty)
      p_rangeTitle$ The title for the range axis (may be empty)
      p_orientation A number that indicates whether the chart will be in portrait or landscape orientation. Example: orientation=XYChartWidget.getORIENTATION_VERTICAL()
      p_legend A number that indicates whether to show a legend for the chart. 0=Do not show legend, 1=Show legend
    • XYChartWidget

      public XYChartWidget(BBjString p_name$, BBjString p_title$, BBjString p_previewText$, BBjString p_previewImage$, BBjString p_chartTitle$, BBjString p_domainTitle$, BBjString p_rangeTitle$, BBjNumber p_orientation, BBjNumber p_legend, BBjString p_connectString$, BBjString p_sql$)

      Create an SQL-based XY Chart specifying all parameters

      Parameters:
      p_name$ The unique name of the chart widget
      p_title$ Title which will display in the title bar
      p_previewText$ A description of the widget used for the preview text in the Customize screen and as the tooltip text on the widget's title
      p_previewImage$ A preview of the chart widget that is shown in the Add/Remove widgets Customize dialog
      p_chartTitle$ The title to be displayed above the pie chart (may be empty)
      p_domainTitle$ The title for the domain axis (may be empty)
      p_rangeTitle$ The title for the range axis (may be empty)
      p_orientation A number that indicates whether the chart will be in portrait or landscape orientation. Example: orientation=XYChartWidget.getORIENTATION_VERTICAL()
      p_legend A number that indicates whether to show a legend for the chart. 0=Do not show legend, 1=Show legend
      p_connectString$ The connection string to the desired database. Example: "jdbc:basis:localhost?database=ChileCompany&user=admin&password=admin123"
      p_sql$ The sql query used to populate the chart. The two columns should be xValue, yValue.
    • XYChartWidget

      public XYChartWidget(BBjString p_name$, BBjString p_title$, BBjString p_previewText$, BBjString p_previewImage$, BBjString p_chartTitle$, BBjString p_domainTitle$, BBjString p_rangeTitle$, BBjNumber p_orientation, BBjNumber p_legend, BBjRecordSet p_rs!, BBjVector p_columns!)

      Create a BBjRecordSet-based XY Chart specifying all parameters

      Parameters:
      p_name$ The unique name of the chart widget
      p_title$ Title which will display in the title bar
      p_previewText$ A description of the widget used for the preview text in the Customize screen and as the tooltip text on the widget's title
      p_previewImage$ A preview of the chart widget that is shown in the Add/Remove widgets Customize dialog
      p_chartTitle$ The title to be displayed above the pie chart (may be empty)
      p_domainTitle$ The title for the domain axis (may be empty)
      p_rangeTitle$ The title for the range axis (may be empty)
      p_orientation A number that indicates whether the chart will be in portrait or landscape orientation. Example: orientation=XYChartWidget.getORIENTATION_VERTICAL()
      p_legend A number that indicates whether to show a legend for the chart. 0=Do not show legend, 1=Show legend
      p_rs! The BBjRecordSet containing the data used to populate the chart
      p_columns! A BBjVector that contains an ordered list of the columns to be used for the charts's data. The entries may be a string corresponding to a field name, or a 0-based index of the column number. If null() is passed in for the p_columns! vector then the first three columns of the BBjRecordSet will be used.
      See Also:
      BBjRecordSet
      BBjVector
    • XYChartWidget

      public XYChartWidget(BBjString p_name$, BBjString p_title$, BBjString p_previewText$, BBjString p_previewImage$, BBjString p_chartTitle$, BBjString p_domainTitle$, BBjString p_rangeTitle$, BBjNumber p_orientation, BBjNumber p_legend, BBjString p_connectString$, BBjString p_sql$, BBjString p_mode$)

      Create an SQL-based XY Chart specifying all parameters

      Parameters:
      p_name$ The unique name of the chart widget
      p_title$ Title which will display in the title bar
      p_previewText$ A description of the widget used for the preview text in the Customize screen and as the tooltip text on the widget's title
      p_previewImage$ A preview of the chart widget that is shown in the Add/Remove widgets Customize dialog
      p_chartTitle$ The title to be displayed above the pie chart (may be empty)
      p_domainTitle$ The title for the domain axis (may be empty)
      p_rangeTitle$ The title for the range axis (may be empty)
      p_orientation A number that indicates whether the chart will be in portrait or landscape orientation. Example: orientation=XYChartWidget.getORIENTATION_VERTICAL()
      p_legend A number that indicates whether to show a legend for the chart. 0=Do not show legend, 1=Show legend
      p_connectString$ The connection string to the desired database. Example: "jdbc:basis:localhost?database=ChileCompany&user=admin&password=admin123"
      p_sql$ The sql query used to populate the chart. The two columns should be xValue, yValue.
      p_mode$ A string comprised of a list of properties and values separated by commas that will be passed to the database or JDBC connection at connect time. For example: "USER=myusername, PWD=mypass, AUTOCOMMIT=N"
      Since:
      BBj 16.00
    • Method Detail

      • clearDataSet

        public void clearDataSet()

        Clears the XY chart's underlying dataset. This is typically done in response to a refresh event, where the dataset is cleared and then repopulated with up-to-date data (via fill() or setSeriesXYValue().

      • clone

        public XYChartWidget clone()

        An internal method used by the Dashboard class to clone a category widget so that it may be displayed in a popped out window

        Returns:
        A cloned version of the original widget
      • create

        public void create(BBjChildWindow p_widgetControlWindow!)

        Creates the XYChartWidget

        Parameters:
        p_widgetControlWindow! The BBjChildWindow that will contain the widget
      • exportData

        public void exportData(BBjNumber p_parentX, BBjNumber p_parentY, BBjNumber p_parentWidth, BBjNumber p_parentHeight)

        Displays an export dialog that allows the user to export the widget's data to a CSV file with several output options

        Parameters:
        p_parentX X location of the parent window
        p_parentY Y location of the parent window
        p_parentWidth Width of the parent window
        p_parentHeight Height of the parent window
      • fill

        public void fill(BBjString p_connectString$, BBjString p_sql$)

        Create an XYSeries based off of the widget name, fill it with data from a query, and add it to the XYSeriesCollection for the chart

        Parameters:
        p_connectString$ The connection string to the desired database. Example: "jdbc:basis:localhost?database=ChileCompany&user=admin&password=admin123"
        p_sql$ The sql query used to populate the chart. The two columns should be xValue, yValue.
      • fill

        public void fill(BBjString p_seriesName$, BBjString p_connectString$, BBjString p_sql$)

        Create an XYSeries, fill it with data from a query, and add it to the XYSeriesCollection for the chart

        Parameters:
        p_seriesName$ The unique name of the XYSeries to add to the chart. Subsequent calls to get or set data in the series will use this name to identify it.
        p_connectString$ The connection string to the desired database. Example: "jdbc:basis:localhost?database=ChileCompany&user=admin&password=admin123"
        p_sql$ The sql query used to populate the chart. The two columns should be xValue, yValue.
      • fill

        public void fill(BBjString p_seriesName$, BBjString p_connectString$, BBjString p_sql$, BBjString p_mode$)

        Create an XYSeries, fill it with data from a query, and add it to the XYSeriesCollection for the chart

        Parameters:
        p_seriesName$ The unique name of the XYSeries to add to the chart. Subsequent calls to get or set data in the series will use this name to identify it.
        p_connectString$ The connection string to the desired database. Example: "jdbc:basis:localhost?database=ChileCompany&user=admin&password=admin123"
        p_sql$ The sql query used to populate the chart. The two columns should be xValue, yValue.
        p_mode$ A string comprised of a list of properties and values separated by commas that will be passed to the database or JDBC connection at connect time. For example: "USER=myusername, PWD=mypass, AUTOCOMMIT=N"
        Since:
        BBj 16.00
      • fill

        public void fill(BBjString p_seriesName$, BBjRecordSet p_rs!, BBjVector p_columns!)

        Create an XYSeries, fill it with data from a BBjRecordSet and vector of columns, and add it to the XYSeriesCollection for the chart

        Parameters:
        p_seriesName$ The unique name of the XYSeries to add to the chart. Subsequent calls to get or set data in the series will use this name to identify it.
        p_rs! The BBjRecordSet containing the data used to populate the chart
        p_columns! A BBjVector that contains an ordered list of the columns to be used for the charts's data. The entries may be a string corresponding to a field name, or a 0-based index of the column number. If null() is passed in for the p_columns! vector then the first three columns of the BBjRecordSet will be used.
      • getDataset

        public org.jfree.data.category.Defaultorg.jfree.data.category.CategoryDataset getDataset()

        Deprecated as of BBj 20.20 - This method used to returns the XYChart's underlying dataset but now returns null() - use the XYChartWidget.getXYDataset() method instead to get the chart's XYSeriesCollection

        Note that PieCharts return a DefaultPieDataset, BarCharts and LineCharts return a DefaultCategoryDataset, and XYCharts return an XYSeriesCollection

        Returns:
        In BBj 20.20 and higher this returns null() - use the XYChartWidget.getXYDataset() method instead to get the chart's XYSeriesCollection
        Deprecated:
        As of BBj 20.20, replaced by XYChartWidget.getXYDataset().
      • getNumItems

        public BBjNumber getNumItems()

        Gets the number of items in the first series in the chart

        Returns:
        The number of items or rows of data in the first series
      • getNumItems

        public BBjNumber getNumItems(BBjNumber p_series)

        Gets the number of items in the chart for a particular series

        Parameters:
        p_series The series to query
        Returns:
        The number of items or rows of data in the series
        See Also:
        Oracle's Paint documentation for more information.
      • getNumRows

        public BBjNumber getNumRows()

        Gets the number of series (number of lines) in the chart

        Returns:
        The number of series or lines in the chart
      • getSeries

        public Series getSeries(BBjString p_seriesName$)

        Returns the requested series

        Parameters:
        p_seriesName Name of the series to return
        Returns:
        Series which contains series information
      • getSeriesName

        public BBjString getSeriesName(BBjNumber p_seriesNumber)

        Returns the name of the specified series number associated with the XY Chart

        Returns:
        A BBjString with the name of the series, or an empty string if the series number is not valid
      • getSeriesNameVector

        public BBjVector getSeriesNameVector()

        Returns the names of the series associated with the XY Chart

        Returns:
        BBjVector which contains the names of the series associated with the XY Chart
      • getSeriesNumber

        public BBjNumber getSeriesNumber(BBjString p_seriesName$)

        Returns the number of the specified series name associated with the XY Chart

        Returns:
        A BBjNumber with the series number, or -1 if the series name is not valid
      • getXYDataset

        public org.jfree.data.xy.org.jfree.data.xy.XYSeriesCollection getXYDataset()

        Returns the XYChart's underlying dataset, which is a JFreeChart XYSeriesCollection

        Note that PieCharts return a DefaultPieDataset, BarCharts and LineCharts return a DefaultCategoryDataset, and XYCharts return an XYSeriesCollection

        Returns:
        The chart's underlying dataset as a JFreeChart XYSeriesCollection
        See Also:
        JFreeChart's XYSeriesCollection documentation for more information.
        Since:
        BBj 20.20
      • isEmpty

        public BBjNumber isEmpty()

        Indicates whether the widget's dataset is empty or not

        Returns:
        0=Not empty, 1=empty
        Since:
        BBj 16.00
      • isRecordSetBased

        public BBjNumber isRecordSetBased()

        Indicates whether the chart's dataset was built from a BBjRecordSet

        Returns:
        0=Not RecordSet Based, 1=RecordSet Based
      • isSQLBased

        public BBjNumber isSQLBased()

        Indicates whether the chart's dataset was built from an SQL query

        Returns:
        0=Not SQL Based, 1=SQL Based
      • refresh

        public void refresh()

        Refreshes the chart, which results in the widget showing an up-to-date version of the chart. This is executed in response to a refresh event, and the chart is filled with curent data and all customizations are applied

      • removeSeries

        public void removeSeries(BBjString p_seriesName$)

        Removes the requested series

        Parameters:
        p_seriesName Name of the series to remove
      • setDataSetValue

        public void setDataSetValue(BBjString p_seriesName$, BBjNumber p_xValue, BBjNumber p_yValue)

        Add an XY data point to the specified series in the XYSeriesCollection for the chart. This method is the same as setSeriesXYValue(), and exists to be consistent with other chart types.

        If the chart has multiple series, they will be rendered in reverse order. So the last series added will be the first series rendered. This matters if you're mixing filled and non-filled series data.

        Parameters:
        p_seriesName$ The unique name of the XYSeries to add the data to. If the series does not exist in the DataSet it will be added automatically.
        p_xValue The X value of the data point.
        p_yValue The Y value of the data point.
      • setDomainAxisLabelGridBandColor

        public void setDomainAxisLabelGridBandColor(BBjString p_colorHexString$, BBjNumber p_opacity)

        Sets the color and opacity for the grid band that's shown when the chart is configured with a custom domain axis label via the setDomainAxisLabels() method.

        Parameters:
        p_colorHexString$ A string with a hex description of the color for marker. Example: "#ffccaa" or "#fca"
        p_opacity A number from 0-1 that determines the starting opacity level (0=transparent, 1=opaque)
      • setDomainAxisLabels

        public void setDomainAxisLabels(BBjString p_domainAxisTitle$, BBjString p_labels!)

        Configure a custom domain title and label set

        Important: Note that the new Axis label set dramatically impacts the display of the data. If the dataset contains 10 items, but the new axis only contains 3 items, then the chart will only show 3 items. If the dataset contains 10 items, but the new axis contains 20 items, then the right half of the chart will be empty without any data plotted on it since there is no data that corresponds to the axis item. Also, the new axis items are zero-based, meaning that your dataset should be adjusted to be zero-based as well. Therefore, if the dataset used values like 2010, 2011, but the new axis used values like "Year 2010, Year 2011", then the plot would be empty. This is because the plot will now start with the X value of 0 and continue on for as many axis labels you provided. However, the dataset used values starting with 2010, so they will be rendered out of bounds, and would only show up if you provided more that two thousand axis label items.

        Parameters:
        p_domainAxisTitle$ The new domain axis title string
        p_labels! A comma separated string of values for the labels that will be distributed along the domain axis
      • setSeriesConfiguration

        public void setSeriesConfiguration(BBjString p_seriesName$, BBjNumber p_drawLines, BBjNumber p_drawShapes, BBjNumber p_shapeNumber, BBjNumber p_smoothLines, Color p_fillColor!, BBjNumber p_lineWidth, BBjNumber p_shapeSize, BBjNumber p_drawOutline, BBjNumber p_outlineWidth, Color p_outlineColor!)

        Configure a series in the XYSeriesCollection for the chart by setting various parameters

        Parameters:
        p_seriesName$ The unique name of the XYSeries to add the data to. If the series does not exist in the DataSet it will be added automatically.
        p_drawLines Inticates whether to draw the lines between data points. 0=NoLines, 1=Lines
        p_drawShapes Inticates whether to draw shapes (circles) around the data points. 0=NoShapes, 1=Shapes
        p_shapeNumber Indicates the type of shape to draw
        p_smoothLines Indicates that the series line should be drawn as smooth curves or straight lines between data points. 0=StraightLines, 1=SmoothCurves.
        p_fillColor! For smooth lines, this is the fill color underneath the curve. For straight lines, it is the fill color of the shapes.
        p_lineWidth The width of the series line.
        p_shapeSize The size of the shape (circle radius) around the data point
        p_drawOutline Indicates whether to draw an outline around the shape or not. 0=NoOutline, 1=Outline.
        p_outlineWidth The width of the shape's outline.
        p_outlineColor! The Color of the shape outline.
      • setSeriesXYValue

        public void setSeriesXYValue(BBjString p_seriesName$, BBjNumber p_xValue, BBjNumber p_yValue)

        Add an XY data point to the specified series in the XYSeriesCollection for the chart.

        If the chart has multiple series, they will be rendered in reverse order. So the last series added will be the first series rendered. This matters if you're mixing filled and non-filled series data.

        Parameters:
        p_seriesName$ The unique name of the XYSeries to add the data to. If the series does not exist in the DataSet it will be added automatically.
        p_xValue The X value of the data point.
        p_yValue The Y value of the data point.
      • viewData

        public void viewData()

        Exports the widget's data to a CSV file and displays it in the application associated with CSV files on the client's machine