55import android .graphics .Color ;
66import android .graphics .DashPathEffect ;
77
8- import com .github .mikephil .charting .interfaces .datasets .ILineDataSet ;
9- import com .github .mikephil .charting .utils .ColorTemplate ;
108import com .github .mikephil .charting .formatter .DefaultFillFormatter ;
119import com .github .mikephil .charting .formatter .FillFormatter ;
10+ import com .github .mikephil .charting .interfaces .datasets .ILineDataSet ;
11+ import com .github .mikephil .charting .utils .ColorTemplate ;
1212import com .github .mikephil .charting .utils .Utils ;
1313
1414import java .util .ArrayList ;
1515import java .util .List ;
1616
1717public class LineDataSet extends LineRadarDataSet <Entry > implements ILineDataSet {
1818
19- /** Drawing mode for this line dataset **/
19+ /**
20+ * Drawing mode for this line dataset
21+ **/
2022 private LineDataSet .Mode mMode = Mode .LINEAR ;
2123
22- /** List representing all colors that are used for the circles */
24+ /**
25+ * List representing all colors that are used for the circles
26+ */
2327 private List <Integer > mCircleColors = null ;
2428
25- /** the color of the inner circles */
29+ /**
30+ * the color of the inner circles
31+ */
2632 private int mCircleColorHole = Color .WHITE ;
2733
28- /** the radius of the circle-shaped value indicators */
34+ /**
35+ * the radius of the circle-shaped value indicators
36+ */
2937 private float mCircleRadius = 8f ;
3038
31- /** the hole radius of the circle-shaped value indicators */
39+ /**
40+ * the hole radius of the circle-shaped value indicators
41+ */
3242 private float mCircleHoleRadius = 4f ;
3343
34- /** sets the intensity of the cubic lines */
44+ /**
45+ * sets the intensity of the cubic lines
46+ */
3547 private float mCubicIntensity = 0.2f ;
3648
37- /** the path effect of this DataSet that makes dashed lines possible */
49+ /**
50+ * the path effect of this DataSet that makes dashed lines possible
51+ */
3852 private DashPathEffect mDashPathEffect = null ;
3953
40- /** formatter for customizing the position of the fill-line */
54+ /**
55+ * formatter for customizing the position of the fill-line
56+ */
4157 private FillFormatter mFillFormatter = new DefaultFillFormatter ();
4258
43- /** if true, drawing circles is enabled */
59+ /**
60+ * if true, drawing circles is enabled
61+ */
4462 private boolean mDrawCircles = true ;
4563
4664 private boolean mDrawCircleHole = true ;
@@ -52,11 +70,11 @@ public LineDataSet(List<Entry> yVals, String label) {
5270 // mCircleRadius = Utils.convertDpToPixel(4f);
5371 // mLineWidth = Utils.convertDpToPixel(1f);
5472
55- if (mCircleColors == null ) {
73+ if (mCircleColors == null ) {
5674 mCircleColors = new ArrayList <Integer >();
5775 }
5876 mCircleColors .clear ();
59-
77+
6078 // default colors
6179 // mColors.add(Color.rgb(192, 255, 140));
6280 // mColors.add(Color.rgb(255, 247, 140));
@@ -108,7 +126,7 @@ public void setMode(LineDataSet.Mode mode) {
108126 /**
109127 * Sets the intensity for cubic lines (if enabled). Max = 1f = very cubic,
110128 * Min = 0.05f = low cubic effect, Default: 0.2f
111- *
129+ *
112130 * @param intensity
113131 */
114132 public void setCubicIntensity (float intensity ) {
@@ -160,7 +178,7 @@ public float getCircleHoleRadius() {
160178 /**
161179 * sets the size (radius) of the circle shpaed value indicators,
162180 * default size = 4f
163- *
181+ * <p/>
164182 * This method is deprecated because of unclarity. Use setCircleRadius instead.
165183 *
166184 * @param size
@@ -171,9 +189,7 @@ public void setCircleSize(float size) {
171189 }
172190
173191 /**
174- *
175192 * This function is deprecated because of unclarity. Use getCircleRadius instead.
176- *
177193 */
178194 @ Deprecated
179195 public float getCircleSize () {
@@ -184,13 +200,13 @@ public float getCircleSize() {
184200 * Enables the line to be drawn in dashed mode, e.g. like this
185201 * "- - - - - -". THIS ONLY WORKS IF HARDWARE-ACCELERATION IS TURNED OFF.
186202 * Keep in mind that hardware acceleration boosts performance.
187- *
188- * @param lineLength the length of the line pieces
203+ *
204+ * @param lineLength the length of the line pieces
189205 * @param spaceLength the length of space in between the pieces
190- * @param phase offset, in degrees (normally, use 0)
206+ * @param phase offset, in degrees (normally, use 0)
191207 */
192208 public void enableDashedLine (float lineLength , float spaceLength , float phase ) {
193- mDashPathEffect = new DashPathEffect (new float [] {
209+ mDashPathEffect = new DashPathEffect (new float []{
194210 lineLength , spaceLength
195211 }, phase );
196212 }
@@ -215,7 +231,7 @@ public DashPathEffect getDashPathEffect() {
215231 /**
216232 * set this to true to enable the drawing of circle indicators for this
217233 * DataSet, default true
218- *
234+ *
219235 * @param enabled
220236 */
221237 public void setDrawCircles (boolean enabled ) {
@@ -243,7 +259,7 @@ public boolean isDrawSteppedEnabled() {
243259
244260 /**
245261 * returns all colors specified for the circles
246- *
262+ *
247263 * @return
248264 */
249265 public List <Integer > getCircleColors () {
@@ -252,11 +268,11 @@ public List<Integer> getCircleColors() {
252268
253269 @ Override
254270 public int getCircleColor (int index ) {
255- return mCircleColors .get (index % mCircleColors . size () );
271+ return mCircleColors .get (index );
256272 }
257273
258274 @ Override
259- public int getCircleColorCount (){
275+ public int getCircleColorCount () {
260276 return mCircleColors .size ();
261277 }
262278
@@ -266,7 +282,7 @@ public int getCircleColorCount(){
266282 * is higher than the size of the colors array. Make sure that the colors
267283 * are already prepared (by calling getResources().getColor(...)) before
268284 * adding them to the DataSet.
269- *
285+ *
270286 * @param colors
271287 */
272288 public void setCircleColors (List <Integer > colors ) {
@@ -279,7 +295,7 @@ public void setCircleColors(List<Integer> colors) {
279295 * is higher than the size of the colors array. Make sure that the colors
280296 * are already prepared (by calling getResources().getColor(...)) before
281297 * adding them to the DataSet.
282- *
298+ *
283299 * @param colors
284300 */
285301 public void setCircleColors (int [] colors ) {
@@ -293,13 +309,13 @@ public void setCircleColors(int[] colors) {
293309 * "new String[] { R.color.red, R.color.green, ... }" to provide colors for
294310 * this method. Internally, the colors are resolved using
295311 * getResources().getColor(...)
296- *
312+ *
297313 * @param colors
298314 */
299315 public void setCircleColors (int [] colors , Context c ) {
300316
301317 List <Integer > clrs = mCircleColors ;
302- if (clrs == null ){
318+ if (clrs == null ) {
303319 clrs = new ArrayList <>();
304320 }
305321 clrs .clear ();
@@ -314,7 +330,7 @@ public void setCircleColors(int[] colors, Context c) {
314330 /**
315331 * Sets the one and ONLY color that should be used for this DataSet.
316332 * Internally, this recreates the colors array and adds the specified color.
317- *
333+ *
318334 * @param color
319335 */
320336 public void setCircleColor (int color ) {
@@ -326,15 +342,15 @@ public void setCircleColor(int color) {
326342 * resets the circle-colors array and creates a new one
327343 */
328344 public void resetCircleColors () {
329- if (mCircleColors == null ) {
345+ if (mCircleColors == null ) {
330346 mCircleColors = new ArrayList <Integer >();
331347 }
332348 mCircleColors .clear ();
333349 }
334350
335351 /**
336352 * Sets the color of the inner circle of the line-circles.
337- *
353+ *
338354 * @param color
339355 */
340356 public void setCircleColorHole (int color ) {
@@ -348,7 +364,7 @@ public int getCircleHoleColor() {
348364
349365 /**
350366 * Set this to true to allow drawing a hole in each data circle.
351- *
367+ *
352368 * @param enabled
353369 */
354370 public void setDrawCircleHole (boolean enabled ) {
0 commit comments