Jump to content

Recommended Posts

Posted

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);    }}[/code]

Thanks for the assist!!

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

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