|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Canvas | +--com.java4less.rchart.Chart
Main class of RChart, it links everythings together; axis, plotter, legend, title... RChart calculates the position and size of all the components and calls the draw method of all of them.
Chart is an extension of Canvas so you can put it on your frames, windows, etc...
Field Summary | |
boolean |
activateSelection
if true the selectedSerie and selectedSeriePoint will get a value of the point, bar or item the cursor is on. |
boolean |
autoSize
if true (default) the position and size of the components will be calculated automatically. |
double |
axisMargin
|
FillStyle |
back
background of the chart. |
java.awt.Image |
backImage
|
LineStyle |
border
border of the chart. |
double |
bottomMargin
area reserved for the x axis. |
double |
currentValueX
position of the cursor. |
double |
currentValueY
position of the cursor. |
double |
currentValueY2
position of the cursor. |
int |
currentX
position of the cursor. |
int |
currentY
position of the cursor. |
static int |
dnum
|
boolean |
doubleBuffering
|
boolean |
fullXAxis
|
int |
layout
position of the legend in the chart. |
static int |
LAYOUT_LEGEND_BOTTOM
|
static int |
LAYOUT_LEGEND_RIGHT
|
static int |
LAYOUT_LEGEND_TOP
|
double |
leftMargin
area reserved for the y axis. |
Legend |
legend
|
double |
legendMargin
area reserved for the legend. |
int |
offsetX
|
int |
offsetY
|
Plotter[] |
Plotters
|
boolean |
repaintAll
|
boolean |
repaintAlways
|
double |
rightMargin
empty area to the right side of the chrta if the legend is on the top or the bottom |
double |
secondYAxisMargin
|
java.lang.String |
selectedSerie
returns name of the serie the cursor is on (points, bars or pie item). |
int |
selectedSeriePoint
returns which point/bar/item of the serie the cursor is on or -1. |
Title |
title
|
static java.awt.Image |
tmpImage
You must set this property if you want to draw vertical labels. |
double |
topMargin
area reserved for the title. |
int |
virtualHeight
height of the chart (in pixels). |
int |
virtualWidth
width of the chart (in pixels). |
java.awt.Component |
visibleComponent
intenal use |
boolean |
withScroll
|
Axis |
XAxis
|
HAxisLabel |
XLabel
Label to be displayed along the X axis. |
Axis |
Y2Axis
|
VAxisLabel |
Y2Label
Label to be displayed along the second Y axis. |
Axis |
YAxis
|
VAxisLabel |
YLabel
Label to be displayed along the Y axis. |
Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
Chart(Title t,
Plotter p,
Axis X,
Axis Y)
creates a chart for the specified components. |
Method Summary | |
void |
addPlotter(Plotter p)
adds an extra plotter to the chart. |
void |
addSerie(DataSerie s)
adds a serie to the plotter (the one used in the constructor). |
static int |
d()
|
static boolean |
drawVerticalText(java.awt.Graphics g2,
java.awt.Font f,
java.awt.Color c,
java.lang.String t,
int x,
int y,
boolean centered)
|
void |
mouseDragged(java.awt.event.MouseEvent e)
|
void |
mouseEntered(java.awt.event.MouseEvent e)
|
void |
mouseExited(java.awt.event.MouseEvent e)
|
void |
mouseMoved(java.awt.event.MouseEvent e)
|
void |
paint(java.awt.Graphics pg)
|
void |
removePlotters()
removes all plotters |
void |
resetChart(Title t,
Plotter p,
Axis X,
Axis Y)
change title, plotter and axos |
static java.awt.Image |
rotate(java.awt.Image im,
int angle,
int maxw,
int maxh,
java.awt.Color transparent)
|
boolean |
saveToFile(java.lang.String psFile,
java.lang.String psFormat)
Saves the current chart to a graphics file (gif , png or jpeg). |
void |
setBounds(int x,
int y,
int w,
int h)
|
void |
setChartListener(ChartListener cl)
|
void |
setSize(java.awt.Dimension s)
|
void |
setSize(int x,
int y)
|
void |
setY2Scale(Axis a)
Sets the second Y axis of the chart. |
Methods inherited from class java.awt.Canvas |
addNotify, getAccessibleContext |
Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, contains, contains, createImage, createImage, deliverEvent, disable, dispatchEvent, doLayout, enable, enable, enableInputMethods, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getInputContext, getInputMethodRequests, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getName, getParent, getPeer, getPreferredSize, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFont, setForeground, setLocale, setLocation, setLocation, setName, setVisible, show, show, size, toString, transferFocus, update, validate |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int LAYOUT_LEGEND_RIGHT
public static final int LAYOUT_LEGEND_TOP
public static final int LAYOUT_LEGEND_BOTTOM
public static final int dnum
public boolean activateSelection
public int currentX
public int currentY
public double currentValueX
public double currentValueY
public double currentValueY2
public VAxisLabel YLabel
public VAxisLabel Y2Label
public HAxisLabel XLabel
public Legend legend
public Axis XAxis
public Axis YAxis
public Axis Y2Axis
public Title title
public double bottomMargin
public double topMargin
public double secondYAxisMargin
public double leftMargin
public double rightMargin
public double legendMargin
public double axisMargin
public boolean autoSize
public Plotter[] Plotters
public int layout
public FillStyle back
public LineStyle border
public int offsetX
public int offsetY
public java.lang.String selectedSerie
public int selectedSeriePoint
public static java.awt.Image tmpImage
public java.awt.Image backImage
public boolean doubleBuffering
public int virtualWidth
public int virtualHeight
public boolean withScroll
public boolean repaintAll
public boolean repaintAlways
public boolean fullXAxis
public java.awt.Component visibleComponent
Constructor Detail |
public Chart(Title t, Plotter p, Axis X, Axis Y)
Method Detail |
public void resetChart(Title t, Plotter p, Axis X, Axis Y)
public static int d()
public void setChartListener(ChartListener cl)
public void addPlotter(Plotter p)
public void removePlotters()
public void setSize(int x, int y)
setSize
in class java.awt.Component
public void setSize(java.awt.Dimension s)
setSize
in class java.awt.Component
public void setBounds(int x, int y, int w, int h)
setBounds
in class java.awt.Component
public void setY2Scale(Axis a)
public void paint(java.awt.Graphics pg)
paint
in class java.awt.Canvas
public void addSerie(DataSerie s)
public static boolean drawVerticalText(java.awt.Graphics g2, java.awt.Font f, java.awt.Color c, java.lang.String t, int x, int y, boolean centered)
public static java.awt.Image rotate(java.awt.Image im, int angle, int maxw, int maxh, java.awt.Color transparent)
public boolean saveToFile(java.lang.String psFile, java.lang.String psFormat)
public void mouseMoved(java.awt.event.MouseEvent e)
mouseMoved
in interface java.awt.event.MouseMotionListener
public void mouseExited(java.awt.event.MouseEvent e)
public void mouseEntered(java.awt.event.MouseEvent e)
public void mouseDragged(java.awt.event.MouseEvent e)
mouseDragged
in interface java.awt.event.MouseMotionListener
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |