cewolfcategorydatasetchart3.jsp

来自「提供 精通Java Web动态图表编程 一书的源代码, 大家赶快下载呀」· JSP 代码 · 共 93 行

JSP
93
字号
<!--
	Fig. 8.4_02_03: CewolfCategoryDatasetChart3.jsp
	功能: Cewolf 编程实例: 基于CategoryDataset的水平堆栈图及垂直立方图
-->
<%@ page contentType="text/html;charset=GB2312"%>
<%@ include file="CewolfDataset.jsp" %>

<%
// 定义绘制颜色
ChartPostProcessor dataColor = new ChartPostProcessor()
{
  public void processChart(Object chart, Map params)
  {
    CategoryPlot plot = (CategoryPlot)((JFreeChart)chart).getPlot();
    for (int i = 0; i < params.size(); i++)
    {
      String colorStr = (String)params.get(String.valueOf(i));
      plot.getRenderer().setSeriesPaint(i, java.awt.Color.decode(colorStr));
    }
  }
};
pageContext.setAttribute("dataColor", dataColor);
%>

<HTML>
 <HEAD>
       <TITLE>Cewolf 编程实例: 基于CategoryDataset的水平堆栈图及垂直立方图</TITLE>
 </HEAD>
 <BODY>

<cewolf:chart
	id="stackedHorizontalBar"
	title="Cewolf 编程实例6: 水平堆栈图"
	type="stackedHorizontalBar"
	xaxislabel="<%= xaxislabel %>"
	yaxislabel="<%= yaxislabel %>">
    <cewolf:data>
        <cewolf:producer id="categoryData" />
    </cewolf:data>
</cewolf:chart>

<cewolf:img
	chartid="stackedHorizontalBar"
	renderer="/cewolf"
	width="500"
	height="375">
</cewolf:img>

<BR><BR>

<cewolf:chart
	id="verticalBar3D"
	title="Cewolf 编程实例7: 3D垂直直方图"
	type="verticalBar3D"
	xaxislabel="<%= xaxislabel %>"
	yaxislabel="<%= yaxislabel %>">
    <cewolf:data>
        <cewolf:producer id="categoryData" />
    </cewolf:data>
	    <cewolf:chartpostprocessor id="dataColor">
        <cewolf:param name="0" value='<%= "#FFFFAA" %>'/>
        <cewolf:param name="1" value='<%= "#AAFFAA" %>'/>
        <cewolf:param name="2" value='<%= "#FFAAFF" %>'/>
        <cewolf:param name="3" value='<%= "#FFAAAA" %>'/>
    </cewolf:chartpostprocessor>
</cewolf:chart>

<cewolf:img
	chartid="verticalBar3D"
	renderer="/cewolf"
	width="500"
	height="375">
</cewolf:img>

 </BODY>
</HTML>

<!--
/**************************************************************************
 * (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 + =
减小字号Ctrl + -
显示快捷键?