org.moxieapps.gwt.highcharts.client
Class Style

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

public class Style
extends Configurable<Style>

A configurable class that can be used to represent custom CSS style options for the chart, which can then be set on various other configuration objects (e.g. BaseChart.setStyle(Style), ChartTitle.setStyle(Style), etc.). Example usage:

   chart.setStyle(
     new Style()
       .setOption("fontFamily", "serif")
   );
 
Note that some convenience methods are provided on this class for setting commonly used CSS options (such as setColor(String), setFontFamily(String), setFontSize(String), etc). But, any arbitrary CSS option can be set by simply using the Configurable.setOption(String, Object) method. E.g., the following two lines are equivalent:
   style.setFontFamily("serif");
   style.setOption("fontFamily", "serif");
 

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

Constructor Summary
Style()
           
 
Method Summary
 Style setBottom(String bottom)
          Convenience method for setting the "bottom" CSS style option.
 Style setColor(String color)
          Convenience method for setting the "color" CSS style option.
 Style setCursor(String cursor)
          Convenience method for setting the "cursor" CSS style option.
 Style setFont(String font)
          Convenience method for setting the "font" CSS style option.
 Style setFontFamily(String fontFamily)
          Convenience method for setting the "fontFamily" CSS style option.
 Style setFontSize(String fontSize)
          Convenience method for setting the "fontSize" CSS style option.
 Style setFontStyle(String fontStyle)
          Convenience method for setting the "fontStyle" CSS style option.
 Style setFontWeight(String fontWeight)
          Convenience method for setting the "fontWeight" CSS style option.
 Style setLeft(String left)
          Convenience method for setting the "left" CSS style option.
 Style setMargin(String margin)
          Convenience method for setting the "margin" CSS style option.
 Style setPosition(String position)
          Convenience method for setting the "position" CSS style option.
 Style setRight(String right)
          Convenience method for setting the "right" CSS style option.
 Style setTop(String top)
          Convenience method for setting the "top" CSS style option.
 
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

Style

public Style()
Method Detail

setBottom

public Style setBottom(String bottom)
Convenience method for setting the "bottom" CSS style option. Equivalent to:

     chart.setOption("bottom", "10px");
 

Parameters:
bottom - The value to use for the CSS style option.
Returns:
A reference to this Style instance for convenient method chaining.

setColor

public Style setColor(String color)
Convenience method for setting the "color" CSS style option. Equivalent to:

     chart.setOption("color", "#FF0000");
 

Parameters:
color - The value to use for the CSS style option.
Returns:
A reference to this Style instance for convenient method chaining.

setCursor

public Style setCursor(String cursor)
Convenience method for setting the "cursor" CSS style option. Equivalent to:

     chart.setOption("cursor", "pointer");
 

Parameters:
cursor - The value to use for the CSS style option.
Returns:
A reference to this Style instance for convenient method chaining.

setFont

public Style setFont(String font)
Convenience method for setting the "font" CSS style option. Equivalent to:

     chart.setOption("font", "normal 13px Verdana, sans-serif");
 

Parameters:
font - The value to use for the CSS style option.
Returns:
A reference to this Style instance for convenient method chaining.

setFontFamily

public Style setFontFamily(String fontFamily)
Convenience method for setting the "fontFamily" CSS style option. Equivalent to:

     chart.setOption("fontFamily", "serif");
 

Parameters:
fontFamily - The value to use for the CSS style option.
Returns:
A reference to this Style instance for convenient method chaining.

setFontSize

public Style setFontSize(String fontSize)
Convenience method for setting the "fontSize" CSS style option. Equivalent to:

     chart.setOption("fontSize", "16px");
 

Parameters:
fontSize - The value to use for the CSS style option.
Returns:
A reference to this Style instance for convenient method chaining.

setFontStyle

public Style setFontStyle(String fontStyle)
Convenience method for setting the "fontStyle" CSS style option. Equivalent to:

     chart.setOption("fontStyle", "italic");
 

Parameters:
fontStyle - The value to use for the CSS style option.
Returns:
A reference to this Style instance for convenient method chaining.

setFontWeight

public Style setFontWeight(String fontWeight)
Convenience method for setting the "fontWeight" CSS style option. Equivalent to:

     chart.setOption("fontWeight", "bold");
 

Parameters:
fontWeight - The value to use for the CSS style option.
Returns:
A reference to this Style instance for convenient method chaining.

setLeft

public Style setLeft(String left)
Convenience method for setting the "left" CSS style option. Equivalent to:

     chart.setOption("left", "10px");
 

Parameters:
left - The value to use for the CSS style option.
Returns:
A reference to this Style instance for convenient method chaining.

setMargin

public Style setMargin(String margin)
Convenience method for setting the "margin" CSS style option. Equivalent to:

     chart.setOption("margin", "0px");
 

Parameters:
margin - The value to use for the CSS style option.
Returns:
A reference to this Style instance for convenient method chaining.

setPosition

public Style setPosition(String position)
Convenience method for setting the "position" CSS style option. Equivalent to:

     chart.setOption("position", "absolute");
 

Parameters:
position - The value to use for the CSS style option.
Returns:
A reference to this Style instance for convenient method chaining.

setRight

public Style setRight(String right)
Convenience method for setting the "right" CSS style option. Equivalent to:

     chart.setOption("right", "10px");
 

Parameters:
right - The value to use for the CSS style option.
Returns:
A reference to this Style instance for convenient method chaining.

setTop

public Style setTop(String top)
Convenience method for setting the "top" CSS style option. Equivalent to:

     chart.setOption("top", "10px");
 

Parameters:
top - The value to use for the CSS style option.
Returns:
A reference to this Style instance for convenient method chaining.


Copyright © 2015. All Rights Reserved.