From: David G. <dav...@ob...> - 2006-06-14 10:29:02
|
Hi All, Richard gave me access to CVS and I've committed the attached patch (which is slightly different to my original version) to make StatCVS work with JFreeChart 1.0.1. Regards, Dave Gilbert David Gilbert wrote: > Hi, > > The attached patch updates StatCVS to use the latest version of > JFreeChart (1.0.1). Anonymous CVS at SourceForge seems broken for me, > so I created this patch as a diff between my modified StatCVS source > files and a clean StatCVS-0.2.2 source directory. There are only a > few changes required, so you could probably edit the sources manually. > > The JFreeChart API is now stable, so this should allow future > JFreeChart releases in the 1.0.x series to be used with StatCVS > without requiring modifications to StatCVS. > > I'm hopeful that with this patch, and the previous one I posted (to > remove the Sun-specific class reference), I will be able to get > StatCVS running out-of-the-box with JamVM and GNU Classpath. > > Regards, > > Dave Gilbert > JFreeChart Project Leader > >------------------------------------------------------------------------ > >diff -ru statcvs-src-clean/src/net/sf/statcvs/renderer/Chart.java statcvs-src-mod/src/net/sf/statcvs/renderer/Chart.java >--- statcvs-src-clean/src/net/sf/statcvs/renderer/Chart.java 2004-10-12 09:23:18.000000000 +0100 >+++ statcvs-src-mod/src/net/sf/statcvs/renderer/Chart.java 2006-06-08 09:55:38.000000000 +0100 >@@ -33,7 +33,8 @@ > import org.jfree.chart.ChartUtilities; > import org.jfree.chart.JFreeChart; > import org.jfree.chart.title.TextTitle; >-import org.jfree.ui.Spacer; >+import org.jfree.ui.RectangleInsets; >+import org.jfree.util.UnitType; > > /** > * superclass of all charts >@@ -105,7 +106,8 @@ > > private void addTitles() { > TextTitle title2 = new TextTitle(title, font); >- title2.setSpacer(new Spacer(Spacer.RELATIVE, 0.05, 0.05, 0.05, 0.0)); >+ title2.setMargin(new RectangleInsets(UnitType.RELATIVE, 0.05, 0.05, >+ 0.05, 0.0)); > chart.addSubtitle(title2); > } > >diff -ru statcvs-src-clean/src/net/sf/statcvs/renderer/LOCChart.java statcvs-src-mod/src/net/sf/statcvs/renderer/LOCChart.java >--- statcvs-src-clean/src/net/sf/statcvs/renderer/LOCChart.java 2004-10-12 09:23:18.000000000 +0100 >+++ statcvs-src-mod/src/net/sf/statcvs/renderer/LOCChart.java 2006-06-08 09:56:16.000000000 +0100 >@@ -72,7 +72,7 @@ > TimeSeriesCollection collection = new TimeSeriesCollection(); > collection.addSeries(locSeries); > createLOCChart(collection, colors, title); >- createChart(); >+ createChart(); > saveChart(width, height); > } > >@@ -96,7 +96,7 @@ > while (it.hasNext()) { > TimeSeries series = (TimeSeries) it.next(); > collection.addSeries(series); >- colors[i] = OutputUtils.getStringColor(series.getName()); >+ colors[i] = OutputUtils.getStringColor(series.getKey().toString()); > i++; > } > createLOCChart(collection, colors, title); >diff -ru statcvs-src-clean/src/net/sf/statcvs/renderer/StackedBarChart.java statcvs-src-mod/src/net/sf/statcvs/renderer/StackedBarChart.java >--- statcvs-src-clean/src/net/sf/statcvs/renderer/StackedBarChart.java 2004-10-12 09:23:18.000000000 +0100 >+++ statcvs-src-mod/src/net/sf/statcvs/renderer/StackedBarChart.java 2006-06-05 14:13:22.000000000 +0100 >@@ -37,13 +37,14 @@ > import net.sf.statcvs.output.ConfigurationOptions; > > import org.jfree.chart.ChartFactory; >-import org.jfree.chart.Legend; > import org.jfree.chart.axis.NumberAxis; > import org.jfree.chart.axis.NumberTickUnit; > import org.jfree.chart.plot.CategoryPlot; > import org.jfree.chart.plot.PlotOrientation; > import org.jfree.chart.renderer.category.CategoryItemRenderer; >+import org.jfree.chart.title.LegendTitle; > import org.jfree.data.category.DefaultCategoryDataset; >+import org.jfree.ui.RectangleEdge; > > /** > * Class for producing stacked bar charts >@@ -150,8 +151,8 @@ > rangeAxis.setTickUnit(new NumberTickUnit(20.0, new DecimalFormat("0"))); > rangeAxis.setUpperBound(100.0); > >- Legend legend = getChart().getLegend(); >- legend.setAnchor(Legend.NORTH); >+ LegendTitle legend = getChart().getLegend(); >+ legend.setPosition(RectangleEdge.TOP); > > createChart(); > saveChart(450, 19 * content.getAuthors().size() + 110, "activity.png"); > > >------------------------------------------------------------------------ > >_______________________________________________ >Statcvs-users mailing list >Sta...@li... >https://lists.sourceforge.net/lists/listinfo/statcvs-users > > |