Always include zero packets in the chart bounds

This commit is contained in:
nifi 2010-09-13 12:22:18 +00:00
parent a0b8927777
commit e64dca7b77

View file

@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * 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 * Authors : Joakim Eriksson, Niclas Finne
* Created : 6 sep 2010 * Created : 6 sep 2010
* Updated : $Date: 2010/09/08 12:40:18 $ * Updated : $Date: 2010/09/13 12:22:18 $
* $Revision: 1.2 $ * $Revision: 1.3 $
*/ */
package se.sics.contiki.collect.gui; package se.sics.contiki.collect.gui;
@ -50,6 +50,7 @@ import javax.swing.JPanel;
import org.jfree.chart.ChartFactory; import org.jfree.chart.ChartFactory;
import org.jfree.chart.ChartPanel; import org.jfree.chart.ChartPanel;
import org.jfree.chart.JFreeChart; import org.jfree.chart.JFreeChart;
import org.jfree.chart.axis.NumberAxis;
import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer;
import org.jfree.data.time.Minute; import org.jfree.data.time.Minute;
import org.jfree.data.time.TimeSeries; import org.jfree.data.time.TimeSeries;
@ -88,6 +89,7 @@ public class PacketChartPanel extends JPanel implements Visualizer {
"Received Packets", timeAxisLabel, valueAxisLabel, timeSeries, "Received Packets", timeAxisLabel, valueAxisLabel, timeSeries,
false, true, false false, true, false
); );
((NumberAxis)chart.getXYPlot().getRangeAxis()).setAutoRangeIncludesZero(true);
this.chartPanel = new ChartPanel(chart); this.chartPanel = new ChartPanel(chart);
this.chartPanel.setPreferredSize(new Dimension(500, 270)); this.chartPanel.setPreferredSize(new Dimension(500, 270));
setBaseShapeVisible(false); setBaseShapeVisible(false);