diff --git a/MPChartLib/src/main/java/com/github/mikephil/charting/charts/BarLineChartBase.java b/MPChartLib/src/main/java/com/github/mikephil/charting/charts/BarLineChartBase.java index c0d54bad41..6fb4cbdca6 100644 --- a/MPChartLib/src/main/java/com/github/mikephil/charting/charts/BarLineChartBase.java +++ b/MPChartLib/src/main/java/com/github/mikephil/charting/charts/BarLineChartBase.java @@ -676,11 +676,6 @@ public void zoom(float scaleX, float scaleY, float x, float y) { /** * Zooms in or out by the given scale factor. * x and y are the values (NOT PIXELS) of the zoom center.. - * - * @param scaleX - * @param scaleY - * @param xValue - * @param yValue * @param axis the axis relative to which the zoom should take place */ public void zoom(float scaleX, float scaleY, float xValue, float yValue, AxisDependency axis) { @@ -691,9 +686,6 @@ public void zoom(float scaleX, float scaleY, float xValue, float yValue, AxisDep /** * Zooms to the center of the chart with the given scale factor. - * - * @param scaleX - * @param scaleY */ public void zoomToCenter(float scaleX, float scaleY) { @@ -706,13 +698,6 @@ public void zoomToCenter(float scaleX, float scaleY) { /** * Zooms by the specified scale factor to the specified values on the specified axis. - * - * @param scaleX - * @param scaleY - * @param xValue - * @param yValue - * @param axis - * @param duration */ @TargetApi(11) public void zoomAndCenterAnimated(float scaleX, float scaleY, float xValue, float yValue, AxisDependency axis, @@ -746,9 +731,6 @@ public void fitScreen() { /** * Sets the minimum scale factor value to which can be zoomed out. 1f = * fitScreen - * - * @param scaleX - * @param scaleY */ public void setScaleMinima(float scaleX, float scaleY) { mViewPortHandler.setMinimumScaleX(scaleX); @@ -785,9 +767,6 @@ public void setVisibleXRangeMinimum(float minXRange) { * Limits the maximum and minimum x range that can be visible by pinching and zooming. e.g. minRange=10, maxRange=100 the * smallest range to be displayed at once is 10, and no more than a range of 100 values can be viewed at once without * scrolling - * - * @param minXRange - * @param maxXRange */ public void setVisibleXRange(float minXRange, float maxXRange) { float minScale = mXAxis.mAxisRange / minXRange; @@ -810,7 +789,6 @@ public void setVisibleYRangeMaximum(float maxYRange, AxisDependency axis) { /** * Sets the size of the area (range on the y-axis) that should be minimum visible at once, no further zooming in possible. * - * @param minYRange * @param axis the axis for which this limit should apply */ public void setVisibleYRangeMinimum(float minYRange, AxisDependency axis) { @@ -820,10 +798,6 @@ public void setVisibleYRangeMinimum(float minYRange, AxisDependency axis) { /** * Limits the maximum and minimum y range that can be visible by pinching and zooming. - * - * @param minYRange - * @param maxYRange - * @param axis */ public void setVisibleYRange(float minYRange, float maxYRange, AxisDependency axis) { float minScale = getAxisRange(axis) / minYRange; @@ -835,8 +809,6 @@ public void setVisibleYRange(float minYRange, float maxYRange, AxisDependency ax /** * Moves the left side of the current viewport to the specified x-position. * This also refreshes the chart by calling invalidate(). - * - * @param xValue */ public void moveViewToX(float xValue) { @@ -850,9 +822,6 @@ public void moveViewToX(float xValue) { * This will move the left side of the current viewport to the specified * x-value on the x-axis, and center the viewport to the specified y value on the y-axis. * This also refreshes the chart by calling invalidate(). - * - * @param xValue - * @param yValue * @param axis - which axis should be used as a reference for the y-axis */ public void moveViewTo(float xValue, float yValue, AxisDependency axis) { @@ -869,10 +838,6 @@ public void moveViewTo(float xValue, float yValue, AxisDependency axis) { * This will move the left side of the current viewport to the specified x-value * and center the viewport to the y value animated. * This also refreshes the chart by calling invalidate(). - * - * @param xValue - * @param yValue - * @param axis * @param duration the duration of the animation in milliseconds */ @TargetApi(11) @@ -893,8 +858,6 @@ public void moveViewToAnimated(float xValue, float yValue, AxisDependency axis, /** * Centers the viewport to the specified y value on the y-axis. * This also refreshes the chart by calling invalidate(). - * - * @param yValue * @param axis - which axis should be used as a reference for the y-axis */ public void centerViewToY(float yValue, AxisDependency axis) { @@ -912,8 +875,6 @@ public void centerViewToY(float yValue, AxisDependency axis) { * x and y value. * This also refreshes the chart by calling invalidate(). * - * @param xValue - * @param yValue * @param axis - which axis should be used as a reference for the y axis */ public void centerViewTo(float xValue, float yValue, AxisDependency axis) { @@ -932,9 +893,6 @@ public void centerViewTo(float xValue, float yValue, AxisDependency axis) { * This will move the center of the current viewport to the specified * x and y value animated. * - * @param xValue - * @param yValue - * @param axis * @param duration the duration of the animation in milliseconds */ @TargetApi(11) @@ -965,11 +923,6 @@ public void centerViewToAnimated(float xValue, float yValue, AxisDependency axis * automatically calculating it's offsets. Use resetViewPortOffsets() to * undo this. ONLY USE THIS WHEN YOU KNOW WHAT YOU ARE DOING, else use * setExtraOffsets(...). - * - * @param left - * @param top - * @param right - * @param bottom */ public void setViewPortOffsets(final float left, final float top, final float right, final float bottom) { @@ -996,16 +949,8 @@ public void resetViewPortOffsets() { calculateOffsets(); } - /** - * ################ ################ ################ ################ - */ - /** CODE BELOW IS GETTERS AND SETTERS */ - /** * Returns the range of the specified axis. - * - * @param axis - * @return */ protected float getAxisRange(AxisDependency axis) { if (axis == AxisDependency.LEFT) @@ -1016,8 +961,6 @@ protected float getAxisRange(AxisDependency axis) { /** * Sets the OnDrawListener - * - * @param drawListener */ public void setOnDrawListener(OnDrawListener drawListener) { this.mDrawListener = drawListener; @@ -1025,8 +968,6 @@ public void setOnDrawListener(OnDrawListener drawListener) { /** * Gets the OnDrawListener. May be null. - * - * @return */ public OnDrawListener getDrawListener() { return mDrawListener; @@ -1038,9 +979,6 @@ public OnDrawListener getDrawListener() { * Returns a recyclable MPPointF instance. * Returns the position (in pixels) the provided Entry has inside the chart * view or null, if the provided Entry is null. - * - * @param e - * @return */ public MPPointF getPosition(Entry e, AxisDependency axis) { @@ -1058,8 +996,6 @@ public MPPointF getPosition(Entry e, AxisDependency axis) { /** * sets the number of maximum visible drawn values on the chart only active * when setDrawValues() is enabled - * - * @param count */ public void setMaxVisibleValueCount(int count) { this.mMaxVisibleCount = count; @@ -1072,8 +1008,6 @@ public int getMaxVisibleCount() { /** * Set this to true to allow highlighting per dragging over the chart * surface when it is fully zoomed out. Default: true - * - * @param enabled */ public void setHighlightPerDragEnabled(boolean enabled) { mHighlightPerDragEnabled = enabled; @@ -1086,8 +1020,6 @@ public boolean isHighlightPerDragEnabled() { /** * Sets the color for the background of the chart-drawing area (everything * behind the grid lines). - * - * @param color */ public void setGridBackgroundColor(int color) { mGridBackgroundPaint.setColor(color); @@ -1096,8 +1028,6 @@ public void setGridBackgroundColor(int color) { /** * Set this to true to enable dragging (moving the chart with the finger) * for the chart (this does not effect scaling). - * - * @param enabled */ public void setDragEnabled(boolean enabled) { this.mDragXEnabled = enabled; @@ -1106,8 +1036,6 @@ public void setDragEnabled(boolean enabled) { /** * Returns true if dragging is enabled for the chart, false if not. - * - * @return */ public boolean isDragEnabled() { return mDragXEnabled || mDragYEnabled; @@ -1115,8 +1043,6 @@ public boolean isDragEnabled() { /** * Set this to true to enable dragging on the X axis - * - * @param enabled */ public void setDragXEnabled(boolean enabled) { this.mDragXEnabled = enabled; @@ -1124,8 +1050,6 @@ public void setDragXEnabled(boolean enabled) { /** * Returns true if dragging on the X axis is enabled for the chart, false if not. - * - * @return */ public boolean isDragXEnabled() { return mDragXEnabled; @@ -1133,8 +1057,6 @@ public boolean isDragXEnabled() { /** * Set this to true to enable dragging on the Y axis - * - * @param enabled */ public void setDragYEnabled(boolean enabled) { this.mDragYEnabled = enabled; @@ -1142,8 +1064,6 @@ public void setDragYEnabled(boolean enabled) { /** * Returns true if dragging on the Y axis is enabled for the chart, false if not. - * - * @return */ public boolean isDragYEnabled() { return mDragYEnabled; @@ -1152,8 +1072,6 @@ public boolean isDragYEnabled() { /** * Set this to true to enable scaling (zooming in and out by gesture) for * the chart (this does not effect dragging) on both X- and Y-Axis. - * - * @param enabled */ public void setScaleEnabled(boolean enabled) { this.mScaleXEnabled = enabled; @@ -1178,15 +1096,11 @@ public boolean isScaleYEnabled() { /** * Set this to true to enable fling gesture for the chart - * - * @param enabled */ public void setFlingEnabled(boolean enabled) { this.mFlingEnabled = enabled; } /** * Returns true if fling gesture is enabled for the chart, false if not. - * - * @return */ public boolean isFlingEnabled() { return mFlingEnabled; @@ -1195,8 +1109,6 @@ public boolean isFlingEnabled() { /** * Set this to true to enable zooming in by double-tap on the chart. * Default: enabled - * - * @param enabled */ public void setDoubleTapToZoomEnabled(boolean enabled) { mDoubleTapToZoomEnabled = enabled; @@ -1204,8 +1116,6 @@ public void setDoubleTapToZoomEnabled(boolean enabled) { /** * Returns true if zooming via double-tap is enabled false if not. - * - * @return */ public boolean isDoubleTapToZoomEnabled() { return mDoubleTapToZoomEnabled; @@ -1213,8 +1123,6 @@ public boolean isDoubleTapToZoomEnabled() { /** * set this to true to draw the grid background, false if not - * - * @param enabled */ public void setDrawGridBackground(boolean enabled) { mDrawGridBackground = enabled; @@ -1223,8 +1131,6 @@ public void setDrawGridBackground(boolean enabled) { /** * When enabled, the borders rectangle will be rendered. * If this is enabled, there is no point drawing the axis-lines of x- and y-axis. - * - * @param enabled */ public void setDrawBorders(boolean enabled) { mDrawBorders = enabled; @@ -1233,8 +1139,6 @@ public void setDrawBorders(boolean enabled) { /** * When enabled, the borders rectangle will be rendered. * If this is enabled, there is no point drawing the axis-lines of x- and y-axis. - * - * @return */ public boolean isDrawBordersEnabled() { return mDrawBorders; @@ -1243,8 +1147,6 @@ public boolean isDrawBordersEnabled() { /** * When enabled, the values will be clipped to contentRect, * otherwise they can bleed outside the content rect. - * - * @param enabled */ public void setClipValuesToContent(boolean enabled) { mClipValuesToContent = enabled; @@ -1254,8 +1156,6 @@ public void setClipValuesToContent(boolean enabled) { * When disabled, the data and/or highlights will not be clipped to contentRect. Disabling this option can * be useful, when the data lies fully within the content rect, but is drawn in such a way (such as thick lines) * that there is unwanted clipping. - * - * @param enabled */ public void setClipDataToContent(boolean enabled) { mClipDataToContent = enabled; @@ -1264,8 +1164,6 @@ public void setClipDataToContent(boolean enabled) { /** * When enabled, the values will be clipped to contentRect, * otherwise they can bleed outside the content rect. - * - * @return */ public boolean isClipValuesToContentEnabled() { return mClipValuesToContent; @@ -1275,8 +1173,6 @@ public boolean isClipValuesToContentEnabled() { * When disabled, the data and/or highlights will not be clipped to contentRect. Disabling this option can * be useful, when the data lies fully within the content rect, but is drawn in such a way (such as thick lines) * that there is unwanted clipping. - * - * @return */ public boolean isClipDataToContentEnabled() { return mClipDataToContent; @@ -1284,8 +1180,6 @@ public boolean isClipDataToContentEnabled() { /** * Sets the width of the border lines in dp. - * - * @param width */ public void setBorderWidth(float width) { mBorderPaint.setStrokeWidth(Utils.convertDpToPixel(width)); @@ -1293,8 +1187,6 @@ public void setBorderWidth(float width) { /** * Sets the color of the chart border lines. - * - * @param color */ public void setBorderColor(int color) { mBorderPaint.setColor(color); @@ -1334,10 +1226,6 @@ public void setKeepPositionOnRotation(boolean keepPositionOnRotation) { * (encapsulated in a MPPointD). This method transforms pixel coordinates to * coordinates / values in the chart. This is the opposite method to * getPixelForValues(...). - * - * @param x - * @param y - * @return */ public MPPointD getValuesByTouchPoint(float x, float y, AxisDependency axis) { MPPointD result = MPPointD.getInstance(0, 0); @@ -1353,10 +1241,6 @@ public void getValuesByTouchPoint(float x, float y, AxisDependency axis, MPPoint * Returns a recyclable MPPointD instance * Transforms the given chart values into pixels. This is the opposite * method to getValuesByTouchPoint(...). - * - * @param x - * @param y - * @return */ public MPPointD getPixelForValues(float x, float y, AxisDependency axis) { return getTransformer(axis).getPixelForValues(x, y); @@ -1364,10 +1248,6 @@ public MPPointD getPixelForValues(float x, float y, AxisDependency axis) { /** * returns the Entry object displayed at the touched position of the chart - * - * @param x - * @param y - * @return */ public Entry getEntryByTouchPoint(float x, float y) { Highlight h = getHighlightByTouchPoint(x, y); @@ -1379,10 +1259,6 @@ public Entry getEntryByTouchPoint(float x, float y) { /** * returns the DataSet object displayed at the touched position of the chart - * - * @param x - * @param y - * @return */ public IBarLineScatterCandleBubbleDataSet getDataSetByTouchPoint(float x, float y) { Highlight h = getHighlightByTouchPoint(x, y); @@ -1398,17 +1274,13 @@ public IBarLineScatterCandleBubbleDataSet getDataSetByTouchPoint(float x, float protected MPPointD posForGetLowestVisibleX = MPPointD.getInstance(0, 0); /** - * Returns the lowest x-index (value on the x-axis) that is still visible on - * the chart. - * - * @return + * Returns the lowest x-index (value on the x-axis) that is still visible on the chart. */ @Override public float getLowestVisibleX() { getTransformer(AxisDependency.LEFT).getValuesByTouchPoint(mViewPortHandler.contentLeft(), mViewPortHandler.contentBottom(), posForGetLowestVisibleX); - float result = (float) Math.max(mXAxis.mAxisMinimum, posForGetLowestVisibleX.x); - return result; + return (float) Math.max(mXAxis.mAxisMinimum, posForGetLowestVisibleX.x); } /** @@ -1419,21 +1291,16 @@ public float getLowestVisibleX() { /** * Returns the highest x-index (value on the x-axis) that is still visible * on the chart. - * - * @return */ @Override public float getHighestVisibleX() { getTransformer(AxisDependency.LEFT).getValuesByTouchPoint(mViewPortHandler.contentRight(), mViewPortHandler.contentBottom(), posForGetHighestVisibleX); - float result = (float) Math.min(mXAxis.mAxisMaximum, posForGetHighestVisibleX.x); - return result; + return (float) Math.min(mXAxis.mAxisMaximum, posForGetHighestVisibleX.x); } /** * Returns the range visible on the x-axis. - * - * @return */ public float getVisibleXRange() { return Math.abs(getHighestVisibleX() - getLowestVisibleX()); @@ -1461,8 +1328,6 @@ public float getScaleY() { /** * if the chart is fully zoomed out, return true - * - * @return */ public boolean isFullyZoomedOut() { return mViewPortHandler.isFullyZoomedOut(); @@ -1471,8 +1336,6 @@ public boolean isFullyZoomedOut() { /** * Returns the left y-axis object. In the horizontal bar-chart, this is the * top axis. - * - * @return */ public YAxis getAxisLeft() { return mAxisLeft; @@ -1481,8 +1344,6 @@ public YAxis getAxisLeft() { /** * Returns the right y-axis object. In the horizontal bar-chart, this is the * bottom axis. - * - * @return */ public YAxis getAxisRight() { return mAxisRight; @@ -1491,9 +1352,6 @@ public YAxis getAxisRight() { /** * Returns the y-axis object to the corresponding AxisDependency. In the * horizontal bar-chart, LEFT == top, RIGHT == BOTTOM - * - * @param axis - * @return */ public YAxis getAxis(AxisDependency axis) { if (axis == AxisDependency.LEFT) @@ -1510,8 +1368,6 @@ public boolean isInverted(AxisDependency axis) { /** * If set to true, both x and y axis can be scaled simultaneously with 2 fingers, if false, * x and y axis can be scaled separately. default: false - * - * @param enabled */ public void setPinchZoom(boolean enabled) { mPinchZoomEnabled = enabled; @@ -1519,8 +1375,6 @@ public void setPinchZoom(boolean enabled) { /** * returns true if pinch-zoom is enabled, false if not - * - * @return */ public boolean isPinchZoomEnabled() { return mPinchZoomEnabled; @@ -1529,8 +1383,6 @@ public boolean isPinchZoomEnabled() { /** * Set an offset in dp that allows the user to drag the chart over it's * bounds on the x-axis. - * - * @param offset */ public void setDragOffsetX(float offset) { mViewPortHandler.setDragOffsetX(offset); @@ -1539,8 +1391,6 @@ public void setDragOffsetX(float offset) { /** * Set an offset in dp that allows the user to drag the chart over it's * bounds on the y-axis. - * - * @param offset */ public void setDragOffsetY(float offset) { mViewPortHandler.setDragOffsetY(offset); @@ -1548,8 +1398,6 @@ public void setDragOffsetY(float offset) { /** * Returns true if both drag offsets (x and y) are zero or smaller. - * - * @return */ public boolean hasNoDragOffset() { return mViewPortHandler.hasNoDragOffset(); @@ -1561,8 +1409,6 @@ public XAxisRenderer getRendererXAxis() { /** * Sets a custom XAxisRenderer and overrides the existing (default) one. - * - * @param xAxisRenderer */ public void setXAxisRenderer(XAxisRenderer xAxisRenderer) { mXAxisRenderer = xAxisRenderer; @@ -1574,8 +1420,6 @@ public YAxisRenderer getRendererLeftYAxis() { /** * Sets a custom axis renderer for the left axis and overwrites the existing one. - * - * @param rendererLeftYAxis */ public void setRendererLeftYAxis(YAxisRenderer rendererLeftYAxis) { mAxisRendererLeft = rendererLeftYAxis; @@ -1587,8 +1431,6 @@ public YAxisRenderer getRendererRightYAxis() { /** * Sets a custom axis renderer for the right acis and overwrites the existing one. - * - * @param rendererRightYAxis */ public void setRendererRightYAxis(YAxisRenderer rendererRightYAxis) { mAxisRendererRight = rendererRightYAxis; @@ -1606,8 +1448,6 @@ public float getYChartMin() { /** * Returns true if either the left or the right or both axes are inverted. - * - * @return */ public boolean isAnyAxisInverted() { if (mAxisLeft.isInverted()) @@ -1629,7 +1469,6 @@ public void setAutoScaleMinMaxEnabled(boolean enabled) { /** * @return true if auto scaling on the y axis is enabled. - * @default false */ public boolean isAutoScaleMinMaxEnabled() { return mAutoScaleMinMaxEnabled; @@ -1690,8 +1529,6 @@ protected void onSizeChanged(int w, int h, int oldw, int oldh) { /** * Sets the text color to use for the labels. Make sure to use * getResources().getColor(...) when using a color from the resources. - * - * @param color */ public void setTextColor(int color) { mAxisRendererLeft.setTextColor(color); diff --git a/MPChartLib/src/main/java/com/github/mikephil/charting/charts/PieRadarChartBase.java b/MPChartLib/src/main/java/com/github/mikephil/charting/charts/PieRadarChartBase.java index aa154c798d..6e878c6518 100644 --- a/MPChartLib/src/main/java/com/github/mikephil/charting/charts/PieRadarChartBase.java +++ b/MPChartLib/src/main/java/com/github/mikephil/charting/charts/PieRadarChartBase.java @@ -11,7 +11,6 @@ import android.util.Log; import android.view.MotionEvent; -import com.github.mikephil.charting.animation.Easing; import com.github.mikephil.charting.animation.Easing.EasingFunction; import com.github.mikephil.charting.components.Legend; import com.github.mikephil.charting.components.XAxis; @@ -253,10 +252,6 @@ public void calculateOffsets() { * returns the angle relative to the chart center for the given point on the * chart in degrees. The angle is always between 0 and 360°, 0° is NORTH, * 90° is EAST, ... - * - * @param x - * @param y - * @return */ public float getAngleForPoint(float x, float y) { @@ -287,11 +282,7 @@ public float getAngleForPoint(float x, float y) { * Returns a recyclable MPPointF instance. * Calculates the position around a center point, depending on the distance * from the center, and the angle of the position around the center. - * - * @param center - * @param dist * @param angle in degrees, converted to radians internally - * @return */ public MPPointF getPosition(MPPointF center, float dist, float angle) { @@ -306,12 +297,7 @@ public void getPosition(MPPointF center, float dist, float angle, MPPointF outpu } /** - * Returns the distance of a certain point on the chart to the center of the - * chart. - * - * @param x - * @param y - * @return + * Returns the distance of a certain point on the chart to the center of the chart. */ public float distanceToCenter(float x, float y) { @@ -345,17 +331,12 @@ public float distanceToCenter(float x, float y) { /** * Returns the xIndex for the given angle around the center of the chart. * Returns -1 if not found / outofbounds. - * - * @param angle - * @return */ public abstract int getIndexForAngle(float angle); /** * Set an offset for the rotation of the RadarChart in degrees. Default 270f * --> top (NORTH) - * - * @param angle */ public void setRotationAngle(float angle) { mRawRotationAngle = angle; @@ -367,8 +348,6 @@ public void setRotationAngle(float angle) { * returned value could be any value, negative or positive, outside of the * 360 degrees. this is used when working with rotation direction, mainly by * gestures and animations. - * - * @return */ public float getRawRotationAngle() { return mRawRotationAngle; @@ -377,8 +356,6 @@ public float getRawRotationAngle() { /** * gets a normalized version of the current rotation angle of the pie chart, * which will always be between 0.0 < 360.0 - * - * @return */ public float getRotationAngle() { return mRotationAngle; @@ -387,8 +364,6 @@ public float getRotationAngle() { /** * Set this to true to enable the rotation / spinning of the chart by touch. * Set it to false to disable it. Default: true - * - * @param enabled */ public void setRotationEnabled(boolean enabled) { mRotateEnabled = enabled; @@ -396,8 +371,6 @@ public void setRotationEnabled(boolean enabled) { /** * Returns true if rotation of the chart by touch is enabled, false if not. - * - * @return */ public boolean isRotationEnabled() { return mRotateEnabled; @@ -419,8 +392,6 @@ public void setMinOffset(float minOffset) { /** * returns the diameter of the pie- or radar-chart - * - * @return */ public float getDiameter() { RectF content = mViewPortHandler.getContentRect(); @@ -433,23 +404,17 @@ public float getDiameter() { /** * Returns the radius of the chart in pixels. - * - * @return */ public abstract float getRadius(); /** * Returns the required offset for the chart legend. - * - * @return */ protected abstract float getRequiredLegendOffset(); /** * Returns the base offset needed for the chart without calculating the * legend size. - * - * @return */ protected abstract float getRequiredBaseOffset(); @@ -465,17 +430,8 @@ public float getYChartMin() { return 0; } - /** - * ################ ################ ################ ################ - */ - /** CODE BELOW THIS RELATED TO ANIMATION */ - /** * Applys a spin animation to the Chart. - * - * @param durationmillis - * @param fromangle - * @param toangle */ @SuppressLint("NewApi") public void spin(int durationmillis, float fromangle, float toangle, EasingFunction easing) { diff --git a/MPChartLib/src/main/java/com/github/mikephil/charting/components/XAxis.java b/MPChartLib/src/main/java/com/github/mikephil/charting/components/XAxis.java index 42ec5a8792..614257295a 100644 --- a/MPChartLib/src/main/java/com/github/mikephil/charting/components/XAxis.java +++ b/MPChartLib/src/main/java/com/github/mikephil/charting/components/XAxis.java @@ -62,8 +62,6 @@ public XAxisPosition getPosition() { /** * sets the position of the x-labels - * - * @param pos */ public void setPosition(XAxisPosition pos) { mPosition = pos; @@ -88,8 +86,6 @@ public void setLabelRotationAngle(float angle) { /** * if set to true, the chart will avoid that the first and last label entry * in the chart "clip" off the edge of the chart or the screen - * - * @param enabled */ public void setAvoidFirstLastClipping(boolean enabled) { mAvoidFirstLastClipping = enabled; @@ -97,8 +93,6 @@ public void setAvoidFirstLastClipping(boolean enabled) { /** * returns true if avoid-first-lastclipping is enabled, false if not - * - * @return */ public boolean isAvoidFirstLastClippingEnabled() { return mAvoidFirstLastClipping; diff --git a/MPChartLib/src/main/java/com/github/mikephil/charting/data/BarDataSet.java b/MPChartLib/src/main/java/com/github/mikephil/charting/data/BarDataSet.java index a4780cdfb9..b8df00e865 100644 --- a/MPChartLib/src/main/java/com/github/mikephil/charting/data/BarDataSet.java +++ b/MPChartLib/src/main/java/com/github/mikephil/charting/data/BarDataSet.java @@ -54,7 +54,7 @@ public BarDataSet(List yVals, String label) { @Override public DataSet copy() { - List entries = new ArrayList(); + List entries = new ArrayList<>(); for (int i = 0; i < mEntries.size(); i++) { entries.add(mEntries.get(i).copy()); } diff --git a/MPChartLib/src/main/java/com/github/mikephil/charting/data/ChartData.java b/MPChartLib/src/main/java/com/github/mikephil/charting/data/ChartData.java index fa6dc27573..0f5470cc79 100644 --- a/MPChartLib/src/main/java/com/github/mikephil/charting/data/ChartData.java +++ b/MPChartLib/src/main/java/com/github/mikephil/charting/data/ChartData.java @@ -19,6 +19,7 @@ * * @author Philipp Jahoda */ +@SuppressWarnings("unused") public abstract class ChartData> implements Serializable { /** @@ -59,13 +60,11 @@ public abstract class ChartData> implements * Default constructor. */ public ChartData() { - mDataSets = new ArrayList(); + mDataSets = new ArrayList<>(); } /** * Constructor taking single or multiple DataSet objects. - * - * @param dataSets */ public ChartData(T... dataSets) { mDataSets = arrayToList(dataSets); @@ -74,9 +73,6 @@ public ChartData(T... dataSets) { /** * Created because Arrays.asList(...) does not support modification. - * - * @param array - * @return */ private List arrayToList(T[] array) { @@ -186,12 +182,8 @@ protected void calcMinMax() { } } - /** ONLY GETTERS AND SETTERS BELOW THIS */ - /** * returns the number of LineDataSets this object contains - * - * @return */ public int getDataSetCount() { if (mDataSets == null) @@ -201,8 +193,6 @@ public int getDataSetCount() { /** * Returns the smallest y-value the data object contains. - * - * @return */ public float getYMin() { return mYMin; @@ -210,9 +200,6 @@ public float getYMin() { /** * Returns the minimum y-value for the specified axis. - * - * @param axis - * @return */ public float getYMin(AxisDependency axis) { if (axis == AxisDependency.LEFT) { @@ -231,8 +218,6 @@ public float getYMin(AxisDependency axis) { /** * Returns the greatest y-value the data object contains. - * - * @return */ public float getYMax() { return mYMax; @@ -240,9 +225,6 @@ public float getYMax() { /** * Returns the maximum y-value for the specified axis. - * - * @param axis - * @return */ public float getYMax(AxisDependency axis) { if (axis == AxisDependency.LEFT) { @@ -261,8 +243,6 @@ public float getYMax(AxisDependency axis) { /** * Returns the minimum x-value this data object contains. - * - * @return */ public float getXMin() { return mXMin; @@ -270,8 +250,6 @@ public float getXMin() { /** * Returns the maximum x-value this data object contains. - * - * @return */ public float getXMax() { return mXMax; @@ -279,8 +257,6 @@ public float getXMax() { /** * Returns all DataSet objects this ChartData object holds. - * - * @return */ public List getDataSets() { return mDataSets; @@ -293,9 +269,7 @@ public List getDataSets() { * situations. * * @param dataSets the DataSet array to search - * @param label * @param ignorecase if true, the search is not case-sensitive - * @return */ protected int getDataSetIndexByLabel(List dataSets, String label, boolean ignorecase) { @@ -315,8 +289,6 @@ protected int getDataSetIndexByLabel(List dataSets, String label, /** * Returns the labels of all DataSets as a string array. - * - * @return */ public String[] getDataSetLabels() { @@ -331,8 +303,6 @@ public String[] getDataSetLabels() { /** * Get the Entry for a corresponding highlight object - * - * @param highlight * @return the entry that is highlighted */ public Entry getEntryForHighlight(Highlight highlight) { @@ -347,10 +317,6 @@ public Entry getEntryForHighlight(Highlight highlight) { * Returns the DataSet object with the given label. Search can be case * sensitive or not. IMPORTANT: This method does calculations at runtime. * Use with care in performance critical situations. - * - * @param label - * @param ignorecase - * @return */ public T getDataSetByLabel(String label, boolean ignorecase) { @@ -372,8 +338,6 @@ public T getDataSetByIndex(int index) { /** * Adds a DataSet dynamically. - * - * @param d */ public void addDataSet(T d) { @@ -389,8 +353,6 @@ public void addDataSet(T d) { * Removes the given DataSet from this data object. Also recalculates all * minimum and maximum values. Returns true if a DataSet was removed, false * if no DataSet could be removed. - * - * @param d */ public boolean removeDataSet(T d) { @@ -411,8 +373,6 @@ public boolean removeDataSet(T d) { * Removes the DataSet at the given index in the DataSet array from the data * object. Also recalculates all minimum and maximum values. Returns true if * a DataSet was removed, false if no DataSet could be removed. - * - * @param index */ public boolean removeDataSet(int index) { @@ -426,9 +386,6 @@ public boolean removeDataSet(int index) { /** * Adds an Entry to the DataSet at the specified index. * Entries are added to the end of the list. - * - * @param e - * @param dataSetIndex */ public void addEntry(Entry e, int dataSetIndex) { @@ -448,9 +405,6 @@ public void addEntry(Entry e, int dataSetIndex) { /** * Adjusts the current minimum and maximum values based on the provided Entry object. - * - * @param e - * @param axis */ protected void calcMinMax(Entry e, AxisDependency axis) { @@ -480,8 +434,6 @@ protected void calcMinMax(Entry e, AxisDependency axis) { /** * Adjusts the minimum and maximum values based on the given DataSet. - * - * @param d */ protected void calcMinMax(T d) { @@ -511,9 +463,6 @@ protected void calcMinMax(T d) { /** * Removes the given Entry object from the DataSet at the specified index. - * - * @param e - * @param dataSetIndex */ public boolean removeEntry(Entry e, int dataSetIndex) { @@ -540,10 +489,6 @@ public boolean removeEntry(Entry e, int dataSetIndex) { * Removes the Entry object closest to the given DataSet at the * specified index. Returns true if an Entry was removed, false if no Entry * was found that meets the specified requirements. - * - * @param xValue - * @param dataSetIndex - * @return */ public boolean removeEntry(float xValue, int dataSetIndex) { @@ -562,9 +507,6 @@ public boolean removeEntry(float xValue, int dataSetIndex) { /** * Returns the DataSet that contains the provided Entry, or null, if no * DataSet contains this Entry. - * - * @param e - * @return */ public T getDataSetForEntry(Entry e) { @@ -587,8 +529,6 @@ public T getDataSetForEntry(Entry e) { /** * Returns all colors used across all DataSet objects this object * represents. - * - * @return */ public int[] getColors() { @@ -619,9 +559,6 @@ public int[] getColors() { /** * Returns the index of the provided DataSet in the DataSet array of this data object, or -1 if it does not exist. - * - * @param dataSet - * @return */ public int getIndexOfDataSet(T dataSet) { return mDataSets.indexOf(dataSet); @@ -630,8 +567,6 @@ public int getIndexOfDataSet(T dataSet) { /** * Returns the first DataSet from the datasets-array that has it's dependency on the left axis. * Returns null if no DataSet with left dependency could be found. - * - * @return */ protected T getFirstLeft(List sets) { for (T dataSet : sets) { @@ -644,8 +579,6 @@ protected T getFirstLeft(List sets) { /** * Returns the first DataSet from the datasets-array that has it's dependency on the right axis. * Returns null if no DataSet with right dependency could be found. - * - * @return */ public T getFirstRight(List sets) { for (T dataSet : sets) { @@ -657,15 +590,13 @@ public T getFirstRight(List sets) { /** * Sets a custom IValueFormatter for all DataSets this data object contains. - * - * @param f */ - public void setValueFormatter(IValueFormatter f) { - if (f == null) + public void setValueFormatter(IValueFormatter valueFormatter) { + if (valueFormatter == null) return; else { for (IDataSet set : mDataSets) { - set.setValueFormatter(f); + set.setValueFormatter(valueFormatter); } } } @@ -673,8 +604,6 @@ public void setValueFormatter(IValueFormatter f) { /** * Sets the color of the value-text (color in which the value-labels are * drawn) for all DataSets this data object contains. - * - * @param color */ public void setValueTextColor(int color) { for (IDataSet set : mDataSets) { @@ -685,8 +614,6 @@ public void setValueTextColor(int color) { /** * Sets the same list of value-colors for all DataSets this * data object contains. - * - * @param colors */ public void setValueTextColors(List colors) { for (IDataSet set : mDataSets) { @@ -697,8 +624,6 @@ public void setValueTextColors(List colors) { /** * Sets the Typeface for all value-labels for all DataSets this data object * contains. - * - * @param tf */ public void setValueTypeface(Typeface tf) { for (IDataSet set : mDataSets) { @@ -709,8 +634,6 @@ public void setValueTypeface(Typeface tf) { /** * Sets the size (in dp) of the value-text for all DataSets this data object * contains. - * - * @param size */ public void setValueTextSize(float size) { for (IDataSet set : mDataSets) { @@ -721,8 +644,6 @@ public void setValueTextSize(float size) { /** * Enables / disables drawing values (value-text) for all DataSets this data * object contains. - * - * @param enabled */ public void setDrawValues(boolean enabled) { for (IDataSet set : mDataSets) { @@ -744,8 +665,6 @@ public void setHighlightEnabled(boolean enabled) { /** * Returns true if highlighting of all underlying values is enabled, false * if not. - * - * @return */ public boolean isHighlightEnabled() { for (IDataSet set : mDataSets) { @@ -769,9 +688,6 @@ public void clearValues() { /** * Checks if this data object contains the specified DataSet. Returns true * if so, false if not. - * - * @param dataSet - * @return */ public boolean contains(T dataSet) { @@ -785,8 +701,6 @@ public boolean contains(T dataSet) { /** * Returns the total entry count across all DataSet objects this data object contains. - * - * @return */ public int getEntryCount() { @@ -801,8 +715,6 @@ public int getEntryCount() { /** * Returns the DataSet object with the maximum number of entries or null if there are no DataSets. - * - * @return */ public T getMaxEntryCountSet() { diff --git a/MPChartLib/src/main/java/com/github/mikephil/charting/data/CombinedData.java b/MPChartLib/src/main/java/com/github/mikephil/charting/data/CombinedData.java index 26c87229df..de31839d3e 100644 --- a/MPChartLib/src/main/java/com/github/mikephil/charting/data/CombinedData.java +++ b/MPChartLib/src/main/java/com/github/mikephil/charting/data/CombinedData.java @@ -140,7 +140,7 @@ public CandleData getCandleData() { */ public List getAllData() { - List data = new ArrayList(); + List data = new ArrayList<>(); if (mLineData != null) data.add(mLineData); if (mBarData != null) diff --git a/MPChartLib/src/main/java/com/github/mikephil/charting/data/LineDataSet.java b/MPChartLib/src/main/java/com/github/mikephil/charting/data/LineDataSet.java index ab5b5191da..96751c2301 100644 --- a/MPChartLib/src/main/java/com/github/mikephil/charting/data/LineDataSet.java +++ b/MPChartLib/src/main/java/com/github/mikephil/charting/data/LineDataSet.java @@ -72,7 +72,7 @@ public LineDataSet(List yVals, String label) { // mLineWidth = Utils.convertDpToPixel(1f); if (mCircleColors == null) { - mCircleColors = new ArrayList(); + mCircleColors = new ArrayList<>(); } mCircleColors.clear(); @@ -84,7 +84,7 @@ public LineDataSet(List yVals, String label) { @Override public DataSet copy() { - List entries = new ArrayList(); + List entries = new ArrayList<>(); for (int i = 0; i < mEntries.size(); i++) { entries.add(mEntries.get(i).copy()); } @@ -109,8 +109,6 @@ protected void copy(LineDataSet lineDataSet) { /** * Returns the drawing mode for this line dataset - * - * @return */ @Override public LineDataSet.Mode getMode() { @@ -119,8 +117,6 @@ public LineDataSet.Mode getMode() { /** * Returns the drawing mode for this LineDataSet - * - * @return */ public void setMode(LineDataSet.Mode mode) { mMode = mode; @@ -129,8 +125,6 @@ public void setMode(LineDataSet.Mode mode) { /** * Sets the intensity for cubic lines (if enabled). Max = 1f = very cubic, * Min = 0.05f = low cubic effect, Default: 0.2f - * - * @param intensity */ public void setCubicIntensity(float intensity) { @@ -151,8 +145,6 @@ public float getCubicIntensity() { /** * Sets the radius of the drawn circles. * Default radius = 4f, Min = 1f - * - * @param radius */ public void setCircleRadius(float radius) { @@ -171,8 +163,6 @@ public float getCircleRadius() { /** * Sets the hole radius of the drawn circles. * Default radius = 2f, Min = 0.5f - * - * @param holeRadius */ public void setCircleHoleRadius(float holeRadius) { @@ -193,8 +183,6 @@ public float getCircleHoleRadius() { * default size = 4f *

* This method is deprecated because of unclarity. Use setCircleRadius instead. - * - * @param size */ @Deprecated public void setCircleSize(float size) { @@ -244,8 +232,6 @@ public DashPathEffect getDashPathEffect() { /** * set this to true to enable the drawing of circle indicators for this * DataSet, default true - * - * @param enabled */ public void setDrawCircles(boolean enabled) { this.mDrawCircles = enabled; @@ -268,12 +254,8 @@ public boolean isDrawSteppedEnabled() { return mMode == Mode.STEPPED; } - /** ALL CODE BELOW RELATED TO CIRCLE-COLORS */ - /** * returns all colors specified for the circles - * - * @return */ public List getCircleColors() { return mCircleColors; @@ -295,8 +277,6 @@ public int getCircleColorCount() { * is higher than the size of the colors array. Make sure that the colors * are already prepared (by calling getResources().getColor(...)) before * adding them to the DataSet. - * - * @param colors */ public void setCircleColors(List colors) { mCircleColors = colors; @@ -308,8 +288,6 @@ public void setCircleColors(List colors) { * is higher than the size of the colors array. Make sure that the colors * are already prepared (by calling getResources().getColor(...)) before * adding them to the DataSet. - * - * @param colors */ public void setCircleColors(int... colors) { this.mCircleColors = ColorTemplate.createColors(colors); @@ -322,8 +300,6 @@ public void setCircleColors(int... colors) { * "new String[] { R.color.red, R.color.green, ... }" to provide colors for * this method. Internally, the colors are resolved using * getResources().getColor(...) - * - * @param colors */ public void setCircleColors(int[] colors, Context c) { @@ -343,8 +319,6 @@ public void setCircleColors(int[] colors, Context c) { /** * Sets the one and ONLY color that should be used for this DataSet. * Internally, this recreates the colors array and adds the specified color. - * - * @param color */ public void setCircleColor(int color) { resetCircleColors(); @@ -356,15 +330,13 @@ public void setCircleColor(int color) { */ public void resetCircleColors() { if (mCircleColors == null) { - mCircleColors = new ArrayList(); + mCircleColors = new ArrayList<>(); } mCircleColors.clear(); } /** * Sets the color of the inner circle of the line-circles. - * - * @param color */ public void setCircleHoleColor(int color) { mCircleHoleColor = color; @@ -377,8 +349,6 @@ public int getCircleHoleColor() { /** * Set this to true to allow drawing a hole in each data circle. - * - * @param enabled */ public void setDrawCircleHole(boolean enabled) { mDrawCircleHole = enabled; @@ -392,8 +362,6 @@ public boolean isDrawCircleHoleEnabled() { /** * Sets a custom IFillFormatter to the chart that handles the position of the * filled-line for each DataSet. Set this to null to use the default logic. - * - * @param formatter */ public void setFillFormatter(IFillFormatter formatter) { diff --git a/MPChartLib/src/main/java/com/github/mikephil/charting/data/LineScatterCandleRadarDataSet.java b/MPChartLib/src/main/java/com/github/mikephil/charting/data/LineScatterCandleRadarDataSet.java index 151294630d..2b83cde2d0 100644 --- a/MPChartLib/src/main/java/com/github/mikephil/charting/data/LineScatterCandleRadarDataSet.java +++ b/MPChartLib/src/main/java/com/github/mikephil/charting/data/LineScatterCandleRadarDataSet.java @@ -29,7 +29,6 @@ public LineScatterCandleRadarDataSet(List yVals, String label) { /** * Enables / disables the horizontal highlight-indicator. If disabled, the indicator is not drawn. - * @param enabled */ public void setDrawHorizontalHighlightIndicator(boolean enabled) { this.mDrawHorizontalHighlightIndicator = enabled; @@ -37,7 +36,6 @@ public void setDrawHorizontalHighlightIndicator(boolean enabled) { /** * Enables / disables the vertical highlight-indicator. If disabled, the indicator is not drawn. - * @param enabled */ public void setDrawVerticalHighlightIndicator(boolean enabled) { this.mDrawVerticalHighlightIndicator = enabled; @@ -45,7 +43,6 @@ public void setDrawVerticalHighlightIndicator(boolean enabled) { /** * Enables / disables both vertical and horizontal highlight-indicators. - * @param enabled */ public void setDrawHighlightIndicators(boolean enabled) { setDrawVerticalHighlightIndicator(enabled); @@ -64,7 +61,6 @@ public boolean isHorizontalHighlightIndicatorEnabled() { /** * Sets the width of the highlight line in dp. - * @param width */ public void setHighlightLineWidth(float width) { mHighlightLineWidth = Utils.convertDpToPixel(width); @@ -98,8 +94,6 @@ public void disableDashedHighlightLine() { /** * Returns true if the dashed-line effect is enabled for highlight lines, false if not. * Default: disabled - * - * @return */ public boolean isDashedHighlightLineEnabled() { return mHighlightDashPathEffect == null ? false : true; diff --git a/MPChartLib/src/main/java/com/github/mikephil/charting/data/PieDataSet.java b/MPChartLib/src/main/java/com/github/mikephil/charting/data/PieDataSet.java index 0497985a0c..b9851c9682 100644 --- a/MPChartLib/src/main/java/com/github/mikephil/charting/data/PieDataSet.java +++ b/MPChartLib/src/main/java/com/github/mikephil/charting/data/PieDataSet.java @@ -65,8 +65,6 @@ protected void calcMinMax(PieEntry e) { /** * Sets the space that is left out between the piechart-slices in dp. * Default: 0 --> no space, maximum 20f - * - * @param spaceDp */ public void setSliceSpace(float spaceDp) { @@ -86,8 +84,6 @@ public float getSliceSpace() { /** * When enabled, slice spacing will be 0.0 when the smallest value is going to be * smaller than the slice spacing itself. - * - * @param autoDisable */ public void setAutomaticallyDisableSliceSpacing(boolean autoDisable) { mAutomaticallyDisableSliceSpacing = autoDisable; @@ -96,8 +92,6 @@ public void setAutomaticallyDisableSliceSpacing(boolean autoDisable) { /** * When enabled, slice spacing will be 0.0 when the smallest value is going to be * smaller than the slice spacing itself. - * - * @return */ @Override public boolean isAutomaticallyDisableSliceSpacingEnabled() { @@ -107,8 +101,6 @@ public boolean isAutomaticallyDisableSliceSpacingEnabled() { /** * sets the distance the highlighted piechart-slice of this DataSet is * "shifted" away from the center of the chart, default 12f - * - * @param shift */ public void setSelectionShift(float shift) { mShift = Utils.convertDpToPixel(shift); @@ -149,8 +141,6 @@ public boolean isUsingSliceColorAsValueLineColor() { /** * This method is deprecated. * Use setUseValueColorForLine(...) instead. - * - * @param enabled */ @Deprecated public void setUsingSliceColorAsValueLineColor(boolean enabled) { diff --git a/MPChartLib/src/main/java/com/github/mikephil/charting/highlight/ChartHighlighter.java b/MPChartLib/src/main/java/com/github/mikephil/charting/highlight/ChartHighlighter.java index b95cf5ad30..cc1aa5624d 100644 --- a/MPChartLib/src/main/java/com/github/mikephil/charting/highlight/ChartHighlighter.java +++ b/MPChartLib/src/main/java/com/github/mikephil/charting/highlight/ChartHighlighter.java @@ -49,8 +49,7 @@ public Highlight getHighlight(float x, float y) { protected MPPointD getValsForTouch(float x, float y) { // take any transformer to determine the x-axis value - MPPointD pos = mChart.getTransformer(YAxis.AxisDependency.LEFT).getValuesByTouchPoint(x, y); - return pos; + return mChart.getTransformer(YAxis.AxisDependency.LEFT).getValuesByTouchPoint(x, y); } /** @@ -69,9 +68,7 @@ protected Highlight getHighlightForX(float xVal, float x, float y) { YAxis.AxisDependency axis = leftAxisMinDist < rightAxisMinDist ? YAxis.AxisDependency.LEFT : YAxis.AxisDependency.RIGHT; - Highlight detail = getClosestHighlightByPixel(closestValues, x, y, axis, mChart.getMaxHighlightDistance()); - - return detail; + return getClosestHighlightByPixel(closestValues, x, y, axis, mChart.getMaxHighlightDistance()); } /** diff --git a/MPChartLib/src/main/java/com/github/mikephil/charting/interfaces/datasets/ILineRadarDataSet.java b/MPChartLib/src/main/java/com/github/mikephil/charting/interfaces/datasets/ILineRadarDataSet.java index ce89822716..8ac63e1db2 100644 --- a/MPChartLib/src/main/java/com/github/mikephil/charting/interfaces/datasets/ILineRadarDataSet.java +++ b/MPChartLib/src/main/java/com/github/mikephil/charting/interfaces/datasets/ILineRadarDataSet.java @@ -11,37 +11,27 @@ public interface ILineRadarDataSet extends ILineScatterCandleRa /** * Returns the color that is used for filling the line surface area. - * - * @return */ int getFillColor(); /** * Returns the drawable used for filling the area below the line. - * - * @return */ Drawable getFillDrawable(); /** * Returns the alpha value that is used for filling the line surface, * default: 85 - * - * @return */ int getFillAlpha(); /** * Returns the stroke-width of the drawn line - * - * @return */ float getLineWidth(); /** * Returns true if filled drawing is enabled, false if not - * - * @return */ boolean isDrawFilledEnabled(); @@ -51,8 +41,6 @@ public interface ILineRadarDataSet extends ILineScatterCandleRa * uses the canvas.clipPath(...) method for drawing the filled area. * For devices with API level < 18 (Android 4.3), hardware acceleration of the chart should * be turned off. Default: false - * - * @param enabled */ void setDrawFilled(boolean enabled); }