BEMSimpleLineGraph v4.0 Release Notes

Release Date: 2015-05-01 // about 7 years ago
  • Breaking Changes

    • πŸ”„ Changed the purpose of lineGraphDidFinishLoading:.
      • Added a new lineGraphDidFinishDrawing: delegate method to differentiate between when the graph finishes drawing & animating and when it finishes loading its data.
      • Those who previously used lineGraphDidFinishLoading: to take graph snapshots should now use lineGraphDidFinishDrawing: instead.
      • The new lineGraphDidFinishDrawing: can be used to create snapshots for the ο£Ώ WATCH
    • ⚑️ Deprecated the distanceToClosestPoint method. This method will become unavailable in a future update. There will be no replacement for this method and we suggest phasing it out.
    • βœ‚ Removed compile-time module check (@import vs. #import). Modules are now be used by default. (a43ba93)
    • βž• Added warnings to deprecated methods which will be removed in the next major release:
      • numberOfPointsInGraph
      • didTouchGraphWithClosestIndex:
      • didReleaseGraphWithClosestIndex:
      • numberOfGapsBetweenLabels

    Semi-Breaking Changes

    • πŸ‘Œ Improved the implementation of the X-Axis. The X-Axis background is now drawn by BEMSimpleLineGraph (as the Y-Axis is) instead of by BEMLine. This will help ensure stability and provide a more reliable system moving forward. It also fixes issues with gradient overlap into the X-Axis area.

    Xcode 6 Improvements

    • πŸ— BEMSimpleLineGraph now takes advantage of Xcode 6's new IBDesignable and IBInspectable features. Preview select graph properties in Interface Builder.
    • 0️⃣ Starting in Xcode 6.3 and Swift 1.2, BEMSimpleLineGraph is compatible with the new NULLABILITY standards. All methods and properties are, by default, non-nullable unless otherwise marked. (a43ba93)

    Key Feature

    • Average Lines (a939039). Added an Average Line feature. Draw an average line with a specific y-value. Use the new averageLine property on BEMSimpleLineGraphView to setup and customize the line. Might be considered a fix for issue #42. The implementation of the average line feature is likely the direction BEMSimpleLineGraph is headed as it expands.

    πŸ†• New Features - Shoutout to @RobDay and his team at @dowjones for PR #132

    • πŸ†• New Properties
      • Optionally display only dots and no line on your graph (resolves #51) using the new displayDotsOnly property.
      • Added new positionYAxisRightproperty. A boolean flag that moves the Y-Axis to the right of the graph.
      • Added a new lineDashPatternForReference[X|Y]AxisLines property. Specify a dash pattern for the reference lines drawn on the graph. This creates the reference lines with a dotted or hashed pattern.
      • Added a new enable[Left|Right|Top|Bottom]ReferenceAxisFrameLine property. By setting these properties, you can control what reference frame lines are drawn on the graph.
      • New displayDotsWhileAnimating property. A boolean specifying whether or not to show the dots while animating the reference lines.
      • New noDataLabelColor. Specify the color for the no data label
      • New noDataLabelFont. Specify the font for the no data label
      • Created a new formatStringForValues property. A format string to apply to values in the Y-Axis. This lets you have fine-grain control over the decimal precision of these values (eg. ".02f")
      • New yAxis[Prefix|Suffix]OnLineGraph property. Specify popup prefix and suffix to show in the built-in popup view
    • Null Graph Values
      • The graph now has the ability to plot null graph values. BEMSimpleLineGraph.h now specifies a special value, BEMNullGraphValue, that corresponds to a null data point. In your response to valueForPointAtIndex, return this special value whenever your data point is null. BEMSimpleLineGraph will now skip over this value when drawing the line. If you set interpolateNullValues, the graph will connect non-null values while preserving spacing for the null value.
    • Customizing Popup Views
      • Added a popUpSuffixForlineGraph: delegate method. A suffix to append to the stock pop up label view's value.
      • Added a popUpPrefixForlineGraph: delegate method. A prefix to prepend to the stock pop up label view's value.
      • If you want to use a custom popup view instead of the built-in popup view, you can respond to the optional method popUpViewForLineGraph:. You respond to this method with a UIView that will be used in place of the default popup.
      • When you use the custom popup view, the data in the view needs to be changed whenever the user drags his or her finger. To handle this modification, BEMSimpleLineGraph will send the message lineGraph:modifyPopupView:ForIndex:. This lets you modify your view for a given datapoint.
    • Axis Customizations
      • Added a new delegate method, incrementPositionsForXAxisOnLineGraph that lets you set the specific indices where X-Axis labels should be drawn.
      • Added a new delegate method, baseIndexForXAxisOnLineGraph, that lets you specify the index of the first X-Axis label to draw.
      • incrementIndexForXAxisOnLineGraph. An increment to apply to the response.
      • baseIndexForXAxisOnLineGraph. X-Axis labels will be drawn on this increment across the X-Axis.
      • baseValueForYAxisOnLineGraph. The starting Y-Axis value to plot draw on the Y-Axis. This lets you set a specifically formatted value so that your access label can be more user friendly (21.50 instead of 21.47)
      • incrementValueForYAxisOnLineGraph- An increment value to add to the response of baseValueForYAxisOnLineGraph that specifies what Y-Axis values to draw. This lets you return a user friendly increment, eg. .25.
    • Snapshot Methods
      • Use the new graphSnapshotImageRenderedWhileInBackground: method to capture a graph snapshot while your app is in the background. Fixes #193. (512f716)
    • Animation & Drawing
      • New β€œexpansion” animation has been added to the list of available animations. Try out the new animation with the BEMLineAnimationExpand type.

    πŸ› Bug Fixes

    • πŸ›  Fixes #134, an issue where popup suffixes would not display when alwaysDisplayPopUpLabels was set to YES. The sample app now demonstrates the use of popup suffixes. (183a675)
    • πŸ›  Fixes #138, an issue where popup prefixes would not display when alwaysDisplayPopUpLabels was set to YES. The sample app now demonstrates the use of popup prefixes. (c83d66c)
    • πŸ›  Fixes #70, a bug where reference axis frame drawing was conditional on reference axis lines being enabled. Now these properties are not dependent on one another. (f1f2ac4)
    • πŸ›  Fixes #196, vertical reference lines are now properly aligned with x-axis labels. (64b4fb1)
    • πŸ›  Fixes #67, the far-right and far-left x-axis labels now re-orient themselves to avoid being clipped.(64b4fb1)
    • πŸ›  Fixed an issue where the reference lines would have an alpha value of 0 if the line also had an alpha value of zero. Reference lines now set to an alpha of 0.1 when the line alpha is 0.0. As before, you can disable
      reference lines using the boolean properties to make them appear or disappear. (1acc2e2)

    ⚑️ GitHub Repo Updates

    • Graph Properties View Controller
      • View all available public BEMSimpleLineGraph properties directly from the sample project
      • Ability to use and toggle these properties directly from the Storyboard is coming soon
    • ⚑️ Readme Updates
      • New Apps Using This Project Section
      • Added details on IBDesignables
      • Added contributions note
      • Improved markdown formatting
      • Added StackOverflow support details
    • ⚑️ Updated project requirements