From e64dca7b7704fe5b7d0a78fbe7c1ee0aaa6c509e Mon Sep 17 00:00:00 2001 From: nifi Date: Mon, 13 Sep 2010 12:22:18 +0000 Subject: [PATCH] Always include zero packets in the chart bounds --- .../src/se/sics/contiki/collect/gui/PacketChartPanel.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/examples/sky-shell/src/se/sics/contiki/collect/gui/PacketChartPanel.java b/examples/sky-shell/src/se/sics/contiki/collect/gui/PacketChartPanel.java index ab749e6bf..a30f386ef 100644 --- a/examples/sky-shell/src/se/sics/contiki/collect/gui/PacketChartPanel.java +++ b/examples/sky-shell/src/se/sics/contiki/collect/gui/PacketChartPanel.java @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: PacketChartPanel.java,v 1.2 2010/09/08 12:40:18 nifi Exp $ + * $Id: PacketChartPanel.java,v 1.3 2010/09/13 12:22:18 nifi Exp $ * * ----------------------------------------------------------------- * @@ -34,8 +34,8 @@ * * Authors : Joakim Eriksson, Niclas Finne * Created : 6 sep 2010 - * Updated : $Date: 2010/09/08 12:40:18 $ - * $Revision: 1.2 $ + * Updated : $Date: 2010/09/13 12:22:18 $ + * $Revision: 1.3 $ */ package se.sics.contiki.collect.gui; @@ -50,6 +50,7 @@ import javax.swing.JPanel; import org.jfree.chart.ChartFactory; import org.jfree.chart.ChartPanel; import org.jfree.chart.JFreeChart; +import org.jfree.chart.axis.NumberAxis; import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; import org.jfree.data.time.Minute; import org.jfree.data.time.TimeSeries; @@ -88,6 +89,7 @@ public class PacketChartPanel extends JPanel implements Visualizer { "Received Packets", timeAxisLabel, valueAxisLabel, timeSeries, false, true, false ); + ((NumberAxis)chart.getXYPlot().getRangeAxis()).setAutoRangeIncludesZero(true); this.chartPanel = new ChartPanel(chart); this.chartPanel.setPreferredSize(new Dimension(500, 270)); setBaseShapeVisible(false);