Module org.hdfgroup.hdfview
Package hdf.view

# Class Chart

Object
org.eclipse.swt.widgets.Dialog
hdf.view.Chart

public class Chart extends org.eclipse.swt.widgets.Dialog
ChartView displays a histogram/line chart of selected row/column of table data or image data. There are two types of chart, histogram and line plot.

Version:
  2.4 2/27/16
Author:
  Jordan T. Henderson

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected hdf.view.Chart.ChartCanvas`
  `chartP`
  Panel that draws plot of data values.
  `protected double[][]`
  `data`
  the data values of line points or histogram
  `static int`
  `HISTOGRAM`
  histogram style chart
  `static int[]`
  `LINE_COLORS`
  The default colors of lines for selected columns
  `static int`
  `LINEPLOT`
  line style chart
  `protected int`
  `numberOfPoints`
  number of data points

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Chart​(org.eclipse.swt.widgets.Shell parent, String title, int style, double[][] data, double[] xData, double[] yRange)`
  Constructs a new ChartView given data and data ranges.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `open()`
  `void`
  `setLineColors​(int[] c)`
  Sets the color of each line of a line plot
  `void`
  `setLineLabels​(String[] l)`
  Sets the labels of each line.
  `void`
  `setTypeToInteger()`
  Sets the data type of the plot data to be integer.

  ### Methods inherited from class org.eclipse.swt.widgets.Dialog

  `checkSubclass, getParent, getStyle, getText, setText`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### HISTOGRAM

    public static final int HISTOGRAM
    histogram style chart
    See Also:
      Constant Field Values

  - ### LINEPLOT

    public static final int LINEPLOT
    line style chart
    See Also:
      Constant Field Values

  - ### LINE_COLORS

    public static final int[] LINE_COLORS
    The default colors of lines for selected columns

  - ### data

    protected double[][] data
    the data values of line points or histogram

  - ### chartP

    protected hdf.view.Chart.ChartCanvas chartP
    Panel that draws plot of data values.

  - ### numberOfPoints

    protected int numberOfPoints
    number of data points

- ## Constructor Details

  - ### Chart

    public Chart​(org.eclipse.swt.widgets.Shell parent, String title, int style, double[][] data, double[] xData, double[] yRange)
    Constructs a new ChartView given data and data ranges.
    Parameters:
      `parent` - the parent of this dialog.
      `title` - the title of this dialog.
      `style` - the style of the chart. Valid values are: HISTOGRAM and LINE
      `data` - the two dimensional data array: data[linenumber][datapoints]
      `xData` - the range of the X values, xRange[0]=xmin, xRange[1]=xmax.
      `yRange` - the range of the Y values, yRange[0]=ymin, yRange[1]=ymax.

- ## Method Details

  - ### open

    public void open()

  - ### setLineColors

    public void setLineColors​(int[] c)
    Sets the color of each line of a line plot
    Parameters:
      `c` - the list of colors

  - ### setLineLabels

    public void setLineLabels​(String[] l)
    Sets the labels of each line.
    Parameters:
      `l` - the list of line labels

  - ### setTypeToInteger

    public void setTypeToInteger()
    Sets the data type of the plot data to be integer.