|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.rednels.ofcgwt.client.model.ChartData
public class ChartData
This is the most important class in the ofcgwt library. Start here, configuring the title, axes, legends, labels, and draw-able elements in your chart. You add an element to the chart data, for example...
ChartData cd = new ChartData("Sales by Region");
PieChart pie = new PieChart();
pie.addValues(10, 30, 40, 20);
cd.addElements(pie);
When finished, call toString() and the GWT JSON objects will convert the
chart data into a formatted OFC2 JSON data string.
| Constructor Summary | |
|---|---|
ChartData()
Creates a new chart data instance. |
|
ChartData(java.lang.String titleText)
Creates a new chart data instance with the given title. |
|
ChartData(java.lang.String titleText,
java.lang.String style)
Creates a new chart data instance with the given title and style. |
|
| Method Summary | |
|---|---|
void |
addElements(java.util.Collection<Element> collection)
Adds a collection of chart elements to the list of elements |
void |
addElements(Element... e)
Adds an element to the list of elements |
com.google.gwt.json.client.JSONValue |
buildJSON()
Build (and return) a JSONObject that contains all the items of this object. |
java.lang.String |
getBackgroundColour()
Get the current background colour |
java.util.Collection<Element> |
getElements()
Get the current elements collection |
Legend |
getLegend()
Get the current chart legend |
java.lang.Integer |
getNumDecimals()
|
RadarAxis |
getRadarAxis()
Get the current RadarAxis object |
Text |
getTitle()
Get the current title Text |
ToolTip |
getTooltip()
Gets the tooltip. |
XAxis |
getXAxis()
Get the current XAxis object |
Text |
getXLegend()
Get the current x legend Text |
YAxis |
getYAxis()
Get the current YAxis object (left side) |
YAxis |
getYAxisRight()
Get the current YAxis object (right side) |
Text |
getYLegend()
Get the current y legend Text |
Text |
getYRightLegend()
Get the current y right legend Text |
boolean |
isDecimalSeparatorComma()
|
boolean |
isFixedNumDecimalsForced()
|
boolean |
isThousandSeparatorDisabled()
|
boolean |
removeElement(Element e)
Removes an element from the list of elements |
void |
setBackgroundColour(java.lang.String bg_colour)
Sets the chart background colour in HTML hex format (#ffffff). |
void |
setDecimalSeparatorComma(boolean isDecimalSeparatorComma)
|
void |
setElements(java.util.Collection<Element> elements)
Clears and then sets the list of elements to this collection |
void |
setFixedNumDecimalsForced(boolean isFixedNumDecimalsForced)
|
void |
setLegend(Legend legend)
Sets the chart legend |
void |
setNumDecimals(java.lang.Integer numDecimals)
|
void |
setRadarAxis(RadarAxis radar_axis)
Sets the RadarAxis to this RadarAxis object |
void |
setThousandSeparatorDisabled(boolean isThousandSeparatorDisabled)
|
void |
setTitle(Text title)
Sets the title to this Text object |
void |
setTooltip(ToolTip tooltip)
Sets the tooltip. |
void |
setXAxis(XAxis x_axis)
Sets the XAxis to this XAxis object |
void |
setXLegend(Text x_legend)
Sets the x legend to this Text object |
void |
setYAxis(YAxis y_axis)
Sets the left YAxis to this YAxis object |
void |
setYAxisLabelStyle(java.lang.Integer size,
java.lang.String colour)
Sets the y axis label style. |
void |
setYAxisRight(YAxis y_axis_right)
Sets the right YAxis to this YAxis object |
void |
setYAxisRightLabelStyle(java.lang.Integer size,
java.lang.String colour)
Sets the y axis right label style. |
void |
setYLegend(Text y_legend)
Sets the y legend to this Text object |
void |
setYRightLegend(Text y2_legend)
Sets the y right legend to this Text object |
java.lang.String |
toString()
Returns the json formatted string of this chart data object. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ChartData()
public ChartData(java.lang.String titleText)
titleText -
public ChartData(java.lang.String titleText,
java.lang.String style)
titleText - style - | Method Detail |
|---|
public void addElements(java.util.Collection<Element> collection)
collection - of type Elementpublic void addElements(Element... e)
e - the elementpublic com.google.gwt.json.client.JSONValue buildJSON()
JSONizable
buildJSON in interface JSONizablepublic java.lang.String getBackgroundColour()
public java.util.Collection<Element> getElements()
public Legend getLegend()
public java.lang.Integer getNumDecimals()
public RadarAxis getRadarAxis()
public Text getTitle()
public ToolTip getTooltip()
public XAxis getXAxis()
public Text getXLegend()
public YAxis getYAxis()
public YAxis getYAxisRight()
public Text getYLegend()
public Text getYRightLegend()
public boolean isDecimalSeparatorComma()
public boolean isFixedNumDecimalsForced()
public boolean isThousandSeparatorDisabled()
public boolean removeElement(Element e)
e - the element
public void setBackgroundColour(java.lang.String bg_colour)
bg_colour - String colourpublic void setDecimalSeparatorComma(boolean isDecimalSeparatorComma)
isDecimalSeparatorComma - the isDecimalSeparatorComma to setpublic void setElements(java.util.Collection<Element> elements)
elements - Collectionpublic void setFixedNumDecimalsForced(boolean isFixedNumDecimalsForced)
isFixedNumDecimalsForced - the isFixedNumDecimalsForced to setpublic void setLegend(Legend legend)
legend - Legend objectpublic void setNumDecimals(java.lang.Integer numDecimals)
numDecimals - the numDecimals to setpublic void setRadarAxis(RadarAxis radar_axis)
radar_axis - RadarAxis objectpublic void setThousandSeparatorDisabled(boolean isThousandSeparatorDisabled)
isThousandSeparatorDisabled - the isThousandSeparatorDisabled to setpublic void setTitle(Text title)
title - Text objectpublic void setTooltip(ToolTip tooltip)
tooltip - the new tooltippublic void setXAxis(XAxis x_axis)
x_axis - XAxis objectpublic void setXLegend(Text x_legend)
x_legend - Text objectpublic void setYAxis(YAxis y_axis)
y_axis - YAxis object
public void setYAxisLabelStyle(java.lang.Integer size,
java.lang.String colour)
size - the sizecolour - the label colourpublic void setYAxisRight(YAxis y_axis_right)
y_axis_right - YAxis object
public void setYAxisRightLabelStyle(java.lang.Integer size,
java.lang.String colour)
size - the sizecolour - the label colourpublic void setYLegend(Text y_legend)
y_legend - Text objectpublic void setYRightLegend(Text y2_legend)
y2_legend - Text objectpublic java.lang.String toString()
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||