Skip to content

New major release

Compare
Choose a tag to compare
@danielgindi danielgindi released this 19 Oct 15:56
· 605 commits to master since this release

This is a major release, with a few breaking changes. So please pay attention.

Updates:

  • x-indexes are dead. Intoducing: x-values. Each entry now has an x and a y.
  • Pie/radar charts do not have a concept of X index anymore
  • Unified XAxis/YAxis features and experience.
  • Unified formatter interfaces for axes.
  • New formatter for y values, not inheriting from NSNumberFormatter anymore, to have dataSet and viewport information to take better formatting decisions.
  • Major refactoring of the Highlight mechanism.
  • Refactored marker mechanism
  • Refactored legend entry mechanism
  • Each dataset can now set its own legend form/size/etc.
  • More demos
  • Some classes have been renamed, keeping the namespaced name only in ObjC (using Swift 2.2 objc(...) feature, and the change of a major version update)
  • FillFormatter now has a block representation using FillFormatter.withblock(...)
  • Same goes for all Default formatters too.
  • No more saveToCameraRoll(). Since Xcode 8.0 it causes "privacy" issues with Apple Review, you have to add the photo albums privacy key to your Info.plist for that.
  • Moved to Swift 3.0. Make sure your project conforms to Swift 3.0.
  • Many minor bug fixes and improvements

Breaking changes / how to migrate:

  • All dataset constructors have changed - they do not take an array of x-indices anymore.
  • All entry constructors have changed - they take in an X and a Y.
  • Pie and Radar chart entries now have their own classes. So exchange the Entry classes withPieChartDataEntry/RadarChartDataEntry
  • If you have any old startAtZeroEnabled calls - these have been deprecated for a long time. Replace them with axisMinimum.
  • If you are using formatters:
    • Replace any chart.valueFormatter = formatter with chart.valueFormatter = ChartDefaultValueFormatter(formatter: formatter) or chart.valueFormatter = [[ChartDefaultValueFormatter alloc] initWithFormatter:formatter];
    • Replace any axis.valueFormatter = formatter with axis.valueFormatter = ChartDefaultAxisValueFormatter(formatter: formatter) or axis.valueFormatter = [[ChartDefaultAxisValueFormatter alloc] initWithFormatter:formatter];
  • In general, all functions that accepted x-indices before, now accept an x-value, so you might have to adjust the names a little bit.
  • Where ChartViewDelegate is implemented, update the chartValueSelected interface
  • Replace drawSliceTextEnabled with drawEntryLabelsEnabled
  • If you have a custom scatter shape - implement an IShapeRenderer, and put your rendering code in there
  • If you have a custom marker - consider subclassing MarkerView/MarkerImage or implementing IMarker. There are more options than before now...
  • If you have used barSpace before, move to using barWidth
  • If you used saveToCameraRoll(), replace with UIImageWriteToSavedPhotosAlbum(chart.getChartImage(trasparent: false), nil, nil, nil)
  • Some classes have been renamed for a cleaner look. They do not contain the "Chart" prefix anymore. That's for Swift only, where there are namespaces. In ObjC the names stayed the same for the sake of namespacing, using Swift 2.2's feature of @objc(name). If your compiler yells that a class does not exist, try to remove the Chart from its name. This should rarely happen, as we've chosen only the classes that are rarely instantiated by the user.