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

» JWorld@TW » Java Tools  

按列印兼容模式列印這個話題 列印話題    把這個話題寄給朋友 寄給朋友   
reply to topicthreaded modego to previous topicgo to next topic
本主題所含的標籤
作者 請教JfreeChart如何顯示資料的數值
hsiuyueh





發文: 2
積分: 0
於 2004-06-15 13:24 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要如何設定,才能讓數值顯示在每一個長條圖的上方
例如下圖

謝謝


reply to postreply to post
作者 Re:請教JfreeChart如何顯示資料的數值 [Re:hsiuyueh]
puss

Aya



發文: 21
積分: 0
於 2004-07-06 12:40 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
hsiuyueh wrote:
請教各位大大

在JfreeChart要如何設定,才能讓數值顯示在每一個長條圖的上方


讀讀 JFreeChart 附的這兩個檔案就知道了

src/org/jfree/chart/demo/ItemLabelDemo1.java
src/org/jfree/chart/demo/ItemLabelDemo2.java


reply to postreply to post
作者 Re:請教JfreeChart如何顯示資料的數值 [Re:puss]
xing0501





發文: 25
積分: 0
於 2004-08-24 18:12 user profilesend a private message to usersend email to xing0501reply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
puss wrote:
讀讀 JFreeChart 附的這兩個檔案就知道了

src/org/jfree/chart/demo/ItemLabelDemo1.java
src/org/jfree/chart/demo/ItemLabelDemo2.java


我照您的指引參照上面檔案把以下程式碼加在程式中,並讓它製成jpeg圖檔
,不過還是沒辦法顯示3D BAR的資料數值…DisapprovedSad
1
2
3
4
5
6
7
8
9
10
11
        final CategoryPlot plot = chart.getCategoryPlot();
        plot.setBackgroundPaint(Color.lightGray);
        plot.setDomainGridlinePaint(Color.white);
        plot.setRangeGridlinePaint(Color.white);
        
        final NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
        rangeAxis.setUpperMargin(0.15);
        
        final CategoryItemRenderer renderer = plot.getRenderer();
        renderer.setLabelGenerator(new LabelGenerator(50.0));
        renderer.setItemLabelsVisible(true);


reply to postreply to post
作者 Re:請教JfreeChart如何顯示資料的數值 [Re:xing0501]
puss

Aya



發文: 21
積分: 0
於 2004-08-27 11:40 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
xing0501 wrote:
我照您的指引參照上面檔案把以下程式碼加在程式中,並讓它製成jpeg圖檔
,不過還是沒辦法顯示3D BAR的資料數值…DisapprovedSad
1
        renderer.setLabelGenerator(new LabelGenerator(50.0));



new LabelGenerator(50.0)

改成

new StandardCategoryLabelGenerator()


reply to postreply to post
作者 Re:請教JfreeChart如何顯示資料的數值 [Re:hsiuyueh]
freshia77





發文: 32
積分: 0
於 2006-04-26 11: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
請教一下各位大大, 我是用3D BAR, 雖然可以在圖中呈現數字, 但是都是在BAR的中間, 我想要呈現在每個BAR的上方, 不知道要用什麼辦法才可以做到呢??謝謝^^


reply to postreply to post
作者 Re:請教JfreeChart如何顯示資料的數值 [Re:freshia77]
peter777777777





發文: 27
積分: 0
於 2007-09-13 14:56 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
freshia77 wrote:
請教一下各位大大, 我是用3D BAR, 雖然可以在圖中呈現數字, 但是都是在BAR的中間, 我想要呈現在每個BAR的上方, 不知道要用什麼辦法才可以做到呢??謝謝^^


用3D 的話~應該用BarRenderer3D 就可以了~
1
2
3
BarRenderer3D barrenderer3d =(BarRenderer3D)categoryplot.getRenderer();
barrenderer3d.setPositiveItemLabelPosition(new ItemLabelPosition(
                 ItemLabelAnchor.OUTSIDE12, TextAnchor.BASELINE_LEFT));


reply to postreply to post
作者 Re:請教JfreeChart如何顯示資料的數值 [Re:hsiuyueh]
freshia77





發文: 32
積分: 0
於 2009-01-08 19: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
各位大大好,我除了數值之外,還想要呈現百分比,請問有什麼方法可以達到呢??
謝謝!!


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