Removing Graph Types from the User Interface

Both the Graph bean and the thin graph use a GraphTypeConverter to mediate between the GraphType constants in the Graph class and the graph types and subtypes that appear in the user interface. The default implementation of the GraphTypeConverter is oracle.dss.graph.gui.GraphTypeConverterAdapter.

If your application does not need all of the graph types that the BI Beans graph supports, you can easily remove the graph types that you do not need. For example, you can remove the stock graphs if your application does not need them. To remove a category of graph types, call the removeType method of the GraphTypeConverterAdapter.

You can also remove subtypes from the main types. For example, if your application does not need percent line graphs, you can remove the percent line graph from the line graphs. To remove a subtype, call the getType method of the GraphTypeConverterAdapter, and then call the removeSubtype method of the Type that you retrieve.

Example: Removing stock graphs

The following code shows how to remove all of the stock graphs from the graph user interface. This code assumes graph that is named myGraph.


// instantiate the GraphTypeConverterAdapter GraphTypeConverterAdapter converter = new GraphTypeConverterAdapter(); // remove the stock graph Type converter.removeType(GraphTypeConverterAdapter.TYPE_STOCK); // set the converter on the graph myGraph.setGraphTypeConverter(converter);

Example: Removing percent graphs

The following code shows how to remove percent graphs from the bar, line, and area graph categories.


// instantiate the GraphTypeConverterAdapter GraphTypeConverterAdapter converter = new GraphTypeConverterAdapter(); // get the area graph Type, then remove percent from it converter.getType(GraphTypeConverterAdapter.TYPE_AREA).removeSubtype(GraphTypeConverterAdapter.AREA_VERT_PERCENT); // get the bar graph Type, then remove percent from it converter.getType(GraphTypeConverterAdapter.TYPE_BAR).removeSubtype(GraphTypeConverterAdapter.BAR_VERT_PERCENT); // get the horizontal bar graph Type, then remove percent from it converter.getType(GraphTypeConverterAdapter.TYPE_HORIZ_BAR).removeSubtype(GraphTypeConverterAdapter.BAR_HORIZ_PERCENT); // get the line graph Type, then remove percent from it converter.getType(GraphTypeConverterAdapter.TYPE_LINE).removeSubtype(GraphTypeConverterAdapter.LINE_PERCENT); // set the converter on the graph myGraph.setGraphTypeConverter(converter);