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

» JWorld@TW » Java Tools  

按列印兼容模式列印這個話題 列印話題    把這個話題寄給朋友 寄給朋友   
reply to topicthreaded modego to previous topicgo to next topic
話題被移動
該話題已被移動 - Roberto , 2003-07-22 14:34
如果您尚不清楚該話題被移動的原因,請參考論壇規則以及本版公告或者聯系本版版主。
本主題所含的標籤
無標籤
作者 關於JFreeChart TimeSeries線條的顏色設定 [精華]
bradlee7321





發文: 32
積分: 0
於 2003-07-21 15:19 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
請問一下..
JFreeChart 0.9.8 能設定Time Series線條的顏色嗎??
因為我現在一張圖裡面有四條線...三條是水平線, 我想讓三條水平線顏色一樣
請問能做到嗎?因為我看開發手冊裡好像沒提到!


reply to postreply to post
作者 Re:關於JFreeChart TimeSeries線條的顏色設定 [Re:bradlee7321]
worookie

Small Ship

版主

發文: 2092
積分: 21
於 2003-07-21 15:33 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
順便問一下
(我沒有手冊 只好到這問了)
很久以前畫的 (JFreeChart v0.9.8)
附圖如下
想把紅線條和藍線條貼在一起畫 (也就是說把他們的間隙調小)
附部分程式碼如下
不知該另外呼叫那個 method 來設定他?
煩請高手指導 謝謝
1
2
3
4
5
6
7
8
9
CategoryDataset dataset = createCategoryDataset(arArStDataItem);
JFreeChart chart = ChartFactory.createVerticalBarChart(
       title, "Ranges",  "Value", dataset, true, true, false);
chart.setBackgroundPaint(new Color(0xBBBBDD));
CategoryPlot plot = chart.getCategoryPlot();
HorizontalCategoryAxis domainAxis = (HorizontalCategoryAxis) plot.getDomainAxis();
domainAxis.setSkipCategoryLabelsToFit(true);
NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());



worookie edited on 2003-07-21 15:41
reply to postreply to post
作者 Re:關於JFreeChart TimeSeries線條的顏色設定 [Re:bradlee7321]
bradlee7321





發文: 32
積分: 0
於 2003-07-21 16:44 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
就我知道...
JFreeChart 間隔好像是隨著圖片尺寸的大小而自動調整它長條圖與長條圖之間的間隔比例n如果真要設定的話, 我想可能要從它所附的原始碼下手了!


reply to postreply to post
作者 Re:關於JFreeChart TimeSeries線條的顏色設定 [Re:bradlee7321]
koji

秒速5センチメートル

站長

發文: 8415
積分: 19
於 2003-07-21 16:46 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
要編輯同一組的線條空隙
像這樣寫
plot.setItemGapsPercent(0.0);

突然發現我寫的時候是0.9.3版
跟現在差好多@_@得找找

koji


koji edited on 2003-07-21 16:59
reply to postreply to post
作者 Re:關於JFreeChart TimeSeries線條的顏色設定 [Re:bradlee7321]
bradlee7321





發文: 32
積分: 0
於 2003-07-21 17:06 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
koji 大大....
那Time Series線條顏色能設定嗎?
這我找了好久都沒找到~~!


reply to postreply to post
作者 Re:關於JFreeChart TimeSeries線條的顏色設定 [Re:bradlee7321]
koji

秒速5センチメートル

站長

發文: 8415
積分: 19
於 2003-07-21 17:52 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
to:
bradlee7321

XYItemRenderer renderer = plot.getRenderer();
renderer.setSeriesPaint(index,Color.YELLOW);

index是數字,妳的線條序號

這是我剛剛抓的0.9.9版的狀況下

koji


reply to postreply to post
作者 Re:關於JFreeChart TimeSeries線條的顏色設定 [Re:bradlee7321]
bradlee7321





發文: 32
積分: 0
於 2003-07-21 20:22 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
嗯嗯, 我試試~~~
請教一下koji
我因為專題的製作, 需要用到JFreeChart來繪製統計圖
您都是怎麼看JFreeChart的JAVADOC的....
因為我常常看個老半天, 還是不知道那是做啥用的......@@"
而且網路的範例少的可憐......>"<
所以有些有的功能我都沒注意到.......
請指導一下, 謝謝哩


reply to postreply to post
作者 Re:關於JFreeChart TimeSeries線條的顏色設定 [Re:bradlee7321]
koji

秒速5センチメートル

站長

發文: 8415
積分: 19
於 2003-07-21 20:28 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
to worookie

BarRenderer br = new BarRenderer();
br.setItemMargin(0.0);
plot.setRenderer(br);

koji


reply to postreply to post
作者 Re:關於JFreeChart TimeSeries線條的顏色設定 [Re:bradlee7321]
koji

秒速5センチメートル

站長

發文: 8415
積分: 19
於 2003-07-21 20:33 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
它有一個demo的source可以看
外加他的document,我記得當時我是看他的文件
現在是不是要付前才有??我剛剛隨便逛一下找不到
把plot,renderer,axis,等等的功能搞清楚
要找api就會好找很多

good luck

koji


reply to postreply to post
作者 Re:關於JFreeChart TimeSeries線條的顏色設定 [Re:bradlee7321]
bradlee7321





發文: 32
積分: 0
於 2003-07-21 20:39 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
喔, 我大致了解了
謝謝你囉~~~
我在研究看看, 有心得會po出來跟大家分享一下
因為這方面的資訊實在很少


reply to postreply to post
作者 Re:關於JFreeChart TimeSeries線條的顏色設定 [Re:bradlee7321]
worookie

Small Ship

版主

發文: 2092
積分: 21
於 2003-07-22 06:17 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
感恩 koji 大大
在您的指導下終於成功了
新的程式 (for JFreeChart v0.9.9) 節錄如下:
1
2
3
4
5
6
7
8
9
10
11
12
CategoryDataset dataset = createCategoryDataset(arArStDataItem);
JFreeChart chart = ChartFactory.createBarChart(
        title, "Ranges", "Value", dataset, PlotOrientation.VERTICAL, true, true, false);
chart.setBackgroundPaint(new Color(0xBBBBDD));
CategoryPlot plot = chart.getCategoryPlot();
BarRenderer br = new BarRenderer();
br.setItemMargin(0.0);
plot.setRenderer(br);
CategoryAxis domainAxis = plot.getDomainAxis(); // v0.9.9
domainAxis.setSkipCategoryLabelsToFit(true);
NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());



reply to postreply to post
作者 Re:關於JFreeChart TimeSeries線條的顏色設定 [Re:bradlee7321]
bradlee7321





發文: 32
積分: 0
於 2003-07-22 10:14 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
呵呵
試成功了~~!0.9.8的也可以用
koji版大, 請問一下, 我剛看到setSeriesStroke(int series, java.awt.Stroke stroke) 這個Method, 這是用來設定什麼的阿...@@"
最主要我這個java.awt.Stroke看不懂....


reply to postreply to post
作者 Re:關於JFreeChart TimeSeries線條的顏色設定 [Re:bradlee7321]
koji

秒速5センチメートル

站長

發文: 8415
積分: 19
於 2003-07-22 10:37 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
to bradlee7321
設定每種資料外圍邊線的厚度,傳入的參數必須為java.awt.Stroke和你要設定的資料對象
如果我沒記錯的話

koji


reply to postreply to post
作者 Re:關於JFreeChart TimeSeries線條的顏色設定 [Re:bradlee7321]
birdboyqss





發文: 8
積分: 0
於 2004-08-10 21:04 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
近來做一個關於jfreechart項目甘特圖顯示。已經能實現顯示和美部分任務的鏈接,但是如果要求對於不同的負責人(已經在數據庫中存儲了關於項目每一項任務的負責人)只出現和自己相關的項目的鏈接。應該修改或者應用哪些類呢??
同時如何能對同一个甘特圖中不同的任務設置不同的標記顔色呢??在jfreechart中哪些類可以對同一个甘特圖中不同的任務設置不同的標記顔色??


reply to postreply to post
作者 Re:關於JFreeChart TimeSeries線條的顏色設定 [Re:bradlee7321]
freshia77





發文: 32
積分: 0
於 2006-04-25 19:29 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
我想請問一下, 我把BarRenderer set 到 plot,就會發生錯誤,

可以請教一下大家是怎麼回事嗎??謝謝^^

1.JPG (914.95k)


reply to postreply to post
» JWorld@TW »  Java Tools

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

JWorld@TW 本站商標資訊

Powered by Powerful JuteForum® Version Jute 1.5.8