public class ChartTitle extends Configurable<ChartTitle>
BaseChart.setChartTitle(ChartTitle) method.)
Example usage:
chart.setChartTitle(
new ChartTitle()
.setText("Sales by Month")
.setAlign(ChartTitle.Align.MIDDLE)
);
| Modifier and Type | Class and Description |
|---|---|
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 and Description |
|---|
ChartTitle() |
| Modifier and Type | Method and Description |
|---|---|
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.
|
getOptions, setOptionpublic 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.Copyright © 2015. All Rights Reserved.