|
For downloads, demos, and more
visit the Client-side GChart Home Page |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface GChartCanvasLite
Defines the features of a canvas (vector graphics) widget that (once you teach GChart how to create such widgets via the setCanvasFactory method) GChart can exploit to render your charts more quickly and with higher resolution.
Names, method signatures, and javadoc comments for this interface are mostly copied from, and a proper subset of, the GWT incubator's GWTCanvas widget. Specifically, for simplicity, features of GWTCanvas that GChart can't exploit, such as gradients and transformations, have been omitted, and only ordinary CSS and RGBA color strings (not the special GWTCanvas Color type) are supported.
The original GWTCanvas code is copyright Google, Inc. under the terms of the Apache 2.0 license.
Tip: To easily bolt-on GWTCanvas to render your charts more quickly and with higher resolution, just add the gwt-incubator.jar to your build path, and copy the boilerplate code in the setCanvasFactory method's javadocs into the module that contains your application's EntryPoint class. If you decide instead to use a different GWT cross-browser vector graphics widget, you can still use that boilerplate as a starting point for your own, custom, interfacing code.
GChart requires that the background color of the canvas element as a whole be transparent (no background color). This is needed because, to facilitate single-curve updating, GChart stitches together the canvas based rendering of a chart from a series of smaller, overlaid, canvas widgets. Since transparent backgrounds are the default for GWTCanvas, and likely for other GWT vector graphics widgets, you are not expected to have to do anything special to meet this requirement.
GChartCanvasFactory,
setCanvasFactory,
setFillSpacing,
setFillThickness| Method Summary | |
|---|---|
void |
arc(double x,
double y,
double radius,
double startAngle,
double endAngle,
boolean antiClockwise)
Draws an arc. |
void |
beginPath()
Erases the current path and prepares it for a new path. |
void |
clear()
Clears the entire canvas. |
void |
closePath()
Closes the current path. |
void |
fill()
Fills the current path according to the current fillstyle. |
void |
lineTo(double x,
double y)
Adds a line from the last point in the current path to the point defined by x and y. |
void |
moveTo(double x,
double y)
Makes the last point in the current path be (x,y). |
void |
resize(int width,
int height)
Resizes the canvas. |
void |
setFillStyle(java.lang.String canvasFillStyle)
Set the current Fill Style to the specified color. |
void |
setLineWidth(double width)
Sets the current context's linewidth. |
void |
setStrokeStyle(java.lang.String canvasStrokeStyle)
Set the current Stroke Style to the specified color. |
void |
stroke()
Strokes the current path according to the current stroke style. |
| Method Detail |
|---|
void arc(double x,
double y,
double radius,
double startAngle,
double endAngle,
boolean antiClockwise)
x - center X coordinatey - center Y coordinateradius - radius of drawn arcstartAngle - angle measured from positive X axis to start of arc CWendAngle - angle measured from positive X axis to end of arc CWantiClockwise - direction that the arc line is drawnvoid beginPath()
void clear()
void closePath()
void fill()
void lineTo(double x,
double y)
x - x coord of pointy - y coord of point
void moveTo(double x,
double y)
x - x coord of pointy - y coord of point
void resize(int width,
int height)
width - width of canvas drawing area in pixelsheight - height of canvas drawing area in pixelsvoid setFillStyle(java.lang.String canvasFillStyle)
Whenever GChart uses canvas to fill-in a symbol's interior (e.g. the interior part, excluding the border, of a solid-fill pie slice), it passes the symbol's canvas fill style string (which is specified via Symbol.setBackgroundColor) to this method. It then uses the fill method of this interface to fill in the symbol's interior with this color.
Your method should be able to handle any color specification string likely to be passed into Symbol.setBackgroundColor, see that method for full details for the kinds of strings that are supported.
canvasFillStyle - the fill style specification string. You may
assume that GChart will pass you either a standard CSS color
specification string, or an RGBA extension of this
standard CSS format, such as rgba(255,255,255,0.5).setBackgroundColor,
fillvoid setLineWidth(double width)
GChart will obtain the width's passed into this method from those specified by the Symbol.setBorderWidth method (which defines the widths of stroked borders around any canvas-rendered line, area, or pie-slice chart elements) and from the Symbol.setFillThickness method (which defines the thickness of a line chart's connecting lines).
width - the width of the stroked line, in pixelssetBorderWidth,
setFillThicknessvoid setStrokeStyle(java.lang.String canvasStrokeStyle)
GChart will obtain the color strings passed into this method from those specified by the Symbol.setBorderColor method. You can assume that these strings will be either in standard CSS or the extended RGBA format, see Symbol.setBorderColor for full details. These colors will become the colors of the stroked borders around any canvas-rendered line, area, or pie-slice chart elements.
canvasStrokeStyle - the stroke style specification string.
You may assume that, during rendering, GChart will pass you either
a standard CSS color specification string, or an RGBA
extension of this standard CSS format such as
rgba(255,255,255,0.5) for semi-transparent white.setBorderColor,
strokevoid stroke()
|
For downloads, demos, and more
visit the Client-side GChart Home Page |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||