public class Credits extends Configurable<Credits>
BaseChart.setCredits(Credits) method.)
Highchart by default puts a credits label in the lower right corner of the chart.
This can be changed using these options. Example usage:
chart.setCredits(
new Credits()
.setText("Presented by Snoopy")
.setHref("http://www.peanuts.com/")
);
| Modifier and Type | Class and Description |
|---|---|
static class |
Credits.Align
An enumeration of supported credits horizontal alignment types, which can be passed to methods
like
setAlign(Credits.Align) method. |
static class |
Credits.VerticalAlign
An enumeration of supported credits vertical alignment types, which can be passed to methods
like
setVerticalAlign(Credits.VerticalAlign) method. |
| Constructor and Description |
|---|
Credits() |
| Modifier and Type | Method and Description |
|---|---|
Credits |
setAlign(Credits.Align align)
Convenience method for setting the 'align' option of the credits.
|
Credits |
setEnabled(boolean enabled)
Convenience method for setting the 'enabled' option for the credits.
|
Credits |
setHref(String href)
Convenience method for setting the 'href' option of the credits.
|
Credits |
setStyle(Style style)
Convenience method for setting the 'style' options of the credits.
|
Credits |
setText(String text)
Convenience method for setting the 'text' option of the credits.
|
Credits |
setVerticalAlign(Credits.VerticalAlign verticalAlign)
Convenience method for setting the 'verticalAlign' option of the credits.
|
Credits |
setX(Number x)
Convenience method for setting the 'x' position option of the credits.
|
Credits |
setY(Number y)
Convenience method for setting the 'y' position option of the credits.
|
getOptions, setOptionpublic Credits setAlign(Credits.Align align)
credits.setOption("/position/align", Credit.Align.LEFT);
The horizontal alignment of the credits text within the chart area. Can be one of "left", "center" and "right".
Defaults to Credits.Align.RIGHT.align - The horizontal alignment of the credits text within the chart area.Credits instance for convenient method chaining.public Credits setEnabled(boolean enabled)
credits.setOption("enabled", true);
Whether to show the credits text. Defaults to true.enabled - Whether or not to enable or disable the credits text.Credits instance for convenient method chaining.public Credits setHref(String href)
credits.setOption("href", "http://www.peanuts.com/");
The URL for the credits label. Defaults to "http://www.highcharts.com".href - The URL for the credits label.Credits instance for convenient method chaining.public Credits setStyle(Style style)
credits.setOption("/style/fontWeight", "bold");
credits.setOption("/style/fontFamily", "serif");
etc.
CSS styles for the credits label. . Defaults to:
style - An object containing the style properties to set on the credits.Credits instance for convenient method chaining.public Credits setText(String text)
credits.setOption("text", "Thanks to Snoopy");
The text for the credits label. Defaults to "Highcharts.com".text - The text for the credits label.Credits instance for convenient method chaining.public Credits setVerticalAlign(Credits.VerticalAlign verticalAlign)
legend.setOption("/position/verticalAlign", Credits.VerticalAlign.BOTTOM);
The vertical alignment of the legend box. Can be one of "top", "middle" or "bottom".
Vertical position can be further determined by the y option.
Defaults to Legend.VerticalAlign.BOTTOM.verticalAlign - The vertical alignment of the credits.Credits instance for convenient method chaining.public Credits setX(Number x)
legend.setOption("/position/x", 70);
The x offset of the credits relative to it's horizontal alignment align within
BaseChart.setSpacingLeft(Number) and BaseChart.setSpacingRight(Number). Negative x
moves it to the left, positive x moves it to the right. The default value of -10 together
with Credits.Align.RIGHT puts it near the right side of the plot area. Defaults to -10.x - The x offset of the credits, relative to the chart's spacing.Credits instance for convenient method chaining.public Credits setY(Number y)
legend.setOption("/position/y", -20);
The vertical offset of the legend relative to it's vertical alignment (@link VerticalAlign}
within BaseChart.setSpacingTop(Number) and BaseChart.setSpacingBottom(Number).
Negative y moves it up, positive y moves it down. Defaults to -5.y - The y position of the credits, relative to the chart's spacing.Credits instance for convenient method chaining.Copyright © 2015. All Rights Reserved.