-
Notifications
You must be signed in to change notification settings - Fork 382
Pan/Zoom and Variable X Axis; many other changes #300
base: feature
Are you sure you want to change the base?
Conversation
Add averageValue delegate method to allow BEMLineGraph to be separate from BEMCalculator Restore modifyPopUpView delegate method Use caption preferredFont instead of SystemFont fro NoData Handle overlapping labels better Reuse code for popup and permanent labels Bug fixes ensure chart doesn't grow views when zero or one data points
Add coding to AverageLine Move gradient properties to strong to properly retain Fix compiler error about integers used in enums Change alwaysDisplayPopupatIndex to use NSUInteger for index instead of float Fix Frame warning in SimpleLineChart's launch Screen
Fix many bugs and buglets
AverageLine: •Color should be picked up from line if not set (default nil) Typo in encoding macro Line: If null data and interpolation on, then extrapolate for beginning/ending nulls. Bezier curve should be used even when only two points. If interpolation off, then bezier line should be interrupted by gaps (but not top/bottom). Avoid infinity result in midPoint calculation SimpleLineGraphView: Support restoration during startup. NoDataLabel color should not default from Line (which defaults to white, same as background) If null value, ensure corresponding Dot isn't left on chart If label isn't used after initially being created, ensure it's removed from view If neither X nor Y reference lines, set line's enableRefLines to NO (although default, might have been previously YES If Xaxis background is defaulting to colorBottom, then also use alphaBottom to match; same for Yaxis and colorTop. Avoid possible infinite loop if delegate gives a zero incrementIndex for x axis Fix one-pixel gap between yaxis and graph Remove spurious NSLogs
Line clipsToBounds to avoid drawing outside the box (when extrapolating nulls or user set minValue too High) Top/Bottom reference lines were outside box When Bezier off and Interpolate nulls off, properly draws line segments now Removed VMA NSLog from TestBed/MasterController
refactors bezier/linear processing into one method
(Still has old code to allow comparison)
Using quad for background
Remove verticalReferenceHorizontalFringeNegation stuff Fix background if points aren't on left/right edges Adds new delegates: lineGraph:locationForPointAtIndex: lineGraph:labelOnXAxisForLocation:, numberOfXAxisLabelsOnLineGraph: maxXValueForLineGraph:, minXValueForLineGraph Moves getting data and calculations of points to new getData method Adds new methods to TestBed Adds missing icons to TestBed Moves saving data from restoration to User defaults
Misc bug fixes in variable xAxis, esp minX/maxX Add hints for minX/maxX in testbed Add %nulls slider in testbed Move from NSNotFound to -1 for empty markers in TestBed DetailVC
No vert ref lines when value null (and not interpolated) No Labels when dot is offscreen In testBed, don't report dots when Null value reset minX value when setting variableXaxis in testBed restore font to fontname field
No vert ref lines when value null (and not interpolated) No Labels when dot is offscreen In testBed, don't report dots when Null value reset minX value when setting variableXaxis in testBed restore font to fontname field
No vert ref lines when value null (and not interpolated) No Labels when dot is offscreen In testBed, don't report dots when Null value reset minX value when setting variableXaxis in testBed restore font to fontname field
Double tap to toggle full scale and zoomed Remove touchInput recognizers when disabled
Bug fix: turning scaling off didn't redraw properly Moved zoom management to handleGesture
Separate out two-finger pan from zoom recognizer for smoothness Allow client setting scale/pan numbers (e.g. to sync two graphs) Rename m--DisplayedValue to m--XDisplayedValue
Always display labels above dots Check for all neighbors, not just two Disappear dots outside of frame.
Use Views to group dots and labels over BEMLine. Allows removal of kludgy yAxisOffset and xAxisOffset globals Set size of major views at beginning, so all calcs based on those views Changed all global mutable Arrays to NSArrays Used CGRectGetM... to simplify calculations Fixes: Animation w/o displaying dots during left dots off previously Implemented numberOfXAxisLabelsOnLineGraph for indexed xAxis (in addition to previous location xAxis) Added min 5 points between xAxisLabels Rewrite panZoom logic
Remove all global vars Change all MutableArrays to Arrays Remove ReferenceLine properties, hand directly to masterline instead Rename AxisValues to Locations
Remove quadratic bezier algorithm
Add some missing property restorers?
…for cubic bezier algorithm to work properly After merge of cubic algorithm, found conflict with variable X axis work. Limited control points x-value to following point's x value. Fixed startup problem for restoring scale and zoom The usual random stuff from storyboard
Some reference lines not appearing Sometimes highest xaxis label doesn't appear Nudge y labels onto page Highest y label doesn't appear when averagelabel is off When changing data sources, sometimes minXDisplayed gets out of sync Several properties not properly restored.
Enable signed conversion checking and fix issues Fix test for white/alpha to handle extended Grey space
…2 bit fr Add EOL to some files Fix for bezier edge of closed background (need to simplify) New delegate to reformat yaxis labels don't remove top level views when no data Calc locations after sections laid out Fix for right hand label out of bounds
Move locationForPointAtIndex to datasource Fix minor doc issues. Fixed case where label is partially onscreen, but point is not. Don't allow zooming infinitely small
Simplify handling of zero points Add NumberOfPoints field to TestBed Fix bug when increasing numberofPoints by more than two Add Activity Indicator to testBed to test didFinishDrawing
Supersedes PR #295, which also incorporates the changes mentioned above. I created a separate pull request in case the addition of the pan/zoom and variableX are determined to be inappropriate for this library. Let me know what you think, especially on API additions, and/or if you have any problems with this build, and/or if there's any thing else you want me to implement, while I'm on a roll... |
Thank you so much for your contributions @mackworth! As soon as we get your other PR (#295) merged in, I'll take a look at this one. If you plan on contributing more to the project, please keep on breaking your PRs as much as possible like you did. |
Spacing consistency with rest of project topline fix Move UIButton+switch and UITextField+Numbers from Master to separate files Title of Master "Options" Add Graph button if collapsed
include fixes from other PR
…r on all datapoints (as it was and is the default) or just on currently displayed graph) Change to labelOnXAxisForLocation to report which label on screen this is. Align left-most and right-most labels left and right respecrtively. Bug Fixes: Restore enableReferenceFrame functionality Use font's lineheight instead of pointsize to correctly calculate line height. Move zoomGestures to self rather than labelView to allow panning on XAxis Property remove zoomPanGesture (overlooked before) Avoid duplicate labels when delegate specified numberOfXAxisLabels is greater than actual number of labels Avoid some flickering due to rounding for dots on edge of screen. Avoid problem when switching back to indexed from location based axis In Master, Correctly load int and float defaults even when they are zero In Master, avoid some -1 issues. Some documentation typos
Added a few bug fixes. Also realized an ambiguity about calculations on graphDatapoints when you have pan/zoom. Does it mean calculate with the currently displayed points or all data points? I think both are useful, so I added a switch. |
Double-tap restores zoom, but at double-tap location Better behavior when sliding finger off screen. Fix compiler error for nil font and NSInteger Fix label tests
A couple bug fixes based on field testing of my app. |
Hi @mackworth, is there any way you can split out a separate pull request with only the pan / zoom feature - and nothing else? There are a lot of changes here, and it is very difficult to accurately sift through everything. I do, however, have a few thoughts on what I have seen:
|
Summary
Pan/Zoom and Variable X Axis; many other changes
Fixes Issues
This pull request fixes the following issues:
NSInteger
instead ofNSUInteger
in regards to Swift and Casting #296, Graph not showing values for large data set #286, when my points count is two. enableBezierCurve = YES; Why the main line? #282, Zooming the Graph #278, BEMLine quadCurvedPathWithPoints: results in index 0 beyond bounds for empty array #271, Can't interact with graph with only one data point #269, Strange Bezier Curve Drawing #261touchLineInputColor
(doesn't change after initial setting)averageLine
color picked up from line if not setcolorBottom
, then also usealphaBottom
to match; same for y-axis andcolorTop
.enableRefLines
toNO
(although default, might have been previouslyYES
)BEMNull
related bugs:Changes
The following changes are included in this pull request:
lineGraph:locationForPointAtIndex:
lineGraph:labelOnXAxisForLocation:
numberOfXAxisLabelsOnLineGraph:maxXValueForLineGraph:
minXValueForLineGraph
Notes