2012-07-03 12 views
7

के साजिश क्षेत्र में पौराणिक कथाओं को एम्बेड करें JFreeChart में, क्या लीजेंड को चार्ट में ही एम्बेड करना संभव है? लीजेंड को चार्ट के शीर्ष, नीचे, बाएं, दाएं दाएं सेट पर सेट किया जा सकता है, लेकिन क्या इसे चार्ट में एम्बेड करना संभव है?JFreeChart

LegendTitle legend=chart.getLegend(); 
legend.setPosition(RectangleEdge.TOP); 

उत्तर

11

कैसे polt अंदर कथा सेट करने के लिए की JFreeChart SamplesXYTitleAnnotationDemo1 में शामिल किए गए एक उदाहरण है, यह महत्वपूर्ण हिस्सा है:

XYPlot plot = (XYPlot) chart.getPlot(); 
LegendTitle lt = new LegendTitle(plot); 
lt.setItemFont(new Font("Dialog", Font.PLAIN, 9)); 
lt.setBackgroundPaint(new Color(200, 200, 255, 100)); 
lt.setFrame(new BlockBorder(Color.white)); 
lt.setPosition(RectangleEdge.BOTTOM); 
XYTitleAnnotation ta = new XYTitleAnnotation(0.98, 0.02, lt,RectangleAnchor.BOTTOM_RIGHT); 

ta.setMaxWidth(0.48); 
plot.addAnnotation(ta); 

enter image description here

+0

कैसे BoxAndWhisker साथ कि काम करता है भूखंडों? मुझे नहीं पता कि कौन सी एनोटेशन का उपयोग करना है और श्रेणीप्लॉट के लिए कैसे। – CGFoX

संबंधित मुद्दे