Adding a chart

The chart 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 chart to a data object and define properties to determine chart 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.
Prerequisites:
  1. Create a dynamic Web project that is enabled for Faces technology by following the instructions in Developing Faces (JSF) applications.
  2. Create a Faces JSP file.
  3. Create a data source.
Note: Data Tree <odc:tree> and Chart <odc:graphDraw> have been enabled to use Server Data.
Use the following steps to put a chart on a JSP page:
  1. In the Web perspective, open your Faces JSP page.
  2. Drag the Chart component from the Enhanced Faces Components drawer of the Palette onto the Faces JSP page.
  3. From the Page Data view, select and drag a data object onto the Chart component. This binds the data object to the Chart.
  4. Click the Chart component on the JSP page. Right-click and select Properties.
  5. On the odc:graphDraw tab, specify the display chart type (bar, pie, or line), the chart title, and the chart size.
  6. On the Display Options tab, specify the X-axis and Y-axis titles.
  7. On the X-axis values tab, specify the X-axis data. You can also select the data format (for example number, currency, string).
  8. On the Y-axis values tab, specify the data to plot on the chart. You can also select the data format (for example number, currency, string).
    1. Click Add Series to add a plotted set of related data. Each series will have a unique color or pattern that is represented in the chart legend.
    2. Specify the Value, Series Name, and Group Operation for each data series. From the Group Operation list, you can select one of the following:
      • None - No group operation is calculated.
      • SUM - Adds the data values in the series.
      • AVG - The arithmetic mean of the data in the series.
      • COUNT - The number of data references in the series.
      • MIN - The smallest data value in the series.
      • MAX - The largest data value in the series.
      • FIRST - The value of the first data object in the series.
      • LAST - The value of the last data object in the series.
  9. Save and run the JSP page on a test server when you have finished
    Note: The chart is a Macromedia Flash based component. The user must have the Flash plugin installed in the browser; otherwise, the chart will not display.
Related tasks
Adding a data tree
Adding a data grid
Adding a Web service
Updating Faces Client components
Deleting Faces Client components

Feedback