View Javadoc
1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one
3    * or more contributor license agreements.  See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership.  The ASF licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License.  You may obtain a copy of the License at
9    *
10   *   http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing,
13   * software distributed under the License is distributed on an
14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   * KIND, either express or implied.  See the License for the
16   * specific language governing permissions and limitations
17   * under the License.
18   */
19  package org.apache.syncope.client.console.chartjs;
20  
21  /**
22   * Provides options for {@link Line}.
23   */
24  public class LineChartOptions extends ChartOptions {
25  
26      private static final long serialVersionUID = -5356780831848556616L;
27  
28      private Boolean scaleShowHorizontalLines = true;
29  
30      private Boolean scaleShowVerticalLines = true;
31  
32      private Integer pointHitDetectionRadius = 20;
33  
34      private String legendTemplate = "<ul class=\"<%=name.toLowerCase()%>-legend\">"
35              + "<% for (var i=0; i<datasets.length; i++){%><li>"
36              + "<span style=\"background-color:<%=datasets[i].strokeColor%>\"></span>"
37              + "<%if(datasets[i].label){%><%=datasets[i].label%><%}%></li><%}%></ul>";
38  
39      /** The bezier curve. */
40      private Boolean bezierCurve;
41  
42      /** The point dot. */
43      private Boolean pointDot;
44  
45      /** The point dot radius. */
46      private Integer pointDotRadius;
47  
48      /** The point dot stroke width. */
49      private Integer pointDotStrokeWidth;
50  
51      /** The dataset stroke. */
52      private Boolean datasetStroke;
53  
54      /** The dataset stroke width. */
55      private Integer datasetStrokeWidth;
56  
57      /** The dataset fill. */
58      private Boolean datasetFill;
59  
60      private Boolean showLine = true;
61  
62      private Double tension = 0.0;
63  
64      public Boolean getScaleShowHorizontalLines() {
65          return scaleShowHorizontalLines;
66      }
67  
68      public void setScaleShowHorizontalLines(final Boolean scaleShowHorizontalLines) {
69          this.scaleShowHorizontalLines = scaleShowHorizontalLines;
70      }
71  
72      public Boolean getScaleShowVerticalLines() {
73          return scaleShowVerticalLines;
74      }
75  
76      public void setScaleShowVerticalLines(final Boolean scaleShowVerticalLines) {
77          this.scaleShowVerticalLines = scaleShowVerticalLines;
78      }
79  
80      public Integer getPointHitDetectionRadius() {
81          return pointHitDetectionRadius;
82      }
83  
84      public void setPointHitDetectionRadius(final Integer pointHitDetectionRadius) {
85          this.pointHitDetectionRadius = pointHitDetectionRadius;
86      }
87  
88      public String getLegendTemplate() {
89          return legendTemplate;
90      }
91  
92      public void setLegendTemplate(final String legendTemplate) {
93          this.legendTemplate = legendTemplate;
94      }
95  
96      /**
97       * Gets the bezier curve.
98       *
99       * @return the bezier curve
100      */
101     public Boolean getBezierCurve() {
102         return bezierCurve;
103     }
104 
105     /**
106      * Sets the bezier curve.
107      *
108      * @param bezierCurve decides whether the line is curved between points (default is true).
109      */
110     public void setBezierCurve(final Boolean bezierCurve) {
111         this.bezierCurve = bezierCurve;
112     }
113 
114     /**
115      * Gets the point dot.
116      *
117      * @return the point dot
118      */
119     public Boolean getPointDot() {
120         return pointDot;
121     }
122 
123     /**
124      * Sets the point dot.
125      *
126      * @param pointDot decides whether to show a dot for each point (default is true).
127      */
128     public void setPointDot(final Boolean pointDot) {
129         this.pointDot = pointDot;
130     }
131 
132     /**
133      * Gets the point dot radius.
134      *
135      * @return the point dot radius
136      */
137     public Integer getPointDotRadius() {
138         return pointDotRadius;
139     }
140 
141     /**
142      * Sets the point dot radius.
143      *
144      * @param pointDotRadius the new point dot radius (default is 3).
145      */
146     public void setPointDotRadius(final Integer pointDotRadius) {
147         this.pointDotRadius = pointDotRadius;
148     }
149 
150     /**
151      * Gets the point dot stroke width.
152      *
153      * @return the point dot stroke width
154      */
155     public Integer getPointDotStrokeWidth() {
156         return pointDotStrokeWidth;
157     }
158 
159     /**
160      * Sets the point dot stroke width.
161      *
162      * @param pointDotStrokeWidth the new point dot stroke width (default is 1).
163      */
164     public void setPointDotStrokeWidth(final Integer pointDotStrokeWidth) {
165         this.pointDotStrokeWidth = pointDotStrokeWidth;
166     }
167 
168     /**
169      * Gets the dataset stroke.
170      *
171      * @return the dataset stroke
172      */
173     public Boolean getDatasetStroke() {
174         return datasetStroke;
175     }
176 
177     /**
178      * Sets the dataset stroke.
179      *
180      * @param datasetStroke decides whether to show a stroke for datasets (default is true)
181      */
182     public void setDatasetStroke(final Boolean datasetStroke) {
183         this.datasetStroke = datasetStroke;
184     }
185 
186     /**
187      * Gets the dataset stroke width.
188      *
189      * @return the dataset stroke width
190      */
191     public Integer getDatasetStrokeWidth() {
192         return datasetStrokeWidth;
193     }
194 
195     /**
196      * Sets the dataset stroke width.
197      *
198      * @param datasetStrokeWidth the new dataset stroke width (default is 2).
199      */
200     public void setDatasetStrokeWidth(final Integer datasetStrokeWidth) {
201         this.datasetStrokeWidth = datasetStrokeWidth;
202     }
203 
204     /**
205      * Gets the dataset fill.
206      *
207      * @return the dataset fill
208      */
209     public Boolean getDatasetFill() {
210         return datasetFill;
211     }
212 
213     /**
214      * Sets the dataset fill.
215      *
216      * @param datasetFill whether to fill the dataset with a color (default is true)
217      */
218     public void setDatasetFill(final Boolean datasetFill) {
219         this.datasetFill = datasetFill;
220     }
221 
222     public Boolean getShowLine() {
223         return showLine;
224     }
225 
226     public void setShowLine(final Boolean showLine) {
227         this.showLine = showLine;
228     }
229 
230     public Double getTension() {
231         return tension;
232     }
233 
234     public void setTension(final Double tension) {
235         this.tension = tension;
236     }
237 }