How to change line thickness on graph?

0

So I have a bunch of line graphs where I have to increase the thickness of the plotted lines. I tried using someone else's Java code here (haven't programmed in Java in ages), which changes the thickness of the line/pen on a time series graph. I have provided the code below, but am wondering how this could be modified to increase the thickness of all the plotted lines on a graph? Right now the customizer class I have created using this code seems to not do anything (I have properly configured the customizer class w/ all appropriate libraries, so this is not a compliation issue).

 

package customizers;
 
import java.awt.BasicStroke;
 
import net.sf.jasperreports.engine.JRAbstractChartCustomizer;
import net.sf.jasperreports.engine.JRChart;
import net.sf.jasperreports.engine.JRChartCustomizer;
 
import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer;
import org.jfree.chart.JFreeChart;
 
public class LineThickness extends JRAbstractChartCustomizer
{
    public void customize(JFreeChart chart, JRChart jasperChart)
    {
       XYLineAndShapeRenderer renderer = (XYLineAndShapeRenderer) chart.getXYPlot().getRenderer();
        BasicStroke stroke = new BasicStroke(3f);
        renderer.setSeriesStroke(1, stroke);
    }
}

Thanks for the assist!!

cclement's picture
Joined: Jul 7 2016 - 7:08am
Last seen: 2 years 11 months ago

still need assistance wiith this, or an example to follow at least, thanks!

cclement - 3 years 1 day ago

1 Answer:

0

Still need help with this!

cclement's picture
Joined: Jul 7 2016 - 7:08am
Last seen: 2 years 11 months ago
Feedback
randomness