public class Key extends Object
Graph
to display information
about the data displayed on the Graph. At it's simplest you could do something
like the following:
AxesGraph graph = new AxesGraph(); Series series = makeMySeries(); graph.addSeries(series); graph.addKey(new Key(null), Align.BOTTOM);which will add all the series to the Graph. If you want more control over the contents off the key, calling the
addSeries
or addCustom
,
methods will clear the Key of any default values, allowing you to set the values as you see fit.Modifier and Type | Method and Description |
---|---|
void |
addCustom(AbstractMarker marker,
String text,
TextStyle style)
Add a custom marker and/or text to the Key.
|
void |
addSeries(Series series,
TextStyle style)
Add the specified series to the Key.
|
void |
setDefaultTextStyle(TextStyle style)
Set the default text style to use on the key.
|
void |
setHorizontalAdvance(int advance)
Set the horizontal padding to place between each item on the same line
|
void |
setMargin(int margin)
Set the margin around the Key.
|
void |
setMargin(int top,
int right,
int bottom,
int left)
Set the margin around the Key.
|
void |
setMaxWidth(int width)
Set the maximum width of the Key box.
|
void |
setPadding(int padding)
Set the padding for the Key.
|
void |
setPadding(int top,
int right,
int bottom,
int left)
Set the padding for the Key.
|
void |
setVerticalAdvance(int advance)
Set the vertical padding to place between each line in the key
|
public Key(Style backstyle)
backstyle
- the style to display the background box of the key in, or
null
not to display a boxpublic void setDefaultTextStyle(TextStyle style)
null
is passed in as a style to addSeries
or
addCustom
methods.style
- the default style to render the text inpublic void addSeries(Series series, TextStyle style)
series
- the series to add to the Keystyle
- The style to render the text in. May be null
to use the default.public void addCustom(AbstractMarker marker, String text, TextStyle style)
marker
- The marker to add to the Key. May be null
to display only text.text
- The text to add to the Key. May be null
to display only the marker.style
- The style to render the text in. May be null
to use the default.public void setMaxWidth(int width)
width
- the maximum width of the key box, in pixels or whatever measurement is used
by your Output
object.public void setMargin(int margin)
Graph.addKey(Key,int)
method. The default is 10.margin
- the margin to use around the key box, in pixels or whatever measurement is used
by your Output
object.public void setMargin(int top, int right, int bottom, int left)
Graph.addKey(Key,int)
method. The default is 10 for eachtop
- the margin to use at the top of the key box, in pixels or whatever measurement is used by your Output
object.right
- the margin to use at the right of the key box, in pixels or whatever measurement is used by your Output
object.bottom
- the margin to use at the bottom of the key box, in pixels or whatever measurement is used by your Output
object.left
- the margin to use at the left of the key box, in pixels or whatever measurement is used by your Output
object.public void setPadding(int padding)
padding
- the padding to use inside the key box, in pixels or whatever measurement is used
by your Output
object.public void setPadding(int top, int right, int bottom, int left)
top
- the padding to use inside at the top of the key box, in pixels or whatever measurement is used
by your Output
object.right
- the padding to use inside at the right of the key box, in pixels or whatever measurement is used
by your Output
object.bottom
- the padding to use inside at the bottom of the key box, in pixels or whatever measurement is used
by your Output
object.left
- the padding to use inside at the left of the key box, in pixels or whatever measurement is used
by your Output
object.public void setVerticalAdvance(int advance)
public void setHorizontalAdvance(int advance)
Copyright © 2001-2016 Big Faceless Organization