JWorld@TW the best professional Java site in Taiwan
      註冊 | 登入 | 全文檢索 | 排行榜  

» JWorld@TW » Java Tools  

按列印兼容模式列印這個話題 列印話題    把這個話題寄給朋友 寄給朋友   
reply to postflat modego to previous topicgo to next topic
本主題所含的標籤
無標籤
作者 Re:請教 JFreeChart TimeSeries 的間隔設定 [Re:bradlee7321]
freshia77





發文: 32
積分: 0
於 2005-10-06 17:12 user profilesend a private message to userreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
大家好...這是我參考各位的文章所寫的,
不過下面日期的部分一直改不好,
麻煩各位大大指導一下嚕....謝謝^^

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<%@page contentType="image/jpeg;charset=MS950"%> 
<!--因為要顯示圖形,設定contentType為image/jpeg --> 
<%@page import="java.util.*,java.io.*,java.awt.*,java.text.*"%> 
<%@page import="org.jfree.data.category.*"%> 
<%@page import="org.jfree.data.general.*"%> 
<%@page import="org.jfree.data.*"%> 
<%@page import="org.jfree.data.xy.*"%> 
<%@page import="org.jfree.chart.*"%> 
<%@page import="org.jfree.chart.axis.*"%> 
<%@page import="org.jfree.chart.ui.*"%> 
<%@page import="org.jfree.chart.plot.*"%> 
<%@page import="org.jfree.chart.renderer.xy.*"%> 
<%@ page import="org.jfree.ui.ApplicationFrame"%> 
<%@ page import="org.jfree.ui.RefineryUtilities"%> 
<%@ page import="org.jfree.chart.title.*"%> 
<%@ page import="org.jfree.chart.servlet.ServletUtilities"%> 
<%@ page import="org.jfree.chart.urls.*"%> 
<%@ page import="org.jfree.chart.entity.*"%> 
<%@ page import="org.jfree.chart.labels.StandardXYToolTipGenerator"%> 
<% 
    XYSeries series1 = new XYSeries("30");
 
    for (int i=1;i<=15;i++) 
    {       
        series1.add(i, 30+i);   
    } 
   
    XYSeriesCollection dataset = new XYSeriesCollection(); 
    dataset.addSeries(series1); 
 
    String chartTitle = "Multi X Chart";   
    JFreeChart chart = ChartFactory.createTimeSeriesChart( 
      chartTitle, 
      "time", "KA", 
      dataset, 
      true, 
      true, 
      false 
      ); 
       
    chart.setBackgroundPaint(java.awt.Color.white);  
 
    XYPlot plot = chart.getXYPlot(); 
    XYItemRenderer renderer = plot.getRenderer(); 
    if (renderer instanceof XYLineAndShapeRenderer) 
    {
        XYLineAndShapeRenderer rr = (XYLineAndShapeRenderer) renderer;
        rr.setDefaultShapesVisible(true);
        rr.setDefaultShapesFilled(true);
 
    } 
       
    DateAxis axis = (DateAxis) plot.getDomainAxis(); 
    axis.setDateFormatOverride(new SimpleDateFormat("yyyy-MM-dd")); 
    
    
     
    /* 
    ChartPanel chartPanel = new ChartPanel(chart); 
    chartPanel.setPreferredSize(new java.awt.Dimension(500, 270)); 
    chartPanel.setMouseZoomable(true, false); 
    setContentPane(chartPanel); 
    */ 
   
    //chart.setBackgroundPaint(java.awt.Color.white); 
   
    OutputStream ostream = response.getOutputStream(); 
    ChartUtilities.writeChartAsPNG(ostream, chart, 700, 400); 
    ostream.close(); 
%> 
<img src="timeserieschart.jsp">



freshia77 edited on 2005-10-07 15:42
reply to postreply to post
話題樹型展開
人氣 標題 作者 字數 發文時間
8521 請教 JFreeChart TimeSeries 的間隔設定 bradlee7321 1973 2003-07-30 12:01
7445 Re:請教 JFreeChart TimeSeries 的間隔設定 koji 110 2003-07-30 12:13
7483 Re:請教 JFreeChart TimeSeries 的間隔設定 bradlee7321 46 2003-07-30 12:34
7534 Re:請教 JFreeChart TimeSeries 的間隔設定 bradlee7321 46 2003-07-30 13:22
7374 Re:請教 JFreeChart TimeSeries 的間隔設定 bradlee7321 52 2003-07-30 13:46
7363 Re:請教 JFreeChart TimeSeries 的間隔設定 koji 134 2003-07-30 13:16
7329 Re:請教 JFreeChart TimeSeries 的間隔設定 koji 158 2003-07-30 13:28
8107 Re:請教 JFreeChart TimeSeries 的間隔設定 bradlee7321 1454 2003-07-30 15:39
7651 Re:請教 JFreeChart TimeSeries 的間隔設定 bradlee7321 2018 2003-07-31 09:45
6952 Re:請教 JFreeChart TimeSeries 的間隔設定 smartdanny 308 2005-06-28 14:05
7500 Re:請教 JFreeChart TimeSeries 的間隔設定 freshia77 2471 2005-10-06 17:12
5942 Re:請教 JFreeChart TimeSeries 的間隔設定 blueway2002 66 2007-05-10 23:22
» JWorld@TW »  Java Tools

reply to postflat modego to previous topicgo to next topic
  已讀文章
  新的文章
  被刪除的文章
Jump to the top of page

JWorld@TW 本站商標資訊

Powered by Powerful JuteForum® Version Jute 1.5.8