import java.awt.Color;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import javax.servlet.http.HttpSession;
import org.jfree.chart.ChartFactory;
import org.jfree.chart.ChartRenderingInfo;
import org.jfree.chart.JFreeChart;
import org.jfree.chart.axis.DateAxis;
import org.jfree.chart.entity.StandardEntityCollection;
import org.jfree.chart.plot.XYPlot;
import org.jfree.chart.servlet.ServletUtilities;
import org.jfree.data.time.Day;
import org.jfree.data.time.TimeSeries;
import org.jfree.data.time.TimeSeriesCollection;
import org.jfree.data.time.TimeSeriesDataItem;
import org.jfree.ui.RectangleInsets;
import com.eward.PublicBean;
import com.excp.web.plastic.bean.DateBean;public class ChartJPGBean {
PublicBean bean=new PublicBean();
DateBean dateBean=new DateBean();
private String x_label;
private String y_label;
private String title;
private String format;
private int width;
private int height;
private static TimeSeriesCollection dataset = new TimeSeriesCollection();
/**************
* 设置数据
* @param arr
*/
private TimeSeriesCollection setDataset(ArrayList arr){
dataset.removeAllSeries(); //在javaBean中使用此类这个很重要,不然会不停的加入新的TimeSeries;
if(arr.size()>0){
for(int i=0;i public String getFormat() {
return format;
} public void setFormat(String format) {
this.format = format;
} public int getHeight() {
return height;
} public void setHeight(int height) {
this.height = height;
} public String getTitle() {
return title;
} public void setTitle(String title) {
this.title = title;
} public int getWidth() {
return width;
} public void setWidth(int width) {
this.width = width;
} public String getX_label() {
return x_label;
} public void setX_label(String x_label) {
this.x_label = x_label;
} public String getY_label() {
return y_label;
} public void setY_label(String y_label) {
this.y_label = y_label;
}
}
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment