ajinkya_c Posted June 14, 2013 Share Posted June 14, 2013 Hi,Check the chart properties there is a option that you need to check to show values.Regards,Ajinkya Link to comment Share on other sites More sharing options...
sritharhello Posted June 14, 2013 Author Share Posted June 14, 2013 Thanks for the reply. I'm using the version iReport 3.7.4 ... Show values are not there in properties ... I checked it in "Common Chart properties" and in "Line Plot Properties".... Link to comment Share on other sites More sharing options...
khareprabudh1 Posted January 24, 2021 Share Posted January 24, 2021 Below code will show values as well as add the "%" sign to that value. In this code i have only one series so i have just used getItemCount(0) and getY(0,i) to get first series. if you have many series just use a loop at the top level. public strictfp void customize(JFreeChart chart, JRChart jasperChart) { XYLineAndShapeRenderer renderer = (XYLineAndShapeRenderer) chart.getXYPlot().getRenderer(); renderer.setBaseItemLabelsVisible(Boolean.TRUE); renderer.setBaseItemLabelFont(new Font("SansSerif", Font.PLAIN, 12)); for(int i = 0 ; i <chart.getXYPlot().getDataset().getItemCount(0); i++){ Number n = chart.getXYPlot().getDataset().getY(0,i); renderer.setBaseItemLabelGenerator((XYItemLabelGenerator) new StandardXYItemLabelGenerator(n.toString().concat("%"))); } } Link to comment Share on other sites More sharing options...
khareprabudh1 Posted January 24, 2021 Share Posted January 24, 2021 see the answer Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now