mirror of
https://github.com/graphhopper/jsprit.git
synced 2020-01-24 07:45:05 +01:00
simplify chartBuilder
This commit is contained in:
parent
ab460f065f
commit
a93d88a0c1
1 changed files with 5 additions and 17 deletions
|
|
@ -18,21 +18,19 @@
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
package jsprit.analysis.toolbox;
|
package jsprit.analysis.toolbox;
|
||||||
|
|
||||||
import java.awt.Color;
|
|
||||||
import java.io.File;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
|
||||||
|
|
||||||
import org.jfree.chart.ChartFactory;
|
import org.jfree.chart.ChartFactory;
|
||||||
import org.jfree.chart.ChartUtilities;
|
import org.jfree.chart.ChartUtilities;
|
||||||
import org.jfree.chart.JFreeChart;
|
import org.jfree.chart.JFreeChart;
|
||||||
import org.jfree.chart.axis.NumberAxis;
|
|
||||||
import org.jfree.chart.plot.PlotOrientation;
|
import org.jfree.chart.plot.PlotOrientation;
|
||||||
import org.jfree.chart.plot.XYPlot;
|
import org.jfree.chart.plot.XYPlot;
|
||||||
import org.jfree.data.Range;
|
|
||||||
import org.jfree.data.xy.XYSeries;
|
import org.jfree.data.xy.XYSeries;
|
||||||
import org.jfree.data.xy.XYSeriesCollection;
|
import org.jfree.data.xy.XYSeriesCollection;
|
||||||
|
|
||||||
|
import java.awt.*;
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author schroeder
|
* @author schroeder
|
||||||
|
|
@ -109,16 +107,6 @@ public class XYLineChartBuilder {
|
||||||
plot.setBackgroundPaint(Color.WHITE);
|
plot.setBackgroundPaint(Color.WHITE);
|
||||||
plot.setDomainGridlinePaint(Color.LIGHT_GRAY);
|
plot.setDomainGridlinePaint(Color.LIGHT_GRAY);
|
||||||
plot.setRangeGridlinePaint(Color.LIGHT_GRAY);
|
plot.setRangeGridlinePaint(Color.LIGHT_GRAY);
|
||||||
NumberAxis yAxis = (NumberAxis) plot.getRangeAxis();
|
|
||||||
Range rangeBounds = collection.getRangeBounds(true);
|
|
||||||
double upper = Math.min(rangeBounds.getUpperBound(), rangeBounds.getLowerBound()*5);
|
|
||||||
if(upper == 0.0){ upper = 10000; }
|
|
||||||
if(rangeBounds.getLowerBound() == upper){
|
|
||||||
yAxis.setRangeWithMargins(rangeBounds.getLowerBound()-rangeBounds.getLowerBound()*.1,upper+upper*.1);
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
yAxis.setRangeWithMargins(rangeBounds.getLowerBound(),upper);
|
|
||||||
}
|
|
||||||
return chart;
|
return chart;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue