|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.moxieapps.gwt.highcharts.client.Configurable<ChartTitle> org.moxieapps.gwt.highcharts.client.ChartTitle
public class ChartTitle
A configurable class that can be used to represent custom title options for the
chart, which can then be set the chart (via the BaseChart.setChartTitle(ChartTitle)
method.)
Example usage:
chart.setChartTitle(
new ChartTitle()
.setText("Sales by Month")
.setAlign(ChartTitle.Align.MIDDLE)
);
Nested Class Summary | |
---|---|
static class |
ChartTitle.Align
An enumeration of supported chart title horizontal alignment types, which can be passed to methods like setAlign(ChartTitle.Align) . |
static class |
ChartTitle.VerticalAlign
An enumeration of supported chart title vertical alignment types, which can be passed to methods like setVerticalAlign(ChartTitle.VerticalAlign) . |
Constructor Summary | |
---|---|
ChartTitle()
|
Method Summary | |
---|---|
ChartTitle |
setAlign(ChartTitle.Align align)
Convenience method for setting the 'align' option of the title. |
ChartTitle |
setFloating(boolean floating)
Convenience method for setting the 'floating' option of the title. |
ChartTitle |
setMargin(Number margin)
Convenience method for setting the 'margin' option of the title. |
ChartTitle |
setStyle(Style style)
Convenience method for setting the 'style' options of the title. |
ChartTitle |
setText(String text)
Convenience method for setting the 'text' option of the title. |
ChartTitle |
setVerticalAlign(ChartTitle.VerticalAlign verticalAlign)
Convenience method for setting the 'verticalAlign' option of the title. |
ChartTitle |
setX(Number x)
Convenience method for setting the 'x' position option of the title. |
ChartTitle |
setY(Number y)
Convenience method for setting the 'y' position option of the title. |
Methods inherited from class org.moxieapps.gwt.highcharts.client.Configurable |
---|
getOptions, setOption |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ChartTitle()
Method Detail |
---|
public ChartTitle setAlign(ChartTitle.Align align)
chartTitle.setOption("align", ChartTitle.Align.LEFT);
The horizontal alignment of the title. Can be one of "left", "center" and "right".
Defaults to ChartTitle.Align.CENTER
.
align
- The horizontal alignment of the title.
ChartTitle
instance for convenient method chaining.public ChartTitle setFloating(boolean floating)
chartTitle.setOption("floating", true);
When the title is floating, the plot area will not move to make space for it. Defaults to false.
floating
- 'true' to float the title above the plot area, or 'false' (the default) to make space for it.
ChartTitle
instance for convenient method chaining.public ChartTitle setMargin(Number margin)
chartTitle.setOption("margin", 60);
The margin between the title and the plot area, or if a subtitle is present,
the margin between the subtitle and the plot area. Defaults to 15.
margin
- The margin between the title and the plot area, or if a subtitle is present,
the margin between the subtitle and the plot area.
ChartTitle
instance for convenient method chaining.public ChartTitle setStyle(Style style)
chartTitle.setOption("/style/fontWeight", "bold");
chartTitle.setOption("/style/fontFamily", "serif");
etc.
CSS styles for the title. Use this for font styling, but use setAlign(org.moxieapps.gwt.highcharts.client.ChartTitle.Align)
,
setX(Number)
, and setY(Number)
for text alignment. Defaults to:
style
- CSS styles for the title.
ChartTitle
instance for convenient method chaining.public ChartTitle setText(String text)
chartTitle.setOption("text", "Sales by Month");
The actual text of the axis title. It can contain basic HTML text markup
like <b>, <i> and spans with style. Defaults to null.
Note to disable an axis title from being displayed completely, simply set the text
to "null". (This can also be accomplished more simply by just setting the title
text to null directly on the axis via the Axis.setAxisTitleText(String)
method.)
text
- The actual text of the axis title.
ChartTitle
instance for convenient method chaining.public ChartTitle setVerticalAlign(ChartTitle.VerticalAlign verticalAlign)
chartTitle.setOption("verticalAlign", ChartTitle.VerticalAlign.BOTTOM);
The vertical alignment of the title. Can be one of "top", "middle" and "bottom". Defaults to "top".
Defaults to ChartTitle.VerticalAlign.TOP
.
verticalAlign
- The vertical alignment of the title.
ChartTitle
instance for convenient method chaining.public ChartTitle setX(Number x)
chartTitle.setOption("x", 70);
The x position of the title relative to the alignment within the spacing set on the chart
controlled via BaseChart.setSpacingLeft(Number)
and BaseChart.setSpacingRight(Number)
.
Defaults to 0.
x
- The x position of the title, relative to the chart's spacing.
ChartTitle
instance for convenient method chaining.public ChartTitle setY(Number y)
chartTitle.setOption("y", -20);
The y position of the title relative to the alignment within the spacing set on the chart
controlled via BaseChart.setSpacingTop(Number)
and BaseChart.setSpacingBottom(Number)
.
Defaults to 25.
y
- The y position of the title, relative to the chart's spacing.
ChartTitle
instance for convenient method chaining.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |