diff --git a/build.properties b/build.properties index 4eb239199994bc4b27a9aa135ebc65d1ca1986c8..1439ef75890eb01ef5943581294d972e591271be 100644 --- a/build.properties +++ b/build.properties @@ -1,5 +1,5 @@ project.name=xchart -build.version=1.0.0 +build.version=1.0.1 lib.dir=lib src.dir=src web.dir=web diff --git a/old/xchart-1.0.0.jar b/old/xchart-1.0.0.jar new file mode 100644 index 0000000000000000000000000000000000000000..9ec5dbb574dc309e2fbc505e2368e96ce2d7b74b Binary files /dev/null and b/old/xchart-1.0.0.jar differ diff --git a/sample/com/xeiam/examples/Example4.java b/sample/com/xeiam/examples/Example4.java index 3e94a7c4a7fa5a6ee082d20b02db879749191c64..9dd25ac622d8a552a1cf41cb528c4257d308516e 100644 --- a/sample/com/xeiam/examples/Example4.java +++ b/sample/com/xeiam/examples/Example4.java @@ -36,18 +36,10 @@ public class Example4 { for (int i = 0; i < numRows; i++) { for (int j = 0; j < numCols; j++) { - // double[][] yData2d = new double[10][1000]; - // for (int k = 0; k < yData2d.length; k++) { - // yData2d[k] = getRandomWalk(1000); - // } - // charts[chartCount++] = QuickChart.getChart(i + "," + j, "X", "Y", null, null, yData2d); charts[chartCount++] = QuickChart.getChart(i + "," + j, "X", "Y", null, null, getRandomWalk(1000)); - } } - new SwingWrapper(charts, numRows, numCols).displayChartMatrix(); - } /** @@ -59,11 +51,10 @@ public class Example4 { private static double[] getRandomWalk(int numPoints) { double[] y = new double[numPoints]; + y[0] = -1000; for (int i = 1; i < y.length; i++) { y[i] = y[i - 1] + Math.random() - .5; } - return y; - } } diff --git a/src/com/xeiam/xcharts/Axis.java b/src/com/xeiam/xcharts/Axis.java index 06ca8471d31f0575fd7953b2cdcd227912d1b566..da921887d07d71d93e0aab3011b9e5a97747bd3b 100644 --- a/src/com/xeiam/xcharts/Axis.java +++ b/src/com/xeiam/xcharts/Axis.java @@ -49,7 +49,7 @@ public class Axis implements IChartPart { private double min = Double.MAX_VALUE; - private double max = Double.MIN_VALUE; + private double max = -Double.MAX_VALUE; /** the bounds */ private Rectangle bounds = new Rectangle(); // default all-zero rectangle @@ -90,12 +90,18 @@ public class Axis implements IChartPart { */ public void addMinMax(double min, double max) { + // System.out.println(min); + // System.out.println(max); + if (min < this.min) { this.min = min; } if (max > this.max) { this.max = max; } + + // System.out.println(this.min); + // System.out.println(this.max); } public Direction getDirection() { diff --git a/src/com/xeiam/xcharts/AxisTick.java b/src/com/xeiam/xcharts/AxisTick.java index 33129db1042e19cb4f1a8d6d9741029a3a0d12bb..d74d617667d5bccb3ba3d6e30abadfef31d1ac20 100644 --- a/src/com/xeiam/xcharts/AxisTick.java +++ b/src/com/xeiam/xcharts/AxisTick.java @@ -178,6 +178,9 @@ public class AxisTick implements IChartPart { private BigDecimal getGridStep(int tickSpace) { double length = Math.abs(axis.getMax() - axis.getMin()); + // System.out.println(axis.getMax()); + // System.out.println(axis.getMin()); + // System.out.println(length); double gridStepHint = length / tickSpace * DEFAULT_TICK_MARK_STEP_HINT; // gridStepHint --> mantissa * 10 ** exponent diff --git a/src/com/xeiam/xcharts/series/Series.java b/src/com/xeiam/xcharts/series/Series.java index 72f1cf617e05e4ca12e1d31ed795126615d41402..c15c5a7416f5a8c9bd7b0d127aabb3bcdd091e05 100644 --- a/src/com/xeiam/xcharts/series/Series.java +++ b/src/com/xeiam/xcharts/series/Series.java @@ -80,6 +80,8 @@ public class Series { Arrays.sort(yDataClone); this.yMin = yDataClone[0]; this.yMax = yDataClone[yDataClone.length - 1]; + // System.out.println(yMin); + // System.out.println(yMax); Color color = SeriesColor.getNextAWTColor(); this.strokeColor = color;