Package org.knowm.xchart
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- Author:
- timmolter
-
-
Constructor Summary
Constructors Constructor Description SwingWrapper(List<T> charts)
Constructor - The number of rows and columns will be calculated automatically ConstructorSwingWrapper(List<T> charts, int numRows, int numColumns)
ConstructorSwingWrapper(T chart)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JFrame
displayChart()
Display the chart in a Swing JFrameJFrame
displayChart(String windowTitle)
Display the chart in a Swing JFrameJFrame
displayChartMatrix()
Display the chart in a Swing JFrameJFrame
displayChartMatrix(String windowTitle)
Display the charts in a Swing JFrameXChartPanel<T>
getXChartPanel()
Get the default XChartPanel.XChartPanel<T>
getXChartPanel(int index)
Get the XChartPanel given the provided index.void
repaintChart()
Repaint the default XChartPanel.void
repaintChart(int index)
Repaint the XChartPanel given the provided index.
-
-
-
Method Detail
-
displayChart
public JFrame displayChart(String windowTitle)
Display the chart in a Swing JFrame- Parameters:
windowTitle
- the title of the window
-
displayChart
public JFrame displayChart()
Display the chart in a Swing JFrame
-
displayChartMatrix
public JFrame displayChartMatrix(String windowTitle)
Display the charts in a Swing JFrame- Parameters:
windowTitle
- the title of the window- Returns:
- the 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
-
-
-