<%// SpecifyColumns:%>


<%
// To generate a WaterfallChart for each value of a categorical variable
// and align the charts horizontally, assign the Column variable role
// to an appropriate categorical variable.
%>
<%@page import="com.sas.servlet.tbeans.graphics.html.WaterfallChart,
        com.sas.graphics.components.waterfallchart.WaterfallChartTableDataModel,
        com.sas.graphics.components.AnalysisVariable,
        com.sas.graphics.components.ClassificationVariable,
        com.sas.graphics.components.GraphConstants,
        javax.swing.table.DefaultTableModel"
%>
<%
  // Create a WaterfallChart and a data source 
    WaterfallChart waterfallChart=new WaterfallChart();
%>

   <%@ include file="YearlyTransactionData.jsp" %>

<%
  // Set the bar label content
     waterfallChart.getGraphModel()
       .setOutsideBarLabelContent(GraphConstants.DATA_LABEL_RESPONSE);

  // Create a data model and attach the data source
     WaterfallChartTableDataModel dataModel=
       new WaterfallChartTableDataModel();
     dataModel.setModel(dataTable);

  // Generate a separate chart for each Year of transactions
     dataModel.setColumnVariable(
       new ClassificationVariable("Year"));

  // Assign the variable roles and sort category values in descending order
     dataModel.setCategoryVariable(
       new ClassificationVariable("Id", GraphConstants.SORT_DESCENDING));

  // Assign the Response variable role and apply the NLMNLUSD format so
  // that Transaction amounts in the output are displayed in an
  // internationalized representation of US dollars.
     dataModel.setResponseVariable(
       new AnalysisVariable("Transaction", "nlmnlusd"));

  // Call the data model's setCategorySortVariable() method
  // to sort bars according to the values of the response variable
     dataModel.setCategorySortVariable(dataModel.getResponseVariable());

  // Assign the data model to the WaterfallChart
     waterfallChart.setDataModel(dataModel);

  // Set a graph title
     waterfallChart.getTitle1().setText("BIP Waterfall Chart");

  // Set HTTP-specific response and request functionality
     waterfallChart.setResponse(response);
     waterfallChart.setRequest(request);

  // Set a graph size and write the chart to the display
     waterfallChart.setWidth(1000);
     waterfallChart.setHeight(450);
     waterfallChart.write(out);
%>