X-Git-Url: http://wamblee.org/gitweb/?a=blobdiff_plain;f=gps%2Fsrc%2Fmain%2Fjava%2Forg%2Fwamblee%2Fgpx%2FTrackStatistics.java;h=455ca985c0b5c245fe6a9bd40d5986a99a3eaf6e;hb=da4789bcace3af66c000c9f8fc6321c8597568f0;hp=42c2039e3fad8411b95db686f0ef07c2234131eb;hpb=fa34d476d1ea565c12595b920b561e512801ff4a;p=utils diff --git a/gps/src/main/java/org/wamblee/gpx/TrackStatistics.java b/gps/src/main/java/org/wamblee/gpx/TrackStatistics.java index 42c2039e..455ca985 100644 --- a/gps/src/main/java/org/wamblee/gpx/TrackStatistics.java +++ b/gps/src/main/java/org/wamblee/gpx/TrackStatistics.java @@ -1,5 +1,6 @@ package org.wamblee.gpx; +import java.awt.Color; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStream; @@ -16,17 +17,17 @@ import org.jfree.data.xy.XYSeriesCollection; import org.wamblee.general.Pair; import org.wamblee.gps.geometry.Point; import org.wamblee.gps.geometry.ReferenceCoordinateSystem; -import org.wamblee.gps.track.Track; +import org.wamblee.gps.track.TrackSegment; public class TrackStatistics implements Serializable { - private Track _track; + private TrackSegment _track; - public TrackStatistics(Track aTrack) { + public TrackStatistics(TrackSegment aTrack) { _track = aTrack; } - public void writeHeightProfileJpg(OutputStream aStream, int aWidth, int aHeight) throws IOException { + public void writeHeightProfilePng(OutputStream aStream, int aWidth, int aHeight) throws IOException { List> data = computeElevationProfile(); XYSeriesCollection dataset = createDataset(data, "height"); JFreeChart chart = ChartFactory.createXYLineChart( @@ -38,7 +39,8 @@ public class TrackStatistics implements Serializable { true, true, false); - ChartUtilities.writeChartAsJPEG(aStream, chart, aWidth, aHeight); + chart.setBackgroundPaint(Color.WHITE); + ChartUtilities.writeChartAsPNG(aStream, chart, aWidth, aHeight); } private static XYSeriesCollection createDataset(List> aHeightProfile, String aName) {