jhplot
Class HChart

java.lang.Object
  extended by jhplot.GHPanel
      extended by jhplot.GHFrame
          extended by jhplot.HChart
All Implemented Interfaces:
java.awt.event.ComponentListener, java.io.Serializable, java.util.EventListener

public class HChart
extends GHFrame

Create various charts based on jFreeChart package

See Also:
Serialized Form

Field Summary
static int IndexPlot
           
 boolean set
           
 
Constructor Summary
HChart()
          Construct a HChart canvas with a plot with the default parameters 600 by 400, and 10% space for the global title "Default"
HChart(java.lang.String title)
          Construct a HChart canvas with a plot with the default parameters 600 by 400, and 10% space for the global title
HChart(java.lang.String title, int xs, int ys)
          Construct a HChart canvas with a single plot/graph
HChart(java.lang.String title, int xs, int ys, boolean set)
          Construct a HChart canvas with a single plot/graph
HChart(java.lang.String title, int xs, int ys, int n1, int n2)
          Construct a HChart canvas with plots/graphs
HChart(java.lang.String title, int xsize, int ysize, int n1, int n2, boolean set)
          Create HChart canvas with a several chart plots
 
Method Summary
 void clear()
          Clear the current graph including graph settings.
 void clear(int i1, int i2)
          Clear the chart characterized by an index in X and Y.
 void clearAll()
          Clear all graphs from data and settings.
 void clearData()
          Clear plot from the data
 void clearPlot()
          Clear plot.
 void close()
          Close the canvas (and dispose all components) Note: a memory leak is found - no time to investigate it.
 void defineHistogram(java.lang.String sname, int Bins, double Min, double Max)
          Define a histogram to fill histogram chart
 void destroy()
          Remove the canvas frame
 void doc()
          Show online documentation.
 void draw(P1D d)
          Draw data from a P1D.
 java.lang.Object geData()
          Returns the current data object
 org.jfree.chart.JFreeChart getChart()
          Returns current Chart
 org.jfree.chart.ChartPanel getChartPanel()
          Returns current Chart panel
 void quit()
          Quit the frame
 void setAutoRange()
          Set autorange in X and Y at the same time
 void setAutoRange(boolean b)
          Set auto-range in X and Y at the same time
 void setChartArea()
          Make an Area chart.
 void setChartBar()
          Make a Bar chart.
 void setChartBar3D()
          Make a Bar chart in 3D.
 void setChartHistogram()
          Make a Histogram chart
 void setChartLine()
          Make a line chart.
 void setChartPie()
          Make a Pie chart.
 void setChartPie3D()
          Make a Pie 3D chart.
 void setChartXY()
          Make a X-Y chart with data points (assuming no errors).
 void setName(java.lang.String title)
          Set global title to the current chart
 void setNameX(java.lang.String s)
          Sets the name for X axis.
 void setNameY(java.lang.String s)
          Sets the name for Y axis.
 void setRange(int axis, double min, double max)
          Sets the range (min-max) displayed on the axis.
 void setTheme(java.lang.String s)
          Set a custom theme for chart..
 void update()
          Update all plots
 void update(int N1, int N2)
          Update the chart
 void valueArea(double[][] data, java.lang.String series, java.lang.String type)
          Set a value to Area data set.
 void valueBar(double value, java.lang.String series, java.lang.String category)
          Set a value to a Bar chart.
 void valueBar3D(double value, java.lang.String series, java.lang.String category)
          Set a value to a 3D Bar chart.
 void valueHistogram(double[] values)
          Set data to make a histogram.
 void valueHistogram(double[] values, java.lang.String name, int Bins, double Min, double Max)
          Build a histogram from an array.
 void valueLine(double value, java.lang.String series, java.lang.String category)
          Set a value to a Line chart.
 void valuePie(java.lang.String name, double value)
          Set a value to pie data set
 void valuePie3D(java.lang.String name, double value)
          Set a value to 3D pie data set.
 void valueXY(P1D d)
          Set XY data from a P1D.
 void valueXYerrors(P1D d)
          Set XY data from a P1D.
 void visible()
          Set the canvas frame visible
 void visible(boolean vs)
          Set the canvas frame visible or not
 
Methods inherited from class jhplot.GHFrame
addGraph, cd, componentHidden, componentMoved, componentShown, getCdX, getCdY, getFrame, getHTMLUrl, getNtotX, getNtotY, setPlotsNum, updateFrame
 
Methods inherited from class jhplot.GHPanel
addComp, componentResized, export, exportDialog, exportImage, getCanvasPanel, getMarginBackground, getMarginPanelBottom, getMarginPanelCenter, getMarginPanelLeft, getMarginPanelRight, getMarginPanelTop, getMarginSizeBottom, getMarginSizeLeft, getMarginSizeRight, getMarginSizeTop, getSizeX, getSizeY, getTextBottom, getTextBottomColor, getTextBottomColorBack, getTextBottomFont, getTextLeft, getTextLeftColor, getTextLeftColorBack, getTextLeftFont, getTextPosBottomX, getTextPosBottomY, getTextPosLeftX, getTextPosLeftY, getTextPosRightX, getTextPosRightY, getTextPosTopX, getTextPosTopY, getTextRight, getTextRightColor, getTextRightColorBack, getTextRightFont, getTextRotationBottom, getTextRotationLeft, getTextRotationRight, getTextRotationTop, getTextTop, getTextTopColor, getTextTopColorBack, getTextTopFont, isBorderShown, printGraph, resetMargins, setGTitle, setGTitle, setGTitle, setGTitle, setGTitle, setMarginBackground, setMarginSizeBottom, setMarginSizeLeft, setMarginSizeRight, setMarginSizeTop, setSizePanel, setTextBottom, setTextBottom, setTextBottom, setTextBottom, setTextBottomColorBack, setTextLeft, setTextLeft, setTextLeft, setTextLeft, setTextLeftColorBack, setTextPosBottomX, setTextPosBottomY, setTextPosLeftX, setTextPosLeftY, setTextPosRightX, setTextPosRightY, setTextPosTopX, setTextPosTopY, setTextRight, setTextRight, setTextRight, setTextRight, setTextRightColorBack, setTextRotationBottom, setTextRotationLeft, setTextRotationRight, setTextRotationTop, setTextTop, setTextTop, setTextTop, setTextTopColorBack, showBorders
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

IndexPlot

public static int IndexPlot

set

public boolean set
Constructor Detail

HChart

public HChart(java.lang.String title,
              int xsize,
              int ysize,
              int n1,
              int n2,
              boolean set)
Create HChart canvas with a several chart plots

Parameters:
title - Title
xsize - size in x direction
ysize - size in y direction
n1 - number of plots/graphs in x
n2 - number of plots/graphs in y
set - set or not the graph

HChart

public HChart(java.lang.String title,
              int xs,
              int ys)
Construct a HChart canvas with a single plot/graph

Parameters:
title - Title for the canvas
xs - size in x
ys - size in y

HChart

public HChart(java.lang.String title,
              int xs,
              int ys,
              boolean set)
Construct a HChart canvas with a single plot/graph

Parameters:
title - Title for the canvas
xs - size in x
ys - size in y
set - set or not the graph (boolean)

HChart

public HChart(java.lang.String title,
              int xs,
              int ys,
              int n1,
              int n2)
Construct a HChart canvas with plots/graphs

Parameters:
title - Title for the canvas
xs - size in x
ys - size in y
n1 - number of plots/graphs in x
n2 - number of plots/graphs in y

HChart

public HChart(java.lang.String title)
Construct a HChart canvas with a plot with the default parameters 600 by 400, and 10% space for the global title

Parameters:
title - Title

HChart

public HChart()
Construct a HChart canvas with a plot with the default parameters 600 by 400, and 10% space for the global title "Default"

Method Detail

visible

public void visible(boolean vs)
Set the canvas frame visible or not

Parameters:
vs - (boolean) true: visible, false: not visible

visible

public void visible()
Set the canvas frame visible


setTheme

public void setTheme(java.lang.String s)
Set a custom theme for chart.. It can be: LEGACY_THEME, JFREE_THEME, DARKNESS_THEME

Parameters:
s - a theme, can be either LEGACY_THEME, JFREE_THEME, DARKNESS_THEME

destroy

public void destroy()
Remove the canvas frame


setChartXY

public void setChartXY()
Make a X-Y chart with data points (assuming no errors).


setChartArea

public void setChartArea()
Make an Area chart.


setChartBar

public void setChartBar()
Make a Bar chart.


setChartBar3D

public void setChartBar3D()
Make a Bar chart in 3D.


setChartHistogram

public void setChartHistogram()
Make a Histogram chart


setChartLine

public void setChartLine()
Make a line chart.


setChartPie

public void setChartPie()
Make a Pie chart.


setChartPie3D

public void setChartPie3D()
Make a Pie 3D chart.


clearPlot

public void clearPlot()
Clear plot.


clearData

public void clearData()
Clear plot from the data


clear

public void clear()
Clear the current graph including graph settings. Note: the current graph is set by the cd() method


clear

public void clear(int i1,
                  int i2)
Clear the chart characterized by an index in X and Y. This method cleans the data and all graph settings.

Parameters:
i1 - location of the graph in X
i2 - location of the graph in Y

clearAll

public void clearAll()
Clear all graphs from data and settings.


update

public void update()
Update all plots


setName

public void setName(java.lang.String title)
Set global title to the current chart

Parameters:
title - title

setNameX

public void setNameX(java.lang.String s)
Sets the name for X axis.

Parameters:
s - Title for X axis.

setNameY

public void setNameY(java.lang.String s)
Sets the name for Y axis.

Parameters:
s - Title for Y axis.

valueXY

public void valueXY(P1D d)
Set XY data from a P1D. Call update() to display it

Parameters:
d - input P1D container

valueXYerrors

public void valueXYerrors(P1D d)
Set XY data from a P1D. Call update() to display it. Errors from P1D will be shown on X and Y.

Parameters:
d - input P1D container

defineHistogram

public void defineHistogram(java.lang.String sname,
                            int Bins,
                            double Min,
                            double Max)
Define a histogram to fill histogram chart

Parameters:
sname - Name
Bins - Number of bins
Min - Min value
Max - Max value

valueHistogram

public void valueHistogram(double[] values)
Set data to make a histogram. Call update() to display it. Make appropriate settings before using defineHistogram()

Parameters:
values - valued to be filled

valueHistogram

public void valueHistogram(double[] values,
                           java.lang.String name,
                           int Bins,
                           double Min,
                           double Max)
Build a histogram from an array. Call update() to show it

Parameters:
values - Values to be filled
name - Name
Bins - Number of bins
Min - Min value
Max - Max value

draw

public void draw(P1D d)
Draw data from a P1D. Drawing updated automatically. 1st level errors are shown

Parameters:
d - input P1D container

valuePie

public void valuePie(java.lang.String name,
                     double value)
Set a value to pie data set

Parameters:
name - Name for this number
value - Number

valuePie3D

public void valuePie3D(java.lang.String name,
                       double value)
Set a value to 3D pie data set. You should call update() method to display it

Parameters:
name - Name for this number
value - Number

valueArea

public void valueArea(double[][] data,
                      java.lang.String series,
                      java.lang.String type)
Set a value to Area data set. You should call update() method to display it

Parameters:
data - Input data
series - name of series
type - type of series

valueBar

public void valueBar(double value,
                     java.lang.String series,
                     java.lang.String category)
Set a value to a Bar chart. You should call update() method to display it

Parameters:
value - Value
series - Series
category - category

setRange

public void setRange(int axis,
                     double min,
                     double max)
Sets the range (min-max) displayed on the axis.

Parameters:
axis - defines to which axis this function applies, generally something like X_AXIS or Y_AXIS.
min - minimum value on the axis
max - maximum value on the axis

setAutoRange

public void setAutoRange(boolean b)
Set auto-range in X and Y at the same time

Parameters:
b - if true, sets auto-range

setAutoRange

public void setAutoRange()
Set autorange in X and Y at the same time


valueLine

public void valueLine(double value,
                      java.lang.String series,
                      java.lang.String category)
Set a value to a Line chart. You should call update() method to display it

Parameters:
value - Value
series - Series
category - category

valueBar3D

public void valueBar3D(double value,
                       java.lang.String series,
                       java.lang.String category)
Set a value to a 3D Bar chart. You should call update() method to display it

Parameters:
value - Value
series - Series
category - category

update

public void update(int N1,
                   int N2)
Update the chart

Parameters:
N1 - location in X
N2 - location in Y

getChart

public org.jfree.chart.JFreeChart getChart()
Returns current Chart

Returns:
current chart

getChartPanel

public org.jfree.chart.ChartPanel getChartPanel()
Returns current Chart panel

Returns:
current Chart panel

geData

public java.lang.Object geData()
Returns the current data object

Returns:
current data

close

public void close()
Close the canvas (and dispose all components) Note: a memory leak is found - no time to investigate it. set to null all the stuff


quit

public void quit()
Quit the frame


doc

public void doc()
Show online documentation.



jHepWork 2.1 (C) S.Chekanov