New major 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 anxand ay.- 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
yvalues, 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) FillFormatternow has a block representation usingFillFormatter.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 yourInfo.plistfor 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 with
PieChartDataEntry/RadarChartDataEntry - If you have any old
startAtZeroEnabledcalls - these have been deprecated for a long time. Replace them withaxisMinimum. - If you are using formatters:
- Replace any
chart.valueFormatter = formatterwithchart.valueFormatter = ChartDefaultValueFormatter(formatter: formatter)orchart.valueFormatter = [[ChartDefaultValueFormatter alloc] initWithFormatter:formatter]; - Replace any
axis.valueFormatter = formatterwithaxis.valueFormatter = ChartDefaultAxisValueFormatter(formatter: formatter)oraxis.valueFormatter = [[ChartDefaultAxisValueFormatter alloc] initWithFormatter:formatter];
- Replace any
- 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
ChartViewDelegateis implemented, update thechartValueSelectedinterface - Replace
drawSliceTextEnabledwithdrawEntryLabelsEnabled - 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/MarkerImageor implementingIMarker. There are more options than before now... - If you have used
barSpacebefore, move to usingbarWidth - If you used
saveToCameraRoll(), replace withUIImageWriteToSavedPhotosAlbum(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.