public class ChartWidget extends BBjWidget implements SaveableWidget,
ChartWidget The base chart class that all the other charts extend. The ChartWidget allows you to set various properties that apply to all or most chart types. It also offers utility methods to set colors, pick color themes, and manipulate colors' saturation, lightness, opacity, and more.
Modifier and Type | Field and Description |
---|---|
static BBjNumber | ColorThemeAgate |
static BBjNumber | ColorThemeAntiquePewter |
static BBjNumber | ColorThemeAntler |
static BBjNumber | ColorThemeBamboo |
static BBjNumber | ColorThemeBeachStrata |
static BBjNumber | ColorThemeBerryPreserves |
static BBjNumber | ColorThemeBerryTart |
static BBjNumber | ColorThemeBiscayneBay |
static BBjNumber | ColorThemeBlackberries |
static BBjNumber | ColorThemeBloodOrange |
static BBjNumber | ColorThemeBlue |
static BBjNumber | ColorThemeBlueFrost |
static BBjNumber | ColorThemeBlueJewel |
static BBjNumber | ColorThemeBluesAndBrowns |
static BBjNumber | ColorThemeBreezy |
static BBjNumber | ColorThemeBreezyToo |
static BBjNumber | ColorThemeBrown |
static BBjNumber | ColorThemeBrownFur |
static BBjNumber | ColorThemeCamo |
static BBjNumber | ColorThemeCampsite |
static BBjNumber | ColorThemeCanary |
static BBjNumber | ColorThemeChocolateRaspberry |
static BBjNumber | ColorThemeCitrus |
static BBjNumber | ColorThemeCoastline |
static BBjNumber | ColorThemeColorful1 |
static BBjNumber | ColorThemeColorful2 |
static BBjNumber | ColorThemeColorful3 |
static BBjNumber | ColorThemeColorful4 |
static BBjNumber | ColorThemeColorful5 |
static BBjNumber | ColorThemeColorful6 |
static BBjNumber | ColorThemeColorful7 |
static BBjNumber | ColorThemeCoral |
static BBjNumber | ColorThemeCranberry |
static BBjNumber | ColorThemeCranberryTart |
static BBjNumber | ColorThemeDarkToLight |
static BBjNumber | ColorThemeDeepBlueSea |
static BBjNumber | ColorThemeDefault |
static BBjNumber | ColorThemeDismal |
static BBjNumber | ColorThemeDivergentBlueTanGreen |
static BBjNumber | ColorThemeDivergentBlueTanRed |
static BBjNumber | ColorThemeDivergentBlueWhiteRed |
static BBjNumber | ColorThemeDivergentRedOrangeRed |
static BBjNumber | ColorThemeDriedRoses |
static BBjNumber | ColorThemeEarlyAmerican |
static BBjNumber | ColorThemeEarthTones1 |
static BBjNumber | ColorThemeEarthTones2 |
static BBjNumber | ColorThemeEarthTones3 |
static BBjNumber | ColorThemeEscape |
static BBjNumber | ColorThemeEveningThunder |
static BBjNumber | ColorThemeFeathers |
static BBjNumber | ColorThemeFlorida |
static BBjNumber | ColorThemeGray |
static BBjNumber | ColorThemeGrayscaleTransparent |
static BBjNumber | ColorThemeGreen |
static BBjNumber | ColorThemeHeirloom |
static BBjNumber | ColorThemeHomestyle |
static BBjNumber | ColorThemeIcyLeaves |
BBjNumber | ColorThemeIndex The index of the color theme associated with the widget, if applicable |
static BBjNumber | ColorThemeLakeside |
static BBjNumber | ColorThemeLavender |
static BBjNumber | ColorThemeMargarita |
static BBjNumber | ColorThemeMistyGarden |
static BBjNumber | ColorThemeMountainMist |
static BBjNumber | ColorThemeMountainSunset |
static BBjNumber | ColorThemeOliveBranch |
static BBjNumber | ColorThemeOrange |
static BBjNumber | ColorThemePeacock |
static BBjNumber | ColorThemePetals |
static BBjNumber | ColorThemePomegranate |
static BBjNumber | ColorThemePowderedCookie |
static BBjNumber | ColorThemePurple |
static BBjNumber | ColorThemePurpleBerry |
static BBjNumber | ColorThemeRed |
static BBjNumber | ColorThemeRetro |
static BBjNumber | ColorThemeRooster |
static BBjNumber | ColorThemeRope |
static BBjNumber | ColorThemeRosemary |
static BBjNumber | ColorThemeSandyBeach |
static BBjNumber | ColorThemeSeaFoam |
static BBjNumber | ColorThemeSepia |
static BBjNumber | ColorThemeSky |
static BBjNumber | ColorThemeTomorrowDark |
static BBjNumber | ColorThemeTomorrowLight |
static BBjNumber | ColorThemeTropicalSunset |
static BBjNumber | ColorThemeWatermelon |
static BBjNumber | ColorThemeWinterRobin |
BBjVector | CustomChartColors! A BBjVector containing one or more Java Color objects to be used when customizing the ChartWidget's colors |
static BBjNumber | DATA_ITEM_LABEL_POSITION_INSIDE_BOTTOM A constant that indicates a category-based chart's data item label will be placed inside the item toward the bottom, used with the ChartWidget::setChartDataItemLabels() method. |
static BBjNumber | DATA_ITEM_LABEL_POSITION_INSIDE_CENTER A constant that indicates a category-based chart's data item label will be placed inside the item at the center, used with the ChartWidget::setChartDataItemLabels() method and the default when the position is not specified. |
static BBjNumber | DATA_ITEM_LABEL_POSITION_INSIDE_LEFT A constant that indicates a category-based chart's data item label will be placed inside the item toward the left, used with the ChartWidget::setChartDataItemLabels() method. |
static BBjNumber | DATA_ITEM_LABEL_POSITION_INSIDE_RIGHT A constant that indicates a category-based chart's data item label will be placed inside the item toward the right, used with the ChartWidget::setChartDataItemLabels() method. |
static BBjNumber | DATA_ITEM_LABEL_POSITION_INSIDE_TOP A constant that indicates a category-based chart's data item label will be placed inside the item toward the top, used with the ChartWidget::setChartDataItemLabels() method. |
static BBjNumber | DATA_ITEM_LABEL_POSITION_OUTSIDE_BOTTOM A constant that indicates a category-based chart's data item label will be placed outside the item toward the bottom, used with the ChartWidget::setChartDataItemLabels() method. |
static BBjNumber | DATA_ITEM_LABEL_POSITION_OUTSIDE_LEFT A constant that indicates a category-based chart's data item label will be placed outside the item toward the left, used with the ChartWidget::setChartDataItemLabels() method. |
static BBjNumber | DATA_ITEM_LABEL_POSITION_OUTSIDE_RIGHT A constant that indicates a category-based chart's data item label will be placed outside the item toward the right, used with the ChartWidget::setChartDataItemLabels() method. |
static BBjNumber | DATA_ITEM_LABEL_POSITION_OUTSIDE_TOP A constant that indicates a category-based chart's data item label will be placed outside the item toward the top, used with the ChartWidget::setChartDataItemLabels() method. |
static org.jfree.chart.ui.HorizontalAlignment | HAlignCenter! A constant to define horizontal alignment of the chart legend's container |
static org.jfree.chart.ui.HorizontalAlignment | HAlignLeft! A constant to define horizontal alignment of the chart legend's container |
static org.jfree.chart.ui.HorizontalAlignment | HAlignRight! A constant to define horizontal alignment of the chart legend's container |
BBjImage | LastRenderedImage! The last rendered version of the chart in a BBjImage format used for the Customize window's preview |
static BBjNumber | LEGENDSHAPE_CAPSULE A constant to define the legend items' shape |
static BBjNumber | LEGENDSHAPE_CIRCLE A constant to define the legend items' shape |
static BBjNumber | LEGENDSHAPE_DIAMOND A constant to define the legend items' shape |
static BBjNumber | LEGENDSHAPE_ELLIPSE A constant to define the legend items' shape |
static BBjNumber | LEGENDSHAPE_RECTANGLE A constant to define the legend items' shape |
static BBjNumber | LEGENDSHAPE_ROUNDEDRECTANGLE A constant to define the legend items' shape |
static BBjNumber | LEGENDSHAPE_SQUARE A constant to define the legend items' shape |
static Rectangle | SideBottom! A constant to define the bottom edge used when setting the position of the chart legend |
static Rectangle | SideLeft! A constant to define the left edge used when setting the position of the chart legend |
static Rectangle | SideRight! A constant to define the right edge used when setting the position of the chart legend |
static Rectangle | SideTop! A constant to define the top edge used when setting the position of the chart legend |
BBjString | TipBackColor$ The background color of the chart's tip, specified as a hex color string |
BBjNumber | TipBackColorOpacity The background color's opacity of the chart's tip, specified as a number between 0 and 1 (0=transparent, 1=opaque) |
BBjNumber | TipDisplayTime The display time in seconds of the chart's tip |
BBjString | TipForeColor$ The foreground color of the chart's tip, specified as a hex color string |
BBjNumber | TipForeColorOpacity The foreground color's opacity of the chart's tip, specified as a number between 0 and 1 (0=transparent, 1=opaque) |
static org.jfree.chart.ui.VerticalAlignment | VAlignBottom! A constant to define vertical alignment of the chart legend's container |
static org.jfree.chart.ui.VerticalAlignment | VAlignCenter! A constant to define vertical alignment of the chart legend's container |
static org.jfree.chart.ui.VerticalAlignment | VAlignTop! A constant to define vertical alignment of the chart legend's container |
BASIS_DASHBOARD_UTILITY_FILL_ERROR_ACTION_KEY_NAME$, CachedImage!, DashboardWidget!, FillErrorAction, ON_FILL_ERROR_IGNORE, ON_FILL_ERROR_STOP, ON_FILL_ERROR_WARN, UserData! Fields inherited from class BBjWidget
BASIS_UTILITY_DEVICE_PIXEL_RATIO_KEY_NAME$, DevicePixelRatio!
Modifier and Type | Method and Description |
---|---|
void | addChartDomainMarker(BBjString p_key$, BBjString p_markerColorDesc$, BBjNumber p_markerOpacity, BBjString p_label$, BBjString p_labelColorDesc$, BBjNumber p_labelOpacity, RectangleAnchor p_rectangleAnchor!, TextAnchor p_textAnchor!) Adds a threshold marker for the chart's domain (markers are typically added to plots to highlight or draw attention to specific values) - note that this applies only to category-based charts (BarCharts, LineCharts, AreaCharts) and XYCharts that have a domain and range axis. This method allows you to add multiple domain markers to a chart while specifying the label text and position. In contrast, the setChartDomainMarker() methods only allow to you specify a single marker and does not include a label for the marker. Typically a marker will be drawn by the renderer as a line perpendicular to the domain axis, however this is entirely up to the renderer. Note that this does not apply to charts without a domain, such as a PieChart or RingChart. The rectangle anchor will typically be a value like RectangleAnchor.TOP, RectangleAnchor.CENTER, RectangleAnchor.TOP_LEFT, RectangleAnchor.BOTTOM_RIGHT. The text anchor will typically be a value like TextAnchor.TOP, TextAnchor.CENTER, TextAnchor.CENTER_LEFT, TextAnchor.CENTER_RIGHT, TextAnchor.TOP_LEFT, TextAnchor.BOTTOM_RIGHT. |
void | addChartRangeMarker(BBjNumber p_value, BBjString p_colorDesc$, BBjNumber p_opacity, BBjString p_label$, BBjString p_labelColorDesc$, BBjNumber p_labelOpacity, RectangleAnchor p_rectangleAnchor!, TextAnchor p_textAnchor!) Adds a threshold marker for the chart's range (markers are typically added to plots to highlight or draw attention to specific values) - note that this applies only to category-based charts (BarCharts, LineCharts, AreaCharts) and XYCharts that have a domain and range axis. This method allows you to add multiple range markers to a chart while specifying the label text and position. In contrast, the setChartRangeMarker() methods only allow to you specify a single marker and does not include a label for the marker. Typically a marker will be drawn by the renderer as a line perpendicular to the range axis, however this is entirely up to the renderer. Note that this does not apply to charts without a range, such as a PieChart or RingChart. The rectangle anchor will typically be a value like RectangleAnchor.TOP, RectangleAnchor.CENTER, RectangleAnchor.TOP_LEFT, RectangleAnchor.BOTTOM_RIGHT. The text anchor will typically be a value like TextAnchor.TOP, TextAnchor.CENTER, TextAnchor.CENTER_LEFT, TextAnchor.CENTER_RIGHT, TextAnchor.TOP_LEFT, TextAnchor.BOTTOM_RIGHT. Note that the range marker label will not display in a 3DLineChart due to a limitation in the underlying JFreeCharts libary. The range marker will still be rendered, but the label will be absent unless it's a different type of category chart. |
static Color | adjustColorBrightness(Color p_color!, BBjNumber p_fraction) Lighten or Darken a Color by a specified amount |
static Color | adjustColorOpacity(Color p_color!, BBjNumber p_fraction) Sets the opacity for a Color to a specified amount |
static Color | adjustColorSaturation(Color p_color!, BBjNumber p_fraction) Saturate or Desaturate a Color by a specified amount |
static BBjVector | adjustColorVectorBrightness(BBjVector p_colorVector!, BBjNumber p_fraction) Lighten or Darken every color in the vector by a specified amount |
static BBjVector | adjustColorVectorOpacity(BBjVector p_colorVector!, BBjNumber p_fraction) Increase or decrease the opacity for every color in the vector to a specified amount |
static BBjVector | adjustColorVectorOpacityToFixedAmount(BBjVector p_colorVector!, BBjNumber p_opacity) Sets the opacity to a fixed amount for every color in the vector |
static BBjVector | adjustColorVectorSaturation(BBjVector p_colorVector!, BBjNumber p_fraction) Saturate or Desaturate every color in the vector by a specified amount |
void | cloneCommonChartWidgetParameters(ChartWidget widget!) A method used internally to propagate a chart widget's properties to a cloned version of the chart |
static BBjImage | createCombinedImage(BBjImage p_imageBottom!, BBjImage p_imageTop!, BBjNumber p_width, BBjNumber p_height) Creates a BBjImage by overlaying one image on top of another, specifying the final image dimensions |
static BBjImage | createCombinedImagesWithText(BBjImage p_imageBottom!, BBjImage p_imageMiddle!, BBjString p_text$, BBjNumber p_width, BBjNumber p_height) Creates a BBjImage by combining two images with text This is an internal method that's used to draw text (such as the user-settable ErrorDisplayText) over two existing images (such as a partially-filled chart and default error image). It's a convenience method that combines calls to the createImageFromText() and createCombinedImage() methods. |
static BBjImage | createCombinedImageWithText(BBjImage p_image!, BBjString p_text$, BBjNumber p_width, BBjNumber p_height) Creates a BBjImage by combining an existing image with text This is an internal method that's used to draw text (such as the user-settable ErrorDisplayText) over an existing image (such as a partially-filled chart). It's a convenience method that combines calls to the createImageFromText() and createCombinedImage() methods. |
static BBjImage | createImageFromText(BBjString p_text$, BBjString p_foreColor$, BBjNumber p_foreOpacity, BBjString p_backColor$, BBjNumber p_backOpacity, BBjString p_fontFile$, BBjString p_fontStyle$, BBjNumber p_width, BBjNumber p_height) Creates a BBjImage by drawing automatically-sized text on a graphics context This method dynamically determines the best font size to maximize the size of the text given the image's dimensions. You can use a linefeed character ($0A$) to split the text into multiple lines. The text block will be centered both vertically and horizontally in the resultant image. |
static BBjImage | createImageFromText(BBjString p_text$, BBjNumber p_width, BBjNumber p_height) Creates a BBjImage by drawing automatically-sized text on a graphics context This method is used internally to indicate that a widget does not contain any data or has experienced an error. The method uses a default font, foreground color, and background color. It centers the text both vertically and horizontally. It also dynamically determines the best font size to maximize the size of the text given the image's dimensions. You can use a linefeed character ($0A$) to split the text into multiple lines. |
static BBjImage | createImageFromText(BBjString p_text$, BBjString p_foreColor$, BBjNumber p_foreOpacity, BBjString p_backColor$, BBjNumber p_backOpacity, Font p_font!, BBjNumber p_width, BBjNumber p_height) Creates a BBjImage by drawing text on a graphics context You can use a linefeed character ($0A$) to split the text into multiple lines |
static BBjImage | createImageFromText(BBjString p_text$, BBjString p_foreColor$, BBjNumber p_foreOpacity, Font p_font!, BBjNumber p_width, BBjNumber p_height) Creates a BBjImage by drawing text on a transparent background You can use a linefeed character ($0A$) to split the text into multiple lines |
static Paint | createRadialGradientPaint(Color p_color1!, Color p_color2!, Point2D p_center!) Gets a radial gradient paint based off of two colors and the center point relative to the entire chart |
static Color | darkenColor(Color p_color!, BBjNumber p_fraction) Make a color darker |
void | email(BBjNumber p_parentX, BBjNumber p_parentY, BBjNumber p_parentWidth, BBjNumber p_parentHeight) Displays a dialog that facilitates emailing a screenshot of the chart as an attachment to one or more recipients |
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 |
void | fillJDBCXYSeries(XYSeries p_series!, BBjString p_connectString$, BBjString p_sql$) Given an SQL query, fill an XYSeries with the resultant two columns of numerical data |
void | fillJDBCXYSeries(XYSeries p_series!, BBjString p_connectString$, BBjString p_sql$, BBjString p_mode$) Given an SQL query, fill an XYSeries with the resultant two columns of numerical data |
void | fillJDBCXYSeries(XYSeries p_series!, BBjRecordSet p_rs!, BBjVector p_columns!) Given a BBjRecordSet and a vector of columns, fill an XYSeries with the resultant two columns of numerical data |
static BBjColor | getBBjColor(Color p_color!) Method to create a BBjColor from a Java Color, taking into account an alpha channel if it exists |
static BBjColor | getBBjColorWithAlphaFromHexString(BBjString p_colorHexString$, BBjNumber p_opacity) Method to create a BBjColor with an alpha channel from a hex string |
DataItem | getChartDataItemFromPoint(BBjNumber p_x, BBjNumber p_y) Gets the chart's last data item with an area that encloses the specified coordinates This method is typically used to get information about a data entity in the chart when the user clicks on the chart. Depending on the chart type, it's possible that the provided point will be inside more than one data entity, such as in an AreaChart where the areas overlap one another. This method will return the last entity that matches, but the getChartDataItemsFromPoint() method will return information for all matching entities. |
BBjVector | getChartDataItemsFromPoint(BBjNumber p_x, BBjNumber p_y) Gets all of the chart's data items with an area that encloses the specified coordinates This method is typically used to get information about a data entity in the chart when the user clicks on the chart. Depending on the chart type, it's possible that the provided point will be inside more than one data entity, such as in an AreaChart where the areas overlap one another. This method will return all matching entities, but the getChartDataItemFromPoint() method will return only the last matching entity. |
DecimalFormat | getChartDomainAxisFormat() Returns the custom decimal format for the XYChart's domain axis (x-axis) numbers - note that this applies only to an XYChart |
BBjString | getChartFontFile() Gets the customized font file for the chart. |
BBjNumber | getChartHeight() Returns the height of the chart |
DecimalFormat | getChartRangeAxisFormat() Returns the custom decimal format for the chart's range axis (y-axis) numbers |
BBjNumber | getChartRangeAxisToCurrency() Return a BBjNumber indicating if the range axis was set to show its values formatted as currency for the current locale |
BBjNumber | getChartRangeAxisToPercent() Return a BBjNumber indicating if the range axis was set to show its values formatted as a percentage. When the range axis is set to show values as a percentage, the range values will be multiplied by 100 and the percent sign will be appended to the value. |
BBjNumber | getChartWidth() Returns the width of the chart |
static BBjVector | getColorTheme(BBjNumber p_colorThemeIndex) Gets a pre-defined color theme vector |
static BBjNumber | getColorThemeCount() Gets the total number of color themes |
static BBjString | getColorThemeDescription(BBjNumber p_colorThemeIndex) Gets the description of the specified color theme |
static Color | getColorWithAlpha(BBjColor p_color!, BBjNumber p_opacity) Method to create a Java Color with an alpha channel from a BBjColor where opacity = (0-1) |
static Color | getColorWithAlpha(Color p_color!, BBjNumber p_opacity) Method to create a Java Color with an alpha channel from a Java Color by specifying an opacity amount. |
static Color | getColorWithAlphaFromHexString(BBjString p_colorHexString$, BBjNumber p_opacity) Method to create a Java Color with an alpha channel from a hex string |
Object | getDataset() |
static BBjVector | getDefaultChartColors() Gets the default colors for a chart |
BBjNumber | getDevicePixelRatio() Gets the screen's device pixel ratio used for modifying ChartWidgets |
static Font | getFont(BBjFont p_font!) Create a java font from a BBjFont |
BBjNumber | getFontScalingFactor() Gets the custom font scaling factor for the chart as set by the original dashboard program. |
static BBjString | getHexStringFromColor(Color p_color!) Method to get a hex representation of a Java Color with an alpha channel |
static BBjVector | getHSBValuesFromRGBColor(Color p_color!) Method to convert a RGB Color to its corresponding HSB (Java) values and return an array containing the 3 HSB values |
static BBjVector | getHSLValuesFromRGBColor(Color p_color!) Method to convert a RGB Color to its corresponding HSL (CSS) values and return an array containing the 3 HSL values |
static Color | getJavaColor(BBjColor p_color!) Method to create a Java Color from a BBjColor |
static Color | getJavaColor(BBjString p_colorHexString$) Method to create a Java Color from a hex color string |
org.jfree.data.category.Defaultorg.jfree.data.category.CategoryDataset | getJDBCCategoryDataset(BBjString p_connectString$, BBjString p_sql$) Given an SQL query, return a DefaultCategoryDataset filled with the desired data |
org.jfree.data.category.Defaultorg.jfree.data.category.CategoryDataset | getJDBCCategoryDataset(BBjString p_connectString$, BBjString p_sql$, BBjString p_mode$) Given an SQL query, return a DefaultCategoryDataset filled with the desired data |
org.jfree.data.category.Defaultorg.jfree.data.category.CategoryDataset | getJDBCCategoryDataset(BBjRecordSet p_rs!, BBjVector p_columns!) Given a BBjRecordSet and a BBjVector containing the columns of interest, return a DefaultCategoryDataset filled with the desired data |
Defaultorg.jfree.data.general.PieDataset | getJDBCPieDataset(BBjString p_connectString$, BBjString p_sql$) Given an SQL query, return a DefaultPieDataset filled with the desired data |
Defaultorg.jfree.data.general.PieDataset | getJDBCPieDataset(BBjString p_connectString$, BBjString p_sql$, BBjString p_mode$) Given an SQL query, return a DefaultPieDataset filled with the desired data |
Defaultorg.jfree.data.general.PieDataset | getJDBCPieDataset(BBjRecordSet p_rs!, BBjVector p_columns!) Given a BBjRecordSet and a BBjVector containing the columns of interest return a DefaultCategoryDataset filled with the desired data |
BBjNumber | getLegendFontSize() Gets the font size for the chart's legend items. This is used internally to ensure that the legend item shapes are the same size as the legen item text. |
static Color | getRGBColorFromHSLValues(BBjNumber p_hue, BBjNumber p_saturation, BBjNumber p_lightness) Method to create a java RGB Color from its corresponding HSL (CSS) values |
BBjNumber | getUserFontScalingFactor() Gets the custom font scaling factor or the chart as set by the user in the Customize screen. |
static BBjVector | getVectorOfJavaColorsFromDivergentHexColorStrings(BBjNumber p_numColors, BBjString p_colorDescStart$, BBjString p_colorDescMiddle$, BBjString p_colorDescFinish$, BBjNumber p_alphaStart!, BBjNumber p_alphaMiddle!, BBjNumber p_alphaFinish!) Method to create a vector of divergent colors with a specified starting, middle, and ending range. In order to result in a balanced divergent palette, the p_numColors must be at least 3 and should be an odd number. |
static BBjVector | getVectorOfJavaColorsFromHexColorStrings(BBjNumber p_numColors, BBjString p_colorDescStart$, BBjString p_colorDescFinish$, BBjNumber p_alphaStart!, BBjNumber p_alphaFinish!) Method to create a vector of Java Colors with a specified starting and ending range |
BBjNumber | hasLegend() Indicates whether the chart has a legend |
BBjNumber | is3D() Indicates whether the chart is 3D or Flat (2D) Note: As of BBj 23.00, the Dashboard Utility uses JFreeCharts 1.5.x which removes the pseudo-3D charts. Therefore, this method will always return 0 for 23 and higher. |
BBjNumber | isAreaChart() Indicates whether the chart is an Area Chart |
BBjNumber | isBarChart() Indicates whether the chart is a Bar Chart |
BBjNumber | isDataSetEmpty() Indicates whether a chart's underlying dataset is empty or not The method traverses the underlying dataset to determine if the widget is empty or not, which is slightly different than the getNumRows() method. For example, a PieChartWidget might have 4 slices defined, all with zero values, so the getNumRows() method would return the number 4. However, the isDataSetEmpty() method would return 1, because even though there were four slices all values for the slices were zero. Note that if you change a widget's SQL via the setSQL() method, you would have to execute the refresh() method on the widget before executing this method, otherwise this method will be checking the widget's dataset for the previous SQL statement. Just setting the SQL statement doesn't force the widget to execute the new SQL statement and fill out the dataset, but the refresh() method does do that. This means that you could execute the setSQL() method, the refresh() method, then executing this method would check the result set of the new SQL statement. |
BBjNumber | isFlat() Indicates whether the chart is 3D or Flat (2D) Note: As of BBj 23.00, the Dashboard Utility uses JFreeCharts 1.5.x which removes the pseudo-3D charts. Therefore, this method will always return 1 for version 23 and higher. |
BBjNumber | isLineChart() Indicates whether the chart is a Line Chart |
BBjNumber | isPieChart() Indicates whether the chart is a Pie Chart |
BBjNumber | isRingChart() Indicates whether the chart is a Ring Chart |
BBjNumber | isStackedAreaChart() Indicates whether the chart is a Stacked Area Chart |
BBjNumber | isStackedBarChart() Indicates whether the chart is a Stacked Bar Chart |
BBjNumber | isStackedPercentageBarChart() Indicates whether the chart is a Stacked Percentage Bar Chart |
BBjNumber | isXYChart() Indicates whether the chart is an XY Chart |
static Color | lightenColor(Color p_color!, BBjNumber p_fraction) Make a color lighter |
static BBjVector | makeColorVectorFromCommaDelimitedHexColorString(BBjString p_colorString!) Return a vector of java colors given a comma delimited string of hex colors |
static BBjVector | makeColorVectorFromCommaDelimitedHexColorString(BBjString p_colorString!, BBjNumber p_opacity) Return a vector of Java Colors given a comma delimited string of hex colors and an opacity amount to be applied to all colors |
static BBjVector | makeLargerColorVectorByDarkening(BBjVector p_colorVector!, BBjNumber p_size) Gets a larger vector of colors by repeating the source vector, darkening it each time |
static BBjVector | makeLargerColorVectorByLightening(BBjVector p_colorVector!, BBjNumber p_size) Gets a larger vector of colors by repeating the source vector, lightening it each time |
static BBjVector | makeLargerColorVectorByReducingOpacity(BBjVector p_colorVector!, BBjNumber p_size) Gets a larger vector of colors by repeating the source vector, decreasing the opacity each time |
void | OnClearTip(BBjTimerEvent p_event!) Removes the chart's tip that is shown after clicking on a data entity. This method is called automatically and is not typically accessed via code. |
void | refresh() Refreshes the chart, which results in the widget showing an up-to-date version of the chart based on the underlying dataset. This is executed in response to a refresh event, and the chart is filled with curent data and all customizations are applied. |
void | resize(BBjNumber p_width, BBjNumber p_height) Resizes the widget using the provided with and height |
void | restoreCustomColorTheme() Restores any custom colors assigned to the chart by the program (after removing user customized theme color) |
static BBjVector | reverseColorVector(BBjVector p_colorVector!) Reverses the order of the colors in a vector |
static BBjVector | rotateColorVector(BBjVector p_colorVector!, BBjNumber p_amount) Rotate the colors in a vector forwards or backwards by a specified amount. Supplying a positive number, such as +1, will cause the Colors to be rotated to the right, so the Color that was previously the last Color will now be the first Color. Suppliying a negative number, such as -1, will cause the Colors to be rotated to the left, so the Color that was previously the second Color will now be the first Color. |
static Color | saturateColor(Color p_color!, BBjNumber p_fraction) Make a color more or less saturated |
void | save() Interactively saves a screenshot of the chart as a PNG file on the client |
static void | saveColorThemePaletteImagesToDirectory(BBjString p_outputDirectory$, BBjString p_namePrefix$, BBjNumber p_width, BBjNumber p_height) Generates a series of PNG image files that are a visual representation of each Color Theme's palette |
static void | saveColorVectorAsPaletteImage(BBjVector p_colorVector!, BBjString p_outputFilename$, BBjNumber p_width, BBjNumber p_height) Generates a color palette PNG image file that is a visual representation of all Colors in the supplied vector |
void | setChartBackground(BBjNumber p_red, BBjNumber p_green, BBjNumber p_blue, BBjNumber p_opacity) Sets a background color for the entire chart |
void | setChartBackground(BBjString p_colorHexString$, BBjNumber p_opacity) Sets a background color for the entire chart |
void | setChartBackground(Paint p_paint!) Sets a background paint for the entire chart |
void | setChartBackgroundGradient(BBjString p_colors!, BBjNumber p_orientation) Sets the colors for the chart's background as a gradient |
void | setChartBackgroundImage(BBjImage p_image!, BBjNumber p_opacity) Sets a background image for the entire chart |
void | setChartBackgroundImage(BBjString p_imageFile$, BBjNumber p_opacity) Sets a background image for the entire chart |
void | setChartColors(BBjString p_colorDescStart$, BBjString p_colorDescFinish$, BBjNumber p_alphaStart!, BBjNumber p_alphaFinish!) Sets the colors for the chart dynamically by generating a series of colors given a starting and ending color with opacities The colors for the chart are considered to be dynamic, as the number of colors in the range will be regerated whenever the underlying dataset changes, such as in response to a refresh event. |
void | setChartColors(BBjString p_colorDescStart$, BBjString p_colorDescMiddle$, BBjString p_colorDescFinish$, BBjNumber p_alphaStart!, BBjNumber p_alphaMiddle!, BBjNumber p_alphaFinish!) Sets the colors for the chart dynamically by generating a series of divergent colors given a starting, middle, and ending color with opacities The colors for the chart are considered to be dynamic, as the number of colors in the range will be regerated whenever the underlying dataset changes, such as in response to a refresh event. |
void | setChartColors(BBjNumber p_numColors, BBjString p_colorDescStart$, BBjString p_colorDescFinish$, BBjNumber p_alphaStart!, BBjNumber p_alphaFinish!) Sets the colors for the chart by generating a series of colors given a starting and ending color |
void | setChartColors(BBjNumber p_numColors, Color p_colorStart!, Color p_colorFinish!) Sets the colors for the chart by generating a series of colors given starting and ending Java Colors which may include an opacity |
void | setChartColors(BBjString p_colors!) Sets the colors for the chart given a fixed number of hex color descriptions in a string |
void | setChartColors(BBjString p_colors!, BBjNumber p_opacity) Sets the colors for the chart given a fixed number of hex color descriptions in a string and an opacity value |
void | setChartColors(BBjVector p_colors!) Sets the colors for the chart given a fixed number of Java Colors in a BBjVector |
void | setChartColorTheme(BBjNumber p_colorThemeIndex) Sets the colors for the chart given a color theme number |
void | setChartDataItemLabelFormat(BBjString p_customLabelFormat$) Sets a custom label format for the chart's label items - note that this applies only to category-based charts (BarCharts, LineCharts, AreaCharts) and XYCharts that have a domain and range axis Note that if you provide a format string that results in a label that cannot fit within the data entity, such as a bar in the BarChart, then the label may not be displayed. If this happens, you can either reduce the length of the string, reduce the font size for the chart's labels, or modify the label's placement. To change the label's font size, you can execute the ChartWidget::setChartFontSizes() method, specifying a smaller-than-default value for the label size. For example:
See the related ChartWidget::setChartDataItemLabels() method to modify the label's position. |
void | setChartDataItemLabelFormat(BBjString p_customLabelFormat$, NumberFormat p_numberFormat!, NumberFormat p_percentageFormat!) Sets a custom label format for the chart's label items by providing a label string and NumberFormatters for the number and percentage fields - note that this applies only to category-based charts (BarCharts, LineCharts, AreaCharts) and XYCharts that have a domain and range axis A sample use case would be: which would cause the label to display the key followed by the value formatted as currency. That way it would show up in a format similar to: If the currency format is not specified, the value would display as "218.0" which does not include the pennies or currency unit. Note that if you provide a format string that results in a label that cannot fit within the data entity, such as a bar in the BarChart, then the label may not be displayed. If this happens, you can either reduce the length of the string, reduce the font size for the chart's labels, or modify the label's placement. To change the label's font size, you can execute the ChartWidget::setChartFontSizes() method, specifying a smaller-than-default value for the label size. For example:
See the related ChartWidget::setChartDataItemLabels() method to modify the label's position. |
void | setChartDataItemLabels(BBjString p_colorHexString$) Enables data item labels in a chart, displaying the range value in the specified color - note that this applies only to category-based charts (BarCharts, LineCharts, AreaCharts) and XYCharts that have a domain and range axis This method signature only specifies the label text color and uses default values for the label's position. See the other method signatures to control the label position. Note that the legacy setLabelsInBarChartColor() method also enables data item labels but uses default positioning and only works with BarCharts. See the related ChartWidget::setChartDataItemLabelFormat() method to modify the label's formatting. |
void | setChartDataItemLabels(BBjString p_colorHexString$, BBjNumber p_labelLocation) Enables data item labels in a chart, displaying the range value in the specified color and position - note that this applies only to category-based charts (BarCharts, LineCharts, AreaCharts) and XYCharts that have a domain and range axis This method signature offers a simplified positioning model that places the labels vertically relative to the data item. See the other method signature that offers complete control over the label position but uses the JFreeChart's custom classes for positioning parameters. Note that the legacy setLabelsInBarChartColor() method also enables data item labels but uses default positioning and only works with BarCharts. See the related ChartWidget::setChartDataItemLabelFormat() method to modify the label's formatting. |
void | setChartDataItemLabels(BBjString p_colorHexString$, ItemLabelAnchor p_itemLabelAnchor!, TextAnchor p_textAnchor!, TextAnchor p_rotationAnchor!, BBjNumber p_angle) Enables data item labels in a chart, displaying the range value in the specified color and position - note that this applies only to category-based charts, such as BarCharts, LineCharts, AreaCharts, etc. that have a domain and range axis. This method signature offers the developer complete control over the label's position, but uses the JFreeChart's custom classes for positioning. See other method signatures for simplified positioning. Note that the legacy setLabelsInBarChartColor() method also enables data item labels but uses default positioning and only works with BarCharts. See the related ChartWidget::setChartDataItemLabelFormat() method to modify the label's formatting. The rectangle anchor will typically be a value like RectangleAnchor.TOP, RectangleAnchor.CENTER, RectangleAnchor.TOP_LEFT, RectangleAnchor.BOTTOM_RIGHT. The text anchor will typically be a value like TextAnchor.TOP, TextAnchor.CENTER, TextAnchor.CENTER_LEFT, TextAnchor.CENTER_RIGHT, TextAnchor.TOP_LEFT, TextAnchor.BOTTOM_RIGHT. |
void | setChartDomainAxisFontScaling(BBjNumber p_scaleFonts) Sets whether the font for the domain axis should be scaled down when the axis contains a large number of entries |
void | setChartDomainAxisFormat(BBjString p_format$) Sets a format for the XYChart's domain axis (x-axis) numbers, allowing you for format numbers with digits, decimals, spaces, separators, currency symbols, and arbitrary text - note that this applies only to an XYChart Internally the JFreeCharts use a Java NumberFormatter to define a custom format. This method bridges the gap and allows you to specify a format mask using BBj's masking characters, which will then be converted to a Java NumberFormat automatically. Special mask characters such as #, 0, ., $, and & should be successfully converted. A few of the commly used special symbols are:
Some examples would be:
|
void | setChartDomainAxisFormat(DecimalFormat p_format!) Sets a format for the XYChart's domain axis (x-axis) numbers, allowing you for format numbers with digits, decimals, spaces, separators, currency symbols, and arbitrary text - note that this applies only to an XYChart |
void | setChartDomainAxisMargins(BBjNumber p_lowerMargin, BBjNumber p_upperMargin) Sets the lower and upper margins on the domain axis as a percentage of the length of the axis |
void | setChartDomainAxisNumLines(BBjNumber p_numLines) Sets maximum number of lines used to display a label on the chart's domain (x axis) when applicable The default number of lines is one. You can use this method to increase the number of lines available for a domain label. When two or more lines are specified, the label may wrap to fill the available space. Setting this value to an integer greater than one may cause the labels to be wrapped in unexpected places. Note that this only applies to charts that have a domain axes, so it will have no effect on a PieChart, for example. |
void | setChartDomainAxisTitle(BBjString p_title$) Sets the title for the domain axis This can be used to dynamically change the axis title, such as in response to a refresh event. Even if the chart was originally created without this axis title, calling this method will add the title to the chart. Note that for an XYChartWidget, setting the domain title via setDomainAxisLabels() will override this method. |
void | setChartDomainAxisVisible(BBjNumber p_visible) Sets whether the domain axis is visible or not |
void | setChartDomainMarker(BBjString p_key$, BBjString p_colorDesc$, BBjNumber p_opacity, BBjNumber p_markerType) Sets a threshold marker for the chart's domain. Markers are typically added to plots to highlight or draw attention to specific values. Note that the addChartDomainMarker() method allows you to add multiple threshold markers specifying the value, color, label, label color, and label position. Typically a marker will be drawn by the renderer as a line perpendicular to the domain axis, however this is entirely up to the renderer. Note that this does not apply to charts without a domain, such as a PieChart or RingChart |
void | setChartDomainMarker(BBjString p_key$, BBjString p_colorDesc$, BBjNumber p_opacity) Sets a threshold marker for the chart's domain. Markers are typically added to plots to highlight or draw attention to specific values. Typically a marker will be drawn by the renderer as a line perpendicular to the domain axis, however this is entirely up to the renderer. Note that this does not apply to charts without a domain, such as a PieChart or RingChart |
void | setChartDomainMarker(BBjString p_key$, Color p_color!) Sets a threshold marker for the chart's domain. Markers are typically added to plots to highlight or draw attention to specific values. Typically a marker will be drawn by the renderer as a line perpendicular to the domain axis, however this is entirely up to the renderer. Note that this does not apply to charts without a domain, such as a PieChart or RingChart |
void | setChartEmptyDisplayImage(BBjString p_imageFile$) Sets the image that will appear in the widget if the chart contains no data Some charts, like the pie chart, do not display anything at all when the underlying dataset is empty. To avoid the widget from appearing blank, you may specify an image or text that will be placed on top of the empty widget. Note that all chart customizations, such as background images and gradients, will still be honored and the text will be placed on top of the regularly rendered chart. See Also: ChartWidget::setChartEmptyDisplayText() |
void | setChartEmptyDisplayText(BBjString p_displayText$) Sets the text that will appear in the widget if the chart contains no data. Some charts, like the pie chart, do not display anything at all when the underlying dataset is empty. To avoid the widget from appearing empty, you may specify an image or text that will be placed on top of the empty widget. Note that all chart customizations, such as background images and gradients, will still be honored and the text will be placed on top of the regularly rendered chart. See Also: ChartWidget::setChartEmptyDisplayImage() |
void | setChartFontColor(BBjString p_colorHexString$, BBjNumber p_opacity) Sets the color for the fonts used in the chart for the labels, legend, title, etc. |
void | setChartFontColor(BBjColor p_color!, BBjNumber p_opacity) Sets the color for the fonts used in the chart for the labels, legend, title, etc. |
void | setChartFontColors(BBjString p_colors!, BBjNumber p_opacity) Sets the colors for the fonts used in the chart for the labels, legend, title, etc. by providing hex color strings in the format of "#ff00cc" for each color. Note that specifying specific font colors will override any colors that may have been set via the setChartFontColor() method. Note if you specify an empty string for any element, then the default color will be used for that element. This makes it easy to modify individual element font colors in a single method. For example, the following code will set all fonts to black (hex 0) with an opacity of 50% resulting in a light gray color. The next line will then override those colors and set the title to a dark blue, the domain to a dark red, and the range to a dark green color. Note that all colors are hex color strings. An example would be "#ff00cc" or "#f0c" |
void | setChartFontFile(BBjString p_fontFile$) Sets a font for the chart. This allows you to set the font used in the chart for the labels, legend, title, etc. This method calls the setChartFontFile() method specifying true for the p_throwError parameter |
void | setChartFontFile(BBjString p_fontFile$, BBjNumber p_throwError) Sets a font for the chart. This allows you to set the font used in the chart for the labels, legend, title, etc.
You may specify any font given a fully qualified path, a font name or path that can be found via the current PREFIX setting, or any font located in the
The following code sets the widget's font by specifying the name of the font file that's located in the dashboard utility's font directory:
The following code sets the widget's font by specifying the fully qualified font name:
|
void | setChartFontSizes(BBjNumber p_titleSize, BBjNumber p_subtitleSize, BBjNumber p_legendItemSize, BBjNumber p_labelSize, BBjNumber p_domainItemSize, BBjNumber p_rangeItemSize, BBjNumber p_annotationSize) Sets the size for the various fonts used in the chart for the labels, legend, title, etc. Note that if you specify a font size of 0 for any element, then the default size will be used for that element. This makes it easy to modify individual element font sizes in a single method. For example, the following code will set the domain font size to 10, the range font size to 12, and will leave all other elements at their default font size.
Note that specifying specific element font sizes will still be affected by any font scaling that may have been set via the |
void | setChartFontStyles(BBjNumber p_titleStyle, BBjNumber p_subtitleStyle, BBjNumber p_legendItemStyle, BBjNumber p_labelStyle, BBjNumber p_domainItemStyle, BBjNumber p_rangeItemStyle, BBjNumber p_annotationStyle) Sets the style (plain/bold/italic) for the various fonts used in the chart for the labels, legend, title, etc. Because the chart's fonts are ultimately used by the Java JFreeChart library, the values for the possible styles are the same constants used for the Java Font object, which are listed below:
If you specify a font style of -1 for any element in the parameter list, then the default style will be used for that element. This makes it easy to modify individual element font styles in a single method. For example, the following code will set the title font style to ITALIC, the label font to BOLD, and will leave all other elements at their default style.
|
void | setChartLegendBackground(BBjString p_colorHexString$, BBjNumber p_opacity) Applies the background color for the legend |
void | setChartLegendFrame(BBjNumber p_width, BBjString p_colorHexString$, BBjNumber p_opacity) Applies the border width and color for the legend |
void | setChartLegendPadding(BBjNumber p_top, BBjNumber p_right, BBjNumber p_bottom, BBjNumber p_left) Sets the padding between the legend border and the legend items |
void | setChartLegendShape(BBjNumber p_shape, BBjNumber p_outlineWidth, Color p_outlineColor!) Sets the parameters for a chart's legend shape. Note that due to the underlying JFreeChart implementation, this method works on all chart types EXCEPT for PieCharts and charts that extend a PieChart, such as a RingChart. The possible values for the shape are
A sample use case would be to set the shape to a Capsule with a 2 pixel red border:
|
void | setChartLegendShape(BBjNumber p_shape, BBjNumber p_outlineWidth, BBjString p_colorHexString$, BBjNumber p_opacity) Sets the parameters for a chart's legend shape. Note that due to the underlying JFreeChart implementation, this method works on all chart types EXCEPT for PieCharts and charts that extend a PieChart, such as a RingChart. The possible values for the shape are
A sample use case would be to set the shape to a Capsule with a 2 pixel red border:
|
void | setChartLegendShapeRadius(BBjNumber p_radius) Sets the radius for a chart's legend shape (typically a circle) in pixels, overriding the default. |
void | setChartLegendShapeRadiusScalingFactor(BBjNumber p_factor) Sets a scaling factor for the radius of a chart's legend shape (typically a circle) as a percentage of the orginal value, overriding the default. Specifying a scaling factor less than 1 decreases the size of the legend shapes. Specifying a scaling factor greater than 1 increases size of the legend shapes. Note that the legend shape must be an integer, although the scaling factor does not need to be an integer. This means that you may provide a floating point scaling factor, but the final shape radius will be rounded to the nearest integer. |
void | setChartMaximumDomainLabelWidthRatio(BBjNumber p_widthRatio) Sets a scaling factor that affects the domain axis label width. The default is 1.5, and higher values will cause the labels to be more likely to overrun each other instead of being truncated. Values from 1 to 3 should produce reasonably good results |
void | setChartPadding(BBjNumber p_top, BBjNumber p_right, BBjNumber p_bottom, BBjNumber p_left) Sets the padding between the chart border and the chart drawing area |
void | setChartPlotShadow(BBjNumber p_size, BBjString p_colorString!, BBjNumber p_opacity, BBjNumber p_distance, BBjNumber p_angle) Sets a diffused shadow for the plot, which adds a shadow to the plot contents (bars, lines, pie slices, etc.). Note that this does not work properly with 3DPieCharts as of JFreeCharts 1.0.19 |
void | setChartRangeAxisFormat(BBjString p_format$) Sets a format for the chart's range axis (y-axis) numbers, allowing you to format numbers with digits, decimals, spaces, separators, currency symbols, and arbitrary text. Note that this method overrides any other axis formatting such as the setChartRangeAxisToCurrency(), setChartRangeAxisToCurrencyWithFractionalDigits(), and setChartRangeAxisToPercent() methods. To clear this format and use another formatting style like setChartRangeAxisToCurrency(), call this method first specifying an empty string for the p_format$ parameter. Internally the JFreeCharts use a Java NumberFormatter to define a custom format. This method bridges the gap and allows you to specify a format mask using BBj's masking characters, which will then be converted to a Java NumberFormat automatically. Special mask characters such as #, 0, ., $, and & should be successfully converted. A few of the commonly used special symbols are:
Some examples would be:
|
void | setChartRangeAxisFormat(DecimalFormat p_format!) Sets a format for the chart's range axis (y-axis) numbers, allowing you for format numbers with digits, decimals, spaces, separators, currency symbols, and arbitrary text. Note that this method overrides any other axis formatting such as the setChartRangeAxisToCurrency(), setChartRangeAxisToCurrencyWithFractionalDigits(), and setChartRangeAxisToPercent() methods. To clear this format and use another formatting style like setChartRangeAxisToCurrency(), call this method first specifying null() for the p_format! parameter. |
void | setChartRangeAxisMinimumSize(BBjNumber p_minimumSize) Sets the minimum size allowed for the axis range when it is automatically calculated |
void | setChartRangeAxisTitle(BBjString p_title$) Sets the title for the range axis This can be used to dynamically change the axis title, such as in response to a refresh event. Even if the chart was originally created without this axis title, calling this method will add the title to the chart. |
void | setChartRangeAxisToCurrency() Sets the range axis to show its values formatted as currency for the current locale Use the setChartRangeAxisToCurrencyWithFractionalDigits() method to use a currency format and specify how many fractional digits to display. |
void | setChartRangeAxisToCurrencyWithFractionalDigits(BBjNumber p_fractionDigits) Sets the range axis to show its values formatted as currency for the current locale with the provided number of fractional digits. The number of fractional digits will usually be in the range of 0 to 3. |
void | setChartRangeAxisToPercent() Sets the range axis to show its values formatted as a percentage, which multiplies the values by 100 and appends the percent sign |
void | setChartRangeAxisUseIntegers(BBjNumber p_useIntegers) Sets whether the range axis is limited to integer values or not |
void | setChartRangeAxisVisible(BBjNumber p_visible) Sets whether the range axis is visible or not |
void | setChartRangeColors(BBjString p_colorDescStart$, BBjString p_colorDescFinish$, BBjNumber p_alphaStart!, BBjNumber p_alphaFinish!) Sets the range Paint for each bar in the chart |
void | setChartRangeColors(BBjString p_colors!) Sets the colors for the chart's bars as a gradient going across the range |
void | setChartRangeColors(BBjString p_colors!, BBjNumber p_opacity) Sets the colors for the chart's bars as a gradient going across the range |
void | setChartRangeColors(BBjVector p_colors!) Sets the range Paint for each bar in the chart |
void | setChartRangeMarker(BBjNumber p_value, BBjString p_colorDesc$, BBjNumber p_opacity) Sets a threshold marker for the chart's range. Markers are typically added to plots to highlight or draw attention to specific values. Note that the addChartRangeMarker() method allows you to add multiple threshold markers specifying the value, color, label, label color, and label position. Typically a marker will be drawn by the renderer as a line perpendicular to the range axis, however this is entirely up to the renderer. Note that this does not apply to charts without a range, such as a PieChart or RingChart. |
void | setChartRangeMarker(BBjNumber p_value, Color p_color!) Sets a threshold marker for the chart's range. Markers are typically added to plots to highlight or draw attention to specific values. Typically a marker will be drawn by the renderer as a line perpendicular to the range axis, however this is entirely up to the renderer. Note that this does not apply to charts without a range, such as a PieChart or RingChart |
void | setChartTitle(BBjString p_chartTitle$) Sets the title of the chart |
void | setChartTitles(BBjString p_chartTitle$, BBjString p_chartDomainTitle$, BBjString p_chartRangeTitle$) Sets the main chart title, domain title, and range title for all category charts (bar, line, area, etc.) This can be called at any time on the widget and facilitates changing the titles on a chart in response to a filter or click event which may cause the SQL and data to change. This method may be called on a PieChartWidget as well, but only the main title will be changed. |
void | setDevicePixelRatio(BBjNumber p_pixelRatio) Sets the screen's device pixel ratio used for modifying ChartWidgets |
void | setFontScalingFactor(BBjNumber p_factor) Sets a font scaling factor for the chart via a dashboard program. This allows you to increase or decrease the size of all fonts used in the chart for the labels, legend, title, etc. Specifying a scaling factor less than 1 decreases the fonts. Specifying a scaling factor greater than 1 increases the fonts. |
void | setGradientShadingAmount(BBjNumber p_gradientShadingAmount) Sets the gradient shanding amount for the entire chart. The default is 0.5, so values greater than this will have a more pronounced gradient on the chart (the bars, for instance). Setting it to zero removes the gradient effect entirely. |
void | setLegendBackground(BBjString p_colorHexString$, BBjNumber p_opacity) Sets a background color for the legend |
void | setLegendBackground(Paint p_paint!) Sets a background paint for the legend |
void | setLegendLabelFormat(BBjString p_customLabelFormat$) Define a custom label format for chart's legend items |
void | setLegendLabelFormat(BBjString p_customLabelFormat$, NumberFormat p_numberFormat!, NumberFormat p_percentageFormat!) Define a custom label format for the chart's legend items by providing a label string and NumberFormatters for the number and percentage fields. A sample use case would be: which would cause the label to display the key followed by the value formatted as currency. That way it would show up in a format similar to: If the currency format is not specified, the value would display as "218.0" which does not include the pennies or currency unit. |
void | setLegendPosition(org.jfree.chart.ui.RectangleEdge p_side!, org.jfree.chart.ui.HorizontalAlignment p_halign!, org.jfree.chart.ui.VerticalAlignment p_valign!) Sets the position of the legend in the chart Use code like widget!.getSideLeft(), widget!.getHAlignLeft(), widget!.getVAlignTop(), etc. |
void | setPlotBackground(BBjNumber p_red, BBjNumber p_green, BBjNumber p_blue, BBjNumber p_opacity) Sets a background color for the plot, not the entire chart |
void | setPlotBackground(BBjString p_colorHexString$, BBjNumber p_opacity) Sets a background color for the plot, not the entire chart |
void | setPlotBackground(Paint p_paint!) Sets a background paint for the plot, not the entire chart |
void | setPlotBackgroundImage(BBjImage p_image!, BBjNumber p_opacity) Sets a background image for the plot, not the whole chart |
void | setPlotBackgroundImage(BBjString p_imageFile$, BBjNumber p_opacity) Sets a background image for the plot, not the whole chart |
void | setRangeValues(BBjNumber p_minRangeValue, BBjNumber p_maxRangeValue) Sets the minimum and maximum values for the range of the chart's plot Note that this does not apply to charts without a range, such as a PieChart or RingChart |
void | setUserFontScalingFactor(BBjNumber p_factor) Sets a font scaling factor for the chart based on the user's preferences. This method is used by the Customize screen to affect the user's choice of font scaling. Dashboard programs should not call this method, and should call the setFontScalingFactor() method instead. Specifying a scaling factor less than 1 decreases the fonts. Specifying a scaling factor greater than 1 increases the fonts. |
void | showTip(BBjString p_tip$) Shows the chart's tip after clicking on a data entity. This method is called automatically by default when the user left-clicks on a chart if the program hasn't registered a callback for the click event. Note that you can have your program register for the click event, create a custom message for the tip, then use this method to tell the widget to display your custom message. |
static BBjVector | shuffleColorVector(BBjVector p_colorVector!) Shuffles the order of the colors in a vector |
static void | viewCategoryDataSet(org.jfree.data.category.Defaultorg.jfree.data.category.CategoryDataset p_dataset!) Creates a table representation of the supplied DefaultCategoryDataset and displays it in a message box. This is primary aimed at debugging by providing a view into what a bar or line chart's dataset looks like. |
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 |
static void | viewPieDataSet(Defaultorg.jfree.data.general.PieDataset p_dataset!) Creates a table representation of the supplied DefaultCategoryDataset and displays it in a message box. This is primary aimed at debugging by providing a view into what a pie or ring chart's dataset looks like. |
void | writePNGToServerOnCreation(BBjString p_imageFile$) Programmatically saves a screenshot of the chart as a PNG file on the server with the specified path after the chart has been created |
void | writePNGToServerOnCreation(BBjString p_imageFile$, BBjNumber p_width, BBjNumber p_height) Programmatically saves a screenshot of the chart at the desired width and height as a PNG file on the server with the specified path after the chart has been created |
active, destroy, getClientSlash, getFillError, getFillErrorDesc, getImage, getImage, imageFileSaveDialog, isDestroyed, logError, name, previewImage, previewText, setActive, setFillErrorDisplayImage, setFillErrorDisplayText, setLastSaveDir, spacesValid, title
create, destroy, display, getDevicePixelRatio, isDestroyed, logQueryPerformance, resize, setDevicePixelRatio
public static BBjNumber ColorThemeAgate
public static BBjNumber ColorThemeAntiquePewter
public static BBjNumber ColorThemeAntler
public static BBjNumber ColorThemeBamboo
public static BBjNumber ColorThemeBeachStrata
public static BBjNumber ColorThemeBerryPreserves
public static BBjNumber ColorThemeBerryTart
public static BBjNumber ColorThemeBiscayneBay
public static BBjNumber ColorThemeBlackberries
public static BBjNumber ColorThemeBloodOrange
public static BBjNumber ColorThemeBlue
public static BBjNumber ColorThemeBlueFrost
public static BBjNumber ColorThemeBlueJewel
public static BBjNumber ColorThemeBluesAndBrowns
public static BBjNumber ColorThemeBreezy
public static BBjNumber ColorThemeBreezyToo
public static BBjNumber ColorThemeBrown
public static BBjNumber ColorThemeBrownFur
public static BBjNumber ColorThemeCamo
public static BBjNumber ColorThemeCampsite
public static BBjNumber ColorThemeCanary
public static BBjNumber ColorThemeChocolateRaspberry
public static BBjNumber ColorThemeCitrus
public static BBjNumber ColorThemeCoastline
public static BBjNumber ColorThemeColorful1
public static BBjNumber ColorThemeColorful2
public static BBjNumber ColorThemeColorful3
public static BBjNumber ColorThemeColorful4
public static BBjNumber ColorThemeColorful5
public static BBjNumber ColorThemeColorful6
public static BBjNumber ColorThemeColorful7
public static BBjNumber ColorThemeCoral
public static BBjNumber ColorThemeCranberry
public static BBjNumber ColorThemeCranberryTart
public static BBjNumber ColorThemeDarkToLight
public static BBjNumber ColorThemeDeepBlueSea
public static BBjNumber ColorThemeDefault
public static BBjNumber ColorThemeDismal
public static BBjNumber ColorThemeDivergentBlueTanGreen
public static BBjNumber ColorThemeDivergentBlueTanRed
public static BBjNumber ColorThemeDivergentBlueWhiteRed
public static BBjNumber ColorThemeDivergentRedOrangeRed
public static BBjNumber ColorThemeDriedRoses
public static BBjNumber ColorThemeEarlyAmerican
public static BBjNumber ColorThemeEarthTones1
public static BBjNumber ColorThemeEarthTones2
public static BBjNumber ColorThemeEarthTones3
public static BBjNumber ColorThemeEscape
public static BBjNumber ColorThemeEveningThunder
public static BBjNumber ColorThemeFeathers
public static BBjNumber ColorThemeFlorida
public static BBjNumber ColorThemeGray
public static BBjNumber ColorThemeGrayscaleTransparent
public static BBjNumber ColorThemeGreen
public static BBjNumber ColorThemeHeirloom
public static BBjNumber ColorThemeHomestyle
public static BBjNumber ColorThemeIcyLeaves
public BBjNumber ColorThemeIndex
The index of the color theme associated with the widget, if applicable
public static BBjNumber ColorThemeLakeside
public static BBjNumber ColorThemeLavender
public static BBjNumber ColorThemeMargarita
public static BBjNumber ColorThemeMistyGarden
public static BBjNumber ColorThemeMountainMist
public static BBjNumber ColorThemeMountainSunset
public static BBjNumber ColorThemeOliveBranch
public static BBjNumber ColorThemeOrange
public static BBjNumber ColorThemePeacock
public static BBjNumber ColorThemePetals
public static BBjNumber ColorThemePomegranate
public static BBjNumber ColorThemePowderedCookie
public static BBjNumber ColorThemePurple
public static BBjNumber ColorThemePurpleBerry
public static BBjNumber ColorThemeRed
public static BBjNumber ColorThemeRetro
public static BBjNumber ColorThemeRooster
public static BBjNumber ColorThemeRope
public static BBjNumber ColorThemeRosemary
public static BBjNumber ColorThemeSandyBeach
public static BBjNumber ColorThemeSeaFoam
public static BBjNumber ColorThemeSepia
public static BBjNumber ColorThemeSky
public static BBjNumber ColorThemeTomorrowDark
public static BBjNumber ColorThemeTomorrowLight
public static BBjNumber ColorThemeTropicalSunset
public static BBjNumber ColorThemeWatermelon
public static BBjNumber ColorThemeWinterRobin
public BBjVector CustomChartColors!
A BBjVector containing one or more Java Color objects to be used when customizing the ChartWidget's colors
public static BBjNumber DATA_ITEM_LABEL_POSITION_INSIDE_BOTTOM
A constant that indicates a category-based chart's data item label will be placed inside the item toward the bottom, used with the ChartWidget::setChartDataItemLabels() method.
BBj 19.00
public static BBjNumber DATA_ITEM_LABEL_POSITION_INSIDE_CENTER
A constant that indicates a category-based chart's data item label will be placed inside the item at the center, used with the ChartWidget::setChartDataItemLabels() method and the default when the position is not specified.
BBj 19.00
public static BBjNumber DATA_ITEM_LABEL_POSITION_INSIDE_LEFT
A constant that indicates a category-based chart's data item label will be placed inside the item toward the left, used with the ChartWidget::setChartDataItemLabels() method.
BBj 19.00
public static BBjNumber DATA_ITEM_LABEL_POSITION_INSIDE_RIGHT
A constant that indicates a category-based chart's data item label will be placed inside the item toward the right, used with the ChartWidget::setChartDataItemLabels() method.
BBj 19.00
public static BBjNumber DATA_ITEM_LABEL_POSITION_INSIDE_TOP
A constant that indicates a category-based chart's data item label will be placed inside the item toward the top, used with the ChartWidget::setChartDataItemLabels() method.
BBj 19.00
public static BBjNumber DATA_ITEM_LABEL_POSITION_OUTSIDE_BOTTOM
A constant that indicates a category-based chart's data item label will be placed outside the item toward the bottom, used with the ChartWidget::setChartDataItemLabels() method.
BBj 19.00
public static BBjNumber DATA_ITEM_LABEL_POSITION_OUTSIDE_LEFT
A constant that indicates a category-based chart's data item label will be placed outside the item toward the left, used with the ChartWidget::setChartDataItemLabels() method.
BBj 19.00
public static BBjNumber DATA_ITEM_LABEL_POSITION_OUTSIDE_RIGHT
A constant that indicates a category-based chart's data item label will be placed outside the item toward the right, used with the ChartWidget::setChartDataItemLabels() method.
BBj 19.00
public static BBjNumber DATA_ITEM_LABEL_POSITION_OUTSIDE_TOP
A constant that indicates a category-based chart's data item label will be placed outside the item toward the top, used with the ChartWidget::setChartDataItemLabels() method.
BBj 19.00
public static org.jfree.chart.ui.HorizontalAlignment HAlignCenter!
A constant to define horizontal alignment of the chart legend's container
public static org.jfree.chart.ui.HorizontalAlignment HAlignLeft!
A constant to define horizontal alignment of the chart legend's container
public static org.jfree.chart.ui.HorizontalAlignment HAlignRight!
A constant to define horizontal alignment of the chart legend's container
public BBjImage LastRenderedImage!
The last rendered version of the chart in a BBjImage format used for the Customize window's preview
public static BBjNumber LEGENDSHAPE_CAPSULE
A constant to define the legend items' shape
public static BBjNumber LEGENDSHAPE_CIRCLE
A constant to define the legend items' shape
public static BBjNumber LEGENDSHAPE_DIAMOND
A constant to define the legend items' shape
public static BBjNumber LEGENDSHAPE_ELLIPSE
A constant to define the legend items' shape
public static BBjNumber LEGENDSHAPE_RECTANGLE
A constant to define the legend items' shape
public static BBjNumber LEGENDSHAPE_ROUNDEDRECTANGLE
A constant to define the legend items' shape
public static BBjNumber LEGENDSHAPE_SQUARE
A constant to define the legend items' shape
public static Rectangle SideBottom!
A constant to define the bottom edge used when setting the position of the chart legend
public static Rectangle SideLeft!
A constant to define the left edge used when setting the position of the chart legend
public static Rectangle SideRight!
A constant to define the right edge used when setting the position of the chart legend
public static Rectangle SideTop!
A constant to define the top edge used when setting the position of the chart legend
public BBjString TipBackColor$
The background color of the chart's tip, specified as a hex color string
public BBjNumber TipBackColorOpacity
The background color's opacity of the chart's tip, specified as a number between 0 and 1 (0=transparent, 1=opaque)
public BBjNumber TipDisplayTime
The display time in seconds of the chart's tip
public BBjString TipForeColor$
The foreground color of the chart's tip, specified as a hex color string
public BBjNumber TipForeColorOpacity
The foreground color's opacity of the chart's tip, specified as a number between 0 and 1 (0=transparent, 1=opaque)
public static org.jfree.chart.ui.VerticalAlignment VAlignBottom!
A constant to define vertical alignment of the chart legend's container
public static org.jfree.chart.ui.VerticalAlignment VAlignCenter!
A constant to define vertical alignment of the chart legend's container
public static org.jfree.chart.ui.VerticalAlignment VAlignTop!
A constant to define vertical alignment of the chart legend's container
public void addChartDomainMarker(BBjString p_key$, BBjString p_markerColorDesc$, BBjNumber p_markerOpacity, BBjString p_label$, BBjString p_labelColorDesc$, BBjNumber p_labelOpacity, RectangleAnchor p_rectangleAnchor!, TextAnchor p_textAnchor!)
Adds a threshold marker for the chart's domain (markers are typically added to plots to highlight or draw attention to specific values) - note that this applies only to category-based charts (BarCharts, LineCharts, AreaCharts) and XYCharts that have a domain and range axis.
This method allows you to add multiple domain markers to a chart while specifying the label text and position. In contrast, the setChartDomainMarker() methods only allow to you specify a single marker and does not include a label for the marker.
Typically a marker will be drawn by the renderer as a line perpendicular to the domain axis, however this is entirely up to the renderer. Note that this does not apply to charts without a domain, such as a PieChart or RingChart.
The rectangle anchor will typically be a value like RectangleAnchor.TOP, RectangleAnchor.CENTER, RectangleAnchor.TOP_LEFT, RectangleAnchor.BOTTOM_RIGHT.
The text anchor will typically be a value like TextAnchor.TOP, TextAnchor.CENTER, TextAnchor.CENTER_LEFT, TextAnchor.CENTER_RIGHT, TextAnchor.TOP_LEFT, TextAnchor.BOTTOM_RIGHT.
p_key$
The column key corresponding to the point on the domain at which the marker will be placedp_markerColorDesc$
A string with a hex description of the color for the marker. Example: "#ffccaa" or "#fca"p_markerOpacity
A number from 0-1 that determines the starting opacity level (0=transparent, 1=opaque)p_label$
The text for the label that accompanies the markerp_labelColorDesc$
A string with a hex description of the color for the label. Example: "#ffccaa" or "#fca"p_labelOpacity
A number from 0-1 that determines the starting opacity level (0=transparent, 1=opaque)p_rectangleAnchor!
The anchor point for the label's rectangle (passing in null() will use the default of RectangleAnchor.CENTER)p_textAnchor!
The anchor point for the label's text in the rectangle (passing in null() will use the default of TextAnchor.CENTER) RectangleAnchor for more information on anchor values
TextAnchor for more information on anchor values
HTML-formatted sample program
Downloadable sample program
BBj 19.00
public void addChartRangeMarker(BBjNumber p_value, BBjString p_colorDesc$, BBjNumber p_opacity, BBjString p_label$, BBjString p_labelColorDesc$, BBjNumber p_labelOpacity, RectangleAnchor p_rectangleAnchor!, TextAnchor p_textAnchor!)
Adds a threshold marker for the chart's range (markers are typically added to plots to highlight or draw attention to specific values) - note that this applies only to category-based charts (BarCharts, LineCharts, AreaCharts) and XYCharts that have a domain and range axis.
This method allows you to add multiple range markers to a chart while specifying the label text and position. In contrast, the setChartRangeMarker() methods only allow to you specify a single marker and does not include a label for the marker.
Typically a marker will be drawn by the renderer as a line perpendicular to the range axis, however this is entirely up to the renderer. Note that this does not apply to charts without a range, such as a PieChart or RingChart.
The rectangle anchor will typically be a value like RectangleAnchor.TOP, RectangleAnchor.CENTER, RectangleAnchor.TOP_LEFT, RectangleAnchor.BOTTOM_RIGHT.
The text anchor will typically be a value like TextAnchor.TOP, TextAnchor.CENTER, TextAnchor.CENTER_LEFT, TextAnchor.CENTER_RIGHT, TextAnchor.TOP_LEFT, TextAnchor.BOTTOM_RIGHT.
Note that the range marker label will not display in a 3DLineChart due to a limitation in the underlying JFreeCharts libary. The range marker will still be rendered, but the label will be absent unless it's a different type of category chart.
p_value
The position (determined by value) at which the marker will be placedp_markerColorDesc$
A string with a hex description of the color for the marker. Example: "#ffccaa" or "#fca"p_markerOpacity
A number from 0-1 that determines the starting opacity level (0=transparent, 1=opaque)p_label$
The text for the label that accompanies the markerp_labelColorDesc$
A string with a hex description of the color for the label. Example: "#ffccaa" or "#fca"p_labelOpacity
A number from 0-1 that determines the starting opacity level (0=transparent, 1=opaque)p_rectangleAnchor!
The anchor point for the label's rectangle (passing in null() will use the default of RectangleAnchor.CENTER which is horizontally in the middle of the marker)p_textAnchor!
The anchor point for the label's text in the rectangle (passing in null() will use the default of TextAnchor.TOP_CENTER which is vertically below the marker) RectangleAnchor for more information on anchor values
TextAnchor for more information on anchor values
HTML-formatted sample program
Downloadable sample program
BBj 19.00
public static Color adjustColorBrightness(Color p_color!, BBjNumber p_fraction)
Lighten or Darken a Color by a specified amount
p_color!
The Java Color to be modifiedp_fraction
The amount to lighten or darken the Color. A positive number will lighten the colors, a negative number will darken the colors. Possible values range from -1.0 to 1.0public static Color adjustColorOpacity(Color p_color!, BBjNumber p_fraction)
Sets the opacity for a Color to a specified amount
p_color!
The Java Color to be modifiedp_fraction
The amount to affec the opacity the Color. A positive number will increase the opacity, a negative number will decrease the opacity. Possible values range from -1.0 to 1.0public static Color adjustColorSaturation(Color p_color!, BBjNumber p_fraction)
Saturate or Desaturate a Color by a specified amount
p_color!
The Java Color to be modifiedp_fraction
The amount to saturate the Color. A positive number will increase the saturation, a negative number will decrease the saturation. Possible values range from -1.0 to 1.0public static BBjVector adjustColorVectorBrightness(BBjVector p_colorVector!, BBjNumber p_fraction)
Lighten or Darken every color in the vector by a specified amount
p_colorVector!
A vector filled with Colors to be modifiedp_fraction
The amount to lighten or darken each Color. A positive number will lighten the colors, a negative number will darken the colors. Possible values range from -1.0 to 1.0public static BBjVector adjustColorVectorOpacity(BBjVector p_colorVector!, BBjNumber p_fraction)
Increase or decrease the opacity for every color in the vector to a specified amount
p_colorVector!
A vector filled with Colors to be modifiedp_fraction
The amount to adjust the opacity value for each Color. A positive number will increase the opacity (making it more opaque), a negative number will decrease the opacity (making it more transparent). Possible values range from -1.0 to 1.0public static BBjVector adjustColorVectorOpacityToFixedAmount(BBjVector p_colorVector!, BBjNumber p_opacity)
Sets the opacity to a fixed amount for every color in the vector
p_colorVector!
A vector filled with Colors to be modifiedp_opacity
The desired opacity value (0-1). 0=Fully Transparent, 1=Fully Opaque.public static BBjVector adjustColorVectorSaturation(BBjVector p_colorVector!, BBjNumber p_fraction)
Saturate or Desaturate every color in the vector by a specified amount
p_colorVector!
A vector filled with Colors to be modifiedp_fraction
The amount to saturate each Color. A positive number will increase the saturation, a negative number will decrease the saturation. Possible values range from -1.0 to 1.0public void cloneCommonChartWidgetParameters(ChartWidget widget!)
A method used internally to propagate a chart widget's properties to a cloned version of the chart
public static BBjImage createCombinedImage(BBjImage p_imageBottom!, BBjImage p_imageTop!, BBjNumber p_width, BBjNumber p_height)
Creates a BBjImage by overlaying one image on top of another, specifying the final image dimensions
p_imageBottom!
A BBjImage that will be drawn on the bottom of the final imagep_imageTop!
A BBjImage that will be drawn on the top of the final imagep_width
The width of the resultant imagep_height
The height of the resultant image 18.20
public static BBjImage createCombinedImagesWithText(BBjImage p_imageBottom!, BBjImage p_imageMiddle!, BBjString p_text$, BBjNumber p_width, BBjNumber p_height)
Creates a BBjImage by combining two images with text
This is an internal method that's used to draw text (such as the user-settable ErrorDisplayText) over two existing images (such as a partially-filled chart and default error image). It's a convenience method that combines calls to the createImageFromText() and createCombinedImage() methods.
p_imageBottom!
A BBjImage that will be drawn on the bottom of the final imagep_imageMiddle!
A BBjImage that will be drawn over the bottom imagep_text$
A BBjString of the text to display over the imagesp_width
The width of the resultant imagep_height
The height of the resultant image 18.20
public static BBjImage createCombinedImageWithText(BBjImage p_image!, BBjString p_text$, BBjNumber p_width, BBjNumber p_height)
Creates a BBjImage by combining an existing image with text
This is an internal method that's used to draw text (such as the user-settable ErrorDisplayText) over an existing image (such as a partially-filled chart). It's a convenience method that combines calls to the createImageFromText() and createCombinedImage() methods.
p_image!
An existing BBjImage, such as a chart imagep_text$
A BBjString of the text to display over the imagep_width
The width of the resultant imagep_height
The height of the resultant image 18.20
public static BBjImage createImageFromText(BBjString p_text$, BBjString p_foreColor$, BBjNumber p_foreOpacity, BBjString p_backColor$, BBjNumber p_backOpacity, BBjString p_fontFile$, BBjString p_fontStyle$, BBjNumber p_width, BBjNumber p_height)
Creates a BBjImage by drawing automatically-sized text on a graphics context
This method dynamically determines the best font size to maximize the size of the text given the image's dimensions. You can use a linefeed character ($0A$) to split the text into multiple lines. The text block will be centered both vertically and horizontally in the resultant image.
p_text$
The text string to drawp_foreColor$
The foreground color of the resultant text specified as a hex color string. An example would be "#ff00cc" or "#f0c"p_foreOpacity
The desired opacity value (0-1) of the foreground color. 0=Fully Transparent, 1=Fully Opaque.p_backColor$
The background color of the resultant text specified as a hex color string. An example would be "#ff00cc" or "#f0c"p_backOpacity
The desired opacity value (0-1) of the background color. 0=Fully Transparent, 1=Fully Opaque.p_fontFile$
The path to the desired font file, ie. System.getProperty("basis.BBjHome") + "/utils/dashboard/fonts/CabinCondensed-Bold.ttf"
p_fontStyle$
The font's style which is one of the following: BOLD, ITALIC, or PLAINp_width
The width of the resultant BBjImagep_height
The height of the resultant BBjImage 18.20
public static BBjImage createImageFromText(BBjString p_text$, BBjNumber p_width, BBjNumber p_height)
Creates a BBjImage by drawing automatically-sized text on a graphics context
This method is used internally to indicate that a widget does not contain any data or has experienced an error. The method uses a default font, foreground color, and background color. It centers the text both vertically and horizontally. It also dynamically determines the best font size to maximize the size of the text given the image's dimensions. You can use a linefeed character ($0A$) to split the text into multiple lines.
p_text$
The text to display in the imagep_width
The width of the resultant imagep_height
The height of the resultant image 18.20
public static BBjImage createImageFromText(BBjString p_text$, BBjString p_foreColor$, BBjNumber p_foreOpacity, BBjString p_backColor$, BBjNumber p_backOpacity, Font p_font!, BBjNumber p_width, BBjNumber p_height)
Creates a BBjImage by drawing text on a graphics context
You can use a linefeed character ($0A$) to split the text into multiple lines
p_text$
The text string to drawp_foreColor$
The foreground color of the resultant text specified as a hex color string. An example would be "#ff00cc" or "#f0c"p_foreOpacity
The desired opacity value (0-1) of the foreground color. 0=Fully Transparent, 1=Fully Opaque.p_backColor$
The background color of the resultant text specified as a hex color string. An example would be "#ff00cc" or "#f0c"p_backOpacity
The desired opacity value (0-1) of the background color. 0=Fully Transparent, 1=Fully Opaque.p_font!
The Java Font used to draw the text, which defines the font family, font styles, and font size.p_width
The width of the resultant BBjImagep_height
The height of the resultant BBjImagepublic static BBjImage createImageFromText(BBjString p_text$, BBjString p_foreColor$, BBjNumber p_foreOpacity, Font p_font!, BBjNumber p_width, BBjNumber p_height)
Creates a BBjImage by drawing text on a transparent background
You can use a linefeed character ($0A$) to split the text into multiple lines
p_text$
The text string to drawp_foreColor$
The foreground color of the resultant text specified as a hex color string. An example would be "#ff00cc" or "#f0c"p_foreOpacity
The desired opacity value (0-1) of the foreground color. 0=Fully Transparent, 1=Fully Opaque.p_font!
The Java Font used to draw the text, which defines the font family, font styles, and font size.p_width
The width of the resultant Imagep_height
The height of the resultant Imagepublic static Paint createRadialGradientPaint(Color p_color1!, Color p_color2!, Point2D p_center!)
Gets a radial gradient paint based off of two colors and the center point relative to the entire chart
p_color1!
The starting Colorp_color2!
The ending Colorp_center!
The center from which the radius extends Oracle's RadialGradientPaint documentation for more information.
public static Color darkenColor(Color p_color!, BBjNumber p_fraction)
Make a color darker
p_color!
Color to make darker.p_fraction
Darkness fraction (0-1).public void email(BBjNumber p_parentX, BBjNumber p_parentY, BBjNumber p_parentWidth, BBjNumber p_parentHeight)
Displays a dialog that facilitates emailing a screenshot of the chart as an attachment to one or more recipients
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
p_parentX
X location of the parent windowp_parentY
Y location of the parent windowp_parentWidth
Width of the parent windowp_parentHeight
Height of the parent windowpublic void fillJDBCXYSeries(XYSeries p_series!, BBjString p_connectString$, BBjString p_sql$)
Given an SQL query, fill an XYSeries with the resultant two columns of numerical data
p_series!
The series to be filled with datap_connectString$
The connection string with which to make the database connectionp_sql$
The SQL query to executepublic void fillJDBCXYSeries(XYSeries p_series!, BBjString p_connectString$, BBjString p_sql$, BBjString p_mode$)
Given an SQL query, fill an XYSeries with the resultant two columns of numerical data
p_series!
The series to be filled with datap_connectString$
The connection string with which to make the database connectionp_sql$
The SQL query to executep_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"
BBj 16.00
public void fillJDBCXYSeries(XYSeries p_series!, BBjRecordSet p_rs!, BBjVector p_columns!)
Given a BBjRecordSet and a vector of columns, fill an XYSeries with the resultant two columns of numerical data
p_series!
The series to be filled with datap_rs!
The BBjRecordSet containing the data used to populate the seriesp_columns!
A BBjVector that contains an ordered list of the columns to be used for the series 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 two columns of the BBjRecordSet will be used.public static BBjColor getBBjColor(Color p_color!)
Method to create a BBjColor from a Java Color, taking into account an alpha channel if it exists
p_color!
A java.awt.color Oracle's Color documentation for more information.
public static BBjColor getBBjColorWithAlphaFromHexString(BBjString p_colorHexString$, BBjNumber p_opacity)
Method to create a BBjColor with an alpha channel from a hex string
p_colorHexString$
A hex color string. An example would be "#ff00cc" or "#f0c"p_opacity
The desired opacity value (0-1). 0=Fully Transparent, 1=Fully Opaque.public DataItem getChartDataItemFromPoint(BBjNumber p_x, BBjNumber p_y)
Gets the chart's last data item with an area that encloses the specified coordinates
This method is typically used to get information about a data entity in the chart when the user clicks on the chart. Depending on the chart type, it's possible that the provided point will be inside more than one data entity, such as in an AreaChart where the areas overlap one another. This method will return the last entity that matches, but the getChartDataItemsFromPoint() method will return information for all matching entities.
p_x
The X location in the chartp_y
The X location in the chartpublic BBjVector getChartDataItemsFromPoint(BBjNumber p_x, BBjNumber p_y)
Gets all of the chart's data items with an area that encloses the specified coordinates
This method is typically used to get information about a data entity in the chart when the user clicks on the chart. Depending on the chart type, it's possible that the provided point will be inside more than one data entity, such as in an AreaChart where the areas overlap one another. This method will return all matching entities, but the getChartDataItemFromPoint() method will return only the last matching entity.
p_x
The X location in the chartp_y
The X location in the chartpublic DecimalFormat getChartDomainAxisFormat()
Returns the custom decimal format for the XYChart's domain axis (x-axis) numbers - note that this applies only to an XYChart
DecimalFormat
BBj 19.00
public BBjString getChartFontFile()
Gets the customized font file for the chart.
public BBjNumber getChartHeight()
Returns the height of the chart
public DecimalFormat getChartRangeAxisFormat()
Returns the custom decimal format for the chart's range axis (y-axis) numbers
public BBjNumber getChartRangeAxisToCurrency()
Return a BBjNumber indicating if the range axis was set to show its values formatted as currency for the current locale
public BBjNumber getChartRangeAxisToPercent()
Return a BBjNumber indicating if the range axis was set to show its values formatted as a percentage.
When the range axis is set to show values as a percentage, the range values will be multiplied by 100 and the percent sign will be appended to the value.
public BBjNumber getChartWidth()
Returns the width of the chart
public static BBjVector getColorTheme(BBjNumber p_colorThemeIndex)
Gets a pre-defined color theme vector
p_colorThemeIndex
Color theme index See ChartWidget.getColorThemeSky() for an example
public static BBjNumber getColorThemeCount()
Gets the total number of color themes
public static BBjString getColorThemeDescription(BBjNumber p_colorThemeIndex)
Gets the description of the specified color theme
p_colorThemeIndex
The number of the desired color theme for which to return a descriptionpublic static Color getColorWithAlpha(BBjColor p_color!, BBjNumber p_opacity)
Method to create a Java Color with an alpha channel from a BBjColor where opacity = (0-1)
p_color!
A BBjColorp_opacity
The desired opacity value (0-1). 0=Fully Transparent, 1=Fully Opaque. Oracle's Color documentation for more information.
public static Color getColorWithAlpha(Color p_color!, BBjNumber p_opacity)
Method to create a Java Color with an alpha channel from a Java Color by specifying an opacity amount.
p_color!
A Colorp_opacity
The desired opacity value (0-1). 0=Fully Transparent, 1=Fully Opaque. Oracle's Color documentation for more information.
public static Color getColorWithAlphaFromHexString(BBjString p_colorHexString$, BBjNumber p_opacity)
Method to create a Java Color with an alpha channel from a hex string
p_colorHexString$
A hex color string. An example would be "#ff00cc" or "#f0c"p_opacity
The desired opacity value (0-1). 0=Fully Transparent, 1=Fully Opaque. Oracle's Color documentation for more information.
public Object getDataset()
public static BBjVector getDefaultChartColors()
Gets the default colors for a chart
public BBjNumber getDevicePixelRatio()
Gets the screen's device pixel ratio used for modifying ChartWidgets
public static Font getFont(BBjFont p_font!)
Create a java font from a BBjFont
p_font!
A BBjFontpublic BBjNumber getFontScalingFactor()
Gets the custom font scaling factor for the chart as set by the original dashboard program.
BBjNumber
A multiplication factor that is applied to the base font size. If the base font is 10 points, and p_factor is 1.2, then the resultant base font size will be 12 points.public static BBjString getHexStringFromColor(Color p_color!)
Method to get a hex representation of a Java Color with an alpha channel
p_color!
A Java Color Oracle's Color documentation for more information.
public static BBjVector getHSBValuesFromRGBColor(Color p_color!)
Method to convert a RGB Color to its corresponding HSB (Java) values and return an array containing the 3 HSB values
p_color!
A Colorpublic static BBjVector getHSLValuesFromRGBColor(Color p_color!)
Method to convert a RGB Color to its corresponding HSL (CSS) values and return an array containing the 3 HSL values
p_color!
A Colorpublic static Color getJavaColor(BBjColor p_color!)
Method to create a Java Color from a BBjColor
p_color!
A BBjColor Oracle's Color documentation for more information.
public static Color getJavaColor(BBjString p_colorHexString$)
Method to create a Java Color from a hex color string
p_colorHexString$
A hex color string. An example would be "#ff00cc" or "#f0c" Oracle's Color documentation for more information.
public org.jfree.data.category.Defaultorg.jfree.data.category.CategoryDataset getJDBCCategoryDataset(BBjString p_connectString$, BBjString p_sql$)
Given an SQL query, return a DefaultCategoryDataset filled with the desired data
p_connectString$
The connection string with which to make the database connectionp_sql$
The SQL query to execute JFreeChart's DefaultCategoryDataset documentation for more information.
public org.jfree.data.category.Defaultorg.jfree.data.category.CategoryDataset getJDBCCategoryDataset(BBjString p_connectString$, BBjString p_sql$, BBjString p_mode$)
Given an SQL query, return a DefaultCategoryDataset filled with the desired data
p_connectString$
The connection string with which to make the database connectionp_sql$
The SQL query to executep_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"
JFreeChart's DefaultCategoryDataset documentation for more information.
BBj 16.00
public org.jfree.data.category.Defaultorg.jfree.data.category.CategoryDataset getJDBCCategoryDataset(BBjRecordSet p_rs!, BBjVector p_columns!)
Given a BBjRecordSet and a BBjVector containing the columns of interest, return a DefaultCategoryDataset filled with the desired data
p_rs!
The BBjRecordSet containing the data used to populate the chartp_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. JFreeChart's DefaultCategoryDataset documentation for more information.
public Defaultorg.jfree.data.general.PieDataset getJDBCPieDataset(BBjString p_connectString$, BBjString p_sql$)
Given an SQL query, return a DefaultPieDataset filled with the desired data
p_connectString$
The connection string with which to make the database connectionp_sql$
The SQL query to execute JFreeChart's DefaultPieDataset documentation for more information.
public Defaultorg.jfree.data.general.PieDataset getJDBCPieDataset(BBjString p_connectString$, BBjString p_sql$, BBjString p_mode$)
Given an SQL query, return a DefaultPieDataset filled with the desired data
p_connectString$
The connection string with which to make the database connectionp_sql$
The SQL query to executep_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"
JFreeChart's DefaultPieDataset documentation for more information.
BBj 16.00
public Defaultorg.jfree.data.general.PieDataset getJDBCPieDataset(BBjRecordSet p_rs!, BBjVector p_columns!)
Given a BBjRecordSet and a BBjVector containing the columns of interest return a DefaultCategoryDataset filled with the desired data
p_rs!
The BBjRecordSet containing the data used to populate the chartp_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 two columns of the BBjRecordSet will be used. JFreeChart's DefaultPieDataset documentation for more information.
public BBjNumber getLegendFontSize()
Gets the font size for the chart's legend items. This is used internally to ensure that the legend item shapes are the same size as the legen item text.
public static Color getRGBColorFromHSLValues(BBjNumber p_hue, BBjNumber p_saturation, BBjNumber p_lightness)
Method to create a java RGB Color from its corresponding HSL (CSS) values
p_hue
The hue component of the colorp_saturation
The saturation component of the colorp_lightness
The lightness component of the colorpublic BBjNumber getUserFontScalingFactor()
Gets the custom font scaling factor or the chart as set by the user in the Customize screen.
BBjNumber
A multiplication factor that is applied to the base font size. If the base font is 10 points, and p_factor is 1.2, then the resultant base font size will be 12 points.public static BBjVector getVectorOfJavaColorsFromDivergentHexColorStrings(BBjNumber p_numColors, BBjString p_colorDescStart$, BBjString p_colorDescMiddle$, BBjString p_colorDescFinish$, BBjNumber p_alphaStart!, BBjNumber p_alphaMiddle!, BBjNumber p_alphaFinish!)
Method to create a vector of divergent colors with a specified starting, middle, and ending range.
In order to result in a balanced divergent palette, the p_numColors must be at least 3 and should be an odd number.
p_numColors
The number of colors in the resultant vectorp_colorDescStart$
A hex color string of the starting color. An example would be "#ff0000" (Red).p_colorDescMiddle$
A hex color string of the middle color. An example would be "ffffff" (White).p_colorDescFinish$
A hex color string of the ending color. An example would be "0000ff" (Blue).p_alphaStart!
The opacity value (0-1) of the starting colorp_alphaMiddle!
The opacity value (0-1) of the starting colorp_alphaFinish!
The opacity value (0-1) of the ending colorpublic static BBjVector getVectorOfJavaColorsFromHexColorStrings(BBjNumber p_numColors, BBjString p_colorDescStart$, BBjString p_colorDescFinish$, BBjNumber p_alphaStart!, BBjNumber p_alphaFinish!)
Method to create a vector of Java Colors with a specified starting and ending range
p_numColors
The number of colors in the resultant vectorp_colorDescStart$
A hex color string of the starting color. An example would be "#ff0000" (Red).p_colorDescFinish$
A hex color string of the ending color. An example would be "#0000ff" (Blue).p_alphaStart!
The opacity value (0-1) of the starting colorp_alphaFinish!
The opacity value (0-1) of the ending color Oracle's Color documentation for more information.
public BBjNumber hasLegend()
Indicates whether the chart has a legend
public BBjNumber is3D()
Indicates whether the chart is 3D or Flat (2D)
Note: As of BBj 23.00, the Dashboard Utility uses JFreeCharts 1.5.x which removes the pseudo-3D charts. Therefore, this method will always return 0 for 23 and higher.
public BBjNumber isAreaChart()
Indicates whether the chart is an Area Chart
public BBjNumber isBarChart()
Indicates whether the chart is a Bar Chart
public BBjNumber isDataSetEmpty()
Indicates whether a chart's underlying dataset is empty or not
The method traverses the underlying dataset to determine if the widget is empty or not, which is slightly different than the getNumRows() method. For example, a PieChartWidget might have 4 slices defined, all with zero values, so the getNumRows() method would return the number 4. However, the isDataSetEmpty() method would return 1, because even though there were four slices all values for the slices were zero.
Note that if you change a widget's SQL via the setSQL() method, you would have to execute the refresh() method on the widget before executing this method, otherwise this method will be checking the widget's dataset for the previous SQL statement. Just setting the SQL statement doesn't force the widget to execute the new SQL statement and fill out the dataset, but the refresh() method does do that. This means that you could execute the setSQL() method, the refresh() method, then executing this method would check the result set of the new SQL statement.
BBj 15.11
public BBjNumber isFlat()
Indicates whether the chart is 3D or Flat (2D)
Note: As of BBj 23.00, the Dashboard Utility uses JFreeCharts 1.5.x which removes the pseudo-3D charts. Therefore, this method will always return 1 for version 23 and higher.
public BBjNumber isLineChart()
Indicates whether the chart is a Line Chart
public BBjNumber isPieChart()
Indicates whether the chart is a Pie Chart
public BBjNumber isRingChart()
Indicates whether the chart is a Ring Chart
public BBjNumber isStackedAreaChart()
Indicates whether the chart is a Stacked Area Chart
public BBjNumber isStackedBarChart()
Indicates whether the chart is a Stacked Bar Chart
public BBjNumber isStackedPercentageBarChart()
Indicates whether the chart is a Stacked Percentage Bar Chart
public BBjNumber isXYChart()
Indicates whether the chart is an XY Chart
public static Color lightenColor(Color p_color!, BBjNumber p_fraction)
Make a color lighter
p_color!
Color to make lighter.p_fraction
Lightness fraction (0-1).public static BBjVector makeColorVectorFromCommaDelimitedHexColorString(BBjString p_colorString!)
Return a vector of java colors given a comma delimited string of hex colors
p_colorString!
A comma delimited string of hex colors. An example parameter would be "#354751, #6e90b3, #efeeec" or "#345, #69b, #eee"public static BBjVector makeColorVectorFromCommaDelimitedHexColorString(BBjString p_colorString!, BBjNumber p_opacity)
Return a vector of Java Colors given a comma delimited string of hex colors and an opacity amount to be applied to all colors
p_colorString!
A comma delimited string of hex colors. An example parameter would be "#354751, #6e90b3, #efeeec" or "#345, #69b, #eee"p_opacity
The desired opacity value (0-1). 0=Fully Transparent, 1=Fully Opaque. Oracle's Color documentation for more information.
public static BBjVector makeLargerColorVectorByDarkening(BBjVector p_colorVector!, BBjNumber p_size)
Gets a larger vector of colors by repeating the source vector, darkening it each time
p_colorVector!
A vector filled with Colorsp_size
The desired number of Colors in the resultant vectorpublic static BBjVector makeLargerColorVectorByLightening(BBjVector p_colorVector!, BBjNumber p_size)
Gets a larger vector of colors by repeating the source vector, lightening it each time
p_colorVector!
A vector filled with Colorsp_size
The desired number of Colors in the resultant vectorpublic static BBjVector makeLargerColorVectorByReducingOpacity(BBjVector p_colorVector!, BBjNumber p_size)
Gets a larger vector of colors by repeating the source vector, decreasing the opacity each time
p_colorVector!
A vector filled with Colorsp_size
The desired number of Colors in the resultant vectorpublic void OnClearTip(BBjTimerEvent p_event!)
Removes the chart's tip that is shown after clicking on a data entity. This method is called automatically and is not typically accessed via code.
p_event!
The BBjTimerEvent that caused this method to executepublic void refresh()
Refreshes the chart, which results in the widget showing an up-to-date version of the chart based on the underlying dataset. This is executed in response to a refresh event, and the chart is filled with curent data and all customizations are applied.
public void resize(BBjNumber p_width, BBjNumber p_height)
Resizes the widget using the provided with and height
p_width
Width of the widgetp_height
Height of the widgetpublic void restoreCustomColorTheme()
Restores any custom colors assigned to the chart by the program (after removing user customized theme color)
public static BBjVector reverseColorVector(BBjVector p_colorVector!)
Reverses the order of the colors in a vector
p_colorVector!
A vector filled with Colorspublic static BBjVector rotateColorVector(BBjVector p_colorVector!, BBjNumber p_amount)
Rotate the colors in a vector forwards or backwards by a specified amount.
Supplying a positive number, such as +1, will cause the Colors to be rotated to the right, so the Color that was previously the last Color will now be the first Color. Suppliying a negative number, such as -1, will cause the Colors to be rotated to the left, so the Color that was previously the second Color will now be the first Color.
p_colorVector!
A vector filled with Colorsp_amount
The desired number of Colors in the resultant vectorpublic static Color saturateColor(Color p_color!, BBjNumber p_fraction)
Make a color more or less saturated
p_color!
Color to modify.p_fraction
Saturation fraction (-1 to 1). Negative numbers decrease the saturation while postive numbers increase the saturation.public void save()
Interactively saves a screenshot of the chart as a PNG file on the client
public static void saveColorThemePaletteImagesToDirectory(BBjString p_outputDirectory$, BBjString p_namePrefix$, BBjNumber p_width, BBjNumber p_height)
Generates a series of PNG image files that are a visual representation of each Color Theme's palette
p_outputDirectory$
The path that will be used as the output directory where the images will be saved.p_namePrefix$
The prefix for the image names. A string that will be used before each theme when naming the images.p_width
The width of each palette entry in the imagep_height
The height of each palette entry in the imagepublic static void saveColorVectorAsPaletteImage(BBjVector p_colorVector!, BBjString p_outputFilename$, BBjNumber p_width, BBjNumber p_height)
Generates a color palette PNG image file that is a visual representation of all Colors in the supplied vector
p_colorVector!
A BBjVector filled with Java Color objects.p_colorVector$
A string with the filename to be used for the output image file.p_width
The width of each palette entry in the imagep_height
The height of each palette entry in the imagepublic void setChartBackground(BBjNumber p_red, BBjNumber p_green, BBjNumber p_blue, BBjNumber p_opacity)
Sets a background color for the entire chart
p_red
The Red value for the color (0-1)p_green
The Green value for the color (0-1)p_blue
The Blue value for the color (0-1)p_opacity
The desired opacity value for the color (0-1). 0=Fully Transparent, 1=Fully Opaque.public void setChartBackground(BBjString p_colorHexString$, BBjNumber p_opacity)
Sets a background color for the entire chart
p_colorHexString$
A hex color string. An example would be "#ff00cc" or "#f0c"p_opacity
The desired opacity value for the color (0-1). 0=Fully Transparent, 1=Fully Opaque.public void setChartBackground(Paint p_paint!)
Sets a background paint for the entire chart
p_paint!
A java.awt.paint object Oracle's Paint documentation for more information.
public void setChartBackgroundGradient(BBjString p_colors!, BBjNumber p_orientation)
Sets the colors for the chart's background as a gradient
p_colors!
A comma delimited string of hex descriptions of the range of colors. The colors go from top to bottom, or left to right, depending on the orientation. Ex: "#000000, $ffcc00, #ffffff".p_orientation
The gradient's orientation, same as the charts: ORIENTATION_VERTICAL=0, ORIENTATION_HORIZONTAL=1.public void setChartBackgroundImage(BBjImage p_image!, BBjNumber p_opacity)
Sets a background image for the entire chart
p_image!
The image to be used for the backgroundp_opacity
The desired opacity value for the image (0-1). 0=Fully Transparent, 1=Fully Opaque.public void setChartBackgroundImage(BBjString p_imageFile$, BBjNumber p_opacity)
Sets a background image for the entire chart
p_imageFile$
A string with the path to the image to be used for the backgroundp_opacity
The desired opacity value for the image (0-1). 0=Fully Transparent, 1=Fully Opaque.public void setChartColors(BBjString p_colorDescStart$, BBjString p_colorDescFinish$, BBjNumber p_alphaStart!, BBjNumber p_alphaFinish!)
Sets the colors for the chart dynamically by generating a series of colors given a starting and ending color with opacities
The colors for the chart are considered to be dynamic, as the number of colors in the range will be regerated whenever the underlying dataset changes, such as in response to a refresh event.
p_colorDescStart$
A string with a hex description of the starting color for the range of colors. Example: "#ffccaa" or "#fca"p_colorDescFinish$
A string with a hex description of the last color for the range of colors.p_alphaStart!
A number from 0-1 that determines the starting opacity level (0=transparent, 1=opaque)p_alphaFinish!
A number from 0-1 that determines the starting opacity level (0=transparent, 1=opaque)public void setChartColors(BBjString p_colorDescStart$, BBjString p_colorDescMiddle$, BBjString p_colorDescFinish$, BBjNumber p_alphaStart!, BBjNumber p_alphaMiddle!, BBjNumber p_alphaFinish!)
Sets the colors for the chart dynamically by generating a series of divergent colors given a starting, middle, and ending color with opacities
The colors for the chart are considered to be dynamic, as the number of colors in the range will be regerated whenever the underlying dataset changes, such as in response to a refresh event.
p_colorDescStart$
A string with a hex description of the starting color for the range of colors. Example: "#ffccaa" or "#fca"p_colorDescFinish$
A string with a hex description of the last color for the range of colors.p_alphaStart!
A number from 0-1 that determines the starting opacity level (0=transparent, 1=opaque)p_alphaFinish!
A number from 0-1 that determines the starting opacity level (0=transparent, 1=opaque)public void setChartColors(BBjNumber p_numColors, BBjString p_colorDescStart$, BBjString p_colorDescFinish$, BBjNumber p_alphaStart!, BBjNumber p_alphaFinish!)
Sets the colors for the chart by generating a series of colors given a starting and ending color
p_numColors
The number of colors in the vectorp_colorDescStart$
A string with a hex description of the starting color for the range of colors. Example: "#ffccaa" or "#fca"p_colorDescFinish$
A string with a hex description of the last color for the range of colors.p_alphaStart!
A number from 0-1 that determines the starting opacity level (0=transparent, 1=opaque)p_alphaFinish!
A number from 0-1 that determines the starting opacity level (0=transparent, 1=opaque)public void setChartColors(BBjNumber p_numColors, Color p_colorStart!, Color p_colorFinish!)
Sets the colors for the chart by generating a series of colors given starting and ending Java Colors which may include an opacity
p_numColors
The number of colors in the vectorp_colorStart!
A Java Color to be used as the starting color for the range of colors.p_colorFinish!
A Java Color to be used as the last color for the range of colors. Oracle's Color documentation for more information.
public void setChartColors(BBjString p_colors!)
Sets the colors for the chart given a fixed number of hex color descriptions in a string
p_colors!
A comma delimited string of hex descriptions of the range of colors. Ex: "#000000, #ffcc00, #ffffff".public void setChartColors(BBjString p_colors!, BBjNumber p_opacity)
Sets the colors for the chart given a fixed number of hex color descriptions in a string and an opacity value
p_colors!
A comma delimited string of hex descriptions of the range of colors. Ex: "#000000, $ffcc00, #ffffff".p_opacity
A number from 0-1 that determines the starting opacity level for all colors (0=transparent, 1=opaque)public void setChartColors(BBjVector p_colors!)
Sets the colors for the chart given a fixed number of Java Colors in a BBjVector
p_colors!
A vector filled with Java Color objects Oracle's Color documentation for more information.
public void setChartColorTheme(BBjNumber p_colorThemeIndex)
Sets the colors for the chart given a color theme number
p_colorThemeIndex
The number of the color theme to apply to the chartpublic void setChartDataItemLabelFormat(BBjString p_customLabelFormat$)
Sets a custom label format for the chart's label items - note that this applies only to category-based charts (BarCharts, LineCharts, AreaCharts) and XYCharts that have a domain and range axis
Note that if you provide a format string that results in a label that cannot fit within the data entity, such as a bar in the BarChart, then the label may not be displayed. If this happens, you can either reduce the length of the string, reduce the font size for the chart's labels, or modify the label's placement. To change the label's font size, you can execute the ChartWidget::setChartFontSizes() method, specifying a smaller-than-default value for the label size. For example:
myBarChart!.setChartFontSizes(0, 0, 0, 9, 0, 0, 0)
will only set the label size to 9px while leaving the other chart fonts at their default sizes.
See the related ChartWidget::setChartDataItemLabels() method to modify the label's position.
p_customLabelFormat$
A string defining the desired label format. The default label format is {2}. An example label format would be "{2}%" and would display a bar's value as "45%" instead of the default "45" HTML-formatted sample program
Downloadable sample program
BBj 19.00
public void setChartDataItemLabelFormat(BBjString p_customLabelFormat$, NumberFormat p_numberFormat!, NumberFormat p_percentageFormat!)
Sets a custom label format for the chart's label items by providing a label string and NumberFormatters for the number and percentage fields - note that this applies only to category-based charts (BarCharts, LineCharts, AreaCharts) and XYCharts that have a domain and range axis
A sample use case would be:
which would cause the label to display the key followed by the value formatted as currency. That way it would show up in a format similar to:myBarChart!.setChartDataItemLabelFormat("{1}: {2}", java.text.NumberFormat.getCurrencyInstance(), java.text.NumberFormat.getPercentInstance())
If the currency format is not specified, the value would display as "218.0" which does not include the pennies or currency unit.Current: $218.10
Note that if you provide a format string that results in a label that cannot fit within the data entity, such as a bar in the BarChart, then the label may not be displayed. If this happens, you can either reduce the length of the string, reduce the font size for the chart's labels, or modify the label's placement. To change the label's font size, you can execute the ChartWidget::setChartFontSizes() method, specifying a smaller-than-default value for the label size. For example:
myBarChart!.setChartFontSizes(0, 0, 0, 9, 0, 0, 0)
will only set the label size to 9px while leaving the other chart fonts at their default sizes.
See the related ChartWidget::setChartDataItemLabels() method to modify the label's position.
p_customLabelFormat$
A string defining the desired label format. The default label format is {2}. An example label format would be "{2}%" and would display a bar's value as "45%" instead of the default "45" p_numberFormat!
A NumberFormat object that formats the range value {2} of the dataset entry as a number with the specified format. For an XYChartWidget, this provides the formatter for the x-values {1}.p_percentageFormat!
A NumberFormat object that formats the range value {2} of the dataset entry as a percentage with the specified format. For an XYChartWidget, this provides the formatter for the y-values {2}. Oracle's NumberFormat documentation for more information.
HTML-formatted sample program
Downloadable sample program
BBj 19.00
public void setChartDataItemLabels(BBjString p_colorHexString$)
Enables data item labels in a chart, displaying the range value in the specified color - note that this applies only to category-based charts (BarCharts, LineCharts, AreaCharts) and XYCharts that have a domain and range axis
This method signature only specifies the label text color and uses default values for the label's position. See the other method signatures to control the label position.
Note that the legacy setLabelsInBarChartColor() method also enables data item labels but uses default positioning and only works with BarCharts.
See the related ChartWidget::setChartDataItemLabelFormat() method to modify the label's formatting.
p_colorHexString$
A string with a hex description of the color for marker. Example: "#ffccaa" or "#fca" HTML-formatted sample program
Downloadable sample program
BBj 19.00
public void setChartDataItemLabels(BBjString p_colorHexString$, BBjNumber p_labelLocation)
Enables data item labels in a chart, displaying the range value in the specified color and position - note that this applies only to category-based charts (BarCharts, LineCharts, AreaCharts) and XYCharts that have a domain and range axis
This method signature offers a simplified positioning model that places the labels vertically relative to the data item. See the other method signature that offers complete control over the label position but uses the JFreeChart's custom classes for positioning parameters.
Note that the legacy setLabelsInBarChartColor() method also enables data item labels but uses default positioning and only works with BarCharts.
See the related ChartWidget::setChartDataItemLabelFormat() method to modify the label's formatting.
p_colorHexString$
A string with a hex description of the color for marker. Example: "#ffccaa" or "#fca"p_labelLocation
The location of the label relative to the data item as defined by one of the following static fields HTML-formatted sample program
Downloadable sample program
BBj 19.00
public void setChartDataItemLabels(BBjString p_colorHexString$, ItemLabelAnchor p_itemLabelAnchor!, TextAnchor p_textAnchor!, TextAnchor p_rotationAnchor!, BBjNumber p_angle)
Enables data item labels in a chart, displaying the range value in the specified color and position - note that this applies only to category-based charts, such as BarCharts, LineCharts, AreaCharts, etc. that have a domain and range axis.
This method signature offers the developer complete control over the label's position, but uses the JFreeChart's custom classes for positioning. See other method signatures for simplified positioning.
Note that the legacy setLabelsInBarChartColor() method also enables data item labels but uses default positioning and only works with BarCharts.
See the related ChartWidget::setChartDataItemLabelFormat() method to modify the label's formatting.
The rectangle anchor will typically be a value like RectangleAnchor.TOP, RectangleAnchor.CENTER, RectangleAnchor.TOP_LEFT, RectangleAnchor.BOTTOM_RIGHT.
The text anchor will typically be a value like TextAnchor.TOP, TextAnchor.CENTER, TextAnchor.CENTER_LEFT, TextAnchor.CENTER_RIGHT, TextAnchor.TOP_LEFT, TextAnchor.BOTTOM_RIGHT.
p_colorHexString$
A string with a hex description of the color for marker. Example: "#ffccaa" or "#fca"p_itemLabelAnchor!
The anchor point for the label's rectangle (passing in null() will use the default of ItemLabelAnchor.CENTER)p_textAnchor!
The anchor point for the label's text in the rectangle (passing in null() will use the default of TextAnchor.CENTER)p_rotationAnchor!
The anchor point for the label's rotation (passing in null() will use the default of TextAnchor.CENTER)p_angle
The angle of rotation in degrees for the label (passing in 0 will result in the default of non-rotated text) RectangleAnchor for more information on anchor values
TextAnchor for more information on anchor values
HTML-formatted sample program
Downloadable sample program
BBj 19.00
public void setChartDomainAxisFontScaling(BBjNumber p_scaleFonts)
Sets whether the font for the domain axis should be scaled down when the axis contains a large number of entries
p_scaleFonts
A number that indicates whether to scale the fonts or not. 0=DoNotScaleFonts, 1=ScaleFonts (default)public void setChartDomainAxisFormat(BBjString p_format$)
Sets a format for the XYChart's domain axis (x-axis) numbers, allowing you for format numbers with digits, decimals, spaces, separators, currency symbols, and arbitrary text - note that this applies only to an XYChart
Internally the JFreeCharts use a Java NumberFormatter to define a custom format. This method bridges the gap and allows you to specify a format mask using BBj's masking characters, which will then be converted to a Java NumberFormat automatically. Special mask characters such as #, 0, ., $, and & should be successfully converted.
A few of the commly used special symbols are:
0
Digit#
Digit, zero shows as absent.
Decimal separator,
Grouping separator-
Minus sign%
Multiply by 100 and show as percentage&
Currency sign'
Escape any of the above special characters''
Single quote
Some examples would be:
widget!.setChartDomainAxisFormat("Total: $##0.00") -> Total: $12.34
widget!.setChartDomainAxisFormat("&##0M") -> $123M if the default locale of the JVM yields a dollar sign for the currency symbol
widget!.setChartDomainAxisFormat("&##0M") -> €123M if the default locale of the JVM yields a euro for the currency symbol
p_format$
A string that defines the desired format using BBj's masking characters Numeric Output
Numeric Output - BBj
DecimalFormat
BBj 19.00
public void setChartDomainAxisFormat(DecimalFormat p_format!)
Sets a format for the XYChart's domain axis (x-axis) numbers, allowing you for format numbers with digits, decimals, spaces, separators, currency symbols, and arbitrary text - note that this applies only to an XYChart
p_format!
A java DecimalFormat that defines the desired format Oracle's DecimalFormat documentation for more information.
BBj 19.00
public void setChartDomainAxisMargins(BBjNumber p_lowerMargin, BBjNumber p_upperMargin)
Sets the lower and upper margins on the domain axis as a percentage of the length of the axis
p_lowerMargin
The lower, or left side in vertical orientation, margin as a percentage of the axis length. For example, 0.05 would indicate a margin that is 5% of the total length.p_upperMargin
The upper, or right side in vertical orientation, margin as a percentage of the axis length. For example, 0.05 would indicate a margin that is 5% of the total length.public void setChartDomainAxisNumLines(BBjNumber p_numLines)
Sets maximum number of lines used to display a label on the chart's domain (x axis) when applicable
The default number of lines is one. You can use this method to increase the number of lines available for a domain label. When two or more lines are specified, the label may wrap to fill the available space. Setting this value to an integer greater than one may cause the labels to be wrapped in unexpected places. Note that this only applies to charts that have a domain axes, so it will have no effect on a PieChart, for example.
p_numLines
An integer that determines the maximum number of lines to use for each label. Possible values are integers greater than zero.public void setChartDomainAxisTitle(BBjString p_title$)
Sets the title for the domain axis
This can be used to dynamically change the axis title, such as in response to a refresh event. Even if the chart was originally created without this axis title, calling this method will add the title to the chart.
Note that for an XYChartWidget, setting the domain title via setDomainAxisLabels() will override this method.
p_title$
The new title for the domain axis BBj 17.00
public void setChartDomainAxisVisible(BBjNumber p_visible)
Sets whether the domain axis is visible or not
p_visible
A number that indicates the axis visibility. 0=Invisible, 1=visible (default)public void setChartDomainMarker(BBjString p_key$, BBjString p_colorDesc$, BBjNumber p_opacity, BBjNumber p_markerType)
Sets a threshold marker for the chart's domain. Markers are typically added to plots to highlight or draw attention to specific values.
Note that the addChartDomainMarker() method allows you to add multiple threshold markers specifying the value, color, label, label color, and label position.
Typically a marker will be drawn by the renderer as a line perpendicular to the domain axis, however this is entirely up to the renderer. Note that this does not apply to charts without a domain, such as a PieChart or RingChart
p_key$
The column key corresponding to the point on the domain at which the marker will be placedp_colorDesc$
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)p_markerType
A number that determines how the marker will be drawn. 0=Region, 1=Linepublic void setChartDomainMarker(BBjString p_key$, BBjString p_colorDesc$, BBjNumber p_opacity)
Sets a threshold marker for the chart's domain. Markers are typically added to plots to highlight or draw attention to specific values.
Typically a marker will be drawn by the renderer as a line perpendicular to the domain axis, however this is entirely up to the renderer. Note that this does not apply to charts without a domain, such as a PieChart or RingChart
p_key$
The column key corresponding to the point on the domain at which the marker will be placedp_colorDesc$
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)public void setChartDomainMarker(BBjString p_key$, Color p_color!)
Sets a threshold marker for the chart's domain. Markers are typically added to plots to highlight or draw attention to specific values.
Typically a marker will be drawn by the renderer as a line perpendicular to the domain axis, however this is entirely up to the renderer. Note that this does not apply to charts without a domain, such as a PieChart or RingChart
p_key$
The column key corresponding to the point on the domain at which the marker will be placedp_color
A Java Color that indicates the marker's colorpublic void setChartEmptyDisplayImage(BBjString p_imageFile$)
Sets the image that will appear in the widget if the chart contains no data
Some charts, like the pie chart, do not display anything at all when the underlying dataset is empty. To avoid the widget from appearing blank, you may specify an image or text that will be placed on top of the empty widget. Note that all chart customizations, such as background images and gradients, will still be honored and the text will be placed on top of the regularly rendered chart.
See Also: ChartWidget::setChartEmptyDisplayText()
p_imageFile$
A string with the path to an image to display over the empty chart. The path may be fully qualified or rely on the prefix. BBj 16.00
public void setChartEmptyDisplayText(BBjString p_displayText$)
Sets the text that will appear in the widget if the chart contains no data.
Some charts, like the pie chart, do not display anything at all when the underlying dataset is empty. To avoid the widget from appearing empty, you may specify an image or text that will be placed on top of the empty widget. Note that all chart customizations, such as background images and gradients, will still be honored and the text will be placed on top of the regularly rendered chart.
See Also: ChartWidget::setChartEmptyDisplayImage()
p_displayText$
A string with the text to display instead of the empty chart BBj 16.00
public void setChartFontColor(BBjString p_colorHexString$, BBjNumber p_opacity)
Sets the color for the fonts used in the chart for the labels, legend, title, etc.
p_shadowHexString$
A hex color string. An example would be "#ff00cc" or "#f0c"p_opacity
The desired opacity value (0-1). 0=Fully Transparent, 1=Fully Opaque.public void setChartFontColor(BBjColor p_color!, BBjNumber p_opacity)
Sets the color for the fonts used in the chart for the labels, legend, title, etc.
p_color!
A BBjColorp_opacity
The desired opacity value (0-1). 0=Fully Transparent, 1=Fully Opaque.public void setChartFontColors(BBjString p_colors!, BBjNumber p_opacity)
Sets the colors for the fonts used in the chart for the labels, legend, title, etc. by providing hex color strings in the format of "#ff00cc" for each color.
Note that specifying specific font colors will override any colors that may have been set via the setChartFontColor() method.
Note if you specify an empty string for any element, then the default color will be used for that element. This makes it easy to modify individual element font colors in a single method. For example, the following code will set all fonts to black (hex 0) with an opacity of 50% resulting in a light gray color. The next line will then override those colors and set the title to a dark blue, the domain to a dark red, and the range to a dark green color.
Note that all colors are hex color strings. An example would be "#ff00cc" or "#f0c"widget!.setChartFontColor("#000000", .5) widget!.setChartFontColors("#1a4065, , , , #732626, #267326, ", 0.9)
p_titleColor
The font color for the titlep_subtitleColor
The font color for the subtitles (domain/range titles)p_legendItemColor
The font color for the legend itemsp_labelColor
The font color for the labels (pie chart labels, and embedded pie or bar chart labels, data item labels for category-based and XYCharts)p_domainItemColor
The font color for the items on the domain axisp_rangeItemColor
The font color for the items on the range axisp_annotationColor
The font color for the annotationspublic void setChartFontFile(BBjString p_fontFile$)
Sets a font for the chart. This allows you to set the font used in the chart for the labels, legend, title, etc.
This method calls the setChartFontFile() method specifying true for the p_throwError parameter
p_fontFile$
A string that contains the path to the desired font file.public void setChartFontFile(BBjString p_fontFile$, BBjNumber p_throwError)
Sets a font for the chart. This allows you to set the font used in the chart for the labels, legend, title, etc.
You may specify any font given a fully qualified path, a font name or path that can be found via the current PREFIX setting, or any font located in the
The following code sets the widget's font by specifying the name of the font file that's located in the dashboard utility's font directory:
The following code sets the widget's font by specifying the fully qualified font name:
widget!.setChartFontFile("SourceSansPro-Regular.ttf")
widget!.setChartFontFile("/Users/bbj/Fonts/TypewriterKeys.ttf")
p_fontFile$
A string that contains the path to the desired font file.p_throwError
A number indicating whether to throw an error if the specified font file is not valid. 0=No Error, 1=Throw Errorpublic void setChartFontSizes(BBjNumber p_titleSize, BBjNumber p_subtitleSize, BBjNumber p_legendItemSize, BBjNumber p_labelSize, BBjNumber p_domainItemSize, BBjNumber p_rangeItemSize, BBjNumber p_annotationSize)
Sets the size for the various fonts used in the chart for the labels, legend, title, etc.
Note that if you specify a font size of 0 for any element, then the default size will be used for that element. This makes it easy to modify individual element font sizes in a single method. For example, the following code will set the domain font size to 10, the range font size to 12, and will leave all other elements at their default font size.
widget!.setChartFontSizes(0, 0, 0, 0, 10, 12, 0)
Note that specifying specific element font sizes will still be affected by any font scaling that may have been set via the setFontScaling()
method.
p_titleSize
The font size for the titlep_subtitleSize
The font size for the subtitles (domain/range titles)p_legendItemSize
The font size for the legend itemsp_labelSize
The font size for the labels (pie chart labels, and embedded pie or bar chart labels)p_domainItemSize
The font size for the items on the domain axisp_rangeItemSize
The font size for the items on the range axisp_annotationSize
The font size for the annotationspublic void setChartFontStyles(BBjNumber p_titleStyle, BBjNumber p_subtitleStyle, BBjNumber p_legendItemStyle, BBjNumber p_labelStyle, BBjNumber p_domainItemStyle, BBjNumber p_rangeItemStyle, BBjNumber p_annotationStyle)
Sets the style (plain/bold/italic) for the various fonts used in the chart for the labels, legend, title, etc.
Because the chart's fonts are ultimately used by the Java JFreeChart library, the values for the possible styles are the same constants used for the Java Font object, which are listed below:
If you specify a font style of -1 for any element in the parameter list, then the default style will be used for that element. This makes it easy to modify individual element font styles in a single method. For example, the following code will set the title font style to ITALIC, the label font to BOLD, and will leave all other elements at their default style.
widget!.setChartFontStyles(BBjFont.FONT_ITALIC, -1, -1, BBjFont.FONT_BOLD, -1, -1, -1)
p_titleStyle
The font style for the title (-1, 0, 1, or 2)p_subtitleStyle
The font style for the subtitles (domain/range titles) (-1, 0, 1, or 2)p_legendItemStyle
The font style for the legend items (-1, 0, 1, or 2)p_labelStyle
The font style for the labels (pie chart labels, and embedded pie or bar chart labels) (-1, 0, 1, or 2)p_domainItemStyle
The font style for the items on the domain axis (-1, 0, 1, or 2)p_rangeItemStyle
The font style for the items on the range axis (-1, 0, 1, or 2)p_annotationStyle
The font style for the annotations (-1, 0, 1, or 2) HTML-formatted sample program
Downloadable sample program
BBj 19.00
public void setChartLegendBackground(BBjString p_colorHexString$, BBjNumber p_opacity)
Applies the background color for the legend
p_colorHexString$
A hex color string for the legend background color. An example would be "#ff00cc" or "#f0c"p_opacity
The desired opacity value for the color (0-1). 0=Fully Transparent, 1=Fully Opaque.public void setChartLegendFrame(BBjNumber p_width, BBjString p_colorHexString$, BBjNumber p_opacity)
Applies the border width and color for the legend
p_width
The width of the borderp_colorHexString$
A hex color string for the border color. An example would be "#ff00cc" or "#f0c"p_opacity
The desired opacity value for the color (0-1). 0=Fully Transparent, 1=Fully Opaque.public void setChartLegendPadding(BBjNumber p_top, BBjNumber p_right, BBjNumber p_bottom, BBjNumber p_left)
Sets the padding between the legend border and the legend items
p_top
The padding amount for the top of the chart in pixelsp_right
The padding amount for the right side of the chart in pixelsp_bottom
The padding amount for the bottom of the chart in pixelsp_left
The padding amount for the left side of the chart in pixelspublic void setChartLegendShape(BBjNumber p_shape, BBjNumber p_outlineWidth, Color p_outlineColor!)
Sets the parameters for a chart's legend shape.
Note that due to the underlying JFreeChart implementation, this method works on all chart types EXCEPT for PieCharts and charts that extend a PieChart, such as a RingChart.
The possible values for the shape are
A sample use case would be to set the shape to a Capsule with a 2 pixel red border:
barChartWidget!.setChartLegendShape(ChartWidget.getLEGENDSHAPE_CAPSULE(), 2, ChartWidget.getJavaColor("#ff0000"))
p_shape
The legend's shape (a constant defined in the ChartWidget class)p_outlineWidth
The stroke, or outline width of the shape in pixelsp_outlineColor!
The Java Color used to paint the shape's outlinepublic void setChartLegendShape(BBjNumber p_shape, BBjNumber p_outlineWidth, BBjString p_colorHexString$, BBjNumber p_opacity)
Sets the parameters for a chart's legend shape.
Note that due to the underlying JFreeChart implementation, this method works on all chart types EXCEPT for PieCharts and charts that extend a PieChart, such as a RingChart.
The possible values for the shape are
A sample use case would be to set the shape to a Capsule with a 2 pixel red border:
barChartWidget!.setChartLegendShape(ChartWidget.getLEGENDSHAPE_CAPSULE(), 2, ChartWidget.getJavaColor("#ff0000"))
p_shape
The legend's shape (a constant defined in the ChartWidget class)p_outlineWidth
The stroke, or outline width of the shape in pixelsp_colorHexString$
A hex color string for the shape's outline color. An example would be "#ff00cc" or "#f0c"p_opacity
The desired opacity value for the outline color (0-1). 0 = Fully Transparent, 1 = Fully Opaque.public void setChartLegendShapeRadius(BBjNumber p_radius)
Sets the radius for a chart's legend shape (typically a circle) in pixels, overriding the default.
p_radius
The circle's radius in pixelspublic void setChartLegendShapeRadiusScalingFactor(BBjNumber p_factor)
Sets a scaling factor for the radius of a chart's legend shape (typically a circle) as a percentage of the orginal value, overriding the default.
Specifying a scaling factor less than 1 decreases the size of the legend shapes. Specifying a scaling factor greater than 1 increases size of the legend shapes. Note that the legend shape must be an integer, although the scaling factor does not need to be an integer. This means that you may provide a floating point scaling factor, but the final shape radius will be rounded to the nearest integer.
p_factor
The amount to scale the legend shape radius by. Values <1 make it smaller and values >1 make it bigger.public void setChartMaximumDomainLabelWidthRatio(BBjNumber p_widthRatio)
Sets a scaling factor that affects the domain axis label width.
The default is 1.5, and higher values will cause the labels to be more likely to overrun each other instead of being truncated. Values from 1 to 3 should produce reasonably good results
p_widthRatio
A number that indicates domain width ratiopublic void setChartPadding(BBjNumber p_top, BBjNumber p_right, BBjNumber p_bottom, BBjNumber p_left)
Sets the padding between the chart border and the chart drawing area
p_top
The padding amount for the top of the chart in pixelsp_right
The padding amount for the right side of the chart in pixelsp_bottom
The padding amount for the bottom of the chart in pixelsp_left
The padding amount for the left side of the chart in pixelspublic void setChartPlotShadow(BBjNumber p_size, BBjString p_colorString!, BBjNumber p_opacity, BBjNumber p_distance, BBjNumber p_angle)
Sets a diffused shadow for the plot, which adds a shadow to the plot contents (bars, lines, pie slices, etc.).
Note that this does not work properly with 3DPieCharts as of JFreeCharts 1.0.19
p_size
The shadow size in pixels which affects the shadows diffusion. Smaller sizes make smaller, more crisp shadows. Larger sizes result in larger, more blurry shadows.p_colorString!
A string with a hex description of the shadow color. Example: "#ffccaa" or "#fca"p_opacity
A number from 0-1 that determines the starting opacity level (0=transparent, 1=opaque)p_distance
The shadow offset distance in pixelsp_angle
The shadow offset angle in degreespublic void setChartRangeAxisFormat(BBjString p_format$)
Sets a format for the chart's range axis (y-axis) numbers, allowing you to format numbers with digits, decimals, spaces, separators, currency symbols, and arbitrary text.
Note that this method overrides any other axis formatting such as the setChartRangeAxisToCurrency(), setChartRangeAxisToCurrencyWithFractionalDigits(), and setChartRangeAxisToPercent() methods. To clear this format and use another formatting style like setChartRangeAxisToCurrency(), call this method first specifying an empty string for the p_format$ parameter.
Internally the JFreeCharts use a Java NumberFormatter to define a custom format. This method bridges the gap and allows you to specify a format mask using BBj's masking characters, which will then be converted to a Java NumberFormat automatically. Special mask characters such as #, 0, ., $, and & should be successfully converted.
A few of the commonly used special symbols are:
0
Digit#
Digit, zero shows as absent.
Decimal separator,
Grouping separator-
Minus sign%
Multiply by 100 and show as a percentage&
Currency sign'
Escape any of the above special characters''
Single quote
Some examples would be:
widget!.setChartRangeAxisFormat("Total: $##0.00") -> Total: $12.34
widget!.setChartRangeAxisFormat("&##0M") -> $123M if the default locale of the JVM yields a dollar sign for the currency symbol
widget!.setChartRangeAxisFormat("&##0M") -> €123M if the default locale of the JVM yields a euro for the currency symbol
p_format$
A string that defines the desired format using BBj's masking characters Numeric Output
Numeric Output - BBj
DecimalFormat
public void setChartRangeAxisFormat(DecimalFormat p_format!)
Sets a format for the chart's range axis (y-axis) numbers, allowing you for format numbers with digits, decimals, spaces, separators, currency symbols, and arbitrary text.
Note that this method overrides any other axis formatting such as the setChartRangeAxisToCurrency(), setChartRangeAxisToCurrencyWithFractionalDigits(), and setChartRangeAxisToPercent() methods. To clear this format and use another formatting style like setChartRangeAxisToCurrency(), call this method first specifying null() for the p_format! parameter.
p_format!
A java DecimalFormat that defines the desired format Oracle's DecimalFormat documentation for more information.
public void setChartRangeAxisMinimumSize(BBjNumber p_minimumSize)
Sets the minimum size allowed for the axis range when it is automatically calculated
p_minimumSize
A number that indicates the numeric range that the range axis will span. The number must be greater than 0.public void setChartRangeAxisTitle(BBjString p_title$)
Sets the title for the range axis
This can be used to dynamically change the axis title, such as in response to a refresh event. Even if the chart was originally created without this axis title, calling this method will add the title to the chart.
p_title$
The new title for the range axis BBj 17.00
public void setChartRangeAxisToCurrency()
Sets the range axis to show its values formatted as currency for the current locale
Use the setChartRangeAxisToCurrencyWithFractionalDigits() method to use a currency format and specify how many fractional digits to display.
public void setChartRangeAxisToCurrencyWithFractionalDigits(BBjNumber p_fractionDigits)
Sets the range axis to show its values formatted as currency for the current locale with the provided number of fractional digits.
The number of fractional digits will usually be in the range of 0 to 3.
p_fractionDigits
The number of fractional digits to display. A value of 0 indicates that only integer values will be used, whereas a value of 2 indicates that two fractional digits should be included. This translates to showing pennies when the locale determines that the currency value uses dollars.public void setChartRangeAxisToPercent()
Sets the range axis to show its values formatted as a percentage, which multiplies the values by 100 and appends the percent sign
public void setChartRangeAxisUseIntegers(BBjNumber p_useIntegers)
Sets whether the range axis is limited to integer values or not
p_useIntegers
A number that indicates whether to use integers or not. 0=Standard (default), 1=Integerspublic void setChartRangeAxisVisible(BBjNumber p_visible)
Sets whether the range axis is visible or not
p_visible
A number that indicates the axis visibility. 0=Invisible, 1=visible (default)public void setChartRangeColors(BBjString p_colorDescStart$, BBjString p_colorDescFinish$, BBjNumber p_alphaStart!, BBjNumber p_alphaFinish!)
Sets the range Paint for each bar in the chart
p_colorDescStart$
A string with a hex description of the starting color for the range of colors. Example: "#ffccaa" or "#fca"p_colorDescFinish$
A string with a hex description of the last color for the range of colors.p_alphaStart!
A number from 0-1 that determines the starting opacity level (0=transparent, 1=opaque)p_alphaFinish!
A number from 0-1 that determines the starting opacity level (0=transparent, 1=opaque)public void setChartRangeColors(BBjString p_colors!)
Sets the colors for the chart's bars as a gradient going across the range
p_colors!
A comma delimited string of hex descriptions of the range of colors. Ex: "#000000, $ffcc00, #ffffff".public void setChartRangeColors(BBjString p_colors!, BBjNumber p_opacity)
Sets the colors for the chart's bars as a gradient going across the range
p_colors!
A comma delimited string of hex descriptions of the range of colors. Ex: "#000000, $ffcc00, #ffffff".p_opacity
A number from 0-1 that determines the starting opacity level for all colors (0=transparent, 1=opaque)public void setChartRangeColors(BBjVector p_colors!)
Sets the range Paint for each bar in the chart
p_colors!
A BBjVector filled with Java Color objectspublic void setChartRangeMarker(BBjNumber p_value, BBjString p_colorDesc$, BBjNumber p_opacity)
Sets a threshold marker for the chart's range. Markers are typically added to plots to highlight or draw attention to specific values.
Note that the addChartRangeMarker() method allows you to add multiple threshold markers specifying the value, color, label, label color, and label position.
Typically a marker will be drawn by the renderer as a line perpendicular to the range axis, however this is entirely up to the renderer. Note that this does not apply to charts without a range, such as a PieChart or RingChart.
p_value
The position (determined by value) at which the marker will be placedp_colorDesc$
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)public void setChartRangeMarker(BBjNumber p_value, Color p_color!)
Sets a threshold marker for the chart's range. Markers are typically added to plots to highlight or draw attention to specific values.
Typically a marker will be drawn by the renderer as a line perpendicular to the range axis, however this is entirely up to the renderer. Note that this does not apply to charts without a range, such as a PieChart or RingChart
p_value
The position (determined by value) at which the marker will be placedp_color
A Java Color that indicates the marker's colorpublic void setChartTitle(BBjString p_chartTitle$)
Sets the title of the chart
p_chartTitle$
A string with the title to be displayed in the chartpublic void setChartTitles(BBjString p_chartTitle$, BBjString p_chartDomainTitle$, BBjString p_chartRangeTitle$)
Sets the main chart title, domain title, and range title for all category charts (bar, line, area, etc.)
This can be called at any time on the widget and facilitates changing the titles on a chart in response to a filter or click event which may cause the SQL and data to change. This method may be called on a PieChartWidget as well, but only the main title will be changed.
p_chartTitle$
A string with the main title to be displayed in the chartp_chartDomainTitle$
A string with the domain title to be displayed in the chartp_chartRangeTitle$
A string with the range title to be displayed in the chart BBj 15.11
public void setDevicePixelRatio(BBjNumber p_pixelRatio)
Sets the screen's device pixel ratio used for modifying ChartWidgets
p_pixelRatio
A BBjNumber specifying the screen's pixel ratio to use when creating the widget's graphics The BBjWidget's DevicePixelRatio static field variable for more information.
public void setFontScalingFactor(BBjNumber p_factor)
Sets a font scaling factor for the chart via a dashboard program. This allows you to increase or decrease the size of all fonts used in the chart for the labels, legend, title, etc.
Specifying a scaling factor less than 1 decreases the fonts. Specifying a scaling factor greater than 1 increases the fonts.
p_factor
A multiplication factor that will be applied to the base font size. If the base font is 10 points, and p_factor is 1.2, then the resultant base font size will be 12 points.public void setGradientShadingAmount(BBjNumber p_gradientShadingAmount)
Sets the gradient shanding amount for the entire chart. The default is 0.5, so values greater than this will have a more pronounced gradient on the chart (the bars, for instance). Setting it to zero removes the gradient effect entirely.
p_gradientShadingAmount
The gradient amount for shadingpublic void setLegendBackground(BBjString p_colorHexString$, BBjNumber p_opacity)
Sets a background color for the legend
p_colorHexString$
A hex color string for the legend background color. An example would be "#ff00cc" or "#f0c"p_opacity
The desired opacity value for the color (0-1). 0 = Fully Transparent, 1 = Fully Opaque.public void setLegendBackground(Paint p_paint!)
Sets a background paint for the legend
p_paint!
A java.awt.paint object Oracle's Paint documentation for more information.
public void setLegendLabelFormat(BBjString p_customLabelFormat$)
Define a custom label format for chart's legend items
p_customLabelFormat$
A string defining the desired label format An example label format would be "{0}: {1} ({2})" and would display as "Apple: 40 (40%)" {0} = The text portion of the dataset entry {1} = The numeric portion of the dataset entry {2} = The numeric portion of the dataset entry followed by a percent signpublic void setLegendLabelFormat(BBjString p_customLabelFormat$, NumberFormat p_numberFormat!, NumberFormat p_percentageFormat!)
Define a custom label format for the chart's legend items by providing a label string and NumberFormatters for the number and percentage fields.
A sample use case would be:
which would cause the label to display the key followed by the value formatted as currency. That way it would show up in a format similar to:widget!.setLegendLabelFormat("{0}: {1}", java.text.NumberFormat.getCurrencyInstance(), java.text.NumberFormat.getPercentInstance())
If the currency format is not specified, the value would display as "218.0" which does not include the pennies or currency unit.Current: $218.10
p_customLabelFormat$
A string defining the desired label format An example label format would be "{0}: {1} ({2})" and would display as "Apple: 40 (40%)" p_numberFormat!
A NumberFormat object that formats the numeric portion {1} of the dataset entryp_percentageFormat!
A NumberFormat object that formats the percentage portion {2} of the dataset entry Oracle's NumberFormat documentation for more information.
public void setLegendPosition(org.jfree.chart.ui.RectangleEdge p_side!, org.jfree.chart.ui.HorizontalAlignment p_halign!, org.jfree.chart.ui.VerticalAlignment p_valign!)
Sets the position of the legend in the chart
Use code like widget!.getSideLeft(), widget!.getHAlignLeft(), widget!.getVAlignTop(), etc.
p_side
The side of the chart (Top, Left, Bottom, Right)p_halign
The horizontal alignment (Left, Center, Right)p_valign
The vertical alignment (Top, Center, Bottom)public void setPlotBackground(BBjNumber p_red, BBjNumber p_green, BBjNumber p_blue, BBjNumber p_opacity)
Sets a background color for the plot, not the entire chart
p_red
The Red value for the color (0-1)p_green
The Green value for the color (0-1)p_blue
The Blue value for the color (0-1)p_opacity
The desired opacity value for the color (0-1). 0=Fully Transparent, 1=Fully Opaque.public void setPlotBackground(BBjString p_colorHexString$, BBjNumber p_opacity)
Sets a background color for the plot, not the entire chart
p_colorHexString$
A hex color string. An example would be "#ff00cc" or "#f0c"p_opacity
The desired opacity value for the color (0-1). 0=Fully Transparent, 1=Fully Opaque.public void setPlotBackground(Paint p_paint!)
Sets a background paint for the plot, not the entire chart
p_paint!
A java.awt.paint object Oracle's Paint documentation for more information.
public void setPlotBackgroundImage(BBjImage p_image!, BBjNumber p_opacity)
Sets a background image for the plot, not the whole chart
p_image!
The image to be used for the backgroundp_opacity
The desired opacity value for the image (0-1). 0=Fully Transparent, 1=Fully Opaque.public void setPlotBackgroundImage(BBjString p_imageFile$, BBjNumber p_opacity)
Sets a background image for the plot, not the whole chart
p_imageFile$
A string with the path to the image to be used for the backgroundp_opacity
The desired opacity value for the image (0-1). 0=Fully Transparent, 1=Fully Opaque.public void setRangeValues(BBjNumber p_minRangeValue, BBjNumber p_maxRangeValue)
Sets the minimum and maximum values for the range of the chart's plot
Note that this does not apply to charts without a range, such as a PieChart or RingChart
p_minRangeValue
The minimum value for the rangep_maxRangeValue
The maximum value for the rangepublic void setUserFontScalingFactor(BBjNumber p_factor)
Sets a font scaling factor for the chart based on the user's preferences. This method is used by the Customize screen to affect the user's choice of font scaling. Dashboard programs should not call this method, and should call the setFontScalingFactor() method instead.
Specifying a scaling factor less than 1 decreases the fonts. Specifying a scaling factor greater than 1 increases the fonts.
p_factor
A multiplication factor that will be applied to the base font size. If the base font is 10 points, and p_factor is 1.2, then the resultant base font size will be 12 points.public void showTip(BBjString p_tip$)
Shows the chart's tip after clicking on a data entity.
This method is called automatically by default when the user left-clicks on a chart if the program hasn't registered a callback for the click event. Note that you can have your program register for the click event, create a custom message for the tip, then use this method to tell the widget to display your custom message.
p_tip$
The string of text to show in the tippublic static BBjVector shuffleColorVector(BBjVector p_colorVector!)
Shuffles the order of the colors in a vector
p_colorVector!
A vector filled with Colorspublic static void viewCategoryDataSet(org.jfree.data.category.Defaultorg.jfree.data.category.CategoryDataset p_dataset!)
Creates a table representation of the supplied DefaultCategoryDataset and displays it in a message box.
This is primary aimed at debugging by providing a view into what a bar or line chart's dataset looks like.
p_dataset!
A DefaultCategoryDataset to viewpublic 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
public static void viewPieDataSet(Defaultorg.jfree.data.general.PieDataset p_dataset!)
Creates a table representation of the supplied DefaultCategoryDataset and displays it in a message box.
This is primary aimed at debugging by providing a view into what a pie or ring chart's dataset looks like.
p_dataset!
A DefaultPieDataset to viewpublic void writePNGToServerOnCreation(BBjString p_imageFile$)
Programmatically saves a screenshot of the chart as a PNG file on the server with the specified path after the chart has been created
p_imageFile$
A string with the path of the file on the server to which the PNG image is to be written BBj 20.20
public void writePNGToServerOnCreation(BBjString p_imageFile$, BBjNumber p_width, BBjNumber p_height)
Programmatically saves a screenshot of the chart at the desired width and height as a PNG file on the server with the specified path after the chart has been created
p_imageFile$
A string with the path of the file on the server to which the PNG image is to be writtenp_width
The width in pixels of the desired PNG filep_height
The height in pixels of the desired PNG file BBj 20.20