com.sapportals.htmlb

Class Chart

java.lang.Object
  extended bycom.sapportals.htmlb.Component
      extended bycom.sapportals.htmlb.Chart

public class Chart
extends Component

Title: Chart Graphics Business graphics are of great importance for the visualization of data and statistics. The Chart control provides an impressive list of the most common types of chart graphics, like pie, bar, area, columns and line graphs in various predefined designs. The actual design is determined by the property chartType. The Chart control is "data driven", i.e. it relies heavily on the concept of data binding. Thus, the most important property is dataSrc that must be assigned to a suitable external table. Suitable in this case means, that the table must specify at least the following columns (the labels in parentheses are the technical names of the columns). * Name of the data series (GROUPID). The Chart control is able to display multiple data sets at the same time, for example to allow the comparison of production statistics from different factories. Each data set must be identified with a unique name. * A column containing the x-values (X), also called "categories". * A column containing the y-values (Y). * A column containing optional z-values (Z). The Chart control is not able to visualize these values at the moment. You may leave this column empty. * An optional color (COLOR). By default, the Chart control visualizes the categories in different colors taken from a number of predefined color schemes. * An optional extension (EXTENSION). Any table containing the above mentioned columns is accepted as data source, even if the table also includes other columns as well. The scaling of the y-axis is determined by the properties axisMin and axisMax. The Chart control provides a title, a legend and labels for the two axis. Title and labels are specified by the properties title, titleCategories(x-axis) and titleValues(y-axis), respectively. A legend is created automatically from the names and colors of the corresponding data series. However, the position of the legend with respect to the graph may be set explicitly with the property legendPosition. The Chart control internally is based on a JAVA applet. Thus, the usual style sheet customizing used by the other HTMLB components is not applicable to the Chart. However, to allow a minimum of customization, the Chart control simulates at least a subset of CSS attributes, i.e. color and font attributes. Copyright (c) 2001, SAP AG


Field Summary
static String PACKAGE_NAME
           
static String UI_ID
           
 
Constructor Summary
Chart()
          Creates a Chart
 
Method Summary
 String getAltText()
          Returns chart's altText
 double getAxisMaxVal()
           
 double getAxisMinVal()
           
 boolean getBusinessDigits()
          show the thousand separators within long number values.
 String getChartLegendPositionString()
          Get the enum string for the legend's position
 ChartType getChartType()
          return the current chart type as enum
 String getChartTypeString()
          Returns the current chart type
 String getColorOrderString()
           
 int getFractionDigits()
          get the number of fraction digits to be displayed at value output strings.
 String getHeight()
          get the current pixel height of the applet on the web page
 IChartModel getModel()
          Get the data model
 String getTitle()
          Returns chart's title
 String getTitleCategories()
          get the title text of the categoriy axis
 String getTitleValues()
          get the title text of the value axis
 String getTooltip()
          Returns chart's tooltip
 String getUI()
          get a identification String for the renderer that is unique across all supported components.
 double getVoidValue()
          get the void value for the chart graphics.
 String getWidth()
          get the current pixel width of the applet on the web page
 boolean isDisplayObjectValues()
          query if object value display is switched on or not (value is being presented at each graphical object)
 boolean isVisible()
           
 boolean isVoidValueSet()
          use this routine to check if a void value was previously set to prevent painting of values.
 boolean requiresForm()
          Chart is display only, thus we don't need a form.
 void setAltText(String altText)
          Returns chart's alt text
 void setAxisMaxVal(double axisMaxVal)
          set the maximum value of the axis
 void setAxisMinVal(double axisMinVal)
          set the minimum value of the axis
 void setBusinessDigits(boolean newValue)
          show the thousand separators within long number values.
 void setChartType(ChartType newType)
          Sets new chart type
 void setColorOrder(ChartColorOrder newOrder)
          Changes the used color order
 void setDisplayObjectValues(boolean displayObjectValues)
          activate/deactive the display of each graphical object's value at it's graphical representation
 void setFractionDigits(int newValue)
          set the number of fraction digits to be displayed at value output strings.
 void setHeight(String height)
          set the height in pixels to be displayed in the web page
 void setLegendPosition(ChartLegendPosition newPosition)
          Changes the legend's position within the chart output
 void setModel(IChartModel newModel)
          Set the data model containing the chart data to render
 void setTitle(String title)
          Returns chart's title
 void setTitleCategories(String titleCategories)
          set the title text for the category axis
 void setTitleValues(String titleValues)
          set the title text for the value axis
 void setTooltip(String tooltip)
          Returns chart's tooltip
 void setVisible(boolean visible)
           
 void setVoidValue(double voidValue)
          set the void value for the chart graphics.
 void setVoidValueSet(boolean voidValueSet)
          use this to switch off the painting of void values.
 void setWidth(String width)
          set the width in pixels to be displayed in the web page
 
Methods inherited from class com.sapportals.htmlb.Component
getEncodedIdForForm, getId, getParent, initFromPageContext, initFromShortId, initializeFromId, isJsObjectNeeded, preRender, render, renderAsString, setId, setJsObjectNeeded, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UI_ID

public static final String UI_ID
See Also:
Constant Field Values

PACKAGE_NAME

public static final String PACKAGE_NAME
See Also:
Constant Field Values
Constructor Detail

Chart

public Chart()
Creates a Chart

Method Detail

getBusinessDigits

public boolean getBusinessDigits()
show the thousand separators within long number values.

Returns:
true if shown, false if not

setBusinessDigits

public void setBusinessDigits(boolean newValue)
show the thousand separators within long number values.

Parameters:
newValue - true if show, false if not, default is false.

getFractionDigits

public int getFractionDigits()
get the number of fraction digits to be displayed at value output strings.

Returns:
number of digits

setFractionDigits

public void setFractionDigits(int newValue)
set the number of fraction digits to be displayed at value output strings.

Parameters:
newValue - number of fraction digits

getVoidValue

public double getVoidValue()
get the void value for the chart graphics. All chart elements with a value equal to this void value will then not being painted.

Returns:
the value to be treated as void value is being returned.

setVoidValue

public void setVoidValue(double voidValue)
set the void value for the chart graphics. All chart elements with a value equal to this void value will then not being painted.

Parameters:
voidValue - Specify the value to be treated as a void value

isVoidValueSet

public boolean isVoidValueSet()
use this routine to check if a void value was previously set to prevent painting of values. This parameter queries the mode if the void value painting is currently active or not.

Returns:
true if void value painting is active, false if not.

setVoidValueSet

public void setVoidValueSet(boolean voidValueSet)
use this to switch off the painting of void values.

Parameters:
voidValueSet - Switch on the usage of the void value painting behavior.

isDisplayObjectValues

public boolean isDisplayObjectValues()
query if object value display is switched on or not (value is being presented at each graphical object)

Returns:
true if object values are displayed, false if not.

setDisplayObjectValues

public void setDisplayObjectValues(boolean displayObjectValues)
activate/deactive the display of each graphical object's value at it's graphical representation


getAxisMinVal

public double getAxisMinVal()
Returns:
returns the currently used minimum value of the axis

setAxisMinVal

public void setAxisMinVal(double axisMinVal)
set the minimum value of the axis

Parameters:
axisMinVal - value of the minimum to be displayed in the graphics

getAxisMaxVal

public double getAxisMaxVal()
Returns:
returns the currently used maximum value of the axis

setAxisMaxVal

public void setAxisMaxVal(double axisMaxVal)
set the maximum value of the axis

Parameters:
axisMaxVal - value of the maximum to be displayed in the graphics

isVisible

public boolean isVisible()

setVisible

public void setVisible(boolean visible)

getWidth

public String getWidth()
get the current pixel width of the applet on the web page

Returns:
current width in pixels, returns 500 for default.

setWidth

public void setWidth(String width)
set the width in pixels to be displayed in the web page

Parameters:
width - pixel width for the graphic's applet extension in the web page

getHeight

public String getHeight()
get the current pixel height of the applet on the web page

Returns:
current height in pixels, returns 200 for default.

setHeight

public void setHeight(String height)
set the height in pixels to be displayed in the web page

Parameters:
height - pixel height for the graphic's applet extension in the web page

getTitleCategories

public String getTitleCategories()
get the title text of the categoriy axis

Returns:
current title text

setTitleCategories

public void setTitleCategories(String titleCategories)
set the title text for the category axis

Parameters:
titleCategories - title text to be displayed on the category axis

getTitleValues

public String getTitleValues()
get the title text of the value axis

Returns:
current title text

setTitleValues

public void setTitleValues(String titleValues)
set the title text for the value axis

Parameters:
titleValues - title text to be displayed on the value axis

getTitle

public String getTitle()
Returns chart's title

Returns:
current title string

setTitle

public void setTitle(String title)
Returns chart's title

Parameters:
title - new title string

getTooltip

public String getTooltip()
Returns chart's tooltip

Returns:
current tooltip string

setAltText

public void setAltText(String altText)
Returns chart's alt text


getAltText

public String getAltText()
Returns chart's altText

Returns:
current altText string

setTooltip

public void setTooltip(String tooltip)
Returns chart's tooltip


setChartType

public void setChartType(ChartType newType)
Sets new chart type

Parameters:
newType - new chart type from ChartType enumeration

getChartTypeString

public String getChartTypeString()
Returns the current chart type

Returns:
String of current chart type enum

getChartType

public ChartType getChartType()
return the current chart type as enum

Returns:
return current chart type, returns ChartType.BARS_3D as default value.

setColorOrder

public void setColorOrder(ChartColorOrder newOrder)
Changes the used color order

Parameters:
newOrder - set color order from ChartColorOrder enum

getColorOrderString

public String getColorOrderString()

setLegendPosition

public void setLegendPosition(ChartLegendPosition newPosition)
Changes the legend's position within the chart output

Parameters:
newPosition - set the legend's position from ChartLegendPosition enum

getChartLegendPositionString

public String getChartLegendPositionString()
Get the enum string for the legend's position

Returns:
String of legend's position

setModel

public void setModel(IChartModel newModel)
Set the data model containing the chart data to render

Parameters:
newModel - IChartModel class to contain the data

getModel

public IChartModel getModel()
Get the data model

Returns:
IChartModel

getUI

public String getUI()
Description copied from class: Component
get a identification String for the renderer that is unique across all supported components. E.g. you could simply return the class name of the component class. The reason for using a separate method and not some internal reflection method is that you can more easily extend the functionality or your Component class without having to rewrite the view class.

Specified by:
getUI in class Component
Returns:
a unique identification string for this Component

requiresForm

public boolean requiresForm()
Chart is display only, thus we don't need a form.

Overrides:
requiresForm in class Component
Returns:
false


Copyright 2006 SAP AG Complete Copyright Notice