Skip to content

fix for the NaN exception on GKLineGraph #28

Open
@Venkata-Maniteja

Description

@Venkata-Maniteja

In the _positionYForLineValue method, the denominator ([self _maxValue] - [self _minValue]) may have 0 value. In this case, exception arise for NaN.

The fix should be:

int diff = ([self _maxValue] - [self _minValue]);
  CGFloat scale;
  if (diff > 0) {
    scale = (value - [self _minValue]) / diff;
  }else{
      scale = 0;
  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions