Giter Club home page Giter Club logo

Comments (6)

pres avatar pres commented on June 16, 2024 1

I see the same problem.

I fixed it by adding:

if graphView.rangeMin == graphView.rangeMax {
   graphView.rangeMin -= 1
   graphView.rangeMax += 1
}

from scrollablegraphview.

GZaccaroni avatar GZaccaroni commented on June 16, 2024

This happens when i try to put 0 as rangeMin and 10 as rangeMax

from scrollablegraphview.

philackm avatar philackm commented on June 16, 2024

Ah, damn. This bug was fixed in the pre Swift 3 version. It appears it has been resurrected during the conversion to Swift 3.

from scrollablegraphview.

philackm avatar philackm commented on June 16, 2024

Would you mind posting the code where you configure the graph view? I can't seem to reproduce it here.

from scrollablegraphview.

richard-giantrobot avatar richard-giantrobot commented on June 16, 2024

I also saw this Issue happen.

It occurs in my instance when both the ScrollableGraphView rangeMin and rangeMax are 0 while the values in the data are all 0.

It appears to fail on line 867 of ScrollableGraphView.swift

The firstDataPoint.location CGPoint is (in our case) CGPoint(x=50, y= Nan)

Part of the trace:

  - 4 : "4   UIKit                               0x0000000106312a46 -[UIBezierPath moveToPoint:] + 27"
  - 5 : "5   ScrollableGraphView                 0x0000000105f99fee _TFC19ScrollableGraphView19ScrollableGraphViewP33_A84E5AB310C496224F4DCD0689E421B214createLinePathfT_CSo12UIBezierPath + 1598"
  - 6 : "6   ScrollableGraphView                 0x0000000105f9abfb _TFC19ScrollableGraphView19ScrollableGraphViewP33_A84E5AB310C496224F4DCD0689E421B211updatePathsfT_T_ + 27"
  - 7 : "7   ScrollableGraphView                 0x0000000105f9a9ef _TFC19ScrollableGraphView19ScrollableGraphViewP33_A84E5AB310C496224F4DCD0689E421B221activePointsDidChangefT_T_ + 47"
  - 8 : "8   ScrollableGraphView                 0x0000000105f8ef1a _TFC19ScrollableGraphView19ScrollableGraphViewWP33_A84E5AB310C496224F4DCD0689E421B220activePointsIntervalGVs14CountableRangeSi_ + 202"
  - 9 : "9   ScrollableGraphView                 0x0000000105f8ef97 _TFC19ScrollableGraphView19ScrollableGraphViewsP33_A84E5AB310C496224F4DCD0689E421B220activePointsIntervalGVs14CountableRangeSi_ + 71"
  - 10 : "10  ScrollableGraphView                 0x0000000105f925ab _TFC19ScrollableGraphView19ScrollableGraphViewP33_A84E5AB310C496224F4DCD0689E421B25setupfT_T_ + 4075"
  - 11 : "11  ScrollableGraphView                 0x0000000105f966b9 _TFC19ScrollableGraphView19ScrollableGraphViewP33_A84E5AB310C496224F4DCD0689E421B28updateUIfT_T_ + 137"
  - 12 : "12  ScrollableGraphView                 0x0000000105f97527 

Some code to recreate it:

        var test: [Double] = [0,0,0,0,0,0,0]
        
        graphView.rangeMax = 0
        graphView.set(data: test, withLabels:[**"MON",**"TUES",**"WED",**"THUR",**"FRI",**"SAT",**"SUN"])

I worked around it by making sure that both the min and max ranges can't be 0 at the same time.

Hope this helps :)

from scrollablegraphview.

Chris-Perkins avatar Chris-Perkins commented on June 16, 2024

I ran into this issue as well and the above fix did not fix my issue. My issue was caused by having the ScrollableGraphView's .frame be equal to .zero (I'm working with autolayout constraints, so the frame was not yet set at the time of graphing).

I fixed my issue by calling self.layoutIfNeeded() to adjust the graphView's frame.

from scrollablegraphview.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.