package com.googlecode.gchart.gcharttestapp.client; import com.googlecode.gchart.client.GChart; /** * Defines a line-plot of x*x vs. x, with solid connecting lines. * * Note: This chart uses the built-in HTML-element based line * rendering. As of GChart 2.5, faster drawn, better looking, * solid connecting lines can be produced by plugging an external * canvas library into GChart. See the setCanvasFactory * method's javadocs for the details, and the sine + cosine chart * on GChart's live demo for a complete working example. * */ public class GChartExample00b extends GChart { GChartExample00b() { setChartTitle("x2 vs x"); setChartSize(150, 150); addCurve(); // solid, 2px thick, 1px resolution, connecting lines: getCurve().getSymbol().setSymbolType(SymbolType.LINE); getCurve().getSymbol().setFillThickness(2); getCurve().getSymbol().setFillSpacing(1); // Make center-fill of square point markers same color as line: getCurve().getSymbol().setBackgroundColor( getCurve().getSymbol().getBorderColor()); for (int i = 0; i < 10; i++) getCurve().addPoint(i,i*i); getCurve().setLegendLabel("x2"); getXAxis().setAxisLabel("x"); getYAxis().setAxisLabel("x2"); } }