• 大小: 10.7MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-08-25
  • 语言: 数据库
  • 标签: java  

资源简介

库存管理平台,支持Mysql数据库,导入即用,操作流程详细,可供新手参考借鉴。

资源截图

代码片段和文件信息

package action;

import java.sql.Connection;

import javax.servlet.http.HttpServletRequest;

import org.jfree.chart.ChartFactory;
import org.jfree.chart.JFreeChart;
import org.jfree.chart.labels.ItemLabelAnchor;
import org.jfree.chart.labels.ItemLabelPosition;
import org.jfree.chart.labels.StandardCategoryItemLabelGenerator;
import org.jfree.chart.plot.CategoryPlot;
import org.jfree.chart.plot.PlotOrientation;
import org.jfree.chart.renderer.category.BarRenderer3D;
import org.jfree.data.category.DefaultCategoryDataset;
import org.jfree.ui.TextAnchor;

import model.Goods;
import model.Stock;
import util.DbUtil;

import com.opensymphony.xwork2.ActionSupport;

import dao.GoodsDao;

public class BarCharAction extends ActionSupport{



/**
 * 
 */
private static final long serialVersionUID = 1L;
private HttpServletRequest request;
private String id;
private Goods goods;
private JFreeChart chart;

public JFreeChart getChart() {
return chart;
}
public void setChart(JFreeChart chart) {
this.chart = chart;
}
public Goods getGoods() {
return goods;
}
public void setGoods(Goods goods) {
this.goods = goods;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}

DbUtil dbUtil = new DbUtil();
GoodsDao goodsDao = new GoodsDao();

public String show() throws Exception{
//这是实现动态数据报表
//request.setAttribute(“mainPage“ “/view/show.jsp“);
/*Connection con=dbUtil.getCon();
goods = goodsDao.getGoodsById(con id);//获取点击商品的信息
*/
//创建报表
DefaultCategoryDataset dataset = new DefaultCategoryDataset();
dataset.addValue(510 “库存“ “java01“);
dataset.addValue(320 “销售量“ “java01“);
chart=ChartFactory.createBarChart3D(“商品库存销售表“ “库存“ ““ dataset
PlotOrientation.VERTICAL true true true);
CategoryPlot plot=chart.getCategoryPlot();
// 显示每个柱的数值,并修改该数值的字体属性
BarRenderer3D renderer=new BarRenderer3D();
renderer.setbaseItemLabelGenerator(new StandardCategoryItemLabelGenerator());
renderer.setbaseItemLabelsVisible(true);
renderer.setbasePositiveItemLabelPosition(new ItemLabelPosition(ItemLabelAnchor.OUTSIDE12 TextAnchor.baseLINE_LEFT));
renderer.setItemLabelAnchorOffset(10D);  
// 设置平行柱的之间距离
renderer.setItemMargin(0.4);

plot.setRenderer(renderer);

return “success“;
}

public void setServletRequest(HttpServletRequest request) {
this.request=request;
}

}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     文件        8605  2014-05-13 12:24  db_stockmanage.sql
     目录           0  2018-12-26 07:03  StockManageSystem\
     文件         836  2018-12-26 07:03  StockManageSystem\.classpath
     文件         917  2018-12-26 07:03  StockManageSystem\.project
     目录           0  2018-12-26 07:03  StockManageSystem\.settings\
     文件         567  2018-12-26 07:03  StockManageSystem\.settings\.jsdtscope
     文件         364  2018-12-26 07:03  StockManageSystem\.settings\org.eclipse.jdt.core.prefs
     文件         503  2018-12-26 07:03  StockManageSystem\.settings\org.eclipse.wst.common.component
     文件         345  2018-12-26 07:03  StockManageSystem\.settings\org.eclipse.wst.common.project.facet.core.xml
     文件          49  2018-12-26 07:03  StockManageSystem\.settings\org.eclipse.wst.jsdt.ui.superType.container
     文件           6  2018-12-26 07:03  StockManageSystem\.settings\org.eclipse.wst.jsdt.ui.superType.name
     目录           0  2018-12-26 07:03  StockManageSystem\WebContent\
     目录           0  2018-12-26 07:03  StockManageSystem\WebContent\meta-INF\
     文件          39  2018-12-26 07:03  StockManageSystem\WebContent\meta-INF\MANIFEST.MF
     目录           0  2018-12-26 07:03  StockManageSystem\WebContent\WEB-INF\
     目录           0  2018-12-26 07:03  StockManageSystem\WebContent\WEB-INF\lib\
     文件      231320  2018-12-26 07:03  StockManageSystem\WebContent\WEB-INF\lib\commons-beanutils-1.8.0.jar
     文件      571259  2018-12-26 07:03  StockManageSystem\WebContent\WEB-INF\lib\commons-collections-3.2.jar
     文件       59590  2018-12-26 07:03  StockManageSystem\WebContent\WEB-INF\lib\commons-fileupload-1.2.2.jar
     文件      279781  2018-12-26 07:03  StockManageSystem\WebContent\WEB-INF\lib\commons-httpclient-3.0.1.jar
     文件      159509  2018-12-26 07:03  StockManageSystem\WebContent\WEB-INF\lib\commons-io-2.0.1.jar
     文件      261809  2018-12-26 07:03  StockManageSystem\WebContent\WEB-INF\lib\commons-lang-2.4.jar
     文件      315805  2018-12-26 07:03  StockManageSystem\WebContent\WEB-INF\lib\commons-lang3-3.1.jar
     文件       60686  2018-12-26 07:03  StockManageSystem\WebContent\WEB-INF\lib\commons-logging-1.1.1.jar
     文件       77826  2018-12-26 07:03  StockManageSystem\WebContent\WEB-INF\lib\ezmorph-1.0.3.jar
     文件      931168  2018-12-26 07:03  StockManageSystem\WebContent\WEB-INF\lib\freemarker-2.3.19.jar
     文件     1052045  2018-12-26 07:03  StockManageSystem\WebContent\WEB-INF\lib\iText-2.1.1.jar
     文件      614203  2018-12-26 07:03  StockManageSystem\WebContent\WEB-INF\lib\javassist-3.11.0.GA.jar
     文件      307860  2018-12-26 07:03  StockManageSystem\WebContent\WEB-INF\lib\jcommon-1.0.13.jar
     文件       21948  2018-12-26 07:03  StockManageSystem\WebContent\WEB-INF\lib\jfreechart-1.0.10-experimental.jar
     文件       72968  2018-12-26 07:03  StockManageSystem\WebContent\WEB-INF\lib\jfreechart-1.0.10-swt.jar
............此处省略693个文件信息

评论

共有 条评论