Jump to content
JasperReports Library 7.0 is now available ×

Label in each point of a XY Line


Recommended Posts


Is it possible to add the 'Labels value' a tag(label) in each point in a Line ChartIs 


customizer code;


import net.sf.jasperreports.engine.JRChartCustomizer;import org.jfree.chart.renderer.xy.XYItemRenderer;import org.jfree.chart.JFreeChart;import org.jfree.chart.labels.XYItemLabelGenerator;import org.jfree.chart.labels.StandardXYItemLabelGenerator;import org.jfree.chart.plot.XYPlot;import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer;import net.sf.jasperreports.engine.JRChart;/**** @author DECISIT*/public class LineChartItemLabelCustomizer implements JRChartCustomizer {@Overridepublic void customize(JFreeChart chart, JRChart jasperChart){    XYPlot XYPlot;     XYLineAndShapeRenderer lineAndShapeRenderer;    XYPlot = (XYPlot) chart.getPlot();    lineAndShapeRenderer= (XYLineAndShapeRenderer) XYPlot.getRenderer();    lineAndShapeRenderer.setBaseItemLabelsVisible(Boolean.TRUE);    lineAndShapeRenderer.setBaseItemLabelGenerator((XYItemLabelGenerator) new StandardXYItemLabelGenerator());}}[/code]










my problem ; when I use LineChartItemLabelCustomizer class, yvalue(F{leftlong}) came in every point. but i want to get label(F{type}).


How can be this class, to do this??

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Posted Images

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...