Class SwingWrapper<T extends org.knowm.xchart.internal.chartpart.Chart<?,?>>

java.lang.Object
org.knowm.xchart.SwingWrapper<T>

public class SwingWrapper<T extends org.knowm.xchart.internal.chartpart.Chart<?,?>> extends Object
A convenience class used to display a Chart in a barebones Swing application
  • Constructor Details

    • SwingWrapper

      public SwingWrapper(T chart)
      Constructor
      Parameters:
      chart -
    • SwingWrapper

      public SwingWrapper(List<T> charts)
      Constructor - The number of rows and columns will be calculated automatically Constructor
      Parameters:
      charts -
    • SwingWrapper

      public SwingWrapper(List<T> charts, int numRows, int numColumns)
      Constructor
      Parameters:
      charts -
      numRows - - the number of rows
      numColumns - - the number of columns
  • Method Details

    • displayChart

      public JFrame displayChart()
      Display the chart in a Swing JFrame
    • displayChartMatrix

      public JFrame displayChartMatrix()
      Display the chart in a Swing JFrame
    • getXChartPanel

      public XChartPanel<T> getXChartPanel()
      Get the default XChartPanel. This is the only one for single panel chart displays and the first panel in matrix chart displays
      Returns:
      the XChartPanel
    • repaintChart

      public void repaintChart()
      Repaint the default XChartPanel. This is the only one for single panel chart displays and the first panel in matrix chart displays
    • getXChartPanel

      public XChartPanel<T> getXChartPanel(int index)
      Get the XChartPanel given the provided index.
      Parameters:
      index -
      Returns:
      the XChartPanel
    • repaintChart

      public void repaintChart(int index)
      Repaint the XChartPanel given the provided index.
      Parameters:
      index -
    • isCentered

      public SwingWrapper isCentered(boolean isCentered)
      Set the Window in the center of screen
      Parameters:
      isCentered -
      Returns:
    • setTitle

      public SwingWrapper setTitle(String windowTitle)
      Set the Window Title
      Parameters:
      windowTitle -
      Returns: