Class XYLineChart

java.lang.Object
java.awt.Component
java.awt.Container
java.awt.Window
java.awt.Frame
javax.swing.JFrame
org.jfree.chart.ui.ApplicationFrame
es.upm.fi.cig.multictbnc.gui.XYLineChart
All Implemented Interfaces:
WindowListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible, RootPaneContainer, WindowConstants

public class XYLineChart extends org.jfree.chart.ui.ApplicationFrame
A class for creating and managing an XY line chart using the JFreeChart library. This class is designed to display XY data in a dynamic and interactive line chart.
See Also:
  • Constructor Details

    • XYLineChart

      public XYLineChart(String titleWindow, String labelX, String labelY, int[] rangeY, String... seriesNames)
      Constructs an XYLineChart instance.
      Parameters:
      titleWindow - the title of the application window
      labelX - the label for the X-axis
      labelY - the label for the Y-axis
      rangeY - the range for the Y-axis
      seriesNames - the names of the series to be displayed in the chart
  • Method Details

    • addHorizontalValueMarker

      public void addHorizontalValueMarker(double y)
      Adds a horizontal value marker to the chart.
      Parameters:
      y - the Y-axis value where the marker will be placed
    • addSeries

      public void addSeries(String... seriesNames)
      Adds new series to the chart.
      Parameters:
      seriesNames - names of the new series to be added
    • addVerticalValueMarker

      public void addVerticalValueMarker(double x)
      Adds a vertical value marker to the chart.
      Parameters:
      x - the X-axis value where the marker will be placed
    • update

      public void update(double x, double y)
      Updates the chart with a new value for the X and Y axis.
      Parameters:
      x - new value for the X-axis
      y - new value for the Y-axis
    • update

      public void update(double x, double[] y)
      Updates the chart providing the X and Y axis values of several series.
      Parameters:
      x - new value for the X-axis
      y - array of new values for the Y-axis, one for each series