title: jfree chart org.jfree.chart.plot.CategoryPlot cannot be cast to org.jfree.chart.plot.XYPlot
body: <p>I am using Studio to create a JasperReports's report. I need to increase the width of the line chart (default is too thin). As far I know JasperReports use Jfeechart for the chart, and I googled this piece of code to do the customization.</p>
  
  <pre><code>public class TSChartCustomizer 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></pre>
  
  <p>I have built and added above class to a jar and added it in the jasper project. And in the chart properties can select the class in customizer class. But when I run the report I got this error:</p>
  
  <pre><code>java.lang.ClassCastException: org.jfree.chart.plot.CategoryPlot cannot be cast to org.jfree.chart.plot.XYPlot
  </code></pre>
  
  <p>I think the problem is probably with the code, but I don't know Jfreechart...</p>
  
  <p>P.S below is the report code, a very simple one for demonstration:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="test6" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="f147421f-bbe6-42bd-b26e-7f4f7cee333a"&gt;
      &lt;queryString&gt;
          &lt;![CDATA[select 'p1' as prod, 'm1' as mon, 10 as num
  union all select 'p1' as prod, 'm2' as mon, 20 as num
  union all select 'p1' as prod, 'm3' as mon, 30 as num]]&gt;
      &lt;/queryString&gt;
      &lt;field name="prod" class="java.lang.String"/&gt;
      &lt;field name="mon" class="java.lang.String"/&gt;
      &lt;field name="num" class="java.lang.Integer"/&gt;
      &lt;background&gt;
          &lt;band splitType="Stretch"/&gt;
      &lt;/background&gt;
      &lt;summary&gt;
          &lt;band height="325" splitType="Stretch"&gt;
              &lt;lineChart&gt;
                  &lt;chart evaluationTime="Report"&gt;
                      &lt;reportElement x="178" y="125" width="200" height="200" uuid="124ec6e6-b32d-477d-84a4-36c8d4df3ac2"/&gt;
                      &lt;chartTitle/&gt;
                      &lt;chartSubtitle/&gt;
                      &lt;chartLegend/&gt;
                  &lt;/chart&gt;
                  &lt;categoryDataset&gt;
                      &lt;categorySeries&gt;
                          &lt;seriesExpression&gt;&lt;![CDATA[$F{prod}]]&gt;&lt;/seriesExpression&gt;
                          &lt;categoryExpression&gt;&lt;![CDATA[$F{mon}]]&gt;&lt;/categoryExpression&gt;
                          &lt;valueExpression&gt;&lt;![CDATA[$F{num}]]&gt;&lt;/valueExpression&gt;
                      &lt;/categorySeries&gt;
                  &lt;/categoryDataset&gt;
                  &lt;linePlot&gt;
                      &lt;plot/&gt;
                      &lt;categoryAxisFormat&gt;
                          &lt;axisFormat/&gt;
                      &lt;/categoryAxisFormat&gt;
                      &lt;valueAxisFormat&gt;
                          &lt;axisFormat/&gt;
                      &lt;/valueAxisFormat&gt;
                  &lt;/linePlot&gt;
              &lt;/lineChart&gt;
          &lt;/band&gt;
      &lt;/summary&gt;
  &lt;/jasperReport&gt;
  </code></pre>