001/**
002 *
003 * Copyright (c) 2014, the Railo Company Ltd. All rights reserved.
004 *
005 * This library is free software; you can redistribute it and/or
006 * modify it under the terms of the GNU Lesser General Public
007 * License as published by the Free Software Foundation; either 
008 * version 2.1 of the License, or (at your option) any later version.
009 * 
010 * This library is distributed in the hope that it will be useful,
011 * but WITHOUT ANY WARRANTY; without even the implied warranty of
012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
013 * Lesser General Public License for more details.
014 * 
015 * You should have received a copy of the GNU Lesser General Public 
016 * License along with this library.  If not, see <http://www.gnu.org/licenses/>.
017 * 
018 **/
019package lucee.runtime.tag;
020
021import lucee.runtime.exp.ExpressionException;
022import lucee.runtime.ext.tag.TagImpl;
023
024/**
025* Specifies a data point to be displayed by a cfgraph tag.
026*
027*
028*
029**/
030public final class GraphData extends TagImpl {
031
032        /** The item label for the data point. The item labels appear on the horizontal axis of Line and 
033        **              Bar charts, the vertical axis of Horizontal Bar charts, and in the legend of Pie charts. */
034        private String item;
035
036        /** The color to use when graphing the data point. The default is to use the values from the cfgraph
037        **              tag colorlist attribute or the built-in default list of colors. Line graphs ignore this attribute. */
038        private String color;
039
040        /** Value to be represented by the data point. */
041        private String value;
042
043        /** A URL to load when the user clicks the data point. This attribute works with Pie, Bar, and 
044        **              HorizontalBar charts. This attribute has an effect only if the graph is in Flash file format. */
045        private String url;
046
047
048        /**
049        * constructor for the tag class
050        **/
051        public GraphData() throws ExpressionException {
052                throw new ExpressionException("tag cfgraphdata is deprecated");
053        }
054
055        /** set the value item
056        *  The item label for the data point. The item labels appear on the horizontal axis of Line and 
057        *               Bar charts, the vertical axis of Horizontal Bar charts, and in the legend of Pie charts.
058        * @param item value to set
059        **/
060        public void setItem(String item)        {
061                this.item=item;
062        }
063
064        /** set the value color
065        *  The color to use when graphing the data point. The default is to use the values from the cfgraph
066        *               tag colorlist attribute or the built-in default list of colors. Line graphs ignore this attribute.
067        * @param color value to set
068        **/
069        public void setColor(String color)      {
070                this.color=color;
071        }
072
073        /** set the value value
074        *  Value to be represented by the data point.
075        * @param value value to set
076        **/
077        public void setValue(String value)      {
078                this.value=value;
079        }
080
081        /** set the value url
082        *  A URL to load when the user clicks the data point. This attribute works with Pie, Bar, and 
083        *               HorizontalBar charts. This attribute has an effect only if the graph is in Flash file format.
084        * @param url value to set
085        **/
086        public void setUrl(String url)  {
087                this.url=url;
088        }
089
090
091        @Override
092        public int doStartTag() {
093                return SKIP_BODY;
094        }
095
096        @Override
097        public int doEndTag()   {
098                return EVAL_PAGE;
099        }
100
101        @Override
102        public void release()   {
103                super.release();
104                item="";
105                color="";
106                value="";
107                url="";
108        }
109}