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.AbstractChart;
022    
023    /**
024     * Component wrapper for a
025     * <a href='http://code.google.com/apis/chart/#gom'>Google-o-meter</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.Meter;
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[] { 70 };
037     *     data.setXdata( Arrays.asList( array ) );
038     *     data.setXmax( 100 );
039     *
040     *     final Meter chart = new Meter();
041     *     final ArrayList&lt;ChartData&lt;Integer&gt;&gt; collection = new ArrayList&lt;ChartData&lt;Integer&gt;&gt;();
042     *     collection.add( data );
043     *     chart.setData( collection );
044     *     chart.setLabel( "70 %" );
045     * </pre>
046     *
047     * @author Rakesh Vidyadharan 2008-08-27
048     * @version $Id: Meter.java 66 2008-09-09 08:13:37Z sptrakesh $
049     */
050    public class Meter extends AbstractChart<Integer>
051    {
052      private static final long serialVersionUID = 1l;
053    
054      /**
055       * The property used to specify colour and colour gradients for countries or
056       * states displayed in the map.  Colour specifications are different for
057       * maps as compared to regular charts.  This property is best styled.
058       */
059      public static final String PROPERTY_LABEL = "label";
060    
061      /**
062       * Return the {@link #PROPERTY_LABEL} property value.
063       *
064       * @return The label value encoded as required by the chart api.
065       */
066      public String getLabel()
067      {
068        return (String) get( PROPERTY_LABEL );
069      }
070    
071      /**
072       * Set the value of the {@link #PROPERTY_LABEL} property.
073       *
074       * @param label The value to set.
075       */
076      public void setLabel( final String label )
077      {
078        set( PROPERTY_LABEL, label );
079      }
080    }