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 — Take care of edge cases when calculating intervals (labelCount == 0) · FlyingAndroid/MPAndroidChart@6c17ca4

File tree

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

‎MPChartLib/src/main/java/com/github/mikephil/charting/renderer/AxisRenderer.java‎

Copy file name to clipboardExpand all lines: MPChartLib/src/main/java/com/github/mikephil/charting/renderer/AxisRenderer.java
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,10 @@ protected void computeAxisValues(float min, float max) {
162162

163163
// Find out how much spacing (in y value space) between axis values
164164
double rawInterval = range / labelCount;
165+
if (Double.isInfinite(rawInterval))
166+
{
167+
rawInterval = range > 0.0 ? range : 1.0;
168+
}
165169
double interval = Utils.roundToNextSignificant(rawInterval);
166170

167171
// If granularity is enabled, then do not allow the interval to go below specified granularity.
Collapse file

‎MPChartLib/src/main/java/com/github/mikephil/charting/renderer/YAxisRendererRadarChart.java‎

Copy file name to clipboardExpand all lines: MPChartLib/src/main/java/com/github/mikephil/charting/renderer/YAxisRendererRadarChart.java
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ protected void computeAxisValues(float min, float max) {
4040

4141
// Find out how much spacing (in y value space) between axis values
4242
double rawInterval = range / labelCount;
43+
if (Double.isInfinite(rawInterval))
44+
{
45+
rawInterval = range > 0.0 ? range : 1.0;
46+
}
4347
double interval = Utils.roundToNextSignificant(rawInterval);
4448

4549
// If granularity is enabled, then do not allow the interval to go below specified granularity.

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.