<%// ChangeStyle:%>
<%
// Numerous pre-defined styles are available to all BIP graphs.
// The styles control visual characteristics of the graph, such
// as the fonts and color scheme it uses.
//
// To change a graph's style, call the LineChart's applyGraphStyle() method
%>
<%@page import="com.sas.models.SimpleTable,
com.sas.swing.models.TableModelAdapter,
com.sas.servlet.tbeans.graphics.html.LineChart,
com.sas.graphics.components.AnalysisVariable,
com.sas.graphics.components.ClassificationVariable,
com.sas.graphics.components.GraphStyle,
com.sas.graphics.components.linechart.LineChartTableDataModel"
%>
<%
// Create a LineChart instance
LineChart lineChart = new LineChart();
// Create a simple SAS table and add data to it
SimpleTable table = new SimpleTable();
%>
<%@ include file="SampleData.jsp" %>
<%
// Convert a simple SAS table to a simple Java Swing table
TableModelAdapter tma = new TableModelAdapter(table);
tma.setFormattedDataUsed(false);
// Override the default style
lineChart.applyGraphStyle(
new GraphStyle(GraphStyle.STYLE_ANALYSIS));
// Create a data model and attach the data source to it
LineChartTableDataModel lineChartDataModel=
new LineChartTableDataModel(tma);
// Assign the Category and Response variable roles
lineChartDataModel.setCategoryVariable(
new ClassificationVariable("Month"));
lineChartDataModel.setResponseVariable(
new AnalysisVariable("Temp"));
// Assign the data model to the LineChart
lineChart.setDataModel(lineChartDataModel);
// Set a title
lineChart.getTitle1().setText("Raleigh Monthly Temperatures");
// Set HTTP-specific response and request functionality
lineChart.setResponse(response);
lineChart.setRequest(request);
// Write the chart to the display
lineChart.write(out);
%>