Package org.wicketstuff.gchart
Class ColumnDeclaration
- java.lang.Object
-
- org.wicketstuff.gchart.ColumnDeclaration
-
-
Constructor Summary
Constructors Constructor Description ColumnDeclaration(String id, ColumnType type)Default constructor.ColumnDeclaration(String id, ColumnType type, IModel<String> labelModel)Constructor with label.ColumnDeclaration(String id, ColumnType type, ColumnRole role)Constructor with role.ColumnDeclaration(ColumnType type)Default constructor.ColumnDeclaration(ColumnType type, String label)Constructor with label as String.ColumnDeclaration(ColumnType type, IModel<String> labelModel)Constructor with label.ColumnDeclaration(ColumnType type, ColumnRole role)Constructor with role.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ColumnDeclarationfromJSON(com.github.openjson.JSONObject jsonObj)Build instance from a JSONobject.static ColumnDeclarationfromJSON(String json)Build an instance from a JSON string for instance as seen in tutorials.StringgetId()StringgetLabel()IModel<String>getLabelModel()StringgetPattern()Map<String,Object>getProperties()ColumnRolegetRole()ColumnTypegetType()voidsetId(String id)voidsetLabelModel(IModel<String> labelModel)voidsetPattern(String pattern)Just given for completeness, Google Charts does not use this value at the moment.voidsetRole(ColumnRole role)Set role of column.voidsetType(ColumnType type)com.github.openjson.JSONObjecttoJSON()Create the JSON serialization of the instance.
-
-
-
Constructor Detail
-
ColumnDeclaration
public ColumnDeclaration(ColumnType type)
Default constructor.- Parameters:
type- Datatype of column.
-
ColumnDeclaration
public ColumnDeclaration(String id, ColumnType type)
Default constructor.- Parameters:
id- Id of Column.type- Datatype of column.
-
ColumnDeclaration
public ColumnDeclaration(ColumnType type, String label)
Constructor with label as String.- Parameters:
type- Datatype of column.label- Label for description of column.
-
ColumnDeclaration
public ColumnDeclaration(ColumnType type, IModel<String> labelModel)
Constructor with label.- Parameters:
type- Datatype of column.labelModel- Model of Label for description of column.
-
ColumnDeclaration
public ColumnDeclaration(String id, ColumnType type, IModel<String> labelModel)
Constructor with label.- Parameters:
id- Id of Column.type- Datatype of column.labelModel- Model of Label for description of column.
-
ColumnDeclaration
public ColumnDeclaration(ColumnType type, ColumnRole role)
Constructor with role. Example:new ColumnDeclaration(ColumnType.STRING, ColumnRole.ANNOTATION);- Parameters:
type- Datatype of column.role- Role of column.
-
ColumnDeclaration
public ColumnDeclaration(String id, ColumnType type, ColumnRole role)
Constructor with role. Example:new ColumnDeclaration(ColumnType.STRING, ColumnRole.ANNOTATION);- Parameters:
id- Id of Column.type- Datatype of column.role- Role of column.
-
-
Method Detail
-
fromJSON
public static ColumnDeclaration fromJSON(String json)
Build an instance from a JSON string for instance as seen in tutorials. For users, that find coding in JSON easier than building nested ChartOptions, this my be an additional offer. Implemented asfromJson(new JSONObject(json));, seefromJSON(com.github.openjson.JSONObject).- Parameters:
json- JSON string like{id: 'task', label: 'Employee Name', type: 'string'}- Returns:
- New instance with data from the JSON String.
-
fromJSON
public static ColumnDeclaration fromJSON(com.github.openjson.JSONObject jsonObj)
Build instance from a JSONobject.- Parameters:
jsonObj- JSON object to build ColumnDeclaration from. If this contains "properties" nested, it will try to fill them in the instance.- Returns:
- New instance with data from the JSONObject.
-
getType
public ColumnType getType()
-
setType
public void setType(ColumnType type)
-
getId
public String getId()
-
setId
public void setId(String id)
-
getLabel
public String getLabel()
-
getRole
public ColumnRole getRole()
-
setRole
public void setRole(ColumnRole role)
Set role of column. See Column Roles.- Parameters:
role- Role of Column.
-
getPattern
public String getPattern()
-
setPattern
public void setPattern(String pattern)
Just given for completeness, Google Charts does not use this value at the moment. Use definition of options of axis ticks with value and format orhAxis.formatinstead to format axis values.- Parameters:
pattern- Pattern for Column.
-
-