jhplot
Class HPlotChart
- java.lang.Object
-
- jhplot.HPlotChart
-
public class HPlotChart extends java.lang.Object
A canvas to keep jFreeChart charts, interact with them, and export to images. This class can be used to export jFreeChart charts to vector formats.
-
-
Constructor Summary
Constructors Constructor and Description HPlotChart(JFreeChart jchart)
Construct a HPlotXY canvas with a plot with the size 600x400.HPlotChart(JFreeChart jchart, int xsize, int ysize)
Create canvas that keeps JFreeChart panel.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description void
close()
Close the canvas (and dispose all components).void
destroy()
Remove the canvas framevoid
doc()
Show online documentation.void
drawToGraphics2D(java.awt.Graphics2D g, int width, int height)
void
export(java.lang.String filename)
Export graph into an image file.void
export(java.lang.String filename, int width, int height)
Export graph into an image file.JFreeChart
getChart()
Return JFreeChartjavax.swing.JFrame
getFrame()
Get grame that keeps averythingChartPanel
getPanel()
Return panel with the chart.void
setTheme(java.lang.String s)
Set a custom theme for chart..void
visible()
Set the canvas frame visiblevoid
visible(boolean vs)
Set the canvas frame visible or not
-
-
-
Constructor Detail
-
HPlotChart
public HPlotChart(JFreeChart jchart, int xsize, int ysize)
Create canvas that keeps JFreeChart panel.- Parameters:
jchart
- chart of JFreeChart.xsize
- size in x directionysize
- size in y direction
-
HPlotChart
public HPlotChart(JFreeChart jchart)
Construct a HPlotXY canvas with a plot with the size 600x400.- Parameters:
jchart
- Chart to be shown.
-
-
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
-
doc
public void doc()
Show online documentation.
-
close
public void close()
Close the canvas (and dispose all components).
-
getFrame
public javax.swing.JFrame getFrame()
Get grame that keeps averything- Returns:
- panel with image
-
getPanel
public ChartPanel getPanel()
Return panel with the chart.- Returns:
- panel with chart.
-
getChart
public JFreeChart getChart()
Return JFreeChart- Returns:
- chart
-
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
-
export
public void export(java.lang.String filename)
Export graph into an image file. The the image format is given by extension. "png", "jpg", "eps", "pdf", "svg". In case of "eps", "pdf" and "svg", vector graphics is used.- Parameters:
file
- name of the image
-
export
public void export(java.lang.String filename, int width, int height)
Export graph into an image file. The the image format is given by extension. "png", "jpg", "eps", "pdf", "svg". In case of "eps", "pdf" and "svg", vector graphics is used.- Parameters:
filename
- file namewidth
- widthheight
- hight
-
drawToGraphics2D
public void drawToGraphics2D(java.awt.Graphics2D g, int width, int height)
-
-
DMelt 3.0 © DataMelt by jWork.ORG