001    /*
002     * This file is part of the Echo Point Project.  This project is a
003     * collection of Components that have extended the Echo Web Application
004     * Framework Version 3.
005     *
006     * Version: MPL 1.1
007     *
008     * The contents of this file are subject to the Mozilla Public License Version
009     * 1.1 (the "License"); you may not use this file except in compliance with
010     * the License. You may obtain a copy of the License at
011     * http://www.mozilla.org/MPL/
012     *
013     * Software distributed under the License is distributed on an "AS IS" basis,
014     * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
015     * for the specific language governing rights and limitations under the
016     * License.
017     */
018    
019    package echopoint.google.chart;
020    
021    import echopoint.google.chart.internal.AdvancedChart;
022    
023    /**
024     * Component wrapper for a
025     * <a href='http://code.google.com/apis/chart/#radar'>Radar chart</a>
026     * provided by <a href='http://code.google.com/apis/chart/'>Google Chart
027     * API</a>.
028     *
029     * <p>The following code shows sample use of this component:</p>
030     * <pre>
031     *   import echopoint.google.chart.RadarChart;
032     *   import echopoint.google.chart.model.ChartData;
033     *
034     *     ...
035     *     final ChartData&lt;Integer&gt; data = new ChartData&lt;Integer&gt;();
036     *     final Integer[] array = new Integer[] { 30, 60, 70, 90, 95, 110 };
037     *     final List&lt;Integer&gt; xdata = Arrays.asList( array );
038     *     final int xmax = 120;
039     *
040     *     data.setXdata( xdata );
041     *     data.setXmax( xmax );
042     *
043     *     final RadarChart&lt;Integer&gt; chart = new RadarChart&lt;Integer&gt;();
044     *     chart.setLineStyle( RadarChart.LineStyle.rs );
045     *     final ArrayList&lt;ChartData&lt;Integer&gt;&gt; collection = new ArrayList&lt;ChartData&lt;Integer&gt;&gt;();
046     *     collection.add( data );
047     *     chart.setData( collection );
048     * </pre>
049     *
050     * @author Rakesh Vidyadharan 2008-08-24
051     * @version $Id: RadarChart.java 66 2008-09-09 08:13:37Z sptrakesh $
052     */
053    public class RadarChart<N extends Number> extends AdvancedChart<N>
054    {
055      private static final long serialVersionUID = 1l;
056    
057      /** The enumeration of line styles supported by the chart. */
058      public enum LineStyle { r, rs }
059    
060      /**
061       * The line style for the chart.  This proeprty is best styled.  Note that
062       * the values must correspond to {@link LineStyle}.
063       */
064      public static final String PROPERTY_LINE_STYLE = "lineStyle";
065    
066      /**
067       * Return the {@link #PROPERTY_LINE_STYLE} property value.
068       *
069       * @return The value of the property.
070       */
071      public String getLineStyle()
072      {
073        return (String) get( PROPERTY_LINE_STYLE );
074      }
075    
076      /**
077       * Set the value of the {@link #PROPERTY_LINE_STYLE} property.  Direct
078       * use of this method is not recommended.
079       *
080       * @see #setLineStyle( LineStyle )
081       * @param style The line style to use for the chart.
082       */
083      public void setLineStyle( final String style )
084      {
085        set( PROPERTY_LINE_STYLE, style );
086      }
087    
088      /**
089       * Set the value of the {@link #PROPERTY_LINE_STYLE} property.  This is
090       * the preferred mutator method for this proeprty.
091       *
092       * @param lineStyle The line style to use.
093       */
094      public void setLineStyle( final LineStyle lineStyle )
095      {
096        setLineStyle( lineStyle.toString() );
097      }
098    }