Comments (6)
I see the same problem.
I fixed it by adding:
if graphView.rangeMin == graphView.rangeMax {
graphView.rangeMin -= 1
graphView.rangeMax += 1
}
from scrollablegraphview.
This happens when i try to put 0 as rangeMin and 10 as rangeMax
from scrollablegraphview.
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.
Would you mind posting the code where you configure the graph view? I can't seem to reproduce it here.
from scrollablegraphview.
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.
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)
- Bar Chart with individual columns having varying widths?
- unable to set dot on multiple graph HOT 1
- app crashes on func. - setPlotPointPositions(forNewlyActivatedPoints activatedPoints: [Int], withData data: [Double]) when i scroll the graph HOT 4
- Maximum Number of Points on screen
- DotPlot are not clickable HOT 3
- Ease out animation bug
- y-axis dynamic value instead of original value.
- Carthage Compile error
- How to Create a Stacked Bar Chart? HOT 1
- App crashed every time a value is added HOT 3
- App crash on startup
- As I change the min and max the reference lines text doesn't change HOT 1
- Error installing ScrollableGraphView from Cocopod
- pointIndex - current day
- Is there a way to stop the graph trailing to 0 at the beginning and end of a plot? HOT 2
- Crashing if all the values for Y axis are 0
- put a number related to each bar index
- change the color of each column
- Bar Chart customisations
- Points HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from scrollablegraphview.