package com.googlecode.gchart.gcharttestapp.client;
import com.google.gwt.user.client.ui.HTML;
import com.googlecode.gchart.client.GChart;
/**
* Various tests for new LINE and ANCHOR_* symbol types, tests of
* the HTML-based heuristics for default axis, title, and
* footnote thicknesses, and a test of the
* setShowOffDecoratedChartGlyphs method.
*
*
*/
public class TestGChart26 extends GChart {
TestGChart26() {
setChartSize(100, 100);
addCurve();
getCurve().getSymbol().setSymbolType(SymbolType.LINE);
getCurve().getSymbol().setFillSpacing(100);
getCurve().getSymbol().setFillThickness(10);
getCurve().getSymbol().setWidth(3);
getCurve().getSymbol().setHeight(3);
for (int i = 0; i <= 10; i++) {
getCurve().addPoint(i,10-i);
}
// add same points in reverse order (doubling the 10th)
for (int i = 10; i >= 0; i--) {
getCurve().addPoint(i,10-i);
}
addCurve();
getCurve().setYAxis(Y2_AXIS);
getCurve().getSymbol().setSymbolType(SymbolType.LINE);
getCurve().getSymbol().setFillSpacing(10);
getCurve().getSymbol().setFillThickness(10);
getCurve().getSymbol().setWidth(3);
getCurve().getSymbol().setHeight(3);
for (int i = 0; i <= 10; i++)
getCurve().addPoint(i,i);
String[] text =
{"NW", "N", "NE", "W", "CENTER", "E", "SW", "S", "SE"};
SymbolType[] symType = {
SymbolType.ANCHOR_NORTHWEST,
SymbolType.ANCHOR_NORTH,
SymbolType.ANCHOR_NORTHEAST,
SymbolType.ANCHOR_WEST,
SymbolType.ANCHOR_CENTER,
SymbolType.ANCHOR_EAST,
SymbolType.ANCHOR_SOUTHWEST,
SymbolType.ANCHOR_SOUTH,
SymbolType.ANCHOR_SOUTHEAST};
for (int i = 0; i < symType.length; i++) {
addCurve();
// use convention that +/-MAX_VALUE ==> min/max position
getCurve().addPoint(-Double.MAX_VALUE,Double.MAX_VALUE);
getCurve().getSymbol().setSymbolType(symType[i]);
getCurve().getPoint().setAnnotationText(""+text[i]);
getCurve().getPoint().setAnnotationFontColor("blue");
getCurve().getPoint().setAnnotationLocation(
AnnotationLocation.CENTER);
}
setChartTitle("line1
line2");
getXAxis().setTickCount(11);
getXAxis().setTickLength(20);
getXAxis().setAxisLabel("line0
line1
line2
line3
line4");
setChartFootnotes("line0
line1
line2
line3
line4
line5
line6
line7
line8
line9
" +
"Check: