public class LineGraphDrawable extends Object
Constructor and Description |
---|
LineGraphDrawable()
Creates a default bargraph drawable with some sensible default colors and spacings.
|
Modifier and Type | Method and Description |
---|---|
void |
draw(Graphics2D graphics,
Rectangle2D drawArea)
Draws the bar-graph into the given Graphics2D context in the given area.
|
Color |
getBackground()
Returns the color for the background of the graph.
|
Color |
getColor()
Returns the main color for the bars.
|
Number[] |
getData()
Returns the numeric data for the drawable or null, if the drawable has no data.
|
Color |
getLastColor() |
int |
getSpacing()
Returns the spacing between the bars.
|
void |
setBackground(Color background)
Defines the color for the background of the graph.
|
void |
setColor(Color color)
Defines the main color for the bars.
|
void |
setData(Number[] data)
Defines the numeric data for the drawable or null, if the drawable has no data.
|
void |
setLastColor(Color lastColor) |
void |
setSpacing(int spacing)
Defines the spacing between the bars.
|
public LineGraphDrawable()
public Number[] getData()
public void setData(Number[] data)
data
- the data (can be null).public Color getColor()
public void setColor(Color color)
color
- the main color for the bars, never null.public Color getBackground()
public void setBackground(Color background)
background
- the background or null, if the graph has a transparent background color.public int getSpacing()
public void setSpacing(int spacing)
spacing
- the spacing between the bars.public Color getLastColor()
public void setLastColor(Color lastColor)
public void draw(Graphics2D graphics, Rectangle2D drawArea)
graphics
- the graphics context on which the bargraph should be rendered.drawArea
- the area on which the bargraph should be drawn.