| | |
| | |
|
| | | /**
|
| | | * Abstract parent class for Google Charts built with the Visualization API.
|
| | | * |
| | | *
|
| | | * @author James Moger
|
| | | * |
| | | *
|
| | | */
|
| | | public abstract class GoogleChart implements Serializable {
|
| | |
|
| | |
| | | final List<ChartValue> values;
|
| | | int width;
|
| | | int height;
|
| | | boolean showLegend;
|
| | |
|
| | | public GoogleChart(String tagId, String title, String keyName, String valueName) {
|
| | | this.tagId = tagId;
|
| | |
| | | this.keyName = keyName;
|
| | | this.valueName = valueName;
|
| | | values = new ArrayList<ChartValue>();
|
| | | showLegend = true;
|
| | | }
|
| | |
|
| | | public void setWidth(int width) {
|
| | |
| | | this.height = height;
|
| | | }
|
| | |
|
| | | public void setShowLegend(boolean val) {
|
| | | this.showLegend = val;
|
| | | }
|
| | |
|
| | | public void addValue(String name, int value) {
|
| | | values.add(new ChartValue(name, value));
|
| | | }
|