Label in each point of a XY Line

0
 

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 {
 
@Override
public 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());
}
}

serial=F{id};


yvalue=F{leftlong};

xvalue=F{longmeter};

label=F{type};

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??

fatih.maden's picture
Joined: Aug 17 2016 - 4:34am
Last seen: 2 years 11 months ago

0 Answers:

No answers yet
Feedback
randomness