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

» JWorld@TW » Java Tools  

按列印兼容模式列印這個話題 列印話題    把這個話題寄給朋友 寄給朋友   
reply to topicthreaded modego to previous topicgo to next topic
本主題所含的標籤
作者 請教jFreeChart中IntervalMarker對應第二個y軸
asina





發文: 2
積分: 0
於 2009-04-12 17:54 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
各位先進大家好:

小弟最近需要製作多種數據合成一張XY軸的報表

由於IntervalMarker中的上界值與下界值部份 目前只能對應到第一個Y軸 無法對應到第二個 或是 第三個Y軸

想請教一下可否給予提示或告知如何解決

可以讓三種不同的IntervalMarker對應到各自的y軸

謝謝


reply to postreply to post
作者 Re:請教jFreeChart中IntervalMarker對應第二個y軸 [Re:asina]
asina





發文: 2
積分: 0
於 2009-04-12 22: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
字問自答好了

//抓取第一軸上下界
double up1 = axis1.getUpperBound();
double low1 = axis1.getLowerBound();

//intervalMarker
//第一個軸可以直接加入
IntervalMarker intervalMarker1 = new IntervalMarker(bpsL, bpsH);
intervalMarker1.setAlpha(0.2f);
intervalMarker1.setPaint(Color.black);
intervalMarker1.setLabel("SYS");
plot.addRangeMarker(intervalMarker1);

//加入第二個軸
NumberAxis axis2 = new NumberAxis("舒張壓");
axis2.setLabelAngle(-Math.PI / 2);
//axis2.setTickUnit(new NumberTickUnit(10));
axis2.setTickLabelPaint(Color.green);  //坐標尺顏色
axis2.setLabelPaint(Color.green);    //分類標籤字體顏色
//out.println(d1 + " " + d2);
axis2.setLowerBound(d1-10);  //最小值
axis2.setUpperBound(d2+10);  //最大值
//out.println(axis2.getLowerBound() + " " + axis2.getUpperBound());
//out.println(axis2.getRange());
//axis2.setTickUnit(new NumberTickUnit(10.0));  //間隔
plot.setRangeAxis(1, axis2);
plot.setRangeAxisLocation(1, AxisLocation.BOTTOM_OR_RIGHT);
    
//抓取第二軸上下界
double up2 = axis2.getUpperBound();
double low2 = axis2.getLowerBound();
      
//out.println(bpdL + " " + bpdH);
//intervalMarker
IntervalMarker intervalMarker2 = new IntervalMarker(((up1-low1)/(up2-low2)*(bpdL-low2)+low1), ((up1-low1)/(up2-low2)*(bpdH-low2)+low1));
intervalMarker2.setAlpha(0.2f);
intervalMarker2.setPaint(Color.green);
intervalMarker2.setLabel("DIA");
plot.addRangeMarker(intervalMarker2);


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