|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.faceless.graph2.Key
public class Key
A Key can optionally be added to the 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.
Graph.addKey(org.faceless.graph2.Key, int)| Constructor Summary | |
|---|---|
Key(Style backstyle)
Create a new Key |
|
| Method Summary | |
|---|---|
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 |
setMargin(int margin)
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. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Key(Style backstyle)
backstyle - the style to display the background box of the key in, or
null not to display a box| Method Detail |
|---|
public void setDefaultTextStyle(TextStyle style)
null is passed in as a style to addSeries or
addCustom methods.
style - the default style to render the text in
public 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 setPadding(int padding)
padding - the padding to use inside the key box, in pixels or whatever measurement is used
by your Output object.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||