The objective of this exercise is to introduce the basic techniques for customizing a graph using the BI Beans API.
Users want graphs that are user-friendly, appealing, and interactive. Previously, you used the Presentation Editor to change the default look-and-feel of an application. In this exercise, you will use the BI Beans API to extend the application, for example, by adding a hyperlink to the graph title.
You can add interaction to graph components.
You will create a link and a tooltip for the Y1 axis title so that when the cursor hovers over the title, a tooltip appears and, when a user clicks the title, a short description about sales is displayed in a new window.
</head>
tag: <SCRIPT>
function openDescription() { newWindow=window.open("","newWindow","titlebar=no,width=300,height=100,toolbar=no");
newWindow.location.reload();
newWindow.document.write("<b>Sales as reported by individual divisions</b>");
newWindow.focus();
}
</SCRIPT>
The openDescription
Javascript function opens a new window with
no titlebar and displays a short description about sales.
<%@page ... >
tag import attribute:oracle.dss.thin.beans.graph.ThinGraph
oracle.dss.thin.beans.graph.ImagemapAction
<%@ page contentType="text/html;charset=WINDOWS-1252" import="oracle.dss.thin.beans.graph.ThinGraph,oracle.dss.thin.beans.graph.ImagemapAction"%>
</orabi:BIThinSession>
tag: <%
// define a new image map
ImagemapAction action = new ImagemapAction();
// set the HREF property
action.setHREF( "#" );
// set the onClick property to call the javascript function openDescription
action.setOnClick("openDescription();");
// set the tooltip description
action.setALT( "Click for more information" );
// set the y1-axis title
((ThinGraph)simpleGraph).getY1Title().setText("Sales");
// apply the imagemap to the y1-axis title
((ThinGraph)simpleGraph).setImagemapAction( ThinGraph.Y1TITLE, ThinGraph.SERIES_UNDEFINED,
ThinGraph.GROUP_UNDEFINED, action);
%>
You added interactive features to a simple graph; it is time to see these features in the application.
You have built additional graph functionality based on the APIs of BI Beans. BI Beans provides extensive APIs for you to build compelling and interactive graphs.
2. Handling Multiple Presentations | Overview | 4. Customizing Crosstab Properties