Note that there are some explanatory texts on larger screens.

plurals
  1. POChartUtilities.apply CurrentTheme make NoSuchMethodError
    primarykey
    data
    text
    <p>I'm using <code>strut2</code> with <code>JFReeChart</code> 1.0.13</p> <p>And some reason a i can't use <code>ChartUtilities.apply CurrentTheme</code>. The libraray is imported.</p> <p>I want to try one of the example.</p> <p>but it makes exception:</p> <p><code>org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) at java.lang.Thread.run(Thread.java:722) Caused by: java.lang.NoSuchMethodError: org.jfree.chart.ChartUtilities.applyCurrentTheme(Lorg/jfree/chart/JFreeChart;)V</code> at </p> <p>I try to use <code>public static ChartTheme getChartTheme()</code> but the same result</p> <pre><code> private static JFreeChart createChart(CategoryDataset categorydataset) { JFreeChart jfreechart = ChartFactory.createBarChart("Open Source Projects By Licence", "Licence", "Project Count", categorydataset, PlotOrientation.HORIZONTAL, false, true, false); TextTitle texttitle = new TextTitle("Source: Freshmeat (http://www.freshmeat.net/)", new Font("Dialog", 0, 10)); texttitle.setPosition(RectangleEdge.BOTTOM); jfreechart.addSubtitle(texttitle); **ChartUtilities.applyCurrentTheme(jfreechart);** CategoryPlot categoryplot = (CategoryPlot)jfreechart.getPlot(); categoryplot.setDomainGridlinesVisible(true); categoryplot.getDomainAxis().setMaximumCategoryLabelWidthRatio(0.8F); NumberAxis numberaxis = (NumberAxis)categoryplot.getRangeAxis(); numberaxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits()); BarRenderer barrenderer = (BarRenderer)categoryplot.getRenderer(); barrenderer.setDrawBarOutline(false); StandardCategoryToolTipGenerator standardcategorytooltipgenerator = new StandardCategoryToolTipGenerator("{1}: {2} projects", new DecimalFormat("0")); barrenderer.setBaseToolTipGenerator(standardcategorytooltipgenerator); GradientPaint gradientpaint = new GradientPaint(0.0F, 0.0F, Color.blue, 0.0F, 0.0F, new Color(0, 0, 64)); barrenderer.setSeriesPaint(0, gradientpaint); return jfreechart; } </code></pre> <p>How can it solved this problem?</p> <p>If i comment this line then is no error, but the chart is not good.</p> <p>Edit:</p> <p>I upgrage the version to 1.0.15 as Roman C sugested After that the problem is fixed.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload