⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cewolfxydataset.jsp

📁 提供 精通Java Web动态图表编程 一书的源代码, 大家赶快下载呀
💻 JSP
字号:
<!--
	Fig. 8.4_04: CewolfXYDataset.jsp
	功能: 生成 XYDataset 类的数据集对象
-->
<%@ page contentType="text/html;charset=GB2312"%>
<%@ taglib uri='/WEB-INF/cewolf.tld' prefix='cewolf' %>

<%@ page import="java.util.*"%>

<%@ page import="de.laures.cewolf.*"%>
<%@ page import="de.laures.cewolf.tooltips.*"%>
<%@ page import="de.laures.cewolf.links.*"%>

<%@ page import="org.jfree.data.*"%>
<%@ page import="org.jfree.data.time.*"%>
<%@ page import="org.jfree.data.gantt.*"%>
<%@ page import="org.jfree.chart.*"%>
<%@ page import="org.jfree.chart.plot.*"%>
<%@ page import="org.jfree.chart.renderer.*"%>
<%@ page import="org.jfree.data.category.*"%>
<%@ page import="org.jfree.data.general.*"%>
<%@ page import="org.jfree.data.xy.*"%>

<%!
	String xaxislabel = "统计时间:2005年4月";
	String yaxislabel = "日销售量";
	String bookTitle = "JAVA";
%>

<%
// 创建数据集
DatasetProducer xyData = new DatasetProducer()
{
  public Object produceDataset(Map params)
  {
    XYSeries xys = new XYSeries(bookTitle);
    int bookSales = 0;
    for (int day = 0; day <= 30; day++)
    {
      bookSales = 10+(int)(Math.random() * 30);
      xys.add(day, bookSales);
    }
    XYSeriesCollection xysc = new XYSeriesCollection(xys);
    return xysc;
  }

  public String getProducerId()
  {
    return "XYDataProducer";
  }

  public boolean hasExpired(Map params, Date since)
  {
    return true;
  }
};
pageContext.setAttribute("xyData", xyData);
%>

<!--
/**************************************************************************
 * (C) Copyright 2004-2005 by Jingkui Zhong(钟京馗) and Huan Tang(唐桓).  *
 * All Rights Reserved.                                                   *
 *                                                                        *
 * DISCLAIMER: The authors of this code have used their                   *
 * best efforts in preparing the code. These efforts include the          *
 * development, research, and testing of the theories and programs        *
 * to determine their effectiveness. The authors and publisher make       *
 * no warranty of any kind, expressed or implied, with regard to these    *
 * programs or to the documentation contained in these codes. The authors *
 * shall not be liable in any event for incidental or consequential       *
 * damages in connection with, or arising out of, the furnishing,         *
 * performance, or use of these programs.                                 *
 **************************************************************************/
 -->

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -