org.moxieapps.gwt.highcharts.client
Class Credits

java.lang.Object
  extended by org.moxieapps.gwt.highcharts.client.Configurable<Credits>
      extended by org.moxieapps.gwt.highcharts.client.Credits

public class Credits
extends Configurable<Credits>

A configurable class that can be used to represent custom credits options for the chart, which can then be set on the chart (via the 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/")
   );
 

Since:
1.0.0
Author:
squinn@moxiegroup.com (Shawn Quinn)

Nested Class Summary
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 Summary
Credits()
           
 
Method Summary
 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.
 
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

Credits

public Credits()
Method Detail

setAlign

public Credits setAlign(Credits.Align align)
Convenience method for setting the 'align' option of the credits. Equivalent to:

     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.

Parameters:
align - The horizontal alignment of the credits text within the chart area.
Returns:
A reference to this Credits instance for convenient method chaining.

setEnabled

public Credits setEnabled(boolean enabled)
Convenience method for setting the 'enabled' option for the credits. Equivalent to:

     credits.setOption("enabled", true);
 
Whether to show the credits text. Defaults to true.

Parameters:
enabled - Whether or not to enable or disable the credits text.
Returns:
A reference to this Credits instance for convenient method chaining.

setHref

public Credits setHref(String href)
Convenience method for setting the 'href' option of the credits. Equivalent to:

     credits.setOption("href", "http://www.peanuts.com/");
 
The URL for the credits label. Defaults to "http://www.highcharts.com".

Parameters:
href - The URL for the credits label.
Returns:
A reference to this Credits instance for convenient method chaining.

setStyle

public Credits setStyle(Style style)
Convenience method for setting the 'style' options of the credits. Equivalent to:

     credits.setOption("/style/fontWeight", "bold");
     credits.setOption("/style/fontFamily", "serif");
     etc.
 
CSS styles for the credits label. . Defaults to:

Parameters:
style - An object containing the style properties to set on the credits.
Returns:
A reference to this Credits instance for convenient method chaining.

setText

public Credits setText(String text)
Convenience method for setting the 'text' option of the credits. Equivalent to:

     credits.setOption("text", "Thanks to Snoopy");
 
The text for the credits label. Defaults to "Highcharts.com".

Parameters:
text - The text for the credits label.
Returns:
A reference to this Credits instance for convenient method chaining.

setVerticalAlign

public Credits setVerticalAlign(Credits.VerticalAlign verticalAlign)
Convenience method for setting the 'verticalAlign' option of the credits. Equivalent to:

     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.

Parameters:
verticalAlign - The vertical alignment of the credits.
Returns:
A reference to this Credits instance for convenient method chaining.
Since:
1.6.0

setX

public Credits setX(Number x)
Convenience method for setting the 'x' position option of the credits. Equivalent to:

     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.

Parameters:
x - The x offset of the credits, relative to the chart's spacing.
Returns:
A reference to this Credits instance for convenient method chaining.

setY

public Credits setY(Number y)
Convenience method for setting the 'y' position option of the credits. Equivalent to:

     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.

Parameters:
y - The y position of the credits, relative to the chart's spacing.
Returns:
A reference to this Credits instance for convenient method chaining.


Copyright © 2015. All Rights Reserved.