public class HChart
extends jhplot.gui.GHFrame
Constructor and Description |
---|
HChart()
Construct a HChart canvas with a plot with the default parameters 600 by
400, and 10% space for the global title "Default"
|
HChart(String title)
Construct a HChart canvas with a plot with the default parameters 600 by
400, and 10% space for the global title
|
HChart(String title,
int xs,
int ys)
Construct a HChart canvas with a single plot/graph
|
HChart(String title,
int xs,
int ys,
boolean set)
Construct a HChart canvas with a single plot/graph
|
HChart(String title,
int xs,
int ys,
int n1,
int n2)
Construct a HChart canvas with plots/graphs
|
HChart(String title,
int xsize,
int ysize,
int n1,
int n2,
boolean set)
Create HChart canvas with a several chart plots
|
Modifier and Type | Method and Description |
---|---|
void |
add(F1D f1)
Add a F1D function to the canvas.
|
void |
add(H1D h1)
Add a H1D histogram to the chart.
|
void |
add(P1D d)
Draw data from a P1D.
|
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 |
destroy()
Remove the canvas frame
|
void |
doc()
Show online documentation.
|
void |
draw(ArrayList<Double> x,
ArrayList<Double> y)
Draw X-Y data from arrays
|
void |
draw(double[] x,
double[] y)
Draw X-Y data from arrays
|
void |
draw(F1D f1)
Draw a F1D function on the canvas.
|
void |
draw(H1D f1)
Draw a H1D histogram on the canvas.
|
void |
drawToGraphics2D(Graphics2D g,
int width,
int height) |
void |
export(String filename)
Export graph into an image file.
|
void |
export(String filename,
int width,
int height)
Export graph into an image file.
|
boolean |
getAntiAlias()
Get antialiasing for the graphics of the current plot
|
org.jfree.chart.axis.ValueAxis |
getAxis(int axis)
Get the axis
|
org.jfree.chart.axis.Axis |
getAxisX()
Get X-axis
|
org.jfree.chart.axis.Axis |
getAxisY()
Get Y-axis
|
org.jfree.chart.JFreeChart |
getChart()
Returns current Chart
|
org.jfree.chart.ChartPanel |
getChartPanel()
Returns current Chart panel
|
Color |
getLabelColor()
Get label color.
|
org.jfree.chart.plot.XYPlot |
getPlot()
Get XY plot
|
Color |
getTickColor()
Get color of ticks.
|
Font |
getTickFont()
Get font of ticks.
|
void |
quit()
Quit the frame
|
void |
setAntiAlias(boolean setit)
Set antialiasing for the graphics of the current plot
|
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 |
setAxis(int axis,
org.jfree.chart.axis.ValueAxis a)
Sets axis
|
void |
setBackgColor(Color color)
Sets the actual background color of the entire graph panel.
|
void |
setChartArea()
Make an Area chart.
|
void |
setChartBar()
Make a Bar chart.
|
void |
setChartBar3D()
Make a Bar chart in 3D.
|
void |
setChartLine()
Make a line chart.
|
void |
setChartLine(double stroke)
Make a line chart.
|
void |
setChartPie()
Make a Pie chart.
|
void |
setChartPie3D()
Make a Pie 3D chart.
|
void |
setChartPolar()
Make a chart using polar coordinates.
|
void |
setFontAxisX(Font f,
Color c)
Set font and color for X-axis (for X-Y plots)
|
void |
setFontAxisY(Font f,
Color c)
Set font and color for Y-axis (for X-Y plots)
|
void |
setFontLegent(Font f)
Set font for legend title
|
void |
setFontTitle(Font f)
Set font for legend title
|
void |
setGrid(boolean b)
Sets whether or not using grid lines.
|
void |
setGrid(int axis,
boolean b)
Sets whether or not using grid lines.
|
void |
setGridColor(Color c)
Sets color of the grid lines for all plots on the same canvas
|
void |
setGridPenWidth(double width)
Sets width of the line for the grid
|
void |
setGridPenWidth(int axis,
double width)
Sets the width of the line for grid
|
void |
setLabelColor(Color labelColor)
Se5t color of the lebales.
|
void |
setLabelFont(Font font)
Set fonts of the labels.
|
void |
setLegend(boolean b)
Sets whether or not this line style should draw the name in the legend of
the graph.
|
void |
setLegendPosition(org.jfree.ui.RectangleEdge e)
Legend position
|
void |
setLogScale(int axis,
boolean b)
Sets true or false to plot on a log scale.
|
void |
setName(String title)
Set global title to the current chart.
|
void |
setNameX(String s)
Sets the name for X axis.
|
void |
setNameY(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(String s)
Set a custom theme for chart..
|
void |
setTickColor(int axis,
Color tickColor)
Set tick color
|
void |
setTickFont(Font tickFont)
Set font of ticks
|
void |
update()
Update all plots
|
void |
update(int N1,
int N2)
Update the chart
|
void |
valueArea(double value,
String series,
String category)
Set a value to a area chart.
|
void |
valueBar(double value,
String series,
String category)
Set a value to a Bar chart.
|
void |
valueBar3D(double value,
String series,
String category)
Set a value to a 3D Bar chart.
|
void |
valueLine(double value,
String series,
String category)
Set a value to a Line chart.
|
void |
valuePie(String name,
double value)
Set a value to pie data set
|
void |
valuePie3D(String name,
double value)
Set a value to 3D pie data set.
|
void |
visible()
Set the canvas frame visible
|
void |
visible(boolean vs)
Set the canvas frame visible or not
|
void |
visible(int posX,
int posY)
Set the canvas frame visible.
|
addGraph, cd, componentHidden, componentMoved, componentShown, getCdX, getCdY, getFrame, getHTMLUrl, getNtotX, getNtotY, setPlotsNum, updateFrame
addComp, componentResized, disableDoubleBuffering, enableDoubleBuffering, exportDialog, 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
public HChart(String title, int xsize, int ysize, int n1, int n2, boolean set)
title
- Titlexsize
- size in x directionysize
- size in y directionn1
- number of plots/graphs in xn2
- number of plots/graphs in yset
- set or not the graphpublic HChart(String title, int xs, int ys)
title
- Title for the canvasxs
- size in xys
- size in ypublic HChart(String title, int xs, int ys, boolean set)
title
- Title for the canvasxs
- size in xys
- size in yset
- set or not the graph (boolean)public HChart(String title, int xs, int ys, int n1, int n2)
title
- Title for the canvasxs
- size in xys
- size in yn1
- number of plots/graphs in xn2
- number of plots/graphs in ypublic HChart(String title)
title
- Titlepublic HChart()
public void setLabelColor(Color labelColor)
labelColor
- public void setLabelFont(Font font)
font
- public Color getLabelColor()
public void setTickColor(int axis, Color tickColor)
tickColor
- public Color getTickColor()
public void setTickFont(Font tickFont)
tickFont
- public Font getTickFont()
public void visible(boolean vs)
vs
- (boolean) true: visible, false: not visiblepublic void visible()
public void visible(int posX, int posY)
posX
- - the x-coordinate of the new location's top-left corner in
the parent's coordinate space;posY
- - he y-coordinate of the new location's top-left corner in the
parent's coordinate spacepublic void setTheme(String s)
s
- a theme, can be either LEGACY_THEME, JFREE_THEME,
DARKNESS_THEMEpublic void destroy()
public void setFontAxisX(Font f, Color c)
f
- fontc
- colorpublic void setFontAxisY(Font f, Color c)
f
- fontc
- colorpublic void setChartArea()
public void setChartBar()
public void setChartBar3D()
public void setChartLine()
public void setChartLine(double stroke)
stroke
- stroke width to draw the linepublic void setChartPie()
public void setChartPie3D()
public void setChartPolar()
public void clearPlot()
public void clearData()
public void clear()
public void clear(int i1, int i2)
i1
- location of the graph in Xi2
- location of the graph in Ypublic void clearAll()
public void update()
public void setName(String title)
title
- titlepublic void setNameX(String s)
s
- Title for X axis.public void setNameY(String s)
s
- Title for Y axis.public void setLogScale(int axis, boolean b)
public void setAxis(int axis, org.jfree.chart.axis.ValueAxis a)
axis
- defines to which axis this function applies. 0 means X aaxis,
1 means Y axis.a
- axis objectpublic org.jfree.chart.axis.ValueAxis getAxis(int axis)
axis
- defines to which axis this function applies. 0 means X aaxis,
1 means Y axis.public void setFontLegent(Font f)
f
- public void setFontTitle(Font f)
f
- public void draw(double[] x, double[] y)
x
- X valuesy
- Y valuespublic void draw(F1D f1)
f1d
- F1D functionpublic void draw(H1D f1)
f1d
- H1D histogramspublic void add(F1D f1)
f1d
- F1D functionpublic void add(H1D h1)
h1
- H1D histogrampublic void draw(ArrayList<Double> x, ArrayList<Double> y)
x
- X valuesy
- Y valuespublic void setLegendPosition(org.jfree.ui.RectangleEdge e)
e
- public void setLegend(boolean b)
b
- true if the name should be shownpublic void add(P1D d)
d
- input P1D containerpublic void valuePie(String name, double value)
name
- Name for this numbervalue
- Numberpublic void valuePie3D(String name, double value)
name
- Name for this numbervalue
- Numberpublic void valueBar(double value, String series, String category)
value
- Valueseries
- Seriescategory
- categorypublic void valueArea(double value, String series, String category)
value
- Valueseries
- Seriescategory
- categorypublic void setRange(int axis, double min, double max)
public void setAutoRange(boolean b)
b
- if true, sets auto-rangepublic void setAutoRange()
public void setAntiAlias(boolean setit)
setit
- true if antialiasing is setpublic boolean getAntiAlias()
public void setGrid(boolean b)
b
- true if shownpublic void setGrid(int axis, boolean b)
axis
- defines to which axis this function applies. 0 means X axis, y
means y axisb
- toggle, true if the the grid should be drawn.public void setGridColor(Color c)
c
- Colorpublic void setGridPenWidth(double width)
c
- width of the linepublic void setGridPenWidth(int axis, double width)
axis
- 0 is X axcis, 1 is Y axiswidth
- with of the linepublic void setBackgColor(Color color)
color
- New background color.public void valueLine(double value, String series, String category)
value
- Valueseries
- Seriescategory
- categorypublic void valueBar3D(double value, String series, String category)
value
- Valueseries
- Seriescategory
- categorypublic void update(int N1, int N2)
N1
- location in XN2
- location in Ypublic org.jfree.chart.JFreeChart getChart()
public org.jfree.chart.axis.Axis getAxisX()
public org.jfree.chart.axis.Axis getAxisY()
public org.jfree.chart.plot.XYPlot getPlot()
public org.jfree.chart.ChartPanel getChartPanel()
public void close()
public void quit()
public void doc()
public void drawToGraphics2D(Graphics2D g, int width, int height)
public void export(String filename)
export
in class jhplot.gui.GHPanel
file
- name of the imagepublic void export(String filename, int width, int height)
filename
- file namewidth
- widthheight
- hightSCaVis 1.0 ©