|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.Widget
com.google.gwt.user.client.ui.Composite
com.googlecode.gchart.client.GChart
public class GChart
A GChart can represent and display a line chart, a bar chart, a pie chart, an area chart, or a chart that contains arbitrary combinations of line, bar, pie, and/or area based curves.
For detailed examples, with screen shots, visit the Chart Gallery.
For detailed instructions on how to integrate Client-side GChart into your GWT application, see Installing Client-side GChart.
CSS Style Rule
USE_CSS for a detailed description of these
CSS convenience methods, and how to assure that they don't
interfere with more traditional, CSS attribute-based,
specifications.
| Nested Class Summary | |
|---|---|
static class |
GChart.AnnotationLocation
Defines the location of a data point's annotation (text label) relative to the location of that point's symbol. |
class |
GChart.Axis
Represents an axis of the chart, for example, the x, y, or y2 axis. |
class |
GChart.Curve
Represents a curve on a chart, which includes information such as the x,y coordinates of each point, the symbol used to represent points on the curve, etc. |
static class |
GChart.Point
Represents a single point on one of the chart's curves. |
class |
GChart.Symbol
Defines a chart curve symbol. |
static class |
GChart.SymbolType
Specifies the type of symbol used by a curve. |
class |
GChart.XAxis
The x-axis of a GChart. |
class |
GChart.Y2Axis
The right, or "y2", axis of a GChart. |
class |
GChart.YAxis
The left y-axis of a GChart. |
| Field Summary | |
|---|---|
static int |
DEFAULT_ANNOTATION_FONTSIZE
Default size, in pixels, of text used to annotate individual plotted points on a curve. |
static java.lang.String |
DEFAULT_BLANK_IMAGE_URL
The default URL GChart will use to access the blank image (specifically, a 1 x 1 pixel transparent GIF) it requires to prevent "missing image" icons from appearing in your charts. |
static java.lang.String |
DEFAULT_FONT_COLOR
The default color of any text appearing in a chart's legend, annotations, or tick labels. |
static java.lang.String |
DEFAULT_FONT_STYLE
|
static java.lang.String |
DEFAULT_FONT_WEIGHT
|
static java.lang.String |
DEFAULT_GRID_COLOR
The default color used for all axes, gridlines, and ticks. |
static java.lang.String |
DEFAULT_HOVERTEXT_TEMPLATE
The default template string used to generate the hovertext displayed when the user hovers their mouse above a point on a curve. |
static java.lang.String |
DEFAULT_LEGEND_BACKGROUND_COLOR
Default color of background of the chart legend |
static java.lang.String |
DEFAULT_LEGEND_BORDER_COLOR
Default color of border around the chart legend |
static java.lang.String |
DEFAULT_LEGEND_BORDER_STYLE
Default style of border around the chart legend |
static int |
DEFAULT_LEGEND_BORDER_WIDTH
Default width of border around the chart legend |
static int |
DEFAULT_LEGEND_FONTSIZE
The default fontsize of text that appears in the chart's legend (key). |
static double |
DEFAULT_PIE_SLICE_FILL_SPACING
The default "spacing" between corresponding edges of the rectangular elements used to simulate continuous fill of pie slices. |
static int |
DEFAULT_PIE_SLICE_FILL_THICKNESS
The default "thickness" of the rectangular elements used to simulate continous fill of pie slices. |
static java.lang.String |
DEFAULT_PIE_SLICE_HOVERTEXT_TEMPLATE
The default hovertext template used by symbols when they have a symbol type of of the form PIE_SLICE_*. |
static java.lang.String |
DEFAULT_PLOTAREA_BACKGROUND_COLOR
The default background color used for the chart's plot area if none is specified. |
static java.lang.String |
DEFAULT_PLOTAREA_BORDER_COLOR
The default border color used for the chart's plot area if none is specified. |
static java.lang.String |
DEFAULT_PLOTAREA_BORDER_STYLE
The default style of the border around the chart's plot area if none is specified. |
static int |
DEFAULT_PLOTAREA_BORDER_WIDTH
The default width of the border around the chart's plot area if none is specified. |
static java.lang.String |
DEFAULT_SYMBOL_BACKGROUND_COLOR
The default CSS background color used for symbols if none is specified. |
static java.lang.String[] |
DEFAULT_SYMBOL_BORDER_COLORS
The default CSS border colors used for symbols if none are specified. |
static java.lang.String |
DEFAULT_SYMBOL_BORDER_STYLE
The default CSS border style used for symbols if none is specified; this default is "solid". |
static int |
DEFAULT_SYMBOL_BORDER_WIDTH
The default CSS border width used for symbols if none is specified; this default is 1 pixel. |
static double |
DEFAULT_SYMBOL_FILL_SPACING
The default spacing between discrete, rectangular, elements used to simulate continous graphical objects, such as connecting lines in line charts or a shaded pie slice. |
static int |
DEFAULT_SYMBOL_FILL_THICKNESS
The default "thickness" of the rectangular elements used to simulate continous graphical objects, such as connecting lines in line charts. |
static int |
DEFAULT_SYMBOL_HEIGHT
The default height (including borders) used for symbols if none is specified; this default is the same as for DEFAULT_SYMBOL_WIDTH |
static GChart.SymbolType |
DEFAULT_SYMBOL_TYPE
The default symbol type for curve if none is specified; this default is BOX_CENTER |
static int |
DEFAULT_SYMBOL_WIDTH
The default width (including borders) used for symbols if none is specified. |
static int |
DEFAULT_TICK_COUNT
The default number of tick marks on each Axis. |
static java.lang.String |
DEFAULT_TICK_LABEL_FONT_COLOR
The default color (a CSS color specification) of tick labels |
static int |
DEFAULT_TICK_LABEL_FONTSIZE
The default fontsize (in pixels) of tick labels |
static java.lang.String |
DEFAULT_TICK_LABEL_FORMAT
The default GWT NumberFormat format string used to convert numbers to the text strings displayed as tick labels on X, Y, and Y2 axes. |
static int |
DEFAULT_TICK_LENGTH
The default length of tick marks, in pixels. |
static int |
DEFAULT_TICK_THICKNESS
The default thickness of tick marks, in pixels. |
static int |
DEFAULT_X_CHARTSIZE
The default width of the area of the chart in which curves are displayed, in pixels. |
static int |
DEFAULT_Y_CHARTSIZE
The default height of the area of the chart in which curves are displayed, in pixels. |
static int |
NAI
In analogy to how it uses Double.NaN (Not a Number), GChart uses NAI (Not an Integer) to represent integers whose values have not been explicitly specified. |
static java.lang.String |
USE_CSS
A special value used to tell GChart that a property should be defined via CSS, not via an explicit Java API specification. |
static com.googlecode.gchart.client.GChart.YAxisId |
Y_AXIS
Keyword used to indicate that a curve should be displayed on the left y-axis. |
static com.googlecode.gchart.client.GChart.YAxisId |
Y2_AXIS
Keyword used to indicate that a curve should be displayed on the right (the so-called y2) y-axis. |
| Constructor Summary | |
|---|---|
GChart()
Convenience no-arg constructor equivalent to GChart(DEFAULT_X_CHARTSIZE,DEFAULT_Y_CHARTSIZE). |
|
GChart(int xChartSize,
int yChartSize)
Instantiates a GChart with a curve display region of the specified size. |
|
| Method Summary | |
|---|---|
void |
addCurve()
Adds a new curve to the chart, at the end of the current list of curves. |
void |
addCurve(int iCurve)
Adds a new curve to the chart, at the specified position in the curve sequence. |
void |
clearCurves()
Removes every curve this chart contains. |
java.lang.String |
getBackgroundColor()
Returns the background color of the chart as a whole. |
static java.lang.String |
getBlankImageURL()
Returns a URL that points to a 1 x 1 pixel blank image file GChart requires to render its charts without producing missing image icons. |
java.lang.String |
getBorderColor()
Returns the color of the border around the chart as a whole. |
java.lang.String |
getBorderStyle()
Returns the style of the border around the chart as a whole |
java.lang.String |
getBorderWidth()
Returns the width of the border around the chart as a whole |
com.google.gwt.user.client.ui.Widget |
getChartFootnotes()
Returns the previously specified chart footnotes widget |
com.google.gwt.user.client.ui.Widget |
getChartTitle()
Returns the previously specified widget representing the chart's title. |
GChart.Curve |
getCurve()
Convenience method equivalent to getCurve(getNCurves()-1). |
GChart.Curve |
getCurve(int iCurve)
Returns a reference to the curve at the specified positional index. |
java.lang.String |
getFontFamily()
Returns the font-family used in tick labels, point annotations, legends, and as the default in titles, footnotes, and axis labels. |
java.lang.String |
getGridColor()
Returns CSS color specification for all gridlines, axes, and tickmarks. |
double |
getInitialPieSliceOrientation()
Returns a previously specified initial pie slice orientation. |
java.lang.String |
getLegendBackgroundColor()
Returns the background color of the chart's legend. |
java.lang.String |
getLegendBorderColor()
Returns the border color of the chart's legend. |
java.lang.String |
getLegendBorderStyle()
Returns the style of the chart's legend's border |
int |
getLegendBorderWidth()
Returns the width of the chart's legend's border |
java.lang.String |
getLegendFontColor()
Returns the color of the font used to display the labels within the legend (chart key) |
int |
getLegendFontSize()
Returns the font size, in pixels, of text displayed in the chart's legend (also know as a chart's key). |
java.lang.String |
getLegendFontStyle()
Returns the font-style in which this GChart's legend text will be rendered. |
java.lang.String |
getLegendFontWeight()
Returns true if legend text will be rendered in a bold, or false if in normal, weight font. |
int |
getNCurves()
Returns the number of curves on this chart. |
java.lang.String |
getPadding()
Returns the CSS string that specifies the width of the padding between the chart and it's external border |
java.lang.String |
getPlotAreaBackgroundColor()
Returns the background color of the area of the chart in which symbols representing curve data are displayed |
java.lang.String |
getPlotAreaBorderColor()
Returns the border color of the area of the chart in which symbols representing curve data are displayed |
java.lang.String |
getPlotAreaBorderStyle()
Returns the style of the border around the area of the chart in which symbols representing curve data are displayed (the so-called plot area). |
int |
getPlotAreaBorderWidth()
Returns the width of the border around the area of the chart in which symbols representing curve data are displayed. |
boolean |
getShowOffChartPoints()
Determinines if this chart will display points whose x,y locations are outside of the axis limits associated with the chart. |
GChart.Axis |
getXAxis()
Returns the x-axis associated with this chart. |
int |
getXChartSize()
Returns the number of x-pixels in the region of the chart used for curve display purposes. |
GChart.Axis |
getY2Axis()
Returns the y2-axis (right y axis) associated with this chart. |
GChart.Axis |
getYAxis()
Returns the (left) y-axis associated with this chart. |
int |
getYChartSize()
Returns the number of y-pixels in the region of the chart used for curve display purposes. |
boolean |
hasY2Axis()
Determines if this chart has a "y2" (right) y-axis. |
boolean |
hasYAxis()
Determines if this chart has an ordinary, or left, y-axis. |
boolean |
isLegendVisible()
Determines if the legend of this chart is visible. |
void |
removeCurve(int iCurve)
Removes the curve at the specified positional index. |
void |
setBackgroundColor(java.lang.String cssColor)
Specifies the background color of the chart as a whole. |
static void |
setBlankImageURL(java.lang.String blankImageURL)
Specifies a URL that points to the transparent, 1 x 1 pixel, "blank GIF" that GChart uses in order to render your chart without adding spurious "missing image" icons to it. |
void |
setBorderColor(java.lang.String cssColor)
Specifies the color of the border around the chart as a whole. |
void |
setBorderStyle(java.lang.String borderStyle)
Sets style of the border around the chart as a whole. |
void |
setBorderWidth(java.lang.String cssWidth)
Specifies the width of the border around the chart as a whole. |
void |
setChartFootnotes(java.lang.String html)
Convenience method equivalent to setChartFootnotes(new HTML(html)). |
void |
setChartFootnotes(com.google.gwt.user.client.ui.Widget chartFootnotes)
Sets widget the appears centered just below the chart |
void |
setChartSize(int xChartSize,
int yChartSize)
Convenience method equivalent to setXChartSize(xChartSize); setYChartSize(yChartSize). |
void |
setChartTitle(java.lang.String html)
Convenience method equivalent to setChartTitle(new HTML(html)). |
void |
setChartTitle(com.google.gwt.user.client.ui.Widget chartTitle)
Specifies the widget that appears centered just above the chart. |
void |
setFontFamily(java.lang.String fontFamily)
Sets the font-family used in tick labels, point annotations, legends, titles, footnotes, and axis labels. |
void |
setGridColor(java.lang.String cssColor)
Specifies the single color used for all gridlines, axes lines, and tick marks. |
void |
setInitialPieSliceOrientation(double orientation)
Sets the default initial orientation for pie slices. |
void |
setLegendBackgroundColor(java.lang.String cssColor)
Sets the background color of the chart's legend. |
void |
setLegendBorderColor(java.lang.String cssColor)
Sets the border color of the chart's legend. |
void |
setLegendBorderStyle(java.lang.String borderStyle)
Sets style of the border around the chart's legend (key). |
void |
setLegendBorderWidth(int width)
Sets the width of the chart legend's border. |
void |
setLegendFontColor(java.lang.String cssColor)
Specifies the color of the legend's font. |
void |
setLegendFontSize(int legendFontSize)
Specifies the font size, in pixels, of text displayed in the chart's legend (also know as a chart's key). |
void |
setLegendFontStyle(java.lang.String cssStyle)
Specifies the cssStyle of the font used to render the legend's labels. |
void |
setLegendFontWeight(java.lang.String cssWeight)
Specifies the weight of the font used in the labels of the legend. |
void |
setLegendVisible(boolean isLegendVisible)
Specifies if the legend is to be visible on this chart. |
void |
setPadding(java.lang.String cssPadding)
Specifies the amount of padding to add just inside of the chart's border, as a CSS padding specification string. |
void |
setPlotAreaBackgroundColor(java.lang.String cssColor)
Specifies the background color of the area of the chart in which symbols representing curve data are displayed |
void |
setPlotAreaBorderColor(java.lang.String cssColor)
Specifies the color of the border around the area of the chart in which symbols representing curve data are displayed. |
void |
setPlotAreaBorderStyle(java.lang.String borderStyle)
Sets style of the border around the chart's plot area (the rectangular area where the curves are drawn). |
void |
setPlotAreaBorderWidth(int width)
Specifies the width of the border around the area of the chart in which symbols representing curve data are displayed. |
void |
setShowOffChartPoints(boolean showOffChartPoints)
Specifies if points falling outside the ranges defined by the chart's axis limits are to be visible or hidden. |
void |
setXChartSize(int xChartSize)
Sets the number of pixels, in the horizontal dimension, available for curve display. |
void |
setYChartSize(int yChartSize)
Sets the number of pixels, in the vertical dimension, available for curve display. |
void |
update()
Builds a chart that reflects current user-specified chart specs (curve data, symbol choices, etc.) |
| Methods inherited from class com.google.gwt.user.client.ui.Composite |
|---|
getElement, isAttached |
| Methods inherited from class com.google.gwt.user.client.ui.Widget |
|---|
getParent, onBrowserEvent, removeFromParent |
| Methods inherited from class com.google.gwt.user.client.ui.UIObject |
|---|
addStyleDependentName, addStyleName, getAbsoluteLeft, getAbsoluteTop, getOffsetHeight, getOffsetWidth, getStyleName, getStylePrimaryName, getTitle, isVisible, isVisible, removeStyleDependentName, removeStyleName, setHeight, setPixelSize, setSize, setStyleName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkEvents, toString, unsinkEvents |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String USE_CSS
This value is mainly used by GChart's "CSS convenience methods" which make it possible to use the Java API to specify certain properties of a GChart that can also be specified via CSS. When the value of the Java property is set to USE_CSS GChart ignores the API specification and allows the standard "CSS cascade" to define the property. The discussion below elaborates on why GChart supports CSS convenience methods, and how the USE_CSS keyword fits into that support.
CSS Convenience Methods and the GChart.USE_CSS keywordLike all GWT Widgets, a GChart is both an object in a Java application, and an HTML element in a web page.
This duality naturally divides the properties of a GChart into three categories:
- Those you can access only via the Java API.
- Those you can access only via CSS and the DOM.
- Those you can access both ways.
I've used the following criteria to determine the access method appropriate for a given GChart property:
- Those properties that mainly define the chart itself--independent of its relationship to any containing web page--are exclusively accessed via the Java API
For example, the x,y data values of a curve have everything to do with the chart itself and nothing to do with the enclosing web page, so all the defining x,y data of a curve can only be accessed via the Java API.
- Those properties that mainly define how the chart fits into the enclosing web page and have nothing to do with the chart itself are accessed exclusively via CSS stylesheets or the GWT DOM class.
For example, how big of a margin should be placed around a GChart is only about how the GChart fits into the enclosing web page, so you must define a GChart's margins using a CSS stylesheet (or via the GWT DOM class)--there is no GChart.setMargin method.
- Finally, those properties that, in some situations are best viewed as part of the chart itself, and in other situations as defining how the chart fits into the enclosing web page can be accessed either via the Java API, or via CSS/DOM.
For example, if you are focused on assuring that the chart has a the same border as every other element on the page, the border around the chart as a whole can be viewed as relating to how the chart fits into the enclosing web page. On the other hand, if you are focused on assuring that, like the frame around a picture, the border looks good around that particular chart, it makes more sense to view it as a part of the chart itself.
The Java API methods for GChart properties in this third category are known as "CSS convenience methods" because, though you could do the same thing by exploiting the "GChart as HTML element" perspective, these methods save you the trouble of looking up CSS syntax, splitting up your chart's specification between Java code and a CSS stylesheet, invoking a rather hard-to-remember method call in the GWT DOM class, etc.
Specifications made via the GChart Java API always take precedence over those made via stylesheets or the DOM class. To instruct GChart that you want one of these properties to be defined via CSS or the DOM, set the associated Java API property to the special value GChart.USE_CSS.
Fortunately, since USE_CSS is the default value for every one of these CSS convenience properties, if you never use the Java API to set them, you can use CSS to control them just as you would for a GWT widget that did not support convenience properties. Unfortunately, these CSS defaults rarely produce a great looking chart out of the box; the example CSS snippet below defines all of these convenience properties and attaches them to GChart's default CSS selector (aka stylename) in a way that I think looks better. A comment to the right of each line contains the corresponding CSS convenience-method call that has the same effect.
.gchart-GChart { background-color: #DDF; /* setBackgroundColor("#DDF"); */ border-width: 1px; /* setBorderWidth("1px"); */ border-color: black; /* setBorderColor("black"); */ border-style: solid; /* setBorderStyle("solid"); */ font-family: Arial, sans-serif; /* setFontFamily("Arial, sans-serif"); */ }Note that certain CSS convenience methods that could in principle have been added, such as those for defining the background image of a chart, were omitted because I thought they would almost never be used. Of course, you can always access these CSS properties "the old fashioned way" (via a CSS specification or methods of the GWT DOM class).
setBorderColor,
setBorderStyle,
setBackgroundColor,
setBorderWidth,
setFontFamily,
Constant Field Valuespublic static final int NAI
public static final int DEFAULT_ANNOTATION_FONTSIZE
Point.setFontSize,
Constant Field Valuespublic static final java.lang.String DEFAULT_LEGEND_BORDER_COLOR
setLegendBorderColor,
Constant Field Valuespublic static final int DEFAULT_LEGEND_BORDER_WIDTH
setLegendBorderWidth,
Constant Field Valuespublic static final java.lang.String DEFAULT_LEGEND_BORDER_STYLE
setLegendBorderStyle,
Constant Field Valuespublic static final java.lang.String DEFAULT_LEGEND_BACKGROUND_COLOR
setLegendBackgroundColor,
Constant Field Valuespublic static final java.lang.String DEFAULT_FONT_COLOR
setLegendFontColor,
setTickLabelFontColor,
setAnnotationFontColor,
Constant Field Valuespublic static final java.lang.String DEFAULT_FONT_STYLE
public static final java.lang.String DEFAULT_FONT_WEIGHT
public static final java.lang.String DEFAULT_HOVERTEXT_TEMPLATE
setHovertextTemplate,
Constant Field Valuespublic static final int DEFAULT_LEGEND_FONTSIZE
setTickLabelFontSize,
getXAxis,
getYAxis,
getY2Axis,
Constant Field Valuespublic static final java.lang.String DEFAULT_PLOTAREA_BACKGROUND_COLOR
setPlotAreaBackgroundColor,
Constant Field Valuespublic static final java.lang.String DEFAULT_PLOTAREA_BORDER_COLOR
setPlotAreaBorderColor,
Constant Field Valuespublic static final java.lang.String DEFAULT_PLOTAREA_BORDER_STYLE
setPlotAreaBorderStyle,
Constant Field Valuespublic static final int DEFAULT_PLOTAREA_BORDER_WIDTH
setPlotAreaBorderWidth,
Constant Field Valuespublic static final java.lang.String DEFAULT_SYMBOL_BACKGROUND_COLOR
getSymbol,
setBackgroundColor,
Constant Field Valuespublic static final java.lang.String[] DEFAULT_SYMBOL_BORDER_COLORS
getSymbol,
setBorderColorpublic static final java.lang.String DEFAULT_SYMBOL_BORDER_STYLE
getSymbol,
setBorderStyle,
Constant Field Valuespublic static final int DEFAULT_SYMBOL_BORDER_WIDTH
getSymbol,
setBorderWidth,
Constant Field Valuespublic static final double DEFAULT_SYMBOL_FILL_SPACING
Note that if fill thickness is 0 (the default for all symbols except pie slices) no filling will be performed, regardless of the fill spacing.
getSymbol,
setFillSpacing,
setFillThickness,
Constant Field Valuespublic static final int DEFAULT_SYMBOL_FILL_THICKNESS
Since this default thickness is 0 px, this implies that, except for pie slices, no such continuous fill elements are generated by default. For example, if you want to have connecting lines drawn between individual data points represented using the BOX_CENTER symbol type, you must explicitly specify a positive fill thickness.
DEFAULT_PIE_SLICE_FILL_THICKNESS,
getSymbol,
setFillSpacing,
setFillThickness,
Constant Field Valuespublic static final double DEFAULT_PIE_SLICE_FILL_SPACING
DEFAULT_SYMBOL_FILL_SPACING,
DEFAULT_PIE_SLICE_FILL_THICKNESS,
getSymbol,
setFillSpacing,
setFillThickness,
Constant Field Valuespublic static final int DEFAULT_PIE_SLICE_FILL_THICKNESS
DEFAULT_SYMBOL_FILL_THICKNESS,
getSymbol,
setFillSpacing,
setFillThickness,
Constant Field Valuespublic static final java.lang.String DEFAULT_PIE_SLICE_HOVERTEXT_TEMPLATE
setHovertextTemplate,
PIE_SLICE_OPTIMAL_SHADING,
Constant Field Valuespublic static final int DEFAULT_SYMBOL_HEIGHT
getSymbol,
setHeight,
DEFAULT_SYMBOL_WIDTH,
Constant Field Valuespublic static final GChart.SymbolType DEFAULT_SYMBOL_TYPE
BOX_CENTER,
setSymbolTypepublic static final int DEFAULT_SYMBOL_WIDTH
getSymbol,
setWidth,
DEFAULT_SYMBOL_WIDTH,
Constant Field Valuespublic static final int DEFAULT_TICK_COUNT
setTickCount,
Constant Field Valuespublic static final java.lang.String DEFAULT_TICK_LABEL_FONT_COLOR
setTickLabelFontColor,
getXAxis,
getYAxis,
getY2Axis,
Constant Field Valuespublic static final int DEFAULT_TICK_LABEL_FONTSIZE
setTickLabelFontSize,
getXAxis,
getYAxis,
getY2Axis,
Constant Field Valuespublic static final java.lang.String DEFAULT_TICK_LABEL_FORMAT
setTickLabelFormat,
getXAxis,
getYAxis,
getY2Axis,
Constant Field Valuespublic static final int DEFAULT_TICK_LENGTH
setTickLength,
Constant Field Valuespublic static final int DEFAULT_TICK_THICKNESS
setTickThickness,
Constant Field Valuespublic static final int DEFAULT_X_CHARTSIZE
public static final int DEFAULT_Y_CHARTSIZE
public static final com.googlecode.gchart.client.GChart.YAxisId Y_AXIS
Y2_AXIS,
setYAxispublic static final com.googlecode.gchart.client.GChart.YAxisId Y2_AXIS
Y_AXIS,
setYAxispublic static final java.lang.String DEFAULT_BLANK_IMAGE_URL
setBlankImageURL,
Constant Field Valuespublic static final java.lang.String DEFAULT_GRID_COLOR
setGridColor,
Constant Field Values| Constructor Detail |
|---|
public GChart()
GChart(int,int)
public GChart(int xChartSize,
int yChartSize)
xChartSize - the width of the curve display region, in pixels.yChartSize - the height of the curve display region, in pixels.setXChartSize,
setYChartSize,
setChartSize| Method Detail |
|---|
public void setInitialPieSliceOrientation(double orientation)
The default value of this setting is 0, which corresponds to due south (6 o'clock). The value specifies the fraction of a complete clockwise rotation, beginning at due south required to reach the first edge of the pie slice.
orientation - the orientation to use for the first
edge of the first pie slice in this GChart, in cases
in which that first pie slice's orientation is undefined
(Double.NaN).setPieSliceOrientationpublic double getInitialPieSliceOrientation()
setInitialPieSliceOrientationpublic void addCurve()
getCurve,
addCurve(int),
removeCurve,
clearCurves,
getNCurvespublic void addCurve(int iCurve)
getCurve,
addCurve(),
removeCurve,
clearCurves,
getNCurvespublic void clearCurves()
getCurve,
addCurve(),
addCurve(int),
removeCurve,
getNCurvespublic java.lang.String getBackgroundColor()
setBackgroundColorpublic java.lang.String getBorderColor()
setBorderColorpublic java.lang.String getBorderWidth()
setBorderWidthpublic java.lang.String getBorderStyle()
setBorderStylepublic com.google.gwt.user.client.ui.Widget getChartFootnotes()
setChartFootnotes(Widget),
setChartFootnotes(String),
getChartTitlepublic com.google.gwt.user.client.ui.Widget getChartTitle()
setChartTitle(Widget),
setChartTitle(String)public GChart.Curve getCurve()
This method, when used in conjunction with no-arg addCurve, method, makes code blocks that create and define the properties of a chart's curves more readable/editable. For example:
addCurve(); // add 1st curve
getCurve().setYAxis(Y2_AXIS); // first setting for 1st curve
//... other settings for first curve
addCurve(); // add 2nd curve
getCurve().setYAxis(Y_AXIS); // first setting for 2nd curve
// ... other settings for 2nd curve
Note that using the no-arg methods in this way allows you to copy entire groups of curve properties, unchanged, between such curve related blocks.
getCurve(int),
getNCurves,
addCurve()public GChart.Curve getCurve(int iCurve)
iCurve - index of the curve to be retrieved.
getCurve(),
addCurve(),
addCurve(int),
removeCurve,
clearCurves,
getNCurvespublic java.lang.String getFontFamily()
setFontFamilypublic java.lang.String getGridColor()
setGridColorpublic java.lang.String getLegendBackgroundColor()
setLegendBackgroundColorpublic java.lang.String getLegendBorderColor()
setLegendBordergroundColorpublic int getLegendBorderWidth()
setLegendBorderWidthpublic java.lang.String getLegendBorderStyle()
setLegendBorderStylepublic java.lang.String getLegendFontWeight()
setLegendFontWeightpublic java.lang.String getLegendFontColor()
setLegendFontColorpublic java.lang.String getLegendFontStyle()
setLegendFontStylepublic int getLegendFontSize()
setLegendFontSizepublic int getNCurves()
getCurve,
addCurve(),
addCurve(int),
removeCurve,
clearCurvespublic java.lang.String getPadding()
setPaddingpublic java.lang.String getPlotAreaBackgroundColor()
setPlotAreaBackgroundColorpublic java.lang.String getPlotAreaBorderColor()
setPlotAreaBorderColorpublic int getPlotAreaBorderWidth()
setPlotAreaBorderWidthpublic java.lang.String getPlotAreaBorderStyle()
setPlotAreaBorderStylepublic boolean getShowOffChartPoints()
setShowOffChartPointspublic static java.lang.String getBlankImageURL()
setBlankImageURLpublic GChart.Axis getXAxis()
getYAxis,
getY2Axispublic int getXChartSize()
setXChartSizepublic GChart.Axis getY2Axis()
getYAxis,
getXAxispublic GChart.Axis getYAxis()
getXAxis,
getY2Axispublic int getYChartSize()
setYChartSizepublic boolean hasY2Axis()
Only charts that have at least one curve on the right y axis will have a y2-axis.