<%// ChangeRadarType:%>


<%
// To change the radar type for a chart, get the chart's 
// graph model and use it to set to set the desired radar type.
//
// When setting the type, you must be sure that the data are
// suitable for that type. This example sets the radar type to
// Radial. The code first calls the graph model's setUniformAxes()
// method to enable the axes to represent different data ranges.
%>
<%@page import="com.sas.servlet.tbeans.graphics.html.RadarChart,
        com.sas.graphics.components.radarchart.RadarChartTableDataModel,
        com.sas.graphics.components.radarchart.RadarChartModel,
        com.sas.graphics.components.AnalysisVariable,
        com.sas.graphics.components.ClassificationVariable,
        com.sas.models.SimpleTable,
        com.sas.swing.models.TableModelAdapter"
%>
<%
  // Create a RadarChart and a data source 
     RadarChart radarChart=new RadarChart();
  // Create a simple SAS table and add data to it
     SimpleTable table = new SimpleTable();
%> 

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

<%
  // Convert a simple SAS table to a simple Java Swing table
     TableModelAdapter tma = new TableModelAdapter(table);
     tma.setFormattedDataUsed(false);

  // Turn off uniform axes and set the Radial radar type
     radarChart.getGraphModel().setUniformAxes(false);
     radarChart.getGraphModel().setRadarType(RadarChartModel.RADAR_TYPE_RADIAL);

  // Create a data model and attach the data source
     RadarChartTableDataModel dataModel=
               new RadarChartTableDataModel(tma);

  // Assign the Category and Response variable roles
     dataModel.setCategoryVariable(
              new ClassificationVariable("Cause"));
     dataModel.setResponseVariable(
              new AnalysisVariable("Count"));

 // Assign the data model to the RadarChart
    radarChart.setDataModel(dataModel);

 // Set a graph title
    radarChart.getTitle1().setText("Causes of Failure");

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

  // Write the chart to the display
     radarChart.write(out);
%>