Handling Problems in Graph Data

In order for the Graph bean to display data accurately, the data that is passed to the graph must meet certain requirements, and these requirements differ in different graph types.

If you display a graph before you pass data to it, then the graph uses a default set of data.

Data problems that prevent the display of the graph

If the data that you pass to the graph does not have enough series or groups of data, then the graph cannot be displayed. For example, the data for a dual-Y graph must have at least two series, so that one series can be assigned to the Y1-axis and one can be assigned to the Y2-axis. If you pass only one series of data to the graph, then an error message appears instead of a graph. You can customize this error message by implementing a DataErrorTextCallback and registering it with the graph. The DataErrorTextCallBack interface is defined in the oracle.dss.graph package.

Data problems that affect the display of the graph

If the data has enough series and groups for the graph to appear, but some other problem affects the display of the data, then the Graph bean displays the graph the best that it can, and it sends an AlertEvent to any registered AlertListener implementations. For example, if all of the data that you pass to a bar graph is null or zero, then the graph shows an empty plot area. Or, if some of the data that you pass to a pie graph is negative, then no slices appear for the negative data. In an AlertListener, you can notify users of the problem with the data and suggest that they alter the query. The AlertListener and the AlertEvent are defined in the oracle.dss.dataView package.

Graph messages

The graph also sends messages to the registered error handler. The default error handler for the the Java-client graph prints messages to the Java console. The default error handler for the thin graph sends messages to the UIX log. You can provide your own ErrorHandler implementation and set it on the graph by calling the addErrorHandler method of the graph. The ErrorHandler interface is defined in the oracle.dss.util package.