com.googlecode.charts4j
Interface GChart

All Known Implementing Classes:
AbstractAxisChart, AbstractGraphChart, AbstractMarkableChart, BarChart, GoogleOMeter, LineChart, MapChart, PieChart, RadarChart, ScatterPlot, VennDiagram, XYLineChart

public interface GChart

Top level interface for all charts. Herein is functionality common to all charts.

Author:
Julien Chastang (julien.c.chastang at gmail dot com)

Method Summary
 void setBackgroundFill(Fill fill)
          Specify background fill.
 void setDataEncoding(DataEncoding dataEncoding)
          Set the data encoding scheme.
 void setSize(int width, int height)
          Set the chart size.
 void setTransparency(int opacity)
          Specify the chart transparency.
 String toURLForHTML()
          Create a URL with the ampersand character entity reference (&) in place of an ampersand.
 String toURLString()
          Create a URL string given the information supplied to this chart.
 

Method Detail

setSize

void setSize(int width,
             int height)
Set the chart size. If no size is specified, the chart will default to 200x125.

Parameters:
width - chart width. Must be > 0 and <= 1000.
height - chart height. Must be > 0 and <= 1000.
See Also:
Chart Size

toURLString

String toURLString()
Create a URL string given the information supplied to this chart. You can copy and paste this string into your web browser, and see if you get the results you anticipated. Better yet, incorporate this method call or toURLForHTML() into your Internet application to dynamically generate charts. URLs beyond 2000 characters are not recommended. You can sometimes get away with the simple encoding scheme if URL length is a problem. See setDataEncoding(DataEncoding dataEncoding)

Returns:
URL String
See Also:
DataEncoding, WWW FAQs: What is the maximum length of a URL?

toURLForHTML

String toURLForHTML()
Create a URL with the ampersand character entity reference (&amp;) in place of an ampersand. Useful for embedding your link in a web page.

Returns:
URL string

setBackgroundFill

void setBackgroundFill(Fill fill)
Specify background fill.

Parameters:
fill - Background fill. Cannot be null.
See Also:
Fill

setTransparency

void setTransparency(int opacity)
Specify the chart transparency. Use cautiously as this feature may obscure background fills. Also there appears to be a bug in the Google Chart API where setting a transparency makes the label color disappear.

Parameters:
opacity - Supply a number between 0 and 100. 0 is completely transparent, and 100 is completely opaque.

setDataEncoding

void setDataEncoding(DataEncoding dataEncoding)
Set the data encoding scheme. The only advantage to the simple encoding scheme is it will ultimately result in shorter URLs, but at the cost of lower resolution. charts4j defaults to the extended encoding, but if you have lots of data and if you are willing to sacrifice resolution, the simple encoding may be right for you.

Parameters:
dataEncoding - Supply the data encoding, either simple or extended. Cannot be null.