GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Fix crash related to circle size (#2115) · FlyingAndroid/MPAndroidChart@5a4a6d4

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • MPChartLib/src/main/java/com/github/mikephil/charting/data
    • LineDataSet.java
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎MPChartLib/src/main/java/com/github/mikephil/charting/data/LineDataSet.java‎

Copy file name to clipboardExpand all lines: MPChartLib/src/main/java/com/github/mikephil/charting/data/LineDataSet.java
+17-6Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import android.content.Context;
55
import android.graphics.Color;
66
import android.graphics.DashPathEffect;
7+
import android.util.Log;
78

89
import com.github.mikephil.charting.formatter.DefaultFillFormatter;
910
import com.github.mikephil.charting.formatter.IFillFormatter;
@@ -146,13 +147,18 @@ public float getCubicIntensity() {
146147

147148

148149
/**
149-
* sets the radius of the drawn circles.
150-
* Default radius = 4f
150+
* Sets the radius of the drawn circles.
151+
* Default radius = 4f, Min = 1f
151152
*
152153
* @param radius
153154
*/
154155
public void setCircleRadius(float radius) {
155-
mCircleRadius = Utils.convertDpToPixel(radius);
156+
157+
if (radius >= 1f) {
158+
mCircleRadius = Utils.convertDpToPixel(radius);
159+
} else {
160+
Log.e("LineDataSet", "Circle radius cannot be < 1");
161+
}
156162
}
157163

158164
@Override
@@ -161,13 +167,18 @@ public float getCircleRadius() {
161167
}
162168

163169
/**
164-
* sets the hole radius of the drawn circles.
165-
* Default radius = 2f
170+
* Sets the hole radius of the drawn circles.
171+
* Default radius = 2f, Min = 0.5f
166172
*
167173
* @param holeRadius
168174
*/
169175
public void setCircleHoleRadius(float holeRadius) {
170-
mCircleHoleRadius = Utils.convertDpToPixel(holeRadius);
176+
177+
if (holeRadius >= 0.5f) {
178+
mCircleHoleRadius = Utils.convertDpToPixel(holeRadius);
179+
} else {
180+
Log.e("LineDataSet", "Circle radius cannot be < 0.5");
181+
}
171182
}
172183

173184
@Override

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.