org.telscenter.sail.webapp.presentation.google.charts.impl
Class BasicGoogleChartOptions

java.lang.Object
  extended by org.telscenter.sail.webapp.presentation.google.charts.impl.BasicGoogleChartOptions
All Implemented Interfaces:
GoogleChartOptions
Direct Known Subclasses:
BarChartOptionsImpl, LineChartOptionsImpl

public class BasicGoogleChartOptions
extends Object
implements GoogleChartOptions

Basic implementation of GoogleChartOptions. The options implemented in this class can be used for all types of GoogleCharts except for GoogleMaps

Version:
$Id:$
Author:
patrick lawler

Field Summary
protected  ChartColor chartColor
           
protected  ChartEffect chartEffect
           
protected  ChartTitle chartTitle
           
protected  List<ChartOption> options
           
protected  DataScaling scaling
           
 
Constructor Summary
BasicGoogleChartOptions()
           
 
Method Summary
 void addChartColor(List<String> colors)
          Specifies a list of colors for this charts data sets, points and legend.
 void addChartColor(String color)
          Specifies the colors for chart data sets, data points or chart legend.
 void addScaling(float min, float max)
          Adds scaling from float min to float max for a data set.
 void addScaling(List<Float> min, List<Float> max)
          Adds scaling for multiple data sets.
 void addSolidFill(String area, String color)
          A Solid Fill can be added to either the background, chart area or to apply a transparency to the entire chart and can be used in conjunction with Linear Stripe and Linear Gradient if available for that type of chart.
 void addTitle(String title)
          Adds a title to this chart.
 void addTitle(String title, String color, int fontSize)
          Adds a String title to this chart with the optional String hexadecimal RGB color and int font size.
 String getOptionString()
          Returns a String in Google Chart API format of the values of the options that have been specified for this chart
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

options

protected List<ChartOption> options

chartColor

protected ChartColor chartColor

scaling

protected DataScaling scaling

chartEffect

protected ChartEffect chartEffect

chartTitle

protected ChartTitle chartTitle
Constructor Detail

BasicGoogleChartOptions

public BasicGoogleChartOptions()
Method Detail

addChartColor

public void addChartColor(String color)
Description copied from interface: GoogleChartOptions
Specifies the colors for chart data sets, data points or chart legend. When specified, the SAME color is used for each data set and matching legend. If less colors than data sets are specified: for line charts, the last color specified will be used for the remaining data sets, for bar charts, the colors are alternated after last specified. Colors are a six digit String hexadecimal RGB color. For transparent colors concatenate two digits 00 - FF for a total where 00 is completely transparent and FF is totally opaque. Note: Order is important! Colors should be added in the same order as the data sets that they are intended for.

Specified by:
addChartColor in interface GoogleChartOptions
See Also:
GoogleChartOptions.addChartColor(java.lang.String)

addChartColor

public void addChartColor(List<String> colors)
Description copied from interface: GoogleChartOptions
Specifies a list of colors for this charts data sets, points and legend.

Specified by:
addChartColor in interface GoogleChartOptions
See Also:
org.telscenter.sail.webapp.presentation.google.charts.GoogleChartOptions#addChartColors(java.util.List)

addScaling

public void addScaling(float min,
                       float max)
Description copied from interface: GoogleChartOptions
Adds scaling from float min to float max for a data set. Scaling needs to be added in the same order as that their respective data sets were added. If only one scaling value is added and there are multiple sets of data, that value is used for all data sets. If less scaling values are added than there are data sets, the last one added is applied to the remaining data sets.

Specified by:
addScaling in interface GoogleChartOptions
See Also:
org.telscenter.sail.webapp.presentation.google.charts.GoogleChartOptions#addScaling(int, int)

addScaling

public void addScaling(List<Float> min,
                       List<Float> max)
Description copied from interface: GoogleChartOptions
Adds scaling for multiple data sets.

Specified by:
addScaling in interface GoogleChartOptions
See Also:
GoogleChartOptions.addScaling(java.util.List, java.util.List)

addSolidFill

public void addSolidFill(String area,
                         String color)
                  throws Exception
Description copied from interface: GoogleChartOptions
A Solid Fill can be added to either the background, chart area or to apply a transparency to the entire chart and can be used in conjunction with Linear Stripe and Linear Gradient if available for that type of chart. Multiple solid fill effects can be added.

Specified by:
addSolidFill in interface GoogleChartOptions
Throws:
Exception
See Also:
GoogleChartOptions.addSolidFill(java.lang.String, java.lang.String)

addTitle

public void addTitle(String title)
Description copied from interface: GoogleChartOptions
Adds a title to this chart. Use a | in the String to force a line break.

Specified by:
addTitle in interface GoogleChartOptions
See Also:
GoogleChartOptions.addTitle(java.lang.String)

addTitle

public void addTitle(String title,
                     String color,
                     int fontSize)
Description copied from interface: GoogleChartOptions
Adds a String title to this chart with the optional String hexadecimal RGB color and int font size. Note: if color is specified, fontsize must also be specified and vice versa.

Specified by:
addTitle in interface GoogleChartOptions
See Also:
GoogleChartOptions.addTitle(java.lang.String, java.lang.String, int)

getOptionString

public String getOptionString()
Description copied from interface: GoogleChartOptions
Returns a String in Google Chart API format of the values of the options that have been specified for this chart

Specified by:
getOptionString in interface GoogleChartOptions
Returns:
String
See Also:
GoogleChartOptions.getOptionString()


Copyright © 2012. All Rights Reserved.