Adding a Graph

The Graph allows you to plot various data points on the same graphical display. You can set up multiple data series and choose to display pie, bar, and line charts. You bind the Graph to a Client Data Object and define properties to determine graph size, type, and divisions. For example, you may want to display employee salaries. In this scenario, your Page Data Object and Client Data Object return a list of employees.

Use the following steps to put a Graph on a JSP page:

  1. In the Web perspective, open your JSP page and the Faces Client Components drawer from the palette.

  2. Drag theGraph control onto the JSP page.

  3. From the Client Data view, select and drag a list property to the Graph component (e.g., the list of employees). This step binds the Client Data to the Graph.

  4. Select the Graph component on the JSP page.

  5. Go to the Properties view.

  6. On the odc:graphDraw tab, specify titles for the x and y axes.

  7. On the X-axis value tab, specify which attribute to place on the X-axis, for example, employee name. You can also indicate how to format the data (number, currency, string).

  8. On the Y-axis values tab, specify which attributes to graph, for example, salary. You can also indicate how to format the data (number, currency, string).

  9. Save and run the JSP page on a test server when you have finished

    Note: For more information on the Graph, press the F1 key in the Properties view.

    Note: The Graph is a Macromedia Flash based component. The user must have the Flash plugin installed in the browser; otherwise, the Graph will not display.