diff --git a/.github/workflows/swift.yml b/.github/workflows/swift.yml new file mode 100644 index 0000000000..938a11b606 --- /dev/null +++ b/.github/workflows/swift.yml @@ -0,0 +1,65 @@ +name: Swift + +on: + push: + branches: + - master + pull_request: + branches: + - '*' + +jobs: + iOS: + runs-on: macos-latest + env: + DEVELOPER_DIR: /Applications/Xcode_12.4.app/Contents/Developer + strategy: + matrix: + destination: ["OS=14.4,name=iPhone 12 Pro"] #, "OS=12.4,name=iPhone XS", "OS=11.4,name=iPhone X", "OS=10.3.1,name=iPhone SE"] + steps: + - uses: actions/checkout@v2 + - name: iOS - ${{ matrix.destination }} + run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -workspace "Charts.xcworkspace" -scheme "Charts" -destination "${{ matrix.destination }}" clean test | xcpretty + + tvOS: + runs-on: macos-latest + env: + DEVELOPER_DIR: /Applications/Xcode_12.4.app/Contents/Developer + strategy: + matrix: + destination: ["OS=14.3,name=Apple TV 4K"] + steps: + - uses: actions/checkout@v2 + - name: tvOS - ${{ matrix.destination }} + run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -workspace "Charts.xcworkspace" -scheme "Charts" -destination "${{ matrix.destination }}" clean test | xcpretty + + macOS_demo: + runs-on: macOS-latest + env: + DEVELOPER_DIR: /Applications/Xcode_12.4.app/Contents/Developer + steps: + - uses: actions/checkout@v2 + - name: macOS + run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -workspace "Charts.xcworkspace" -scheme "ChartsDemo-macOS" -destination "platform=macOS" clean build | xcpretty + + iOS_demo: + runs-on: macos-latest + env: + DEVELOPER_DIR: /Applications/Xcode_12.4.app/Contents/Developer + strategy: + matrix: + destination: ["OS=14.4,name=iPhone 12 Pro"] #, "OS=12.4,name=iPhone XS", "OS=11.4,name=iPhone X", "OS=10.3.1,name=iPhone SE"] + steps: + - uses: actions/checkout@v2 + - name: iOS - ${{ matrix.destination }} + run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -workspace "Charts.xcworkspace" -scheme "ChartsDemo-iOS" -destination "${{ matrix.destination }}" clean build | xcpretty + + spm: + name: Test with SPM + runs-on: macOS-latest + env: + DEVELOPER_DIR: /Applications/Xcode_12.4.app/Contents/Developer + steps: + - uses: actions/checkout@v2 + - name: SPM Test + run: swift build -c debug diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 70a7ecaee0..0000000000 --- a/.travis.yml +++ /dev/null @@ -1,25 +0,0 @@ -language: objective-c -osx_image: xcode11 -matrix: - include: - - osx_image: xcode11 - env: PLATFORM="iOS" - - osx_image: xcode11 - env: PLATFORM="tvOS" - - osx_image: xcode11 - env: PLATFORM="macOS" -env: - global: - - LANG=en_US.UTF-8 - - secure: HRl5Cg3/LmTJYCSDGtV8Fiqf6OgWXR6C5YkNviOElU9YmcCTvnmE7MCm+gK8hJNIQ2mWCBTlxTC7jJxeYlx0D+JQ6IhRc75B4zXgbtth6HCzlvhWDcBbNU/K+JPDjy2EAoVgvf8Xseq6GqM4WcVg2Pwr9PS3aaH/SKDE6yVoPXRM2wXRAxIdxayqm/RQgG88jAKgg+Ub5DKW/c9NLLbUf/WdY9SgQDJtqeZCMv7G3/IzW34KZgVPsqSrPByzZXbf7KgYkYLQlscH4mcUctk1qxhdCae//zcgUZo/utpXWbPXQqtvDpuqrg9IRvoGxa/D1I7dLSJsVnk4aP7RW18vn4HJ82C2AiEp+lU2TQE9y5lXcGssZVIa5aZNTWL90HVer3Kg6AnHffvdCSZ/UHsMZJFURUXL9fRIlWVGuEDeQOqlV6lUmEtp/BiEdV4D5PuCyT6snsmEwkc51goyqh6uS6XhJyqYEQdxdoybznwp91tVmASsRybppIGHTkcWN5csF4zQt40tEwd8LoqM+bBUo0wxKiKsNsecL4JA+YDYs2saZY9U3s8jAaIon+qDu071fPRaPEvBhYHYDhy4cTvBXibyGUYGHkrgLu0w19wDfHcJKt2In58yOmaCCLNoTGp/ZLNVRyZ8VDlj/NdJ2dWpMsL2Aj7OxU065kCL2FlvuRU= -cache: - - bundler -before_install: - - brew update - - brew upgrade carthage || true - - carthage version - - carthage bootstrap --platform $PLATFORM -script: - - bundle exec rake ci[$PLATFORM] -after_success: - - bash <(curl -s https://codecov.io/bash) diff --git a/CHANGELOG.md b/CHANGELOG.md index a054634d80..8d7af2c277 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,214 @@ # Changelog +## [v4.0.1](https://github.com/danielgindi/Charts/tree/v4.0.1) (2021-02-18) + +[Full Changelog](https://github.com/danielgindi/Charts/compare/v4.0.0...v4.0.1) + +**Merged pull requests:** + +- Fix bounds checks on binary search [\#4577](https://github.com/danielgindi/Charts/pull/4577) ([jjatie](https://github.com/jjatie)) +- Added SPM build action [\#4576](https://github.com/danielgindi/Charts/pull/4576) ([jjatie](https://github.com/jjatie)) +- Replace FBSnapshotTestCase with pointfree/swift-snapshot-testing [\#4574](https://github.com/danielgindi/Charts/pull/4574) ([jjatie](https://github.com/jjatie)) +- Fixed incorrect guard return statement when rendering limit lines [\#4563](https://github.com/danielgindi/Charts/pull/4563) ([jjatie](https://github.com/jjatie)) +- SPM GitHub Action [\#4553](https://github.com/danielgindi/Charts/pull/4553) ([jjatie](https://github.com/jjatie)) +- ChartViewBase cleanup [\#4537](https://github.com/danielgindi/Charts/pull/4537) ([nuomi1](https://github.com/nuomi1)) +- Add Tutorial Link.md [\#4516](https://github.com/danielgindi/Charts/pull/4516) ([StewartLynch](https://github.com/StewartLynch)) +- Import swift algorithms [\#4497](https://github.com/danielgindi/Charts/pull/4497) ([jjatie](https://github.com/jjatie)) +- Algorithm updates [\#3638](https://github.com/danielgindi/Charts/pull/3638) ([jjatie](https://github.com/jjatie)) + +## [v4.0.0](https://github.com/danielgindi/Charts/tree/v4.0.0) (2020-10-30) + +[Full Changelog](https://github.com/danielgindi/Charts/compare/v3.6.0...v4.0.0) + +**Merged pull requests:** + +- Alternative for SPM dynamic linking [\#4478](https://github.com/danielgindi/Charts/pull/4478) ([alexruperez](https://github.com/alexruperez)) +- Resolve conflict for 4.0 branch and master [\#4456](https://github.com/danielgindi/Charts/pull/4456) ([liuxuan30](https://github.com/liuxuan30)) +- ChartBaseDataSet, copy constructor - missing drawIconsEnabled parameter initialization [\#4424](https://github.com/danielgindi/Charts/pull/4424) ([bivant](https://github.com/bivant)) + +## [v3.6.0](https://github.com/danielgindi/Charts/tree/v3.6.0) (2020-09-21) + +[Full Changelog](https://github.com/danielgindi/Charts/compare/v3.5.0...v3.6.0) + +**Implemented enhancements:** + +- Bars not showing bar chart [\#1742](https://github.com/danielgindi/Charts/issues/1742) + +**Fixed bugs:** + +- Fatal error: Can't form Range with upperBound \< lowerBound [\#4046](https://github.com/danielgindi/Charts/issues/4046) + +**Closed issues:** + +- How to add string values in Y Axis for Example How show Mutli. graphs for months data? [\#4473](https://github.com/danielgindi/Charts/issues/4473) +- Charts not supported by xcode 12 and swift compiler version 5.3 [\#4471](https://github.com/danielgindi/Charts/issues/4471) +- How can i set each slice percentage different color? [\#4451](https://github.com/danielgindi/Charts/issues/4451) +- Support for Swift Package manager [\#4450](https://github.com/danielgindi/Charts/issues/4450) +- If you get an element of the histogram, then change the color [\#4446](https://github.com/danielgindi/Charts/issues/4446) +- lineChartView.zoom\(\) - how to obtain center x/y coordinates [\#4434](https://github.com/danielgindi/Charts/issues/4434) +- Crash after updating to iOS 13.6 and Xcode 11.6 on NaN [\#4433](https://github.com/danielgindi/Charts/issues/4433) +- Multiple Highlight points [\#4430](https://github.com/danielgindi/Charts/issues/4430) +- DateValueFormatter uses wrong date [\#4427](https://github.com/danielgindi/Charts/issues/4427) +- why y asix value is getting more and more high, how to disable it [\#4425](https://github.com/danielgindi/Charts/issues/4425) +- One group bar chart how to use XAxis and YAxis, and then show different number to show two unit [\#4416](https://github.com/danielgindi/Charts/issues/4416) +- Legend does not support dashed lines [\#4413](https://github.com/danielgindi/Charts/issues/4413) +- How to get number of items displayed in yAxis [\#4412](https://github.com/danielgindi/Charts/issues/4412) +- corner [\#4410](https://github.com/danielgindi/Charts/issues/4410) +- corne人、 [\#4409](https://github.com/danielgindi/Charts/issues/4409) +- How do you edit xAxis values? [\#4401](https://github.com/danielgindi/Charts/issues/4401) +- Cannot get x axis label into center of the bar chart [\#4394](https://github.com/danielgindi/Charts/issues/4394) +- How the Remove the Background Graph lines from BarChart Graph [\#4388](https://github.com/danielgindi/Charts/issues/4388) +- How to Remove the Background Graph lines from BarChart Graph [\#4387](https://github.com/danielgindi/Charts/issues/4387) +- Add Gradient to Bar Chart - BarChartDataSet [\#4385](https://github.com/danielgindi/Charts/issues/4385) +- How to run playgrounds? [\#4384](https://github.com/danielgindi/Charts/issues/4384) +- CDN: trunk URL couldn't be downloaded: https://cdn.jsdelivr.net/cocoa/Specs/5/1/e/Charts/3.4.0/Charts.podspec.json Response: SSL peer certificate or SSH remote key was not OK [\#4381](https://github.com/danielgindi/Charts/issues/4381) +- Mac Catalyst compile error: no such module 'Charts' [\#4380](https://github.com/danielgindi/Charts/issues/4380) +- How to display the data \(one line has two different data\( -1 ~0 and 0 -1\) [\#4376](https://github.com/danielgindi/Charts/issues/4376) +- Chart load with large amounts of data takes to much time [\#4372](https://github.com/danielgindi/Charts/issues/4372) +- 使用复杂 [\#4369](https://github.com/danielgindi/Charts/issues/4369) +- Overriding DefaultAxisValueFormatter Doesn't Work [\#4365](https://github.com/danielgindi/Charts/issues/4365) +- RadarCharView data update may cause crash [\#4361](https://github.com/danielgindi/Charts/issues/4361) +- SwiftUI tutorial Bar Chart [\#4360](https://github.com/danielgindi/Charts/issues/4360) +- drawGridLinesBehindDataEnabled has no effect on CombinedChart [\#4357](https://github.com/danielgindi/Charts/issues/4357) +- - [\#4356](https://github.com/danielgindi/Charts/issues/4356) +- iOS Charts subclass Markerview use Swift always Build Error in “xxx-Swift.h” [\#4355](https://github.com/danielgindi/Charts/issues/4355) +- Set images on xAxis on HorizontalBarChartView [\#4353](https://github.com/danielgindi/Charts/issues/4353) +- How to set spacing between bars on a BarChartDataEntry [\#4352](https://github.com/danielgindi/Charts/issues/4352) +- Swift 5.0 in 4.0.0 Branch? [\#4351](https://github.com/danielgindi/Charts/issues/4351) +- Rounded bars swift5 [\#4350](https://github.com/danielgindi/Charts/issues/4350) +- The “Swift Language Version” \(SWIFT\_VERSION\) build setting must be set to a supported value for targets which use Swift. This setting can be set in the build settings editor. [\#4347](https://github.com/danielgindi/Charts/issues/4347) +- DropDowm pod for xcode 9 [\#4346](https://github.com/danielgindi/Charts/issues/4346) +- How to creat a custom LimitLine with two labels [\#4344](https://github.com/danielgindi/Charts/issues/4344) +- How to remove top grid line for line chart [\#4343](https://github.com/danielgindi/Charts/issues/4343) +- Bars not showing BarChart [\#4337](https://github.com/danielgindi/Charts/issues/4337) +- Compiler issue Xcode 11.4 swift 5.2 using Carthage [\#4335](https://github.com/danielgindi/Charts/issues/4335) +- Radar type 有没有圆形结构呢? [\#4332](https://github.com/danielgindi/Charts/issues/4332) +- Build error Module compiled with Swift 5.1.3 cannot be imported by the Swift 5.2 compiler [\#4322](https://github.com/danielgindi/Charts/issues/4322) +- linecharts moveViewToX不起作用 [\#4313](https://github.com/danielgindi/Charts/issues/4313) +- Compatibility with SwiftUI [\#4305](https://github.com/danielgindi/Charts/issues/4305) +- CGAffineTransformInvert: singular matrix [\#4290](https://github.com/danielgindi/Charts/issues/4290) +- BarChart.setData\(\) not working [\#4284](https://github.com/danielgindi/Charts/issues/4284) +- Combined chart \(Scatter and Line\) producing random results. [\#4261](https://github.com/danielgindi/Charts/issues/4261) +- Using charts with Mac Catalyst generate many deprecated warnings. [\#4249](https://github.com/danielgindi/Charts/issues/4249) +- entries属性只能readonly了吗 能不能改成可以读写 [\#4108](https://github.com/danielgindi/Charts/issues/4108) +- Draw gradient line in line chart [\#537](https://github.com/danielgindi/Charts/issues/537) + +**Merged pull requests:** + +- Update readme.md with link to SwiftUI tutorial [\#4400](https://github.com/danielgindi/Charts/pull/4400) ([Basistiy](https://github.com/Basistiy)) +- Increase iOS version to 9 in Package.swift [\#4399](https://github.com/danielgindi/Charts/pull/4399) ([Rubenfer](https://github.com/Rubenfer)) +- Fix AxisBase Formatter Getter \(Fixes \#4365\) [\#4366](https://github.com/danielgindi/Charts/pull/4366) ([giantramen](https://github.com/giantramen)) +- Added video tutorial to README [\#4286](https://github.com/danielgindi/Charts/pull/4286) ([rebeloper](https://github.com/rebeloper)) + ## [v3.5.0](https://github.com/danielgindi/Charts/tree/v3.5.0) (2020-04-16) [Full Changelog](https://github.com/danielgindi/Charts/compare/v3.4.0...v3.5.0) +**Implemented enhancements:** + +- Height of Half Pie Chart \(white space in the chart where the removed bottom half from pie chart should be\) [\#4033](https://github.com/danielgindi/Charts/issues/4033) + +**Closed issues:** + +- How to remove colors below bar chart [\#4334](https://github.com/danielgindi/Charts/issues/4334) +- Last item is not displayed [\#4324](https://github.com/danielgindi/Charts/issues/4324) +- The Demo app Doesn't compile for tvOS [\#4320](https://github.com/danielgindi/Charts/issues/4320) +- Module compiled with Swift 5.1.2 cannot be imported by Swift 5.2 compiler [\#4317](https://github.com/danielgindi/Charts/issues/4317) +- Show 'k' instead of ',000' in large numbers at leftAxis [\#4309](https://github.com/danielgindi/Charts/issues/4309) +- 为什么x轴和柱子之间有空间呢? [\#4307](https://github.com/danielgindi/Charts/issues/4307) +- why Legend.position is deprecated? How do I set the position of the legend? [\#4306](https://github.com/danielgindi/Charts/issues/4306) +- How to set 24 hour time format in x-axis of line chart? [\#4302](https://github.com/danielgindi/Charts/issues/4302) +- can i customise your chart? [\#4301](https://github.com/danielgindi/Charts/issues/4301) +- Getting the value of an item selected. [\#4295](https://github.com/danielgindi/Charts/issues/4295) +- how to set the legend's position? [\#4292](https://github.com/danielgindi/Charts/issues/4292) +- ChartLimitLine is not drawn as dashed [\#4291](https://github.com/danielgindi/Charts/issues/4291) +- Legend not displayed correctly in iOS 13.2.2 [\#4289](https://github.com/danielgindi/Charts/issues/4289) +- dyld: Library not loaded: @rpath/Charts.framework/Charts XCODE 11.3.1 [\#4280](https://github.com/danielgindi/Charts/issues/4280) +- ChartData::getDataSetByLabel always return the first IChartDataSet when ignorecase = true [\#4274](https://github.com/danielgindi/Charts/issues/4274) +- How to use hover? [\#4267](https://github.com/danielgindi/Charts/issues/4267) +- AxisRange and drag [\#4264](https://github.com/danielgindi/Charts/issues/4264) +- How to add legends with X axis and Y axis values in the balloon marker view in IOS Charts? [\#4263](https://github.com/danielgindi/Charts/issues/4263) +- Can we set two fill colors for line chart? [\#4260](https://github.com/danielgindi/Charts/issues/4260) +- i do not want show some value How do it? [\#4255](https://github.com/danielgindi/Charts/issues/4255) +- `isAccessibilityElement` should not return `false` for `NSUIView` [\#4253](https://github.com/danielgindi/Charts/issues/4253) +- x轴从数据量多切换到数据量少的时候 x轴间距变大 [\#4245](https://github.com/danielgindi/Charts/issues/4245) +- Access level of ChartViewBase's API [\#4243](https://github.com/danielgindi/Charts/issues/4243) +- 数据源都是0的时候有问题 [\#4241](https://github.com/danielgindi/Charts/issues/4241) +- How to set space between Y-Axis labels and graph [\#4237](https://github.com/danielgindi/Charts/issues/4237) +- HorizontalBarChartView,when I use setVisibleXRangeMaximum\(5.0\),xAxis cannot show all label [\#4235](https://github.com/danielgindi/Charts/issues/4235) +- OverLap stackview chart - Selected color - Layout Stack bar [\#4234](https://github.com/danielgindi/Charts/issues/4234) +- Xcode tries to use AppKit when compiling with Mac Catalyst [\#4233](https://github.com/danielgindi/Charts/issues/4233) +- CombinedChartView Legend only shows line data info not info for other types [\#4230](https://github.com/danielgindi/Charts/issues/4230) +- Legend in CombinedChartView only shows Legend for LineData [\#4229](https://github.com/danielgindi/Charts/issues/4229) +- X-Axis setLabel with force enabled not working [\#4228](https://github.com/danielgindi/Charts/issues/4228) +- Can BarChartDataEntry with multiple Y values render icon once instead of for each Y value? [\#4225](https://github.com/danielgindi/Charts/issues/4225) +- Radar chart - cannot hide yAxis [\#4224](https://github.com/danielgindi/Charts/issues/4224) +- Highlight does not respect the draw order. [\#4223](https://github.com/danielgindi/Charts/issues/4223) +- Source not able to compile [\#4221](https://github.com/danielgindi/Charts/issues/4221) +- How to render radar-chart with live data and dynamic array entries? [\#4220](https://github.com/danielgindi/Charts/issues/4220) +- How to color one quadrant of the graph? [\#4219](https://github.com/danielgindi/Charts/issues/4219) +- SwiftCharts: How to set space between x axis equally ? [\#4218](https://github.com/danielgindi/Charts/issues/4218) +- How can i set xVals in line chat in latest version. [\#4217](https://github.com/danielgindi/Charts/issues/4217) +- Separator between x-Axis value [\#4215](https://github.com/danielgindi/Charts/issues/4215) +- Reload LineChartView with Button [\#4214](https://github.com/danielgindi/Charts/issues/4214) +- Contains is not implemented in ChartDataSet, crashes when called [\#4212](https://github.com/danielgindi/Charts/issues/4212) +- PieChart outside value label border [\#4210](https://github.com/danielgindi/Charts/issues/4210) +- CombinedChartRenderer property : \_renderers should be set open [\#4208](https://github.com/danielgindi/Charts/issues/4208) +- Create special line chart [\#4207](https://github.com/danielgindi/Charts/issues/4207) +- How can I add images on Y axis instead of values [\#4206](https://github.com/danielgindi/Charts/issues/4206) +- How to remove top and bottom extra space in LineChartView? [\#4205](https://github.com/danielgindi/Charts/issues/4205) +- Bar Chart Gradient color issue [\#4203](https://github.com/danielgindi/Charts/issues/4203) +- Y轴上数据是整数值,但刻度是小数应该怎么办?怎么才能让刻度值只显示整数? [\#4202](https://github.com/danielgindi/Charts/issues/4202) +- How to add pieChartDataSet.sliceSpace only for the selected item? [\#4201](https://github.com/danielgindi/Charts/issues/4201) +- \[LineChartView\] Issues with circles positions [\#4200](https://github.com/danielgindi/Charts/issues/4200) +- BarChart bottom space when having a small value [\#4198](https://github.com/danielgindi/Charts/issues/4198) +- Is there a way to add to the datapoint label in a line chart? [\#4196](https://github.com/danielgindi/Charts/issues/4196) +- Change position of data labels to bottom of the line in ios charts [\#4195](https://github.com/danielgindi/Charts/issues/4195) +- Custom chart with overrided legendRenderer not working [\#4194](https://github.com/danielgindi/Charts/issues/4194) +- Is this possible to use with project catalyst? [\#4193](https://github.com/danielgindi/Charts/issues/4193) +- pageviewcontroller Cannot drag inside [\#4192](https://github.com/danielgindi/Charts/issues/4192) +- How Pie chart Center Click Disable [\#4191](https://github.com/danielgindi/Charts/issues/4191) +- How to set only given values to xAxis, set equal distance between those values? [\#4190](https://github.com/danielgindi/Charts/issues/4190) +- How can i override the xAxisrenderer in RadarChartView [\#4189](https://github.com/danielgindi/Charts/issues/4189) +- iOS Charts not showing all xAxis Value [\#4187](https://github.com/danielgindi/Charts/issues/4187) +- How can I customize chart without modifying the source code? [\#4185](https://github.com/danielgindi/Charts/issues/4185) +- Add Line Cap to Bar for Horizontal Bar Chart [\#4183](https://github.com/danielgindi/Charts/issues/4183) +- X/Y coordinates being rounded to whole numbers instead of being presented as decimals [\#4182](https://github.com/danielgindi/Charts/issues/4182) +- I need to draw peichart like below image [\#4177](https://github.com/danielgindi/Charts/issues/4177) +- Candlestick xAxis label's too small when zoomed out [\#4176](https://github.com/danielgindi/Charts/issues/4176) +- How to change the color of text that displayed inside the chart ios swift 4. [\#4174](https://github.com/danielgindi/Charts/issues/4174) +- runtime/cgo: could not obtain pthread\_keys on Xcode 11 simulator [\#4173](https://github.com/danielgindi/Charts/issues/4173) +- PieChartView show xValuePosition and yValuePosition on item press [\#4172](https://github.com/danielgindi/Charts/issues/4172) +- Should Version 4.0.0 be updated to include changes from recent releases? [\#4167](https://github.com/danielgindi/Charts/issues/4167) +- How to control colors within a single dataSet? [\#4166](https://github.com/danielgindi/Charts/issues/4166) +- X labels that display in 3.0.4 are not rendered in 3.0.5 [\#4165](https://github.com/danielgindi/Charts/issues/4165) +- How to draw a circle markers when value is selected in Line Chart [\#4164](https://github.com/danielgindi/Charts/issues/4164) +- LineChartView万级数据绘制缓慢卡顿 [\#4158](https://github.com/danielgindi/Charts/issues/4158) +- UITableView does not scroll when dragging within chart for iOS 13. [\#4156](https://github.com/danielgindi/Charts/issues/4156) +- How to properly subclass XAxis? [\#4155](https://github.com/danielgindi/Charts/issues/4155) +- Line Chart ignores colors if mode is set to bezier. [\#4148](https://github.com/danielgindi/Charts/issues/4148) +- BarChartRenderer FatalError: Index out of range [\#4146](https://github.com/danielgindi/Charts/issues/4146) +- I have two ChartLimitLine and I need to know how to fill the area between them I'm using LineChartView [\#4142](https://github.com/danielgindi/Charts/issues/4142) +- I can't set static count of y axes and labels [\#4139](https://github.com/danielgindi/Charts/issues/4139) +- how can I set a Non-uniform coordinate Y-axis? [\#4137](https://github.com/danielgindi/Charts/issues/4137) +- Buuble Chart event for Single bubble [\#4134](https://github.com/danielgindi/Charts/issues/4134) +- Default Colors Should Support Dark Mode \[iOS 13\] [\#4133](https://github.com/danielgindi/Charts/issues/4133) +- Entries are Assignment to readonly property. [\#4126](https://github.com/danielgindi/Charts/issues/4126) +- BarChartView have interval between bar and xaxis [\#4115](https://github.com/danielgindi/Charts/issues/4115) +- can not draw circle on axis as the picture [\#4111](https://github.com/danielgindi/Charts/issues/4111) +- Empty Line Chart, setVisibleXRangeMaximum causing Fatal error: Double cannot be converted to Int [\#4109](https://github.com/danielgindi/Charts/issues/4109) +- Description is still saying OSX [\#4106](https://github.com/danielgindi/Charts/issues/4106) +- Line Graph draggable points just in y-axis. [\#4059](https://github.com/danielgindi/Charts/issues/4059) +- The x axis cannot draw displayed incorrectly. [\#4057](https://github.com/danielgindi/Charts/issues/4057) +- Crash when using BarChartDataSet with BarChartData [\#4040](https://github.com/danielgindi/Charts/issues/4040) +- leftAxis line disappears when filling area between two line charts. [\#4037](https://github.com/danielgindi/Charts/issues/4037) +- Last value and highlight/selected values in candlestick chart [\#4036](https://github.com/danielgindi/Charts/issues/4036) +- Last xAxis label cutting [\#4023](https://github.com/danielgindi/Charts/issues/4023) +- `Fill` isn't extendable [\#3140](https://github.com/danielgindi/Charts/issues/3140) +- Non-Public API Usage [\#2899](https://github.com/danielgindi/Charts/issues/2899) +- BarChartView: xAxis values are not aligned with bars [\#2106](https://github.com/danielgindi/Charts/issues/2106) +- wanted beta testeur for new axe logarithmic [\#2102](https://github.com/danielgindi/Charts/issues/2102) + **Merged pull requests:** - Fix warnings on current code base [\#4321](https://github.com/danielgindi/Charts/pull/4321) ([liuxuan30](https://github.com/liuxuan30)) @@ -29,6 +234,122 @@ [Full Changelog](https://github.com/danielgindi/Charts/compare/v3.3.0...v3.4.0) +**Fixed bugs:** + +- Line charts: Line sections disappear when zoomed in \(has PR\). [\#4099](https://github.com/danielgindi/Charts/issues/4099) +- Line chart x axis animation is broken [\#4093](https://github.com/danielgindi/Charts/issues/4093) +- LineChartView.highlightValue causes CoreGraphics API errors [\#4043](https://github.com/danielgindi/Charts/issues/4043) +- Horizontal Bezier Line Graph Not Drawing Through All Points [\#3960](https://github.com/danielgindi/Charts/issues/3960) +- Index out of bounds exception in v3.2 in createAccessibleElement [\#3659](https://github.com/danielgindi/Charts/issues/3659) + +**Closed issues:** + +- Xcode asking for constants instead of variables in Charts code [\#4161](https://github.com/danielgindi/Charts/issues/4161) +- Blank space should not exist in BarChartView [\#4157](https://github.com/danielgindi/Charts/issues/4157) +- Could not find module 'Charts' for target 'arm64-apple-ios'; found: x86\_64-apple-ios-simulator, x86\_64 [\#4154](https://github.com/danielgindi/Charts/issues/4154) +- 指定哪个swift版本都报语法错误 [\#4145](https://github.com/danielgindi/Charts/issues/4145) +- lineChart customize the color or style of the selected point [\#4144](https://github.com/danielgindi/Charts/issues/4144) +- How do I customize the color or style of the selected point in a polygraph [\#4143](https://github.com/danielgindi/Charts/issues/4143) +- Help, How to achieve this style? [\#4138](https://github.com/danielgindi/Charts/issues/4138) +- AutoScaleMinMax doesn't work in candlestick iOS [\#4135](https://github.com/danielgindi/Charts/issues/4135) +- 怎么手动设定滚动到指定x坐标 [\#4130](https://github.com/danielgindi/Charts/issues/4130) +- The reuse of charts on tableviewcell [\#4127](https://github.com/danielgindi/Charts/issues/4127) +- LineChartView decrease height if add many LineChartDataSets [\#4122](https://github.com/danielgindi/Charts/issues/4122) +- 堆叠柱状图不同数据之间的间距 [\#4120](https://github.com/danielgindi/Charts/issues/4120) +- Removing LineChartView to save memory? [\#4114](https://github.com/danielgindi/Charts/issues/4114) +- h [\#4110](https://github.com/danielgindi/Charts/issues/4110) +- swift 5 [\#4107](https://github.com/danielgindi/Charts/issues/4107) +- Scatter charts dots needs to be shown even it is less than half [\#4096](https://github.com/danielgindi/Charts/issues/4096) +- barchart 1st bar offset [\#4092](https://github.com/danielgindi/Charts/issues/4092) +- Compiling Chart with Swift 5.1 raises compilation error [\#4090](https://github.com/danielgindi/Charts/issues/4090) +- How to change color for Key's Label ? [\#4088](https://github.com/danielgindi/Charts/issues/4088) +- y axis [\#4087](https://github.com/danielgindi/Charts/issues/4087) +- No chart data available \(displaying large data sets\) [\#4075](https://github.com/danielgindi/Charts/issues/4075) +- 3.2.2 xBounds starts from 1 [\#4073](https://github.com/danielgindi/Charts/issues/4073) +- Build error on Xcode 11 beta 3 - macOS app [\#4071](https://github.com/danielgindi/Charts/issues/4071) +- Why not fix \#3865 in swift4.2 as well? [\#4067](https://github.com/danielgindi/Charts/issues/4067) +- Pod install failed - Could not found branch v3.3 issue [\#4063](https://github.com/danielgindi/Charts/issues/4063) +- Potential bug highlighting Bars in Bar chart [\#4062](https://github.com/danielgindi/Charts/issues/4062) +- PieChart slices with different height/thick [\#4061](https://github.com/danielgindi/Charts/issues/4061) +- Line Chart crashes when upgrading from 3.2.1 to 3.2.2 or greater [\#4060](https://github.com/danielgindi/Charts/issues/4060) +- How to set the shadow width? [\#4058](https://github.com/danielgindi/Charts/issues/4058) +- iOS13 port [\#4056](https://github.com/danielgindi/Charts/issues/4056) +- Embedding in Objective C++ project [\#4054](https://github.com/danielgindi/Charts/issues/4054) +- Example project does not work for latest swift [\#4053](https://github.com/danielgindi/Charts/issues/4053) +- Line chart line color array issue [\#4052](https://github.com/danielgindi/Charts/issues/4052) +- I set the display is double but turned into an integer [\#4051](https://github.com/danielgindi/Charts/issues/4051) +- xAxis Renderer label [\#4039](https://github.com/danielgindi/Charts/issues/4039) +- Highlight midPoint of visible area [\#4032](https://github.com/danielgindi/Charts/issues/4032) +- Snap to position for x values \(paging\) [\#4030](https://github.com/danielgindi/Charts/issues/4030) +- how can I use both chart in one view like video? [\#4026](https://github.com/danielgindi/Charts/issues/4026) +- How to Parse xValue and yValue to LineChartData ? [\#4025](https://github.com/danielgindi/Charts/issues/4025) +- Fatal error: Index out of range from subscript\(position: Index\) -\> Element [\#4024](https://github.com/danielgindi/Charts/issues/4024) +- Pie chart label [\#4022](https://github.com/danielgindi/Charts/issues/4022) +- Cannot find "@import Charts;" in -Swift.h, I can only @import Charts in OC files, anything I missed? [\#4021](https://github.com/danielgindi/Charts/issues/4021) +- Cannot subclass LineChartRenderer with Clang 11 [\#4018](https://github.com/danielgindi/Charts/issues/4018) +- Unable to compile with Swift Package Manager due to missing dependencies [\#4016](https://github.com/danielgindi/Charts/issues/4016) +- Show values in marker when you click a circle in LineChart [\#4015](https://github.com/danielgindi/Charts/issues/4015) +- Is it possible to show only part of series on full XAxis labels? [\#4014](https://github.com/danielgindi/Charts/issues/4014) +- BarChartRenderer FatalError: Index out of range [\#4013](https://github.com/danielgindi/Charts/issues/4013) +- how to set max zoom scale for y-axis [\#4011](https://github.com/danielgindi/Charts/issues/4011) +- ScatterChartDataSet basic initializer causes crashes [\#4010](https://github.com/danielgindi/Charts/issues/4010) +- oc project could't use [\#4008](https://github.com/danielgindi/Charts/issues/4008) +- Line chart issue [\#4005](https://github.com/danielgindi/Charts/issues/4005) +- Crash on PieChartRenderer line 833 [\#4001](https://github.com/danielgindi/Charts/issues/4001) +- BarChartView shows on UI when y value is zero [\#4000](https://github.com/danielgindi/Charts/issues/4000) +- can make excel [\#3999](https://github.com/danielgindi/Charts/issues/3999) +- Cannot remove an observer for the key path "bounds" because it is not registered as an observer [\#3995](https://github.com/danielgindi/Charts/issues/3995) +- How to set y axis value with larger difference because my candles are showing very small in size please provide any way [\#3993](https://github.com/danielgindi/Charts/issues/3993) +- compiling for iOS 8.0, but module 'Charts' has a minimum deployment target of iOS 8.4: [\#3992](https://github.com/danielgindi/Charts/issues/3992) +- SIGABRT [\#3986](https://github.com/danielgindi/Charts/issues/3986) +- Getting The below error on Xcode update: Error Group :-1: Undefined symbol: \_OBJC\_CLASS\_$\_XBarChart :-1: Undefined symbol: \_OBJC\_CLASS\_$\_XBarChartConfiguration :-1: Undefined symbol: \_OBJC\_CLASS\_$\_XBarItem, When I run on real device. [\#3985](https://github.com/danielgindi/Charts/issues/3985) +- Second to last value in stacked BarChart not drawn when the last value is zero [\#3984](https://github.com/danielgindi/Charts/issues/3984) +- Value labels are not always showing in horizontal bar chart [\#3981](https://github.com/danielgindi/Charts/issues/3981) +- When I manually integrated "charts", running the iOS9.0 emulator crashed. [\#3980](https://github.com/danielgindi/Charts/issues/3980) +- LineChartDataSet function setColors is unavailable? [\#3979](https://github.com/danielgindi/Charts/issues/3979) +- notifyDataSetChanged\(\) crashes with CGAffineTransformInvert: singular matrix. [\#3978](https://github.com/danielgindi/Charts/issues/3978) +- this version is 3.2.2 in pods, this version has problem [\#3977](https://github.com/danielgindi/Charts/issues/3977) +- Undefined symbol: method descriptor for Charts.ChartViewBase.initialize\(\) -\> \(\) [\#3976](https://github.com/danielgindi/Charts/issues/3976) +- PieChart highlightEnabled flag operation is reverse of setting [\#3975](https://github.com/danielgindi/Charts/issues/3975) +- I am not getting the last value of x axis in the group chart [\#3974](https://github.com/danielgindi/Charts/issues/3974) +- Charts 3.3.0 not running on Xcode 10.2 [\#3972](https://github.com/danielgindi/Charts/issues/3972) +- change line chart legend text color [\#3971](https://github.com/danielgindi/Charts/issues/3971) +- drawCenterTextEnable [\#3969](https://github.com/danielgindi/Charts/issues/3969) +- Installing version 3.3 from Pods not found [\#3968](https://github.com/danielgindi/Charts/issues/3968) +- zero value in bar chart [\#3967](https://github.com/danielgindi/Charts/issues/3967) +- \[Question\] Line Chart Filled Circle Hole when highlighted [\#3966](https://github.com/danielgindi/Charts/issues/3966) +- How to change pie chart boarder color and width size ? and separator line width size and curve? in swift 4 [\#3959](https://github.com/danielgindi/Charts/issues/3959) +- Charts Pagination [\#3957](https://github.com/danielgindi/Charts/issues/3957) +- button press [\#3956](https://github.com/danielgindi/Charts/issues/3956) +- Edit leading Trailing and width of bar [\#3954](https://github.com/danielgindi/Charts/issues/3954) +- Can't suspend the ongoing drag [\#3953](https://github.com/danielgindi/Charts/issues/3953) +- incorrect display in LineChartView When all yAxis data being 0 [\#3950](https://github.com/danielgindi/Charts/issues/3950) +- Balloon Marker Swift errors [\#3947](https://github.com/danielgindi/Charts/issues/3947) +- Linhas de sobreposição PieChart [\#3942](https://github.com/danielgindi/Charts/issues/3942) +- Display Attributed String on X-Axis [\#3941](https://github.com/danielgindi/Charts/issues/3941) +- getHighlightByTouchPoint will get nil [\#3940](https://github.com/danielgindi/Charts/issues/3940) +- Fatal error: removeEntry is not implemented in ChartBaseDataSet: [\#3937](https://github.com/danielgindi/Charts/issues/3937) +- Line graph points create lines to other points [\#3936](https://github.com/danielgindi/Charts/issues/3936) +- CombinedChart and data [\#3930](https://github.com/danielgindi/Charts/issues/3930) +- Gradient and round corner in bar chart [\#3928](https://github.com/danielgindi/Charts/issues/3928) +- Slide space color pie-chart [\#3926](https://github.com/danielgindi/Charts/issues/3926) +- Cannot build enterprise with Charts [\#3924](https://github.com/danielgindi/Charts/issues/3924) +- ChartUtils.swift line 225 [\#3922](https://github.com/danielgindi/Charts/issues/3922) +- Not Drawing Chart With Exact Axis [\#3921](https://github.com/danielgindi/Charts/issues/3921) +- LineChartView with a line that goes backwards [\#3919](https://github.com/danielgindi/Charts/issues/3919) +- Remove slices text in pieChart [\#3918](https://github.com/danielgindi/Charts/issues/3918) +- Crash at BarChartDataSet as! IBarChartDataSet [\#3917](https://github.com/danielgindi/Charts/issues/3917) +- carthage support lagging - needs updating for Xcode 10.2 & Swift5 [\#3914](https://github.com/danielgindi/Charts/issues/3914) +- The first dot doesn't show up when I use lineChart [\#3912](https://github.com/danielgindi/Charts/issues/3912) +- How to listen to the end of a chart swipe to call a method [\#3911](https://github.com/danielgindi/Charts/issues/3911) +- How to display single data when using LineChartView [\#3910](https://github.com/danielgindi/Charts/issues/3910) +- Straight Line in third quadrant does't show up [\#3898](https://github.com/danielgindi/Charts/issues/3898) +- Horizontal scrolling in long vertical tableView causes the outer table to jump [\#3866](https://github.com/danielgindi/Charts/issues/3866) +- PieChart with value lines with very small values render values on top of each other [\#3613](https://github.com/danielgindi/Charts/issues/3613) +- Line Chart do not draw line for Data Set [\#2567](https://github.com/danielgindi/Charts/issues/2567) +- Stacked bar marker returns entry.y of entire stack [\#2173](https://github.com/danielgindi/Charts/issues/2173) +- Repeating Xaxis values [\#2143](https://github.com/danielgindi/Charts/issues/2143) + **Merged pull requests:** - Apply Xcode11 changes [\#4153](https://github.com/danielgindi/Charts/pull/4153) ([liuxuan30](https://github.com/liuxuan30)) @@ -48,8 +369,77 @@ **Implemented enhancements:** +- Provide pre-compiled universal binary [\#3867](https://github.com/danielgindi/Charts/issues/3867) - Renamed `values` to `entries` to reflect the property's type [\#3847](https://github.com/danielgindi/Charts/pull/3847) ([jjatie](https://github.com/jjatie)) +**Fixed bugs:** + +- Pie chart with vertical orientation clips last legend entry [\#3860](https://github.com/danielgindi/Charts/issues/3860) + +**Closed issues:** + +- 雷达图的拐点是怎么设置的 [\#3964](https://github.com/danielgindi/Charts/issues/3964) +- BarChartView没有从0开始 [\#3963](https://github.com/danielgindi/Charts/issues/3963) +- version 3.3 using spm results invalid string error [\#3962](https://github.com/danielgindi/Charts/issues/3962) +- 折线图能分页吗 就是滑动到最左边 网络请求再加载数据 [\#3961](https://github.com/danielgindi/Charts/issues/3961) +- BarChartView problem on dataset count changed [\#3958](https://github.com/danielgindi/Charts/issues/3958) +- No Such Module 'Charts' [\#3955](https://github.com/danielgindi/Charts/issues/3955) +- drawing asynchronous [\#3952](https://github.com/danielgindi/Charts/issues/3952) +- demo can not run [\#3951](https://github.com/danielgindi/Charts/issues/3951) +- BarChartView extends all bars to bottom when all values are negative [\#3949](https://github.com/danielgindi/Charts/issues/3949) +- xcode10.2,swift5,chart version 3.3.0 [\#3948](https://github.com/danielgindi/Charts/issues/3948) +- Compiling for iOS 8.1, but module 'Charts' has a minimum deployment target of iOS 8.4 [\#3946](https://github.com/danielgindi/Charts/issues/3946) +- X轴的Label显示间隔会随着值的增加而变大, 能控制显示间隔吗? [\#3943](https://github.com/danielgindi/Charts/issues/3943) +- the first point of LineChartView is not displayed, and so is demo [\#3938](https://github.com/danielgindi/Charts/issues/3938) +- why????? [\#3934](https://github.com/danielgindi/Charts/issues/3934) +- The “Swift Language Version” \(SWIFT\_VERSION\) build setting must be set to a supported value for targets which use Swift. Supported values are: 4.0, 4.2, 5.0. This setting can be set in the build settings editor. [\#3932](https://github.com/danielgindi/Charts/issues/3932) +- error: SWIFT\_VERSION '3.0' is unsupported, supported versions are: 4.0, 4.2, 5.0. \(in target 'Charts'\) [\#3929](https://github.com/danielgindi/Charts/issues/3929) +- 最新版更新后的问题 [\#3927](https://github.com/danielgindi/Charts/issues/3927) +- How can i get CenterEntry in the View when i setted the MaxVisibleRange? [\#3925](https://github.com/danielgindi/Charts/issues/3925) +- EXC\_BAD\_ACCESS error on PieChart [\#3923](https://github.com/danielgindi/Charts/issues/3923) +- The first dot doesn't show up when I use lineChart [\#3915](https://github.com/danielgindi/Charts/issues/3915) +- Swift 5 Support w/ Cocoapods [\#3913](https://github.com/danielgindi/Charts/issues/3913) +- HOW to create pie chart like below image . https://user-images.githubusercontent.com/20434573/54804603-1d31fa80-4c9a-11e9-9960-00cf7c7d117d.png [\#3908](https://github.com/danielgindi/Charts/issues/3908) +- x Axis grid line origin is wrong ! maybe a bug, anxious!!! [\#3904](https://github.com/danielgindi/Charts/issues/3904) +- why not use CAShapeLayer? [\#3903](https://github.com/danielgindi/Charts/issues/3903) +- Chart legend [\#3896](https://github.com/danielgindi/Charts/issues/3896) +- Wrong values from pixelForValues [\#3895](https://github.com/danielgindi/Charts/issues/3895) +- Cannot set labels for RadarChart [\#3893](https://github.com/danielgindi/Charts/issues/3893) +- I can't migrate the swift files\(combined chart\) in objective c project. Could please share the objective c code fully. Thanks in advance. [\#3890](https://github.com/danielgindi/Charts/issues/3890) +- Draw circle only on last value [\#3887](https://github.com/danielgindi/Charts/issues/3887) +- Mismatch left axis maximum and minimum values [\#3886](https://github.com/danielgindi/Charts/issues/3886) +- How to animate? start poisiton is not from zero. [\#3885](https://github.com/danielgindi/Charts/issues/3885) +- I want to change line chart fill colours [\#3882](https://github.com/danielgindi/Charts/issues/3882) +- Circle view is not showing for first point of line chart [\#3881](https://github.com/danielgindi/Charts/issues/3881) +- support ECG demo? [\#3880](https://github.com/danielgindi/Charts/issues/3880) +- How to remove the values given outside the circle in piechart [\#3878](https://github.com/danielgindi/Charts/issues/3878) +- file was built for x86\_64 which is not the architecture being linked \(arm64\):error: linker command failed with exit code 1 \(use -v to see invocation\) [\#3877](https://github.com/danielgindi/Charts/issues/3877) +- Clipping first and last circle from line chart IOS. [\#3873](https://github.com/danielgindi/Charts/issues/3873) +- Smoothly moving a slowly changing linechart [\#3859](https://github.com/danielgindi/Charts/issues/3859) +- Monthly X-Axis labels \(corresponding values\) in my LineChart are not at the right position [\#3858](https://github.com/danielgindi/Charts/issues/3858) +- CandleChart do not render the first candle in CombineChartView [\#3857](https://github.com/danielgindi/Charts/issues/3857) +- Have 2 or more tresholds for one graph [\#3856](https://github.com/danielgindi/Charts/issues/3856) +- Unexpected crash on 3.2.2 [\#3855](https://github.com/danielgindi/Charts/issues/3855) +- How to change the display of legends? [\#3853](https://github.com/danielgindi/Charts/issues/3853) +- I want to call a method after the chart has been dragged and stopped. How can I detect it and the chart has stopped? [\#3851](https://github.com/danielgindi/Charts/issues/3851) +- HorizontalBarChartView bar negative values position [\#3850](https://github.com/danielgindi/Charts/issues/3850) +- charts 有数据创建图表后,点击按钮将数据置为空则崩溃 [\#3849](https://github.com/danielgindi/Charts/issues/3849) +- No circle is drawn on a line chart when there is only one data. \(version 3.2.2 only\) [\#3848](https://github.com/danielgindi/Charts/issues/3848) +- slice color [\#3844](https://github.com/danielgindi/Charts/issues/3844) +- BarChartView showing consecutive values in xAxis [\#3843](https://github.com/danielgindi/Charts/issues/3843) +- How to hide those icons? [\#3842](https://github.com/danielgindi/Charts/issues/3842) +- Swift 4.2: 'values' is deprecated Warnings [\#3840](https://github.com/danielgindi/Charts/issues/3840) +- Y-axis values draw error [\#3837](https://github.com/danielgindi/Charts/issues/3837) +- Horizontal Bar Chart Value Labels Cut Off [\#3836](https://github.com/danielgindi/Charts/issues/3836) +- The right Y axis displays incorrect values that does not fit the chart [\#3835](https://github.com/danielgindi/Charts/issues/3835) +- How to align labels on left side and put values inside bars on HorizontalBarChartView? \[HELP WANTED\] [\#3833](https://github.com/danielgindi/Charts/issues/3833) +- How to show the tooltip like value when clicked on candle of candleStick chart [\#3832](https://github.com/danielgindi/Charts/issues/3832) +- In line chart, can I make all labels in Chart area even with changing yOffset? [\#3829](https://github.com/danielgindi/Charts/issues/3829) +- Multiline value labels on BarChart. [\#3826](https://github.com/danielgindi/Charts/issues/3826) +- how can I spin the selected slice of piechart to top. [\#3825](https://github.com/danielgindi/Charts/issues/3825) +- Update Cocoapods [\#3773](https://github.com/danielgindi/Charts/issues/3773) +- Select circles on line chart [\#3307](https://github.com/danielgindi/Charts/issues/3307) + **Merged pull requests:** - Fix horizontal bar chart not drawing values and add unit tests [\#3906](https://github.com/danielgindi/Charts/pull/3906) ([liuxuan30](https://github.com/liuxuan30)) @@ -70,6 +460,128 @@ [Full Changelog](https://github.com/danielgindi/Charts/compare/v3.2.1...v3.2.2) +**Implemented enhancements:** + +- 【PieChart】Please support multiple colors for valueline. [\#3480](https://github.com/danielgindi/Charts/issues/3480) + +**Fixed bugs:** + +- CombinedChartView's candleData don't display in v3.2.0 [\#3662](https://github.com/danielgindi/Charts/issues/3662) +- Incorrect behavior for AxisBase.axisMaxLabels [\#3656](https://github.com/danielgindi/Charts/issues/3656) +- Horizontal Bar Chart legend issue [\#3301](https://github.com/danielgindi/Charts/issues/3301) + +**Closed issues:** + +- barchartview draw value in bottom of chart [\#3827](https://github.com/danielgindi/Charts/issues/3827) +- Regarding to label of axis, I think it displays .03 instead of 0.03 [\#3824](https://github.com/danielgindi/Charts/issues/3824) +- Bar Chart Not Showing Colours Correctly [\#3823](https://github.com/danielgindi/Charts/issues/3823) +- Pie Chart on click show value on label. Does anyone know how to do it? [\#3822](https://github.com/danielgindi/Charts/issues/3822) +- chartTranslated in a Pie Chart is not called [\#3821](https://github.com/danielgindi/Charts/issues/3821) +- Issue creating a simple line chart [\#3820](https://github.com/danielgindi/Charts/issues/3820) +- How to save image of scrollable graph [\#3819](https://github.com/danielgindi/Charts/issues/3819) +- Candle charts not showing candles on swift 4.2 [\#3818](https://github.com/danielgindi/Charts/issues/3818) +- How to get a value from line graph if there is more than one lines [\#3817](https://github.com/danielgindi/Charts/issues/3817) +- Multiple colors for the same line [\#3816](https://github.com/danielgindi/Charts/issues/3816) +- Memory Leaks in subclass of LineChartView [\#3813](https://github.com/danielgindi/Charts/issues/3813) +- Distortion When Animating Height of Auto Layout `LineChartView` [\#3811](https://github.com/danielgindi/Charts/issues/3811) +- How to show break in line chart for more than one graph? [\#3810](https://github.com/danielgindi/Charts/issues/3810) +- PIE Chart Colors not properly set [\#3809](https://github.com/danielgindi/Charts/issues/3809) +- A Question to contribution [\#3808](https://github.com/danielgindi/Charts/issues/3808) +- When y value is equal ,HorizontalBarChartView only show integer [\#3806](https://github.com/danielgindi/Charts/issues/3806) +- Highlight per drag not working! [\#3805](https://github.com/danielgindi/Charts/issues/3805) +- chartTranslated is called when no translation happened [\#3803](https://github.com/danielgindi/Charts/issues/3803) +- Xcode10 real machine operation error! [\#3802](https://github.com/danielgindi/Charts/issues/3802) +- Bar Width issue after reset the data [\#3801](https://github.com/danielgindi/Charts/issues/3801) +- Performance issue: drawCircles\(context: CGContext\) in LineChart [\#3798](https://github.com/danielgindi/Charts/issues/3798) +- LineChartView Y-Aixs label'number inaccuracy [\#3794](https://github.com/danielgindi/Charts/issues/3794) +- charts在特定范围内的参考坐标精度问题 [\#3793](https://github.com/danielgindi/Charts/issues/3793) +- Change chart legend show order [\#3791](https://github.com/danielgindi/Charts/issues/3791) +- hello,I don't want to display the pie chart by zero percent. How can I do this [\#3790](https://github.com/danielgindi/Charts/issues/3790) +- how to center legend text of LineChartView? [\#3789](https://github.com/danielgindi/Charts/issues/3789) +- How to Plot only for the available x axis and leave the rest of the x axis blank? [\#3788](https://github.com/danielgindi/Charts/issues/3788) +- Custom chart marker [\#3787](https://github.com/danielgindi/Charts/issues/3787) +- How to shift xAxis values to right? [\#3785](https://github.com/danielgindi/Charts/issues/3785) +- How to disable Accessibility support? [\#3782](https://github.com/danielgindi/Charts/issues/3782) +- Feature: Add option to draw limit lines on top of data [\#3781](https://github.com/danielgindi/Charts/issues/3781) +- Legend spacing issue with LineChart and colors\[\] [\#3780](https://github.com/danielgindi/Charts/issues/3780) +- How to change value line length for each value in pieChartView [\#3776](https://github.com/danielgindi/Charts/issues/3776) +- Crash on the function isDrawingValuesAllowed [\#3772](https://github.com/danielgindi/Charts/issues/3772) +- How to let y axis line show same space when axisMinimum = 0? [\#3771](https://github.com/danielgindi/Charts/issues/3771) +- Xcode 10.1 pod install Charts open project error!!! [\#3769](https://github.com/danielgindi/Charts/issues/3769) +- Is it possible to make some gaps on a same line plot? [\#3765](https://github.com/danielgindi/Charts/issues/3765) +- Is it possible to draw custom shape on chart and handle touch on it [\#3763](https://github.com/danielgindi/Charts/issues/3763) +- Start slice automatically seleted in pie chart [\#3762](https://github.com/danielgindi/Charts/issues/3762) +- How to change color when press down on pie chart? [\#3761](https://github.com/danielgindi/Charts/issues/3761) +- notifyDataSetChanged\(\) crash when datapoint is highlighted in LineChartView [\#3759](https://github.com/danielgindi/Charts/issues/3759) +- BarChartView display half in first bar when change from group bar to bar only [\#3757](https://github.com/danielgindi/Charts/issues/3757) +- Description of Bar doesn't appear in Horizontal BarChartView [\#3756](https://github.com/danielgindi/Charts/issues/3756) +- Chart spacing between xAxis Labels [\#3755](https://github.com/danielgindi/Charts/issues/3755) +- Granularity makes my app crash because require index from zero [\#3753](https://github.com/danielgindi/Charts/issues/3753) +- this counter will make your app being crash in particular case [\#3752](https://github.com/danielgindi/Charts/issues/3752) +- Bar Chart Drawing is wrong without setting axisminimum [\#3751](https://github.com/danielgindi/Charts/issues/3751) +- Help needed - in changing the position for Piechart in SWIFT [\#3749](https://github.com/danielgindi/Charts/issues/3749) +- When using CombinedChartView, CandleChartData cannot be displayed [\#3748](https://github.com/danielgindi/Charts/issues/3748) +- Linear chart line with different thickness of direction [\#3746](https://github.com/danielgindi/Charts/issues/3746) +- I want to try a lot of line charts corresponding to the X axis is different, how can I achieve it. [\#3745](https://github.com/danielgindi/Charts/issues/3745) +- 折线图-具体时间的数据绘制进图表问题 [\#3743](https://github.com/danielgindi/Charts/issues/3743) +- Changing lineCap doesn't work when mode is not linear/stepped [\#3739](https://github.com/danielgindi/Charts/issues/3739) +- Reverse Pie Chart animation [\#3738](https://github.com/danielgindi/Charts/issues/3738) +- How to create y-axis for empty label ? [\#3735](https://github.com/danielgindi/Charts/issues/3735) +- Different colors for above and below 0 when filling a Line Chart [\#3733](https://github.com/danielgindi/Charts/issues/3733) +- How to adding multiple lines to Line Chart for swift 4.0? [\#3732](https://github.com/danielgindi/Charts/issues/3732) +- How to format y-values drawn on bar? [\#3731](https://github.com/danielgindi/Charts/issues/3731) +- how to moveViewToX and not calling setNeedsDisplay\(\) [\#3730](https://github.com/danielgindi/Charts/issues/3730) +- When using CombinedChartView, CandleChartData cannot be displayed [\#3729](https://github.com/danielgindi/Charts/issues/3729) +- Need Help. How to show labels in xAxis for GroupedBarChart? [\#3728](https://github.com/danielgindi/Charts/issues/3728) +- Force axis granularity [\#3727](https://github.com/danielgindi/Charts/issues/3727) +- Y decimal values error [\#3725](https://github.com/danielgindi/Charts/issues/3725) +- if i have 840entrys how can i set the xaxis what i want .e.g i only want to show the 0 and 840 [\#3723](https://github.com/danielgindi/Charts/issues/3723) +- if i have 840entrys how can i set the xaxis what i want .e.g i only want to show the 0 and 840 [\#3722](https://github.com/danielgindi/Charts/issues/3722) +- Align both right and left axis in the same line [\#3720](https://github.com/danielgindi/Charts/issues/3720) +- The `open var noDataTextAlignment: NSTextAlignment = .left` is missing the `@objc` so it's not exposed in Objective C. [\#3719](https://github.com/danielgindi/Charts/issues/3719) +- How to hide bottom colors & label section in Bar Chat [\#3718](https://github.com/danielgindi/Charts/issues/3718) +- Draw Line chart for non linear X-axis [\#3717](https://github.com/danielgindi/Charts/issues/3717) +- Any way to adjust the candle bar width? [\#3716](https://github.com/danielgindi/Charts/issues/3716) +- xAxis grid line in-between bar rather than center of bar [\#3713](https://github.com/danielgindi/Charts/issues/3713) +- Bubble Chart is not rendering [\#3711](https://github.com/danielgindi/Charts/issues/3711) +- Bubble Chart is not rendering [\#3710](https://github.com/danielgindi/Charts/issues/3710) +- \[Feature request\] Continue line chart beyond x-axis limits [\#3708](https://github.com/danielgindi/Charts/issues/3708) +- Use of unresolved identifier 'UIAccessibility' & Type 'UIAccessibilityTraits' \(aka 'UInt64'\) has no member 'header' [\#3707](https://github.com/danielgindi/Charts/issues/3707) +- How to draw a line chart in sections? [\#3706](https://github.com/danielgindi/Charts/issues/3706) +- \[Feature / Help\] Resize Chart based on data visibility [\#3705](https://github.com/danielgindi/Charts/issues/3705) +- \[Request / Help\] Resize Chart based on hidden / shown lines [\#3704](https://github.com/danielgindi/Charts/issues/3704) +- listening for click events in pieChartView [\#3703](https://github.com/danielgindi/Charts/issues/3703) +- How to add Strings on Left Axis in iOS-charts? [\#3702](https://github.com/danielgindi/Charts/issues/3702) +- \[Charts.BarChartDataSet setDrawIconsEnabled:\]: unrecognized selector sent to instance [\#3700](https://github.com/danielgindi/Charts/issues/3700) +- How can I set xAxis to second line? [\#3698](https://github.com/danielgindi/Charts/issues/3698) +- Add to OC project and the api is so big, How to solve this problem [\#3697](https://github.com/danielgindi/Charts/issues/3697) +- How can I call func stringForValue\(\_ value: Double, axis: AxisBase?\) -\> String [\#3696](https://github.com/danielgindi/Charts/issues/3696) +- Line chart, slide left and right to see more data? How to set it up [\#3693](https://github.com/danielgindi/Charts/issues/3693) +- Value for SWIFT\_VERSION cannot be empty. \(in target 'Charts'\) [\#3692](https://github.com/danielgindi/Charts/issues/3692) +- how to make a combine chart \(line chart + bar chart\) with leftAxis taking the top half area of the combined graph and right axis taking the bottom half [\#3690](https://github.com/danielgindi/Charts/issues/3690) +- is there any library for Gantt chart in ios swift ? please suggest me a solution..... [\#3688](https://github.com/danielgindi/Charts/issues/3688) +- Integrated to xcode10 crash [\#3687](https://github.com/danielgindi/Charts/issues/3687) +- XCode 10 app crash. [\#3686](https://github.com/danielgindi/Charts/issues/3686) +- Getting Errors in Xcode 9.2 [\#3684](https://github.com/danielgindi/Charts/issues/3684) +- How to show double vale with string in y-axis [\#3683](https://github.com/danielgindi/Charts/issues/3683) +- When I have a lot of data, how can I slide to the far right by default? [\#3682](https://github.com/danielgindi/Charts/issues/3682) +- Pie Chart - Slices are not drawn and values are overlapping [\#3679](https://github.com/danielgindi/Charts/issues/3679) +- setVisibleXRangeMaximum is behaving unexpectedly [\#3678](https://github.com/danielgindi/Charts/issues/3678) +- Getting issues after pod update. [\#3677](https://github.com/danielgindi/Charts/issues/3677) +- Pie chart and gradient [\#3674](https://github.com/danielgindi/Charts/issues/3674) +- CandleStickChartRenderer drawDataSet method does not work with CombinedChartView [\#3673](https://github.com/danielgindi/Charts/issues/3673) +- How to Hide Text? [\#3672](https://github.com/danielgindi/Charts/issues/3672) +- Memory leaks were detected also in the demo project [\#3671](https://github.com/danielgindi/Charts/issues/3671) +- Can't add two pie charts in a uiviewcontroller at same time [\#3670](https://github.com/danielgindi/Charts/issues/3670) +- ChartData ValueTextColor can not achieve a variety of colors [\#3669](https://github.com/danielgindi/Charts/issues/3669) +- PieChartView settings color is Invalid [\#3668](https://github.com/danielgindi/Charts/issues/3668) +- DrawValuesEnabled variable unreachable \(Swift 4.2\) [\#3665](https://github.com/danielgindi/Charts/issues/3665) +- Failed to verify bitcode in Charts.framework [\#3663](https://github.com/danielgindi/Charts/issues/3663) +- \[3.2.0\] Excessive Memory leaks in Swift 4.2 related to LineChartView, not present in 3.1.1 w/Swift 4 [\#3649](https://github.com/danielgindi/Charts/issues/3649) +- BarChart - xAxis Labels disappear if not a min of 2 on the screen [\#2854](https://github.com/danielgindi/Charts/issues/2854) +- 柱状图一直横向拉伸, 持续差不多 15s 就崩溃了 [\#2642](https://github.com/danielgindi/Charts/issues/2642) +- Any one try to integrate with SpriteKit/SKScene ? [\#2129](https://github.com/danielgindi/Charts/issues/2129) + **Merged pull requests:** - Add Collection conformances to ChartDataSet types [\#3815](https://github.com/danielgindi/Charts/pull/3815) ([jjatie](https://github.com/jjatie)) @@ -94,9 +606,253 @@ [Full Changelog](https://github.com/danielgindi/Charts/compare/v3.2.0...v3.2.1) +**Closed issues:** + +- Getting error after updating XCode to 10 from 9.4 [\#3661](https://github.com/danielgindi/Charts/issues/3661) +- Bar Chart with horizondal scroll on clicking button. [\#3660](https://github.com/danielgindi/Charts/issues/3660) +- How to change the piechart' valueLineColor and valueTextColor color individually [\#3658](https://github.com/danielgindi/Charts/issues/3658) +- Update to Swift 4.2 [\#3655](https://github.com/danielgindi/Charts/issues/3655) +- I am trying to use charts. for ios app. I am using cocoa pod for dependency setup. After setup i am trying to build the code it throwing compile errors. [\#3653](https://github.com/danielgindi/Charts/issues/3653) +- Type 'RunLoop' has no member 'Mode' [\#3652](https://github.com/danielgindi/Charts/issues/3652) +- Module compiled with Swift 4.1.2 cannot be imported by the Swift 4.2 [\#3651](https://github.com/danielgindi/Charts/issues/3651) +- Type 'RunLoop' has no member 'Mode' [\#3648](https://github.com/danielgindi/Charts/issues/3648) +- As of todays update, I am running into this issue. 'common' renamed RunLoopMode.commonModes [\#3647](https://github.com/danielgindi/Charts/issues/3647) +- Change circleHoleColor for one point [\#3646](https://github.com/danielgindi/Charts/issues/3646) +- This API is not working with Swift 4.1.. even after taking V3.2 of Charts API also.. I fixed it myself :\( [\#3645](https://github.com/danielgindi/Charts/issues/3645) +- Help building Charts Demo [\#3643](https://github.com/danielgindi/Charts/issues/3643) +- Limit line label orientation [\#3641](https://github.com/danielgindi/Charts/issues/3641) +- Is it possible to zoom into a range of values? [\#3639](https://github.com/danielgindi/Charts/issues/3639) +- Not working with SDK-Swift 4.2 [\#3635](https://github.com/danielgindi/Charts/issues/3635) +- getting the error that let is implicitly final please change from open to public in Xcode10 GM Seed [\#3634](https://github.com/danielgindi/Charts/issues/3634) +- How to optimize when the amount of data is large [\#3633](https://github.com/danielgindi/Charts/issues/3633) +- Adding mathematical function plotting [\#3632](https://github.com/danielgindi/Charts/issues/3632) +- Color shadow inside piechart [\#3631](https://github.com/danielgindi/Charts/issues/3631) +- I can not set one label on y axis. [\#3630](https://github.com/danielgindi/Charts/issues/3630) +- where is the code for draw the xAxis and yAxis indicateLine [\#3628](https://github.com/danielgindi/Charts/issues/3628) +- Is it possible to add a vertical label for Y-Axis? Or anyone working on it? [\#3627](https://github.com/danielgindi/Charts/issues/3627) +- Adding dashed lines in between bars in bar graph [\#3626](https://github.com/danielgindi/Charts/issues/3626) +- Create Line chart and/or Bar chart from String Array [\#3625](https://github.com/danielgindi/Charts/issues/3625) +- Change data if button press [\#3624](https://github.com/danielgindi/Charts/issues/3624) +- Pie Chart and Legend [\#3622](https://github.com/danielgindi/Charts/issues/3622) +- Add labels to marker or create custom marker view [\#3620](https://github.com/danielgindi/Charts/issues/3620) +- is there any way we can change the values font size for ipad in the same code? [\#3618](https://github.com/danielgindi/Charts/issues/3618) +- Reg: Display Min and Max Point in a PopUp [\#3617](https://github.com/danielgindi/Charts/issues/3617) +- Charts ScaleX problem [\#3616](https://github.com/danielgindi/Charts/issues/3616) +- CombinedChartView - EXC\_BAD\_ACCESS with doubleTapToZoomEnabled [\#3614](https://github.com/danielgindi/Charts/issues/3614) +- BarChartView How to set the fixed width and spacing? [\#3609](https://github.com/danielgindi/Charts/issues/3609) +- How can I combine two lineCharts? [\#3607](https://github.com/danielgindi/Charts/issues/3607) +- 'Charts/Charts-Swift.h' file not found [\#3603](https://github.com/danielgindi/Charts/issues/3603) +- Combined Chart with Horizontal Bar chart and a Line chart [\#3600](https://github.com/danielgindi/Charts/issues/3600) +- Design customization [\#3597](https://github.com/danielgindi/Charts/issues/3597) +- Move pie chart to specific location in the view [\#3595](https://github.com/danielgindi/Charts/issues/3595) +- Adding text data points to axis [\#3592](https://github.com/danielgindi/Charts/issues/3592) +- Performance hit [\#3585](https://github.com/danielgindi/Charts/issues/3585) +- Multiple colours for setValueTextColor and xAxis label with NSAttributedString [\#3566](https://github.com/danielgindi/Charts/issues/3566) +- Can't set a fixed width for YAxis with outside style. [\#3565](https://github.com/danielgindi/Charts/issues/3565) +- Switch from Grouped Bar chart back to normal [\#3551](https://github.com/danielgindi/Charts/issues/3551) +- X or Y axis interval of the labels [\#3547](https://github.com/danielgindi/Charts/issues/3547) +- How can I plot all Axis Value? [\#3540](https://github.com/danielgindi/Charts/issues/3540) +- When the number of numeric numbers on the Y axis does not agree, the right of the multiple charts will not be aligned. [\#3347](https://github.com/danielgindi/Charts/issues/3347) + ## [v3.2.0](https://github.com/danielgindi/Charts/tree/v3.2.0) (2018-09-17) -[Full Changelog](https://github.com/danielgindi/Charts/compare/3.1.1...v3.2.0) +[Full Changelog](https://github.com/danielgindi/Charts/compare/v3.1.1...v3.2.0) + +**Fixed bugs:** + +- Remove noDataText [\#3396](https://github.com/danielgindi/Charts/issues/3396) + +**Closed issues:** + +- Xcode 10 beta & Swift 4.2 support [\#3623](https://github.com/danielgindi/Charts/issues/3623) +- CombinedChartView not population correctly [\#3619](https://github.com/danielgindi/Charts/issues/3619) +- How to remove Cubic Line chart value? [\#3615](https://github.com/danielgindi/Charts/issues/3615) +- How to set Y axis to display different colors of label [\#3611](https://github.com/danielgindi/Charts/issues/3611) +- Installation with carthage error!!! [\#3610](https://github.com/danielgindi/Charts/issues/3610) +- xcodebuild archive error [\#3606](https://github.com/danielgindi/Charts/issues/3606) +- swift library added successfully, but can't reach any of the interfaces [\#3605](https://github.com/danielgindi/Charts/issues/3605) +- BarChart draw sum of values above bar [\#3604](https://github.com/danielgindi/Charts/issues/3604) +- iOS 12 [\#3601](https://github.com/danielgindi/Charts/issues/3601) +- v [\#3598](https://github.com/danielgindi/Charts/issues/3598) +- Compilation errors with Swift 4.1 [\#3596](https://github.com/danielgindi/Charts/issues/3596) +- Bar Chart highlights last clicked bar [\#3594](https://github.com/danielgindi/Charts/issues/3594) +- Remove hightlight, when swipe ends. Or just catch event when swipe ends [\#3588](https://github.com/danielgindi/Charts/issues/3588) +- bars did not displayed as expect [\#3586](https://github.com/danielgindi/Charts/issues/3586) +- what about the property 'gradientPositions' on branch 4.0.0, and how to use [\#3584](https://github.com/danielgindi/Charts/issues/3584) +- Creating markers for Radar Charts [\#3582](https://github.com/danielgindi/Charts/issues/3582) +- How to display value on touch? [\#3581](https://github.com/danielgindi/Charts/issues/3581) +- LineChart \(gradient fill\) is not working in Swift 4 [\#3580](https://github.com/danielgindi/Charts/issues/3580) +- Is there a way to use Line Chart with custom xAxis? [\#3579](https://github.com/danielgindi/Charts/issues/3579) +- Xaxis MutliLine and Value Multiline [\#3575](https://github.com/danielgindi/Charts/issues/3575) +- REACT NATIVE CHART ISSUE [\#3574](https://github.com/danielgindi/Charts/issues/3574) +- Data labels not shown when mutable array of entries used. [\#3573](https://github.com/danielgindi/Charts/issues/3573) +- Grid background color extends beyond data sets [\#3572](https://github.com/danielgindi/Charts/issues/3572) +- real time plot [\#3571](https://github.com/danielgindi/Charts/issues/3571) +- Add shadow effect for pie chart [\#3570](https://github.com/danielgindi/Charts/issues/3570) +- The target “Charts” contains source code developed with Swift 2.x. Xcode 9 does not support building or migrating Swift 2.x targets. [\#3569](https://github.com/danielgindi/Charts/issues/3569) +- What is the best way to show around 100'000 values? [\#3568](https://github.com/danielgindi/Charts/issues/3568) +- CandleChart In CombinedChartView not work [\#3567](https://github.com/danielgindi/Charts/issues/3567) +- the x axis label is not in the right position when I used groupBarChart [\#3564](https://github.com/danielgindi/Charts/issues/3564) +- Bar Charts with only top outline like line chart [\#3562](https://github.com/danielgindi/Charts/issues/3562) +- How to fill the area between two lines on LineChart [\#3561](https://github.com/danielgindi/Charts/issues/3561) +- How to support rose chart? [\#3560](https://github.com/danielgindi/Charts/issues/3560) +- How I can get unselected entry [\#3559](https://github.com/danielgindi/Charts/issues/3559) +- Custom x-axis labels won't show without backing data [\#3557](https://github.com/danielgindi/Charts/issues/3557) +- Cannot build Charts project using Carthage [\#3555](https://github.com/danielgindi/Charts/issues/3555) +- Customizing bar chart [\#3554](https://github.com/danielgindi/Charts/issues/3554) +- Line Chart: Can't display icons unless data labels are also displayed [\#3553](https://github.com/danielgindi/Charts/issues/3553) +- How to enable highlight to some datapoints only when chart is zoomed [\#3552](https://github.com/danielgindi/Charts/issues/3552) +- 关于OC项目引入Charts IPA体积过大的问题 [\#3549](https://github.com/danielgindi/Charts/issues/3549) +- X or Y unit?How to do? [\#3545](https://github.com/danielgindi/Charts/issues/3545) +- Why my chart have line on zero on yAXis [\#3544](https://github.com/danielgindi/Charts/issues/3544) +- Value of type 'EnumeratedSequence\<\[CGPoint\]\>' has no member 'compactMap' [\#3543](https://github.com/danielgindi/Charts/issues/3543) +- Show Axis unit in last label [\#3542](https://github.com/danielgindi/Charts/issues/3542) +- In iOS-Charts how to hide one of Y axis grid lines. [\#3541](https://github.com/danielgindi/Charts/issues/3541) +- Highlighting on a scrollable line graph [\#3539](https://github.com/danielgindi/Charts/issues/3539) +- disable gradient fill Linechart [\#3537](https://github.com/danielgindi/Charts/issues/3537) +- Undefined symbols for architecture - import issues [\#3536](https://github.com/danielgindi/Charts/issues/3536) +- Horizontal Bar Chart Bar Collapsing [\#3535](https://github.com/danielgindi/Charts/issues/3535) +- How to remove space between line chart and top legend [\#3534](https://github.com/danielgindi/Charts/issues/3534) +- Scrolling of bar chart is not working initially. [\#3532](https://github.com/danielgindi/Charts/issues/3532) +- Remove DataSet label [\#3531](https://github.com/danielgindi/Charts/issues/3531) +- HorizontalBarChartView 横向柱状图Y轴问题 [\#3530](https://github.com/danielgindi/Charts/issues/3530) +- 怎么设置柱状图的宽度不变 [\#3529](https://github.com/danielgindi/Charts/issues/3529) +- Is it possible to show the values of a horizontal stacked bar chart centered? [\#3526](https://github.com/danielgindi/Charts/issues/3526) +- how to change LineChartDataSet without strange redraw issues? [\#3525](https://github.com/danielgindi/Charts/issues/3525) +- I want to add image in left side of line graph when we scroll the image is also scroll [\#3521](https://github.com/danielgindi/Charts/issues/3521) +- Fixed label at axis origin [\#3519](https://github.com/danielgindi/Charts/issues/3519) +- Horizontal bar charts labels max out too early [\#3517](https://github.com/danielgindi/Charts/issues/3517) +- multiple PieCharts in on Screen [\#3516](https://github.com/danielgindi/Charts/issues/3516) +- First and Last Bars are not displaying full bars in CombinedChartView [\#3515](https://github.com/danielgindi/Charts/issues/3515) +- Line chart does not render correctly [\#3514](https://github.com/danielgindi/Charts/issues/3514) +- Line chart with LineChartView the line is lower than the minimum values [\#3513](https://github.com/danielgindi/Charts/issues/3513) +- Bar chart is plotting for empty value and Line chart is not appeared in CombinedChartView [\#3511](https://github.com/danielgindi/Charts/issues/3511) +- The shape of graph becomes smaller and smaller in RadarChartGraph [\#3510](https://github.com/danielgindi/Charts/issues/3510) +- not able to display x-axis labels like \(jun, july\) in line chart [\#3509](https://github.com/danielgindi/Charts/issues/3509) +- Move points on LineChart with Pan Gesture [\#3508](https://github.com/danielgindi/Charts/issues/3508) +- 32 bit Device not handling high x-values [\#3507](https://github.com/danielgindi/Charts/issues/3507) +- How do you override the getFormattedValue\(\) method when it doesn't exist? [\#3506](https://github.com/danielgindi/Charts/issues/3506) +- drawBarShadowEnabled is crashing in swift 4 [\#3505](https://github.com/danielgindi/Charts/issues/3505) +- x,y axis and guidelines hide on grah reload [\#3503](https://github.com/danielgindi/Charts/issues/3503) +- 显示float问题 [\#3501](https://github.com/danielgindi/Charts/issues/3501) +- App Crash in release mode not in debug mode [\#3499](https://github.com/danielgindi/Charts/issues/3499) +- Arrow on axis end [\#3498](https://github.com/danielgindi/Charts/issues/3498) +- LineChartView setup "set.mode = LineChartModeCubicBezier",The wave-peak trough of the smooth chart shows no value and deviates from these points [\#3497](https://github.com/danielgindi/Charts/issues/3497) +- Errors when trying to compile a project using Charts [\#3496](https://github.com/danielgindi/Charts/issues/3496) +- Need Help I want to Make 2 lines of X axis label and x axis label background color [\#3495](https://github.com/danielgindi/Charts/issues/3495) +- Getting current xAxis value [\#3494](https://github.com/danielgindi/Charts/issues/3494) +- where to catch the function about marker disappears or appears with dataEntrance [\#3493](https://github.com/danielgindi/Charts/issues/3493) +- Get chart image without rendering chart [\#3492](https://github.com/danielgindi/Charts/issues/3492) +- Cant able to set XAxis Range for custom DateTime formatter [\#3491](https://github.com/danielgindi/Charts/issues/3491) +- How to set the accuracy of data, such as two decimal places, e.g 2.32, 3.21. [\#3490](https://github.com/danielgindi/Charts/issues/3490) +- FFT graphs? [\#3489](https://github.com/danielgindi/Charts/issues/3489) +- Is there a better way to easily add highest and lowest value in candlestick chart [\#3488](https://github.com/danielgindi/Charts/issues/3488) +- Remove piechart center white area [\#3487](https://github.com/danielgindi/Charts/issues/3487) +- xAxis label is croped when using custom valueFormatter [\#3485](https://github.com/danielgindi/Charts/issues/3485) +- Change location of left axis labels [\#3484](https://github.com/danielgindi/Charts/issues/3484) +- How to plot multiple yValue but display selected xValue in xAxis Label? [\#3483](https://github.com/danielgindi/Charts/issues/3483) +- Bubble Charts Choose not jump into the method “chartValueSelected...”? [\#3482](https://github.com/danielgindi/Charts/issues/3482) +- How to plot time value format on x-axis in real time graph [\#3481](https://github.com/danielgindi/Charts/issues/3481) +- How to remove Right side vertical line and values in LineChartView [\#3478](https://github.com/danielgindi/Charts/issues/3478) +- Bar Chart View acting weird \(zooming\) [\#3477](https://github.com/danielgindi/Charts/issues/3477) +- Is their anyway to show legend in rows and columns format? [\#3476](https://github.com/danielgindi/Charts/issues/3476) +- Duplicate Y-axis values while pitching the graph moving up [\#3475](https://github.com/danielgindi/Charts/issues/3475) +- getValuesByTouchPoint / UIView coords to graph coords [\#3474](https://github.com/danielgindi/Charts/issues/3474) +- Pie Chart label not show if its value 0 [\#3473](https://github.com/danielgindi/Charts/issues/3473) +- Build failed [\#3472](https://github.com/danielgindi/Charts/issues/3472) +- What will be the version of pod if I am running on swift 2.3 ? [\#3471](https://github.com/danielgindi/Charts/issues/3471) +- Using SPM results in a "dependency graph is unresolvable" error. [\#3470](https://github.com/danielgindi/Charts/issues/3470) +- Demo is not compiling [\#3469](https://github.com/danielgindi/Charts/issues/3469) +- Question [\#3466](https://github.com/danielgindi/Charts/issues/3466) +- need help [\#3464](https://github.com/danielgindi/Charts/issues/3464) +- bar Chart legend always show one label [\#3462](https://github.com/danielgindi/Charts/issues/3462) +- Monitor rotation angle [\#3461](https://github.com/danielgindi/Charts/issues/3461) +- when clicking chartView,How to prompt multiple markerView [\#3460](https://github.com/danielgindi/Charts/issues/3460) +- The chart will draw incorrectly if LineChart leftAxis.axisMinimum does not start at zero [\#3458](https://github.com/danielgindi/Charts/issues/3458) +- Grouped bar chart plotting wrong !! [\#3457](https://github.com/danielgindi/Charts/issues/3457) +- 为什么我设置X轴不显示 [\#3456](https://github.com/danielgindi/Charts/issues/3456) +- how to set string values on x axis in bar chart? please help [\#3455](https://github.com/danielgindi/Charts/issues/3455) +- Left axis and right axis not same zero line [\#3454](https://github.com/danielgindi/Charts/issues/3454) +- How can make HorizontalBarChart dont start at zero? [\#3453](https://github.com/danielgindi/Charts/issues/3453) +- Can't customise X-axis grid line labels in time value line chart. [\#3452](https://github.com/danielgindi/Charts/issues/3452) +- xAxis gridlines are missing [\#3451](https://github.com/danielgindi/Charts/issues/3451) +- How to add attributed string in Xaxis labels [\#3450](https://github.com/danielgindi/Charts/issues/3450) +- 点击0这一列,所有的柱状图都高亮,可以吗 [\#3449](https://github.com/danielgindi/Charts/issues/3449) +- how to use 'LineChartView' to draw a line between nonzero values? [\#3448](https://github.com/danielgindi/Charts/issues/3448) +- The maximum value of the histogram is not shown. [\#3447](https://github.com/danielgindi/Charts/issues/3447) +- The Y-axis numerical display problem. [\#3446](https://github.com/danielgindi/Charts/issues/3446) +- Is it possible to show x-Axis gridlines when there's only one ChartDataEntry? [\#3444](https://github.com/danielgindi/Charts/issues/3444) +- Chart callback events [\#3443](https://github.com/danielgindi/Charts/issues/3443) +- Help needed with Grouped Horizontal Bar Chart [\#3442](https://github.com/danielgindi/Charts/issues/3442) +- Candlestick doesn't work when x does not start at 0 [\#3441](https://github.com/danielgindi/Charts/issues/3441) +- Is there a callback method? [\#3439](https://github.com/danielgindi/Charts/issues/3439) +- oc项目集成Charts,上架打包失败,提示ERROR ITMS-90171: "Invalid Bundle Structure - The binary file '时间炼.app/Frameworks/Charts.framework/Charts' is not permitted. Your app can’t contain standalone executables or libraries, other than a valid CFBundleExecutable of supported bundles. Refer to the Bundle Programming Guide at https://developer.apple.com/go/?id=bundle-structure for information on the iOS app bundle structure."。新手,求解答!Thanks [\#3438](https://github.com/danielgindi/Charts/issues/3438) +- Axis label alignment with labelRotationAngle [\#3437](https://github.com/danielgindi/Charts/issues/3437) +- Show grid with axis deactivated [\#3436](https://github.com/danielgindi/Charts/issues/3436) +- Error: cannot use instance member '\_viewPortHandler' within property initializer; property initializers run before 'self' is available [\#3434](https://github.com/danielgindi/Charts/issues/3434) +- remove labels [\#3433](https://github.com/danielgindi/Charts/issues/3433) +- How to set the number of lines for the label of xAxis of HorizontalBarChartView ? [\#3431](https://github.com/danielgindi/Charts/issues/3431) +- xAxis labelText too long, it can not draw complete. [\#3430](https://github.com/danielgindi/Charts/issues/3430) +- Weird crash [\#3427](https://github.com/danielgindi/Charts/issues/3427) +- Why does the default value of the Y label take the decimal point? [\#3426](https://github.com/danielgindi/Charts/issues/3426) +- Why won't the viewport move to the last X value of my line chart? [\#3425](https://github.com/danielgindi/Charts/issues/3425) +- How to disable highlight for some specific values [\#3423](https://github.com/danielgindi/Charts/issues/3423) +- IAxisValueFormatter Error: Index out of range [\#3422](https://github.com/danielgindi/Charts/issues/3422) +- can we animate SelectionShift when selecting a segment of pie chart? [\#3420](https://github.com/danielgindi/Charts/issues/3420) +- Y-axis minimum scale deviation problem. [\#3419](https://github.com/danielgindi/Charts/issues/3419) +- How do you set the scale of the Y-axis? [\#3418](https://github.com/danielgindi/Charts/issues/3418) +- BarLineChartViewBase doubleTapGestureRecognized [\#3417](https://github.com/danielgindi/Charts/issues/3417) +- Remove the box from the pie chart. [\#3416](https://github.com/danielgindi/Charts/issues/3416) +- Unable to set transparent color or clear color to the graphs background. [\#3414](https://github.com/danielgindi/Charts/issues/3414) +- BarChartView has no TouchUpInside event, only TouchDown event. [\#3411](https://github.com/danielgindi/Charts/issues/3411) +- YAxis,the integer bit is missing, showing.0 or.00 [\#3410](https://github.com/danielgindi/Charts/issues/3410) +- touchesEnded can't be called in chart view? [\#3409](https://github.com/danielgindi/Charts/issues/3409) +- Is it possible to show date values in the Stacked BarChart? [\#3408](https://github.com/danielgindi/Charts/issues/3408) +- Passing STRING values to X-Axis currently the SetDataCount is accepting only INT and Double data types [\#3407](https://github.com/danielgindi/Charts/issues/3407) +- compactMap build error [\#3405](https://github.com/danielgindi/Charts/issues/3405) +- Marker in CombinedChart is displayed incorrectly. [\#3404](https://github.com/danielgindi/Charts/issues/3404) +- I need to customize the column chart [\#3401](https://github.com/danielgindi/Charts/issues/3401) +- YAxis show the value .0 or .00 [\#3400](https://github.com/danielgindi/Charts/issues/3400) +- How to do BarChart \(grouped DataSets\)\(OC\)? [\#3399](https://github.com/danielgindi/Charts/issues/3399) +- Can't build success with xcode toolchains swift 4.0.3 release [\#3398](https://github.com/danielgindi/Charts/issues/3398) +- pod not install in xcode 9.3 version [\#3397](https://github.com/danielgindi/Charts/issues/3397) +- Lag during scroll [\#3395](https://github.com/danielgindi/Charts/issues/3395) +- Hide percents on PieChartDiagram when it's so small [\#3394](https://github.com/danielgindi/Charts/issues/3394) +- Value of type 'BarChartDataEntries' has no member 'unit' [\#3393](https://github.com/danielgindi/Charts/issues/3393) +- BarChart 1st bar offset [\#3392](https://github.com/danielgindi/Charts/issues/3392) +- Open up Access Modifiers? [\#3391](https://github.com/danielgindi/Charts/issues/3391) +- ld: warning: directory not found for option '-F/Users/hansenpen/Library/Developer/Xcode/DerivedData/CS\_PROJECT\_-\_ALPHA-hglwyidqwcstjvejzxikmednefgv/Build/Products/Debug-iphonesimulator/Charts' ld: framework not found Charts clang: error: linker command failed with exit code 1 \(use -v to see invocation\) [\#3390](https://github.com/danielgindi/Charts/issues/3390) +- How to install charts Framework using Xcode 9.1 [\#3388](https://github.com/danielgindi/Charts/issues/3388) +- Unable to compile swift 3.2 code from xcode 9.3. I am using 3.1.1 version of charts. [\#3387](https://github.com/danielgindi/Charts/issues/3387) +- why there is flexible space between the BarChatView and the xAxis ? sometimes the space are nil but sometimes the space exist . when it happens the xAxis will draw rect inside the PilaView . it doesn't connected with the XAxisLabelPosition attribute . i cann't figured it out [\#3386](https://github.com/danielgindi/Charts/issues/3386) +- Error building project [\#3385](https://github.com/danielgindi/Charts/issues/3385) +- missing property in latest LineChartView [\#3383](https://github.com/danielgindi/Charts/issues/3383) +- minOffset not working [\#3382](https://github.com/danielgindi/Charts/issues/3382) +- Display Real time data like pulseRate. [\#3381](https://github.com/danielgindi/Charts/issues/3381) +- Grouped bar chart shows up as stacked bar chart after migration. [\#3380](https://github.com/danielgindi/Charts/issues/3380) +- Candle stick chart cds.setBarSpace\(\) not working [\#3379](https://github.com/danielgindi/Charts/issues/3379) +- Line chart fill color goes above/below zeroline [\#3377](https://github.com/danielgindi/Charts/issues/3377) +- Charts Pod not working with Xcode 9.3 \(Swift 4.1\) [\#3376](https://github.com/danielgindi/Charts/issues/3376) +- Can any one know how to draw this charts [\#3375](https://github.com/danielgindi/Charts/issues/3375) +- Compile error on newest ChartsDemo-iOS project [\#3373](https://github.com/danielgindi/Charts/issues/3373) +- ChartIndexAxisValueFormatter Not working in line charts [\#3371](https://github.com/danielgindi/Charts/issues/3371) +- Line Graph xValue [\#3367](https://github.com/danielgindi/Charts/issues/3367) +- xAxis labels are not aligned with grouped bar, when data is more [\#3364](https://github.com/danielgindi/Charts/issues/3364) +- Select the data point programmatically and the highLight is NAN [\#3363](https://github.com/danielgindi/Charts/issues/3363) +- Layout issue with chart legend [\#3359](https://github.com/danielgindi/Charts/issues/3359) +- Is it possible to draw the line on top of a custom XAxisRenderer? [\#3348](https://github.com/danielgindi/Charts/issues/3348) +- How to set x-axis labels with selected round with color. [\#3345](https://github.com/danielgindi/Charts/issues/3345) +- How to hide the grid background on some bar [\#3342](https://github.com/danielgindi/Charts/issues/3342) +- Space between axis line and axis label [\#3336](https://github.com/danielgindi/Charts/issues/3336) +- Can't manage to align plots with x axis values [\#3332](https://github.com/danielgindi/Charts/issues/3332) +- Show the last x axis label on bar chart [\#3324](https://github.com/danielgindi/Charts/issues/3324) +- HorizontalBarChartView display partial data [\#3320](https://github.com/danielgindi/Charts/issues/3320) +- 如何在滑动代理中获取当前中心位置所对应的数据源的索引 [\#3318](https://github.com/danielgindi/Charts/issues/3318) +- Visible max and min Y Values [\#2600](https://github.com/danielgindi/Charts/issues/2600) +- Invert xAxis label [\#2504](https://github.com/danielgindi/Charts/issues/2504) +- @junito1209 please explain what are you doing on Charts wiki page [\#2261](https://github.com/danielgindi/Charts/issues/2261) +- Crash Observed when AxisRenderer interval is becoming NaN [\#2168](https://github.com/danielgindi/Charts/issues/2168) +- Problem selecting bubbles on the same xIndex [\#2060](https://github.com/danielgindi/Charts/issues/2060) **Merged pull requests:** @@ -112,13 +868,65 @@ - Add Objective-c compatible for turning off drag in X and Y Axis separately [\#3421](https://github.com/danielgindi/Charts/pull/3421) ([lennonhe](https://github.com/lennonhe)) - Add more render options for y axis labels [\#3406](https://github.com/danielgindi/Charts/pull/3406) ([alexrepty](https://github.com/alexrepty)) -## [3.1.1](https://github.com/danielgindi/Charts/tree/3.1.1) (2018-04-02) +## [v3.1.1](https://github.com/danielgindi/Charts/tree/v3.1.1) (2018-04-02) -[Full Changelog](https://github.com/danielgindi/Charts/compare/v3.1.1...3.1.1) +[Full Changelog](https://github.com/danielgindi/Charts/compare/3.1.1...v3.1.1) -## [v3.1.1](https://github.com/danielgindi/Charts/tree/v3.1.1) (2018-04-02) +## [3.1.1](https://github.com/danielgindi/Charts/tree/3.1.1) (2018-04-02) -[Full Changelog](https://github.com/danielgindi/Charts/compare/3.1.0...v3.1.1) +[Full Changelog](https://github.com/danielgindi/Charts/compare/3.1.0...3.1.1) + +**Fixed bugs:** + +- ChartsDemo-Swift crashes [\#3327](https://github.com/danielgindi/Charts/issues/3327) + +**Closed issues:** + +- Why does yVals start with a negative number when the data is empty? [\#3374](https://github.com/danielgindi/Charts/issues/3374) +- Compile Error [\#3372](https://github.com/danielgindi/Charts/issues/3372) +- Y Axis need to add Time slots for current day [\#3368](https://github.com/danielgindi/Charts/issues/3368) +- inconsistent include of UIKit vs AppKit [\#3362](https://github.com/danielgindi/Charts/issues/3362) +- Crash Issue in BarChartData [\#3361](https://github.com/danielgindi/Charts/issues/3361) +- How can we format the LABEL used for values? [\#3354](https://github.com/danielgindi/Charts/issues/3354) +- Remove value labels padding [\#3350](https://github.com/danielgindi/Charts/issues/3350) +- Does Charts support real-time drawing [\#3344](https://github.com/danielgindi/Charts/issues/3344) +- Constant for Bar width and space [\#3343](https://github.com/danielgindi/Charts/issues/3343) +- Bar Graph groupBars function issue [\#1966](https://github.com/danielgindi/Charts/issues/1966) +- bar chart from dates [\#1963](https://github.com/danielgindi/Charts/issues/1963) +- A crash of CombinedChartView,when touch on the chart view\(chas\) [\#1957](https://github.com/danielgindi/Charts/issues/1957) +- Graph doesn't display on older iPads [\#1954](https://github.com/danielgindi/Charts/issues/1954) +- Regarding deprecated xValues [\#1947](https://github.com/danielgindi/Charts/issues/1947) +- Charts being overlaid inside UICollectionView using dequeueReusableCell [\#1943](https://github.com/danielgindi/Charts/issues/1943) +- We are unable to split the label in two lines. [\#1941](https://github.com/danielgindi/Charts/issues/1941) +- Make releases so they follow the Semantic Versioning \(SemVer\) [\#1930](https://github.com/danielgindi/Charts/issues/1930) +- Marker Position [\#1876](https://github.com/danielgindi/Charts/issues/1876) +- Charts 3.0 unable to draw discontinuous line chart [\#1866](https://github.com/danielgindi/Charts/issues/1866) +- Radar charts custom labels [\#1840](https://github.com/danielgindi/Charts/issues/1840) +- Unable to subclass [\#1838](https://github.com/danielgindi/Charts/issues/1838) +- offset goes wrong when using mutiple bar chart in combined chart [\#1813](https://github.com/danielgindi/Charts/issues/1813) +- Histogram Example? [\#1792](https://github.com/danielgindi/Charts/issues/1792) +- Sunburst Chart [\#1715](https://github.com/danielgindi/Charts/issues/1715) +- Line chart with preview [\#1520](https://github.com/danielgindi/Charts/issues/1520) +- Get scroll position of dragable line chart [\#1272](https://github.com/danielgindi/Charts/issues/1272) +- Trend line in scatter chart? [\#1263](https://github.com/danielgindi/Charts/issues/1263) +- Can we use custom image instead of Circle in line chart? [\#1206](https://github.com/danielgindi/Charts/issues/1206) +- Legend with NSAttributedString and multiple lines on Vertical [\#1193](https://github.com/danielgindi/Charts/issues/1193) +- Trim the legend view [\#1192](https://github.com/danielgindi/Charts/issues/1192) +- Chart auto min/max does not take into account second line [\#1136](https://github.com/danielgindi/Charts/issues/1136) +- Add different colorHoleColor for different datapoints in a LineChart iOS Charts [\#1104](https://github.com/danielgindi/Charts/issues/1104) +- How to remove marker programatically [\#1097](https://github.com/danielgindi/Charts/issues/1097) +- Overlapping issues in x and y axis values [\#1048](https://github.com/danielgindi/Charts/issues/1048) +- Enhancement: Horizontal Combined Chart [\#1041](https://github.com/danielgindi/Charts/issues/1041) +- Enhancement: Linked x-axis or stacked y-axis. [\#1022](https://github.com/danielgindi/Charts/issues/1022) +- Scale or zoom to particular axis or point in Combined chart view [\#993](https://github.com/danielgindi/Charts/issues/993) +- Max Value Y - Axis = 1 , How to set Y-Axis increment Y- Value ? [\#989](https://github.com/danielgindi/Charts/issues/989) +- Drawing value for the WholeStack only [\#926](https://github.com/danielgindi/Charts/issues/926) +- Pie chart Y values overlap [\#779](https://github.com/danielgindi/Charts/issues/779) +- Swift Package Manager [\#753](https://github.com/danielgindi/Charts/issues/753) +- Stacked bar chart with different number of rects [\#744](https://github.com/danielgindi/Charts/issues/744) +- The label value position with the same yAxis and different value. [\#724](https://github.com/danielgindi/Charts/issues/724) +- Minimum / maximum scale causes the chart to slide sideways when trying to pinch zoom further [\#437](https://github.com/danielgindi/Charts/issues/437) +- Top and bottom grid line diverging widths [\#411](https://github.com/danielgindi/Charts/issues/411) **Merged pull requests:** @@ -132,7 +940,139 @@ ## [v3.1.0](https://github.com/danielgindi/Charts/tree/v3.1.0) (2018-03-22) -[Full Changelog](https://github.com/danielgindi/Charts/compare/3.0.5...v3.1.0) +[Full Changelog](https://github.com/danielgindi/Charts/compare/v3.0.5...v3.1.0) + +**Fixed bugs:** + +- Bug in ZoomViewJob? [\#3299](https://github.com/danielgindi/Charts/issues/3299) +- BarChartView bug if set barWidth was 1.0? [\#3213](https://github.com/danielgindi/Charts/issues/3213) +- Scatter circle disappear when chart scaled [\#3185](https://github.com/danielgindi/Charts/issues/3185) +- PieChart `highlightValue\(x:y:dataSetIndex:\)` should provide error for dataSetIndex \> 1 [\#3146](https://github.com/danielgindi/Charts/issues/3146) +- PieChart size is extremely small in a UITableViewCell [\#3108](https://github.com/danielgindi/Charts/issues/3108) +- Handling critical Y values with autoScaleMinMaxEnabled [\#2053](https://github.com/danielgindi/Charts/issues/2053) +- Charts 3.0 - Error: this application, or a library it uses, has passed an invalid numeric value \(NaN, or not-a-number\) to CoreGraphics API and this value is being ignored [\#1626](https://github.com/danielgindi/Charts/issues/1626) + +**Closed issues:** + +- Programatically passed renderer is corrupting animations [\#3349](https://github.com/danielgindi/Charts/issues/3349) +- How to show Integer value [\#3346](https://github.com/danielgindi/Charts/issues/3346) +- Does not build on Xcode 8.3.3 & Swift 3 [\#3341](https://github.com/danielgindi/Charts/issues/3341) +- how to use pod 'Charts' into objective c project , i create header file to use swift , but what should i do after create header file ? [\#3338](https://github.com/danielgindi/Charts/issues/3338) +- How to show all labels in xAxis ? [\#3337](https://github.com/danielgindi/Charts/issues/3337) +- How to set the interval in X axis label [\#3335](https://github.com/danielgindi/Charts/issues/3335) +- Line chart with solid and dashed line [\#3334](https://github.com/danielgindi/Charts/issues/3334) +- Code signing is required for product type 'Application' in SDK 'iOS 11.2' [\#3333](https://github.com/danielgindi/Charts/issues/3333) +- My project within framework target and pod Charts into my framework target can't load Charts framework [\#3328](https://github.com/danielgindi/Charts/issues/3328) +- Swift 4.1 compilation warnings [\#3323](https://github.com/danielgindi/Charts/issues/3323) +- Two Horizontal grid lines always appear above Base Axis line [\#3322](https://github.com/danielgindi/Charts/issues/3322) +- BalloonMarker support swift 3 ? [\#3321](https://github.com/danielgindi/Charts/issues/3321) +- Unable to get horizontal scrolling in bar chart [\#3319](https://github.com/danielgindi/Charts/issues/3319) +- Horizontal Bar Chart xAxis formatted label textColor [\#3317](https://github.com/danielgindi/Charts/issues/3317) +- Wrong dataSetIndex in stringForValue delegate method [\#3314](https://github.com/danielgindi/Charts/issues/3314) +- Limit line in the left and right drag or zoom can be fixed [\#3313](https://github.com/danielgindi/Charts/issues/3313) +- Save picture crash in demos on iOS 11+ [\#3311](https://github.com/danielgindi/Charts/issues/3311) +- How to display reload text in iOS-Charts? [\#3310](https://github.com/danielgindi/Charts/issues/3310) +- Can't show Label text in XAxis [\#3308](https://github.com/danielgindi/Charts/issues/3308) +- Straight lines [\#3306](https://github.com/danielgindi/Charts/issues/3306) +- Values on X axis issue [\#3304](https://github.com/danielgindi/Charts/issues/3304) +- when setInverted\(true\) in the leftAxis of CombinedChart, the candleStickData doesnot show ? [\#3303](https://github.com/danielgindi/Charts/issues/3303) +- HorizontalBarChart X axe labels duplicated [\#3300](https://github.com/danielgindi/Charts/issues/3300) +- how can i change label color? [\#3298](https://github.com/danielgindi/Charts/issues/3298) +- value granularity [\#3296](https://github.com/danielgindi/Charts/issues/3296) +- Better way to manage Stacked Bar Chart Value labels? [\#3295](https://github.com/danielgindi/Charts/issues/3295) +- Remove Y axis border line in Line Graph [\#3294](https://github.com/danielgindi/Charts/issues/3294) +- XAxisRenderer not called [\#3293](https://github.com/danielgindi/Charts/issues/3293) +- How to display string value on xAxis label in line chart [\#3292](https://github.com/danielgindi/Charts/issues/3292) +- how to change the color of text that displayed below the chart ios swift 3 [\#3288](https://github.com/danielgindi/Charts/issues/3288) +- color in BalloonMarker is never used [\#3287](https://github.com/danielgindi/Charts/issues/3287) +- Question: LineChart variable line thickness? [\#3285](https://github.com/danielgindi/Charts/issues/3285) +- Modify selected slice [\#3284](https://github.com/danielgindi/Charts/issues/3284) +- Put shadow under slice [\#3283](https://github.com/danielgindi/Charts/issues/3283) +- How can I take selected value index in Pie Chart [\#3282](https://github.com/danielgindi/Charts/issues/3282) +- hide other label when one slice of pie chart was selected [\#3281](https://github.com/danielgindi/Charts/issues/3281) +- How to show custom x and y axis details in LineChart in objective c ??? [\#3280](https://github.com/danielgindi/Charts/issues/3280) +- I need to put dates from an array on xAxis [\#3277](https://github.com/danielgindi/Charts/issues/3277) +- Is there a way to round the corners of the BalloonMarker? [\#3276](https://github.com/danielgindi/Charts/issues/3276) +- Set values not showing until chart is zoomed [\#3275](https://github.com/danielgindi/Charts/issues/3275) +- How to add gap between chart and legend? [\#3274](https://github.com/danielgindi/Charts/issues/3274) +- LineChart : How to show the grid in right axis [\#3271](https://github.com/danielgindi/Charts/issues/3271) +- How to custom axis' label in horizontal bar chart [\#3270](https://github.com/danielgindi/Charts/issues/3270) +- LineChart: How to fix space between point on xAxis [\#3269](https://github.com/danielgindi/Charts/issues/3269) +- Line Chart Issue in CombinedChartView [\#3268](https://github.com/danielgindi/Charts/issues/3268) +- LineChartRenderer - drawHighlighted:context:indices: [\#3267](https://github.com/danielgindi/Charts/issues/3267) +- Scatter Bar Char - Plots on axis \(0,0\) partially visible [\#3266](https://github.com/danielgindi/Charts/issues/3266) +- is it support the ios 7??? [\#3263](https://github.com/danielgindi/Charts/issues/3263) +- Combined chart for candlestick + bar [\#3262](https://github.com/danielgindi/Charts/issues/3262) +- setScatterShape applied to Legend also [\#3261](https://github.com/danielgindi/Charts/issues/3261) +- ChartDataSet min and max values not recalculated when calling clear\(\) [\#3260](https://github.com/danielgindi/Charts/issues/3260) +- How to realize the Line and the bar Chart in the same one Chart? [\#3259](https://github.com/danielgindi/Charts/issues/3259) +- '\_xBounds' and other variables inaccessible due to 'internal' protection level workaround [\#3258](https://github.com/danielgindi/Charts/issues/3258) +- //view\_line\_graph.centerViewTo\(xValue: Double\(dataEntries\[pos\].x\) , yValue: Double\(dataEntries\[pos\].y\), axis: YAxis.AxisDependency.right\) [\#3257](https://github.com/danielgindi/Charts/issues/3257) +- dyld: Library not loaded: @rpath/Charts.framework/Charts [\#3250](https://github.com/danielgindi/Charts/issues/3250) +- X Axis disapeared [\#3249](https://github.com/danielgindi/Charts/issues/3249) +- Save zoom state [\#3248](https://github.com/danielgindi/Charts/issues/3248) +- leftAxis label bug? [\#3246](https://github.com/danielgindi/Charts/issues/3246) +- x-axis label jumps when zoomed in and side scrolling. [\#3245](https://github.com/danielgindi/Charts/issues/3245) +- avoidFirstLastClippingEnabled not working and set last circleColor a different value [\#3244](https://github.com/danielgindi/Charts/issues/3244) +- Got totally 50 errors after install CocoaPods ..! I am using Swift 4.0 [\#3243](https://github.com/danielgindi/Charts/issues/3243) +- Error in Library When added pod file [\#3242](https://github.com/danielgindi/Charts/issues/3242) +- How to do multiple data on x axis? [\#3241](https://github.com/danielgindi/Charts/issues/3241) +- Missing entries in PieChartDataEntry legends. [\#3240](https://github.com/danielgindi/Charts/issues/3240) +- Candle Stick does not show [\#3239](https://github.com/danielgindi/Charts/issues/3239) +- How i give LineChart Entry using x index and y value in Charts '3.0.4'? help wanted [\#3238](https://github.com/danielgindi/Charts/issues/3238) +- ChartDataEntry with icons shows scatter shape at same time [\#3237](https://github.com/danielgindi/Charts/issues/3237) +- HorizontalBarChart - Right axis label starts with the highest value up to the same value [\#3235](https://github.com/danielgindi/Charts/issues/3235) +- Carthage Charts [\#3234](https://github.com/danielgindi/Charts/issues/3234) +- 3.0.5 Bar chart xAxis valueFormatter regression - no data points shown. [\#3233](https://github.com/danielgindi/Charts/issues/3233) +- Pin the graph on one side while zooming [\#3232](https://github.com/danielgindi/Charts/issues/3232) +- yAxisMaximum auto-increment RadarChartView [\#3231](https://github.com/danielgindi/Charts/issues/3231) +- Compile issue after install pod 'Chart' [\#3230](https://github.com/danielgindi/Charts/issues/3230) +- corner line chart [\#3227](https://github.com/danielgindi/Charts/issues/3227) +- Make specific pieChart segment stick out and go back to normal size, animated [\#3224](https://github.com/danielgindi/Charts/issues/3224) +- Dash line and highlighted top value [\#3221](https://github.com/danielgindi/Charts/issues/3221) +- Why is the xAxis Value Formater so often called? [\#3220](https://github.com/danielgindi/Charts/issues/3220) +- How easy is to add some technical indicators? [\#3219](https://github.com/danielgindi/Charts/issues/3219) +- How to set X-Axis data to bottom of chart with strings data? [\#3212](https://github.com/danielgindi/Charts/issues/3212) +- how to drag the LineChartView [\#3211](https://github.com/danielgindi/Charts/issues/3211) +- Release 3.0.5 contains version number inconsistencies [\#3210](https://github.com/danielgindi/Charts/issues/3210) +- Unable to Hide PieChart Legends. [\#3209](https://github.com/danielgindi/Charts/issues/3209) +- Recent release with my Swift3 project [\#3208](https://github.com/danielgindi/Charts/issues/3208) +- Cannot set double value in Combined chart line chart. [\#3205](https://github.com/danielgindi/Charts/issues/3205) +- Bar charts with different column widths [\#3204](https://github.com/danielgindi/Charts/issues/3204) +- Labels on x-axes not linked to chart data points [\#3203](https://github.com/danielgindi/Charts/issues/3203) +- Remark: The AppCoda tutorial is outdated [\#3196](https://github.com/danielgindi/Charts/issues/3196) +- Unable to set strings as values in x axis of linechart [\#3195](https://github.com/danielgindi/Charts/issues/3195) +- drag event issie [\#3194](https://github.com/danielgindi/Charts/issues/3194) +- Custom XAxisRenderer labels are shifting around when scrolling [\#3193](https://github.com/danielgindi/Charts/issues/3193) +- How to asynchronous drawings LineChart? [\#3192](https://github.com/danielgindi/Charts/issues/3192) +- How do I listen to the left or right to the end of the event when I zoom in on the lineCharts? [\#3184](https://github.com/danielgindi/Charts/issues/3184) +- Want to delete color set beside legend label [\#3180](https://github.com/danielgindi/Charts/issues/3180) +- How to show/hide Stacked Bar Chart yValue? [\#3175](https://github.com/danielgindi/Charts/issues/3175) +- Readme needs to be updated for 3.0.5 [\#3170](https://github.com/danielgindi/Charts/issues/3170) +- Add Axis description to Charts Framework [\#3168](https://github.com/danielgindi/Charts/issues/3168) +- ChartViewDelegate not called when barChart is out of screen [\#3165](https://github.com/danielgindi/Charts/issues/3165) +- dash line \(separators\) in between in bars. [\#3163](https://github.com/danielgindi/Charts/issues/3163) +- StackedBarChart Value on middle of each stacked bar chart [\#3162](https://github.com/danielgindi/Charts/issues/3162) +- ChartLimitLine Label Position [\#3161](https://github.com/danielgindi/Charts/issues/3161) +- bar chat [\#3158](https://github.com/danielgindi/Charts/issues/3158) +- Bar coloring [\#3157](https://github.com/danielgindi/Charts/issues/3157) +- HorizontalBarChart doesn't display bar draw values when bar is partially off ViewPort [\#3155](https://github.com/danielgindi/Charts/issues/3155) +- X-Axis Labels not showing [\#3154](https://github.com/danielgindi/Charts/issues/3154) +- How to make highlight scrolling on chart not trigger parent scrollView? \[help\] [\#3153](https://github.com/danielgindi/Charts/issues/3153) +- How to fill the color like the marked part of this following picture? Thanks a lot! [\#3144](https://github.com/danielgindi/Charts/issues/3144) +- finger leaves the chart area [\#3128](https://github.com/danielgindi/Charts/issues/3128) +- Technical Support in Github [\#3126](https://github.com/danielgindi/Charts/issues/3126) +- Plotting the bar from top to bottom \(in reverse manner\) [\#3125](https://github.com/danielgindi/Charts/issues/3125) +- pieChart Data name overlap [\#3109](https://github.com/danielgindi/Charts/issues/3109) +- LineChart with different colors based on values. [\#3107](https://github.com/danielgindi/Charts/issues/3107) +- AxisBase Value Formatter [\#3105](https://github.com/danielgindi/Charts/issues/3105) +- Multiple charts in same view [\#3103](https://github.com/danielgindi/Charts/issues/3103) +- Draw dotted x-axis timeline [\#3102](https://github.com/danielgindi/Charts/issues/3102) +- PieChart value labels are overlaping when values are between 0 to 9 [\#2948](https://github.com/danielgindi/Charts/issues/2948) +- xValues on X-Axis for non-continuous dates [\#2398](https://github.com/danielgindi/Charts/issues/2398) +- y-labels position is wrong,when i set autoScaleMinMaxEnabled = YES [\#2379](https://github.com/danielgindi/Charts/issues/2379) +- Distance between chart legend and the horizontal bar chart is to big in case of rotated labels [\#2138](https://github.com/danielgindi/Charts/issues/2138) +- How to set LabelCount bigger than 25 in HorizatalBarView [\#2085](https://github.com/danielgindi/Charts/issues/2085) **Merged pull requests:** @@ -160,13 +1100,228 @@ - fix \#2356 crash if floor\(10.0 \* intervalMagnitude\) is 0.0 [\#2377](https://github.com/danielgindi/Charts/pull/2377) ([liuxuan30](https://github.com/liuxuan30)) - Fixes the distance issue between the legend and the horizontal bar chart \(Fixes \#2138\) [\#2214](https://github.com/danielgindi/Charts/pull/2214) ([SvenMuc](https://github.com/SvenMuc)) +## [v3.0.5](https://github.com/danielgindi/Charts/tree/v3.0.5) (2018-01-08) + +[Full Changelog](https://github.com/danielgindi/Charts/compare/3.0.5...v3.0.5) + ## [3.0.5](https://github.com/danielgindi/Charts/tree/3.0.5) (2018-01-08) -[Full Changelog](https://github.com/danielgindi/Charts/compare/v3.0.5...3.0.5) +[Full Changelog](https://github.com/danielgindi/Charts/compare/v3.0.4...3.0.5) -## [v3.0.5](https://github.com/danielgindi/Charts/tree/v3.0.5) (2018-01-08) +**Implemented enhancements:** -[Full Changelog](https://github.com/danielgindi/Charts/compare/v3.0.4...v3.0.5) +- range, and therefore interval, is NaN in computeAxisValues [\#2845](https://github.com/danielgindi/Charts/issues/2845) +- Crash when calling `func highlightValue\(x: Double, dataSetIndex: Int, callDelegate: Bool\)` [\#2840](https://github.com/danielgindi/Charts/issues/2840) + +**Fixed bugs:** + +- Combined Chart, when highlight is active, bars hides line [\#3091](https://github.com/danielgindi/Charts/issues/3091) +- A problem of CombinedChartView's YAxis [\#1830](https://github.com/danielgindi/Charts/issues/1830) + +**Closed issues:** + +- Command /bin/sh failed with exit code 1 [\#3156](https://github.com/danielgindi/Charts/issues/3156) +- Xcode 9 / Swift 4 issue with current master [\#3152](https://github.com/danielgindi/Charts/issues/3152) +- Is it possible to show value on touch next to highlight position? [\#3151](https://github.com/danielgindi/Charts/issues/3151) +- Remove legend [\#3150](https://github.com/danielgindi/Charts/issues/3150) +- Add a shadow to the line chart [\#3148](https://github.com/danielgindi/Charts/issues/3148) +- Missing alternate x-axis labels on line chart [\#3139](https://github.com/danielgindi/Charts/issues/3139) +- Can the histogram set the corner? [\#3138](https://github.com/danielgindi/Charts/issues/3138) +- Charts demo ipa file request [\#3137](https://github.com/danielgindi/Charts/issues/3137) +- Main Thread Checker: UI API called on background thread. [\#3129](https://github.com/danielgindi/Charts/issues/3129) +- How to get X\_axis touch points coordinates in radar graph [\#3127](https://github.com/danielgindi/Charts/issues/3127) +- Division by zero crash in AxisRendererBase [\#3124](https://github.com/danielgindi/Charts/issues/3124) +- why bar chart non start at zero [\#3123](https://github.com/danielgindi/Charts/issues/3123) +- BarChart - Show X-Axis with Step as 1 [\#3122](https://github.com/danielgindi/Charts/issues/3122) +- Have Line Graph Value Labels Above/Below Independently [\#3120](https://github.com/danielgindi/Charts/issues/3120) +- Corner Radius on Grid Background [\#3119](https://github.com/danielgindi/Charts/issues/3119) +- ChartsDemo doesn't compile [\#3116](https://github.com/danielgindi/Charts/issues/3116) +- Rounded line chart [\#3115](https://github.com/danielgindi/Charts/issues/3115) +- value of barChart covered by title [\#3113](https://github.com/danielgindi/Charts/issues/3113) +- PieChartView Can not highlight which i want to highlighted [\#3110](https://github.com/danielgindi/Charts/issues/3110) +- How to scroll bar chart if max values to show? [\#3101](https://github.com/danielgindi/Charts/issues/3101) +- Is it possible to draw a chart like this? [\#3097](https://github.com/danielgindi/Charts/issues/3097) +- How to disable the rotation option of pie charts in iOS charts? [\#3096](https://github.com/danielgindi/Charts/issues/3096) +- How to disable the rotation option of pie charts in iOS charts? [\#3095](https://github.com/danielgindi/Charts/issues/3095) +- 数据空值处理问题 [\#3094](https://github.com/danielgindi/Charts/issues/3094) +- how to display the integer values on pie chart instead of float? [\#3093](https://github.com/danielgindi/Charts/issues/3093) +- Line Chart point colours depend on value at each point [\#3090](https://github.com/danielgindi/Charts/issues/3090) +- how to cancel highlights when the drag gesture ends [\#3089](https://github.com/danielgindi/Charts/issues/3089) +- why my value is .50 ?Why not 0.5? How to do? [\#3083](https://github.com/danielgindi/Charts/issues/3083) +- how to use String in YAxis, rather than Double? [\#3082](https://github.com/danielgindi/Charts/issues/3082) +- Scrolling axis [\#3081](https://github.com/danielgindi/Charts/issues/3081) +- Clipping of values in line graph [\#3077](https://github.com/danielgindi/Charts/issues/3077) +- \[LineChart\] Ignore / don't plot first or end value [\#3075](https://github.com/danielgindi/Charts/issues/3075) +- Which attribute control the yellow line,like the picture? [\#3074](https://github.com/danielgindi/Charts/issues/3074) +- Archive error using swift 4.0 [\#3072](https://github.com/danielgindi/Charts/issues/3072) +- How can I have a chart like this one? [\#3070](https://github.com/danielgindi/Charts/issues/3070) +- Module compiled with Swift 4.0 cannot be imported in Swift 3.2.3 [\#3068](https://github.com/danielgindi/Charts/issues/3068) +- Unable to make chart look like IOS Stock App after trying every mode \(LineChartModeLinear = 0, LineChartModeStepped = 1, LineChartModeCubicBezier = 2, LineChartModeHorizontalBezier = 3\) of LineChartDataSet [\#3066](https://github.com/danielgindi/Charts/issues/3066) +- Cannot Select barChar column [\#3065](https://github.com/danielgindi/Charts/issues/3065) +- Updating data in LineChart takes up to 30 seconds [\#3064](https://github.com/danielgindi/Charts/issues/3064) +- How to sync the scrolling of 2 charts [\#3063](https://github.com/danielgindi/Charts/issues/3063) +- Line chart with bottom spacing and custom position y-labels at min and max values [\#3059](https://github.com/danielgindi/Charts/issues/3059) +- 'characters' is deprecated: Please use String or Substring directly [\#3057](https://github.com/danielgindi/Charts/issues/3057) +- Pod to OC error [\#3053](https://github.com/danielgindi/Charts/issues/3053) +- How to represent a null value,It's like the picture? not 0 [\#3052](https://github.com/danielgindi/Charts/issues/3052) +- dyld library not loaded @rpath/charts.framework/charts reason : image not found XCode 9.1 MacOS version 10.12.6 [\#3050](https://github.com/danielgindi/Charts/issues/3050) +- Can't change the border width of circle point in line chart. [\#3049](https://github.com/danielgindi/Charts/issues/3049) +- Charts library is not working in Swift 4 Xcode 9 [\#3048](https://github.com/danielgindi/Charts/issues/3048) +- Create an image of the entire chart [\#3037](https://github.com/danielgindi/Charts/issues/3037) +- lineChartView only enables one data set to be with icons [\#3036](https://github.com/danielgindi/Charts/issues/3036) +- Add charts to UIView programatically [\#3033](https://github.com/danielgindi/Charts/issues/3033) +- Only disable animation for adding values [\#3031](https://github.com/danielgindi/Charts/issues/3031) +- BarChartDataSet with only negative values doesn't call stringForValue on formatter [\#3030](https://github.com/danielgindi/Charts/issues/3030) +- Please provide an example for pieradarchart [\#3029](https://github.com/danielgindi/Charts/issues/3029) +- Multiple charts in a collection view [\#3028](https://github.com/danielgindi/Charts/issues/3028) +- Bubbles chart [\#3027](https://github.com/danielgindi/Charts/issues/3027) +- delete [\#3025](https://github.com/danielgindi/Charts/issues/3025) +- How to change position xAxis Label on the Top Bar Chart ? [\#3022](https://github.com/danielgindi/Charts/issues/3022) +- How to decrease space between chartData ? Is there any parameter ? [\#3021](https://github.com/danielgindi/Charts/issues/3021) +- 已解决 [\#3020](https://github.com/danielgindi/Charts/issues/3020) +- Drawing min mix median lines [\#3017](https://github.com/danielgindi/Charts/issues/3017) +- Installation error through cocapods [\#3016](https://github.com/danielgindi/Charts/issues/3016) +- Swift 4.0.2 not compatible [\#3015](https://github.com/danielgindi/Charts/issues/3015) +- Error NSAttributedStringKey.font on Xcode 9.1 Swift 4 with Charts \(3.0.4\) [\#3014](https://github.com/danielgindi/Charts/issues/3014) +- Double Bar Lines [\#3013](https://github.com/danielgindi/Charts/issues/3013) +- Same zero line for left and right axis [\#3011](https://github.com/danielgindi/Charts/issues/3011) +- How to get version 3.0.2 ? [\#3009](https://github.com/danielgindi/Charts/issues/3009) +- How can I scroll to previous data? [\#3006](https://github.com/danielgindi/Charts/issues/3006) +- Crashing in X-axis render method. [\#3004](https://github.com/danielgindi/Charts/issues/3004) +- How to align yAxis at zero point? [\#2989](https://github.com/danielgindi/Charts/issues/2989) +- Line Chart View not drawn because Date values in xAxis \(not sorted Ascending/Descending\) ? [\#2988](https://github.com/danielgindi/Charts/issues/2988) +- Showing .0, .00 accoding the the decimal places insted of 0 in graphs [\#2987](https://github.com/danielgindi/Charts/issues/2987) +- How to select one of them in the first time。 [\#2985](https://github.com/danielgindi/Charts/issues/2985) +- 当饼状图的数据为0%的时候,左下角有个多余的字母N,问题已解决,有遇到这个问题的请私聊我 [\#2984](https://github.com/danielgindi/Charts/issues/2984) +- Scale to particular x-axis range in line chart [\#2979](https://github.com/danielgindi/Charts/issues/2979) +- ChartViewDelegate [\#2978](https://github.com/danielgindi/Charts/issues/2978) +- What is the compatible version with Xcode 8.3.3 ? [\#2977](https://github.com/danielgindi/Charts/issues/2977) +- ScatterChartDataSet troubles with alignments. [\#2976](https://github.com/danielgindi/Charts/issues/2976) +- Uneven X-Axis values for a line chart [\#2975](https://github.com/danielgindi/Charts/issues/2975) +- Stacked bar chart value label clipped [\#2974](https://github.com/danielgindi/Charts/issues/2974) +- Pie chart monochrome or gradient fill not support [\#2973](https://github.com/danielgindi/Charts/issues/2973) +- PieChart:- PieChart not completely show. [\#2972](https://github.com/danielgindi/Charts/issues/2972) +- Error after updating to Xcode 9.1 [\#2970](https://github.com/danielgindi/Charts/issues/2970) +- Add cornerRadius to vertical highlighter line and draw circle only on highlight [\#2969](https://github.com/danielgindi/Charts/issues/2969) +- How can I don't draw lines when data absent at some point? [\#2968](https://github.com/danielgindi/Charts/issues/2968) +- How to use your file directly to my project without pod installation? [\#2964](https://github.com/danielgindi/Charts/issues/2964) +- Line chart lines are clipped [\#2963](https://github.com/danielgindi/Charts/issues/2963) +- Marker with multiple datasets [\#2962](https://github.com/danielgindi/Charts/issues/2962) +- how do i run it in xcode 9?? [\#2958](https://github.com/danielgindi/Charts/issues/2958) +- Regarding Xcode version [\#2957](https://github.com/danielgindi/Charts/issues/2957) +- Cannot align chart description on left instead of right [\#2956](https://github.com/danielgindi/Charts/issues/2956) +- change color of bar chart programmatically ? [\#2954](https://github.com/danielgindi/Charts/issues/2954) +- Remove or change line color in chart [\#2953](https://github.com/danielgindi/Charts/issues/2953) +- Show line bar position per seconds [\#2952](https://github.com/danielgindi/Charts/issues/2952) +- Add Two Custom Marker views on linechart graph [\#2951](https://github.com/danielgindi/Charts/issues/2951) +- Display high and low value in chart but Displayed one only [\#2947](https://github.com/danielgindi/Charts/issues/2947) +- Change LineChartDataSet label color not value color. [\#2944](https://github.com/danielgindi/Charts/issues/2944) +- when dataset value is increases then the graph value is misplace . and i am showing three bar in one group. and also show the integer value in particular bar above. [\#2938](https://github.com/danielgindi/Charts/issues/2938) +- Errors after conversion to Swift4 NSAttributedStringKey [\#2937](https://github.com/danielgindi/Charts/issues/2937) +- xAxis setLabelsToSkip and valuesObjc want to have replace api [\#2936](https://github.com/danielgindi/Charts/issues/2936) +- xAxis value is started with 0 but it not coordinate with y axis 0 value [\#2935](https://github.com/danielgindi/Charts/issues/2935) +- line charts with many gradients according the value [\#2934](https://github.com/danielgindi/Charts/issues/2934) +- Xcode 9.1 - Characters is deprecated [\#2933](https://github.com/danielgindi/Charts/issues/2933) +- How to add corner radius to balloonmarker [\#2932](https://github.com/danielgindi/Charts/issues/2932) +- leftAxis and rightAxis didn't show up [\#2931](https://github.com/danielgindi/Charts/issues/2931) +- Errors when importing BalloonMarker [\#2928](https://github.com/danielgindi/Charts/issues/2928) +- Bar chart does not start at zero. [\#2927](https://github.com/danielgindi/Charts/issues/2927) +- The following binaries use incompatible versions of Swift [\#2926](https://github.com/danielgindi/Charts/issues/2926) +- Change the color of a specific X-Axis label and the corresponding data value in a line chart using Charts framework [\#2925](https://github.com/danielgindi/Charts/issues/2925) +- Adding corner radius on top of Bar [\#2924](https://github.com/danielgindi/Charts/issues/2924) +- I want to change colour of the label text on the x-axis where it's highlighted. [\#2923](https://github.com/danielgindi/Charts/issues/2923) +- How to give Gradient colour for limit line in linechartviewDataSet [\#2922](https://github.com/danielgindi/Charts/issues/2922) +- Gradient colour for stroke line horizantally .It is possible in android [\#2921](https://github.com/danielgindi/Charts/issues/2921) +- y axis range not automatically recalculated when adding entry to data set [\#2920](https://github.com/danielgindi/Charts/issues/2920) +- Build framework from project [\#2919](https://github.com/danielgindi/Charts/issues/2919) +- How to draw a diagram above the axis labels? [\#2918](https://github.com/danielgindi/Charts/issues/2918) +- - [\#2917](https://github.com/danielgindi/Charts/issues/2917) +- How to use IValueFormatter in stacked bar chart [\#2916](https://github.com/danielgindi/Charts/issues/2916) +- Use of unresolved identifier NSAttributedStringKey in Xcode 8.3.2 for swift 3 [\#2915](https://github.com/danielgindi/Charts/issues/2915) +- Barchart with rounded bar style [\#2912](https://github.com/danielgindi/Charts/issues/2912) +- Animate adding single point [\#2911](https://github.com/danielgindi/Charts/issues/2911) +- Crash [\#2910](https://github.com/danielgindi/Charts/issues/2910) +- Multi Window [\#2909](https://github.com/danielgindi/Charts/issues/2909) +- how can I unhighlight any slice selected before in PieChart ? [\#2908](https://github.com/danielgindi/Charts/issues/2908) +- Barchart DefaultValueFormatter dataSetIndex always 0 [\#2907](https://github.com/danielgindi/Charts/issues/2907) +- LineChartDataSet Multi color [\#2906](https://github.com/danielgindi/Charts/issues/2906) +- How to disconnect data points? [\#2905](https://github.com/danielgindi/Charts/issues/2905) +- Licensing question [\#2904](https://github.com/danielgindi/Charts/issues/2904) +- A way to add values to labels on x axis? [\#2903](https://github.com/danielgindi/Charts/issues/2903) +- Update cocoapods.org version [\#2902](https://github.com/danielgindi/Charts/issues/2902) +- noDataText for PieChartView isn't working. [\#2901](https://github.com/danielgindi/Charts/issues/2901) +- xcode9 alert swift question [\#2900](https://github.com/danielgindi/Charts/issues/2900) +- Dynamically set the bar width [\#2898](https://github.com/danielgindi/Charts/issues/2898) +- Marker action [\#2897](https://github.com/danielgindi/Charts/issues/2897) +- Filler line for acceptable range of values in LineChart [\#2896](https://github.com/danielgindi/Charts/issues/2896) +- Pie chart full view [\#2895](https://github.com/danielgindi/Charts/issues/2895) +- Problem with BalloonMarker in lineChart [\#2892](https://github.com/danielgindi/Charts/issues/2892) +- OS X Bar chart Demo highlight and stacked color are inconsistent [\#2890](https://github.com/danielgindi/Charts/issues/2890) +- Problem with charts in UITableView cells [\#2888](https://github.com/danielgindi/Charts/issues/2888) +- drawing xAxis ratio values [\#2885](https://github.com/danielgindi/Charts/issues/2885) +- Xcode 9 compatibility [\#2883](https://github.com/danielgindi/Charts/issues/2883) +- Large Whitespace Between X-Axis Labels and Legend [\#2882](https://github.com/danielgindi/Charts/issues/2882) +- help about performance issues about line charts [\#2881](https://github.com/danielgindi/Charts/issues/2881) +- Animation on PieChartView [\#2880](https://github.com/danielgindi/Charts/issues/2880) +- Scrolling chart after setting lineChart.xAxis.axisMaximum = someValue [\#2879](https://github.com/danielgindi/Charts/issues/2879) +- "chartValueSelected" is not getting called in customView [\#2878](https://github.com/danielgindi/Charts/issues/2878) +- curve line [\#2877](https://github.com/danielgindi/Charts/issues/2877) +- Swift 4 issue [\#2876](https://github.com/danielgindi/Charts/issues/2876) +- 不显示百分号了 [\#2873](https://github.com/danielgindi/Charts/issues/2873) +- LineChartView: Using two different colors in one dataset [\#2871](https://github.com/danielgindi/Charts/issues/2871) +- xcode 9.0 errors after installing pod 'Charts' [\#2869](https://github.com/danielgindi/Charts/issues/2869) +- Change scroll direction HorizontalBarChartView x-axis from top to bottom chart [\#2868](https://github.com/danielgindi/Charts/issues/2868) +- Set names of X-axis and Y-axis itself \(not their labels\) [\#2867](https://github.com/danielgindi/Charts/issues/2867) +- 'characters' is deprecated: Please use String or Substring directly [\#2866](https://github.com/danielgindi/Charts/issues/2866) +- Syntax error in pod [\#2865](https://github.com/danielgindi/Charts/issues/2865) +- Filled Line Chart [\#2863](https://github.com/danielgindi/Charts/issues/2863) +- How can I highlight a specific slice of the PieChart? [\#2862](https://github.com/danielgindi/Charts/issues/2862) +- How can I make the chart rotate completely, 360, 720 on a button click ? [\#2861](https://github.com/danielgindi/Charts/issues/2861) +- How can I make the chart rotate completely, 360, 720 on a button click ? [\#2860](https://github.com/danielgindi/Charts/issues/2860) +- xcode9 pod install have a problem [\#2856](https://github.com/danielgindi/Charts/issues/2856) +- can I implement stacked bar with rounded corners ? [\#2855](https://github.com/danielgindi/Charts/issues/2855) +- Updating Charts to 3.0.4 and Swift 4 doesn't work [\#2851](https://github.com/danielgindi/Charts/issues/2851) +- How to add string labels to XAxis horizontal bar in Charts framework\(swift 3\) [\#2850](https://github.com/danielgindi/Charts/issues/2850) +- How to show off numbers in HorizontalBar [\#2849](https://github.com/danielgindi/Charts/issues/2849) +- In Multiple bar chart Unable to set Values more than 4 bar in under given year.. [\#2847](https://github.com/danielgindi/Charts/issues/2847) +- Type 'NSAttributedStringKey' \(aka 'NSString'\) has no member 'font' [\#2844](https://github.com/danielgindi/Charts/issues/2844) +- Install charts via cocapods pulls back old version 3.0.2 [\#2843](https://github.com/danielgindi/Charts/issues/2843) +- xcode 9.0 compile ERROR: "static var 'defaultFormatter' is not public" [\#2842](https://github.com/danielgindi/Charts/issues/2842) +- Pass String to LineChartData [\#2841](https://github.com/danielgindi/Charts/issues/2841) +- Customised graph with ranges\(Normal-blue and Warning-yellow\) also with it's legend [\#2838](https://github.com/danielgindi/Charts/issues/2838) +- using UIGraphicsGetCurrentContext in MarkerImage subclass [\#2835](https://github.com/danielgindi/Charts/issues/2835) +- How to show BarChartDataSet with descending x values? [\#2834](https://github.com/danielgindi/Charts/issues/2834) +- getTransformer function doesn't work properly when AxisDependency is set to right [\#2833](https://github.com/danielgindi/Charts/issues/2833) +- Grouped Bar chart X-axis and Bar Alignment [\#2832](https://github.com/danielgindi/Charts/issues/2832) +- How to create a custom Marker from Xib - Swift [\#2831](https://github.com/danielgindi/Charts/issues/2831) +- does not support new Objective-C project with Xcode 9 [\#2830](https://github.com/danielgindi/Charts/issues/2830) +- radarChart default labelCount [\#2829](https://github.com/danielgindi/Charts/issues/2829) +- NSDecimalNumber instead of Double [\#2828](https://github.com/danielgindi/Charts/issues/2828) +- LineChart 填充 [\#2825](https://github.com/danielgindi/Charts/issues/2825) +- Swift: Different colours for circles in one LineChartDataSet [\#2824](https://github.com/danielgindi/Charts/issues/2824) +- Unable to update Chart library [\#2823](https://github.com/danielgindi/Charts/issues/2823) +- xMin, xMax, yMin, yMax not recalculated to zero on .clear\(\) [\#2822](https://github.com/danielgindi/Charts/issues/2822) +- OS X errors with swift 4 [\#2819](https://github.com/danielgindi/Charts/issues/2819) +- I want to add marker image from line chart in swift 4.0 [\#2818](https://github.com/danielgindi/Charts/issues/2818) +- ChartMarkerView not able to subclass of swift class [\#2817](https://github.com/danielgindi/Charts/issues/2817) +- Type 'NSAttributedStringKey' \(aka 'NSString'\) has no member 'font' [\#2816](https://github.com/danielgindi/Charts/issues/2816) +- StackedBarChart isn't stacking bars [\#2815](https://github.com/danielgindi/Charts/issues/2815) +- Cocoapod 3.0.4 [\#2814](https://github.com/danielgindi/Charts/issues/2814) +- Error aplication Thread in ios 11 with version 3.0.4 [\#2812](https://github.com/danielgindi/Charts/issues/2812) +- Cannot compile with version 3.0.3 and Xcode 9 due to incompatible Swift version [\#2810](https://github.com/danielgindi/Charts/issues/2810) +- I have the version 3.0.4 but when compile project I has an error [\#2809](https://github.com/danielgindi/Charts/issues/2809) +- 拖动的时候 会强烈抖动 [\#2808](https://github.com/danielgindi/Charts/issues/2808) +- Version 3.0.4 doesn't appear via Cocoapods [\#2807](https://github.com/danielgindi/Charts/issues/2807) +- Bump Pod Version [\#2805](https://github.com/danielgindi/Charts/issues/2805) +- module 'Charts' not found when dray it into target [\#2803](https://github.com/danielgindi/Charts/issues/2803) +- How to get y-axis values "Int" to "Double" [\#2799](https://github.com/danielgindi/Charts/issues/2799) +- The line chart enlarged is crash [\#2797](https://github.com/danielgindi/Charts/issues/2797) +- How to change the entrylabel\(i.e, 90%\) color in PieChart [\#2794](https://github.com/danielgindi/Charts/issues/2794) +- Chart Grid Lines Don't Always Draw [\#2791](https://github.com/danielgindi/Charts/issues/2791) +- Charts.framework: No such file or directory [\#2789](https://github.com/danielgindi/Charts/issues/2789) +- Memory Leak in Horizontal Bar Chart [\#2745](https://github.com/danielgindi/Charts/issues/2745) +- axisDependency does not work [\#2258](https://github.com/danielgindi/Charts/issues/2258) +- HorizontalBarChart does not update labels correctly [\#2257](https://github.com/danielgindi/Charts/issues/2257) **Merged pull requests:** @@ -223,19 +1378,386 @@ ## [3.0.4](https://github.com/danielgindi/Charts/tree/3.0.4) (2017-09-21) -[Full Changelog](https://github.com/danielgindi/Charts/compare/v3.0.3...3.0.4) +[Full Changelog](https://github.com/danielgindi/Charts/compare/3.0.3...3.0.4) + +**Closed issues:** + +- cocoaPod can not install branch of swift4 [\#2802](https://github.com/danielgindi/Charts/issues/2802) +- Swift 4 [\#2801](https://github.com/danielgindi/Charts/issues/2801) +- how tomake leftAxis.inverted and LineChartDataSet.fillColor not inverted [\#2798](https://github.com/danielgindi/Charts/issues/2798) +- Bar Chart Demo One Label One Color [\#2792](https://github.com/danielgindi/Charts/issues/2792) +- BarChart draw vertical dotted lines on specific bars [\#2788](https://github.com/danielgindi/Charts/issues/2788) +- How can I control the number of decimals? [\#2787](https://github.com/danielgindi/Charts/issues/2787) +- Charts “3.0.2” cannot find "BalloonMarker" [\#2786](https://github.com/danielgindi/Charts/issues/2786) +- Graphs gets cut from both ends [\#2785](https://github.com/danielgindi/Charts/issues/2785) +- Is it possible to draw multiple lineCharts with different starting points on same view? [\#2783](https://github.com/danielgindi/Charts/issues/2783) +- getFormattedLabel Index Out of Range [\#2782](https://github.com/danielgindi/Charts/issues/2782) +- Line chart right axis inset [\#2781](https://github.com/danielgindi/Charts/issues/2781) +- No type or protocol named 'IChartAxisValueFormatter' [\#2780](https://github.com/danielgindi/Charts/issues/2780) +- Zero Value is under BarChart [\#2779](https://github.com/danielgindi/Charts/issues/2779) +- App crashes while using Charts swift library in Objective C Project [\#2778](https://github.com/danielgindi/Charts/issues/2778) +- Cannot subscript a value of type '\[String : AnyObject\]' with an index of type 'NSAttributedStringKey' [\#2777](https://github.com/danielgindi/Charts/issues/2777) +- How to drag data entries to change their y value in real time. [\#2776](https://github.com/danielgindi/Charts/issues/2776) +- How to break line the legends ? [\#2775](https://github.com/danielgindi/Charts/issues/2775) +- How can I get current viewport shown x range and scale value [\#2770](https://github.com/danielgindi/Charts/issues/2770) +- How to disable scale of left YAxis? [\#2748](https://github.com/danielgindi/Charts/issues/2748) +- Bar Chart remove x if y is 0 [\#2747](https://github.com/danielgindi/Charts/issues/2747) +- How to display Negative X-Axis on LineChart [\#797](https://github.com/danielgindi/Charts/issues/797) **Merged pull requests:** - Changes for Swift 4 [\#2507](https://github.com/danielgindi/Charts/pull/2507) ([liuxuan30](https://github.com/liuxuan30)) +## [3.0.3](https://github.com/danielgindi/Charts/tree/3.0.3) (2017-09-08) + +[Full Changelog](https://github.com/danielgindi/Charts/compare/v3.0.3...3.0.3) + ## [v3.0.3](https://github.com/danielgindi/Charts/tree/v3.0.3) (2017-09-08) -[Full Changelog](https://github.com/danielgindi/Charts/compare/3.0.3...v3.0.3) +[Full Changelog](https://github.com/danielgindi/Charts/compare/3.0.2...v3.0.3) -## [3.0.3](https://github.com/danielgindi/Charts/tree/3.0.3) (2017-09-08) +**Implemented enhancements:** -[Full Changelog](https://github.com/danielgindi/Charts/compare/3.0.2...3.0.3) +- fatal error: Index out of range [\#2109](https://github.com/danielgindi/Charts/issues/2109) + +**Fixed bugs:** + +- Crash in YAxisRendererRadarChart [\#2356](https://github.com/danielgindi/Charts/issues/2356) +- Fatal error when providing multiple data sets in PieChartData [\#2099](https://github.com/danielgindi/Charts/issues/2099) + +**Closed issues:** + +- X Values Hidden On Bar Graph [\#2774](https://github.com/danielgindi/Charts/issues/2774) +- How to add new real-time data to lineChart ? [\#2773](https://github.com/danielgindi/Charts/issues/2773) +- Avoid xAxis limit-labels display in a one-bar BarChart. [\#2771](https://github.com/danielgindi/Charts/issues/2771) +- zoom at particular position via code [\#2769](https://github.com/danielgindi/Charts/issues/2769) +- how to use HorizontalBarChart with decimal number as xAxis [\#2768](https://github.com/danielgindi/Charts/issues/2768) +- Cannot rescale Y-axis even if changing axisMinimum and axisMaximum [\#2766](https://github.com/danielgindi/Charts/issues/2766) +- I want to change ValueFormat of BarChartDataSet. I can't change it. [\#2764](https://github.com/danielgindi/Charts/issues/2764) +- Changing x-label formats from one line to word-wrapped is awkward [\#2763](https://github.com/danielgindi/Charts/issues/2763) +- chartValueSelected not getting value from Max Value [\#2762](https://github.com/danielgindi/Charts/issues/2762) +- Dual YAxis [\#2761](https://github.com/danielgindi/Charts/issues/2761) +- How to set the position of the values top on BarChartView? [\#2759](https://github.com/danielgindi/Charts/issues/2759) +- Line chart xAxis cut left or right in iphone 5 [\#2758](https://github.com/danielgindi/Charts/issues/2758) +- TableView does not scroll vertically after graph is rendered to cells [\#2757](https://github.com/danielgindi/Charts/issues/2757) +- Fill the color between two line charts using IFillFormatter [\#2756](https://github.com/danielgindi/Charts/issues/2756) +- How to use custom view for labels of xAxis? [\#2755](https://github.com/danielgindi/Charts/issues/2755) +- Chart not consistently showing data [\#2753](https://github.com/danielgindi/Charts/issues/2753) +- Obtaining current number of points being rendered in zoomed viewing window [\#2752](https://github.com/danielgindi/Charts/issues/2752) +- Barchart starting above X-Axis [\#2751](https://github.com/danielgindi/Charts/issues/2751) +- Getting the position of Data array of entry: ChartDataEntry via chartValueSelected\(args\) method [\#2750](https://github.com/danielgindi/Charts/issues/2750) +- Create Simple Bar Chart [\#2749](https://github.com/danielgindi/Charts/issues/2749) +- iOS8 simulator crashed iOS 8模拟器崩溃在画Y轴线的地方 [\#2746](https://github.com/danielgindi/Charts/issues/2746) +- Chart displays values, but no bars [\#2744](https://github.com/danielgindi/Charts/issues/2744) +- Can not inherit Charts to subclass some cutomize charts [\#2743](https://github.com/danielgindi/Charts/issues/2743) +- CandleStick fill colors not showing [\#2742](https://github.com/danielgindi/Charts/issues/2742) +- Bar chart click on outside of bar calling delegate [\#2741](https://github.com/danielgindi/Charts/issues/2741) +- Resize chart after adding limit line [\#2739](https://github.com/danielgindi/Charts/issues/2739) +- Pie chart entry icon get cut [\#2738](https://github.com/danielgindi/Charts/issues/2738) +- How can I set ValuePosition for individual slices? [\#2736](https://github.com/danielgindi/Charts/issues/2736) +- You can't slide along the X-axis [\#2735](https://github.com/danielgindi/Charts/issues/2735) +- Candlechart zooming disable interaction with viewcontroller [\#2734](https://github.com/danielgindi/Charts/issues/2734) +- 2 datasets, one should only display one label at the top [\#2733](https://github.com/danielgindi/Charts/issues/2733) +- How do I change the color of the text on top of the bars? [\#2732](https://github.com/danielgindi/Charts/issues/2732) +- Can't subclass BarChartRenderer due to 'fileprivate' status of many properties [\#2731](https://github.com/danielgindi/Charts/issues/2731) +- Left axis axisMinimum inside a TableviewCell does not work [\#2729](https://github.com/danielgindi/Charts/issues/2729) +- How to set minimum displayed Y axis value [\#2728](https://github.com/danielgindi/Charts/issues/2728) +- Custom Text Axis X Horizontal Bar Chart [\#2726](https://github.com/danielgindi/Charts/issues/2726) +- Crash when use in Notification Content Extension [\#2725](https://github.com/danielgindi/Charts/issues/2725) +- Problems encountered with charts [\#2724](https://github.com/danielgindi/Charts/issues/2724) +- Can I use Charts in Swift 4? [\#2723](https://github.com/danielgindi/Charts/issues/2723) +- Add gradient to bar chart [\#2722](https://github.com/danielgindi/Charts/issues/2722) +- Draw bar chart from axisMinimum instead of 0 [\#2721](https://github.com/danielgindi/Charts/issues/2721) +- Different Charts-Swifg.h when simulator and iphone [\#2720](https://github.com/danielgindi/Charts/issues/2720) +- Viewport transX jumping when zooming Y scale \(dynamic/realtime data\) [\#2719](https://github.com/danielgindi/Charts/issues/2719) +- Align X labels with Charts [\#2718](https://github.com/danielgindi/Charts/issues/2718) +- iOS swift3 Chart xaxis duplicate value issue for linechartview [\#2715](https://github.com/danielgindi/Charts/issues/2715) +- Label Position xAxis Radar Chart [\#2714](https://github.com/danielgindi/Charts/issues/2714) +- Showing actual value IN ADDITION to percentage, in a pie slice? [\#2713](https://github.com/danielgindi/Charts/issues/2713) +- Fail to display any thing in line chart. [\#2712](https://github.com/danielgindi/Charts/issues/2712) +- How to decrees column width size in LineChart [\#2710](https://github.com/danielgindi/Charts/issues/2710) +- Runtime EXC\_BAD\_ACCESS with barchart whiles zoom in [\#2709](https://github.com/danielgindi/Charts/issues/2709) +- How to format values on barchart [\#2708](https://github.com/danielgindi/Charts/issues/2708) +- where do I find ioscharts.framework? [\#2707](https://github.com/danielgindi/Charts/issues/2707) +- Add horizontal line at certain value on Y-Axis? [\#2706](https://github.com/danielgindi/Charts/issues/2706) +- BarChart does not render with multiple data sets [\#2705](https://github.com/danielgindi/Charts/issues/2705) +- Balloon Marker: making it work in line chart inside combined view [\#2703](https://github.com/danielgindi/Charts/issues/2703) +- IValueFormatter text showing More than one Time [\#2700](https://github.com/danielgindi/Charts/issues/2700) +- Disable bar selection or highlight? [\#2699](https://github.com/danielgindi/Charts/issues/2699) +- Increase Yaxis Labes According to the max values. [\#2696](https://github.com/danielgindi/Charts/issues/2696) +- xAxis scrolling in combineChartView [\#2695](https://github.com/danielgindi/Charts/issues/2695) +- How to highlight at specific entry ? [\#2693](https://github.com/danielgindi/Charts/issues/2693) +- Horizontal bar charts 'Y' values are getting overlapped with '0' [\#2691](https://github.com/danielgindi/Charts/issues/2691) +- Two ChartViews own the same Xaxis [\#2690](https://github.com/danielgindi/Charts/issues/2690) +- issues about BarChartView [\#2689](https://github.com/danielgindi/Charts/issues/2689) +- Tap Gesture Handler callback method [\#2686](https://github.com/danielgindi/Charts/issues/2686) +- How to draw dashed circles for values? [\#2685](https://github.com/danielgindi/Charts/issues/2685) +- How to Redraw the charts? [\#2684](https://github.com/danielgindi/Charts/issues/2684) +- BarChartView top border not showing [\#2682](https://github.com/danielgindi/Charts/issues/2682) +- Drawing horizontal dashed lines except on x-axis line? [\#2681](https://github.com/danielgindi/Charts/issues/2681) +- X-Axis Date values not displaying properly? [\#2680](https://github.com/danielgindi/Charts/issues/2680) +- Dashed border on highlighted bar - BarChart [\#2675](https://github.com/danielgindi/Charts/issues/2675) +- ChartFill - I would like to fill above the line [\#2674](https://github.com/danielgindi/Charts/issues/2674) +- Anyone have iOS charts working with Xcode 9 Beta? [\#2673](https://github.com/danielgindi/Charts/issues/2673) +- Change Scale on Y Axis for CombinedChart [\#2672](https://github.com/danielgindi/Charts/issues/2672) +- Y-axis with text [\#2671](https://github.com/danielgindi/Charts/issues/2671) +- Show only 2 labels on xAxis in CombinedChartView [\#2670](https://github.com/danielgindi/Charts/issues/2670) +- Graphing just a part of the data [\#2669](https://github.com/danielgindi/Charts/issues/2669) +- How to add texts/image into a chart? [\#2667](https://github.com/danielgindi/Charts/issues/2667) +- Is it possible to scroll without Zooming/ Scaling ? [\#2666](https://github.com/danielgindi/Charts/issues/2666) +- Use Charts in Swift3,Error [\#2664](https://github.com/danielgindi/Charts/issues/2664) +- Custom highlighter/marker [\#2663](https://github.com/danielgindi/Charts/issues/2663) +- Display programatically a marker on a chart [\#2662](https://github.com/danielgindi/Charts/issues/2662) +- Scrollview inside Marker [\#2661](https://github.com/danielgindi/Charts/issues/2661) +- Bitcode Problem [\#2660](https://github.com/danielgindi/Charts/issues/2660) +- Fix Marker on center even when chart is scaled or dragged [\#2659](https://github.com/danielgindi/Charts/issues/2659) +- How to add marker to center position in ios charts while scrolling horizontally with increasing scaleX and enabling drag [\#2658](https://github.com/danielgindi/Charts/issues/2658) +- Y Axis scales display format [\#2657](https://github.com/danielgindi/Charts/issues/2657) +- Marker and long press gesture... [\#2656](https://github.com/danielgindi/Charts/issues/2656) +- Pie chart Crash [\#2655](https://github.com/danielgindi/Charts/issues/2655) +- YAxisValues:"Zero" of the integer part is not displayed when the YAxis coordinate is zero [\#2653](https://github.com/danielgindi/Charts/issues/2653) +- Memory leak when valueFormatter is set [\#2652](https://github.com/danielgindi/Charts/issues/2652) +- autoScaleMinMaxEnabled, axisMaximum and axisMinimum [\#2651](https://github.com/danielgindi/Charts/issues/2651) +- Draw X-Axis labels with dates keeping index of x-axis independent like before [\#2648](https://github.com/danielgindi/Charts/issues/2648) +- About ChartHighLight [\#2647](https://github.com/danielgindi/Charts/issues/2647) +- Start value from X-Axis [\#2646](https://github.com/danielgindi/Charts/issues/2646) +- Combined chart with horizontal bar and bubble [\#2644](https://github.com/danielgindi/Charts/issues/2644) +- I have a problem with compiling [\#2643](https://github.com/danielgindi/Charts/issues/2643) +- How to implement custom dataset in objective-c? [\#2639](https://github.com/danielgindi/Charts/issues/2639) +- I am not able to set values on the bar in simple bar chart. [\#2638](https://github.com/danielgindi/Charts/issues/2638) +- Swift based Charts library increased application size when used for objective c based project [\#2637](https://github.com/danielgindi/Charts/issues/2637) +- 使用CombinedChartView绘制柱形图,如何只让当前bar视图显示灰色背影。 [\#2636](https://github.com/danielgindi/Charts/issues/2636) +- OHLC charts... [\#2635](https://github.com/danielgindi/Charts/issues/2635) +- unable to set string values on x-axis in grouped bar chart . [\#2632](https://github.com/danielgindi/Charts/issues/2632) +- How to set group width in multiple bar chart? [\#2631](https://github.com/danielgindi/Charts/issues/2631) +- override renderLegend\(context: CGContext\) [\#2630](https://github.com/danielgindi/Charts/issues/2630) +- Changing chart's type without creating a new object... [\#2627](https://github.com/danielgindi/Charts/issues/2627) +- Using Charts in NSStackView [\#2626](https://github.com/danielgindi/Charts/issues/2626) +- Does PieChart support multiple columns of vertical legend? [\#2625](https://github.com/danielgindi/Charts/issues/2625) +- I need this method: setShowOnlyMinMax [\#2624](https://github.com/danielgindi/Charts/issues/2624) +- Unable to use this library in Objective-c . [\#2623](https://github.com/danielgindi/Charts/issues/2623) +- 计算柱形图的宽度和设定间隙 [\#2622](https://github.com/danielgindi/Charts/issues/2622) +- How to adjust RadarChartView text from the bottom of the height? [\#2621](https://github.com/danielgindi/Charts/issues/2621) +- How to give all pie-slices a rounded edge? [\#2620](https://github.com/danielgindi/Charts/issues/2620) +- Alternative color to fill in radar chart [\#2617](https://github.com/danielgindi/Charts/issues/2617) +- About gradient color for lineChartView [\#2615](https://github.com/danielgindi/Charts/issues/2615) +- Invalid bundle [\#2614](https://github.com/danielgindi/Charts/issues/2614) +- Want to display circles at data points on a line graph only if the data has changed or is about to change [\#2613](https://github.com/danielgindi/Charts/issues/2613) +- Swift language Version. [\#2612](https://github.com/danielgindi/Charts/issues/2612) +- Linker Command Fail error [\#2611](https://github.com/danielgindi/Charts/issues/2611) +- xAxis's first lable always on the left [\#2610](https://github.com/danielgindi/Charts/issues/2610) +- when i Creat one LineChartData objc. it's draws Three points [\#2609](https://github.com/danielgindi/Charts/issues/2609) +- i wanna display Char form with no data. but with Y Values. [\#2608](https://github.com/danielgindi/Charts/issues/2608) +- Is there any way to get the xaxis value when chart scroll end specific area? [\#2607](https://github.com/danielgindi/Charts/issues/2607) +- Memory Leak in Legend and ArrayBufferProtocol [\#2606](https://github.com/danielgindi/Charts/issues/2606) +- fatal error due to call to computeAxisValues during call to notifyDataSetChanged [\#2605](https://github.com/danielgindi/Charts/issues/2605) +- Bar Chart & label displayed wrongly when dataset count changes [\#2603](https://github.com/danielgindi/Charts/issues/2603) +- BarChart.Axis label change starting index when .rightAxix is enabled [\#2602](https://github.com/danielgindi/Charts/issues/2602) +- Spacing between left axis labels [\#2601](https://github.com/danielgindi/Charts/issues/2601) +- React Native support [\#2598](https://github.com/danielgindi/Charts/issues/2598) +- Not able to see yAxis label while changing position of that label [\#2596](https://github.com/danielgindi/Charts/issues/2596) +- About stacked bar value label postion [\#2595](https://github.com/danielgindi/Charts/issues/2595) +- Invalid Bundle - Xcode 9 Beta 2 [\#2593](https://github.com/danielgindi/Charts/issues/2593) +- Stacked bar always show last value [\#2592](https://github.com/danielgindi/Charts/issues/2592) +- Use Charts in App Extension [\#2590](https://github.com/danielgindi/Charts/issues/2590) +- About bar and line combined [\#2589](https://github.com/danielgindi/Charts/issues/2589) +- Draw graph of a function [\#2588](https://github.com/danielgindi/Charts/issues/2588) +- Scrolling chart [\#2587](https://github.com/danielgindi/Charts/issues/2587) +- How change value double to value int format? [\#2586](https://github.com/danielgindi/Charts/issues/2586) +- stringForValue value [\#2585](https://github.com/danielgindi/Charts/issues/2585) +- Invalid architecture... support arm64. [\#2584](https://github.com/danielgindi/Charts/issues/2584) +- Line chart with blank data show Y axis label incorrect on iPhone 5 [\#2583](https://github.com/danielgindi/Charts/issues/2583) +- 'M\_PI' is deprecated: Please use 'Double.pi' or '.pi' to get the value of correct type and avoid casting. [\#2580](https://github.com/danielgindi/Charts/issues/2580) +- 0 lost when the value less than 1.0,why? [\#2579](https://github.com/danielgindi/Charts/issues/2579) +- Error Library not loaded: @rpath/libswiftAppKit.dylib [\#2578](https://github.com/danielgindi/Charts/issues/2578) +- CenterText/Description Text overruns onto PieChart [\#2577](https://github.com/danielgindi/Charts/issues/2577) +- Hide specific legend not all [\#2576](https://github.com/danielgindi/Charts/issues/2576) +- horizontal barchart each bar have different maximum value [\#2575](https://github.com/danielgindi/Charts/issues/2575) +- Barchart fixed interval in left axis [\#2574](https://github.com/danielgindi/Charts/issues/2574) +- Change color of Bar chart data label [\#2573](https://github.com/danielgindi/Charts/issues/2573) +- Visible ChartDataEntry when zoomed in? [\#2572](https://github.com/danielgindi/Charts/issues/2572) +- Changing color of the bar graph [\#2571](https://github.com/danielgindi/Charts/issues/2571) +- Custom bar chart highlight style [\#2570](https://github.com/danielgindi/Charts/issues/2570) +- How to show LineChart with icon [\#2566](https://github.com/danielgindi/Charts/issues/2566) +- how to do Paging [\#2565](https://github.com/danielgindi/Charts/issues/2565) +- Range float bars [\#2564](https://github.com/danielgindi/Charts/issues/2564) +- Cropping left axis labels and missing some values [\#2563](https://github.com/danielgindi/Charts/issues/2563) +- How to create a custom marker view in line chart for showing x values as well [\#2562](https://github.com/danielgindi/Charts/issues/2562) +- HorizontalBarChartView:when i set Xvalue = 0,1,2,3..... HorizontalBarChartView some X dont show [\#2559](https://github.com/danielgindi/Charts/issues/2559) +- But I hope also have the valueFonts property set for each font size, like valueColors [\#2558](https://github.com/danielgindi/Charts/issues/2558) +- charts uses iphone show "No architectures to compile for \(ONLY\_ACTIVE\_ARCH=YES, active arch=arm64, VALID\_ARCHS=i386 x86\_64 \)". [\#2557](https://github.com/danielgindi/Charts/issues/2557) +- Caching charts [\#2555](https://github.com/danielgindi/Charts/issues/2555) +- How to add X axis values in the balloon marker view in IOS Charts? [\#2554](https://github.com/danielgindi/Charts/issues/2554) +- One label for each data point - Line Chart - SOLUTION FOUND [\#2553](https://github.com/danielgindi/Charts/issues/2553) +- PieChart legend.yOffset bug [\#2552](https://github.com/danielgindi/Charts/issues/2552) +- PieChart legend.yOffset bug [\#2551](https://github.com/danielgindi/Charts/issues/2551) +- Duplicates x-axis labels are plotted separately in graph? [\#2549](https://github.com/danielgindi/Charts/issues/2549) +- How to set the label count for X axis ? [\#2548](https://github.com/danielgindi/Charts/issues/2548) +- Hide graph label if value fall below a certain threshold/minimum [\#2547](https://github.com/danielgindi/Charts/issues/2547) +- BarChar Position Label [\#2546](https://github.com/danielgindi/Charts/issues/2546) +- Swift language upgrade required [\#2544](https://github.com/danielgindi/Charts/issues/2544) +- BarChartDataEntry different value than value display for each BarChartDataSet [\#2543](https://github.com/danielgindi/Charts/issues/2543) +- LineChartDataSet why there is no valueFonts [\#2542](https://github.com/danielgindi/Charts/issues/2542) +- Need swift combined chart demo. [\#2540](https://github.com/danielgindi/Charts/issues/2540) +- Pie Chart Highlighted region [\#2536](https://github.com/danielgindi/Charts/issues/2536) +- Replace the value label without redraw the bar. [\#2535](https://github.com/danielgindi/Charts/issues/2535) +- Lines on Horizontal Bar Chart [\#2532](https://github.com/danielgindi/Charts/issues/2532) +- Cannot convert value of type 'AutoreleasingUnsafeMutablePointer\' to expected argument type 'AutoreleasingUnsafeMutablePointer\?' [\#2530](https://github.com/danielgindi/Charts/issues/2530) +- zoom programatically, reset the zoom, set the highlight and moving the X-Axis and the Y-Axis to the middle [\#2529](https://github.com/danielgindi/Charts/issues/2529) +- BarGraph - 0 values - Bar Offset [\#2528](https://github.com/danielgindi/Charts/issues/2528) +- Chart displays intermittently [\#2527](https://github.com/danielgindi/Charts/issues/2527) +- Changing BarChart xAxis label position [\#2526](https://github.com/danielgindi/Charts/issues/2526) +- Create PDF Of Charts [\#2525](https://github.com/danielgindi/Charts/issues/2525) +- What is the equivalent of "onChartDoubleTapped"? [\#2524](https://github.com/danielgindi/Charts/issues/2524) +- Delegate Memory Leak [\#2523](https://github.com/danielgindi/Charts/issues/2523) +- Chart is sometimes not showing data on Plus devices [\#2521](https://github.com/danielgindi/Charts/issues/2521) +- How to run in Xcode 9 \(beta\) [\#2520](https://github.com/danielgindi/Charts/issues/2520) +- HorizontalBarChartView offset X [\#2519](https://github.com/danielgindi/Charts/issues/2519) +- Line not showing in LineChart [\#2518](https://github.com/danielgindi/Charts/issues/2518) +- Displaying float values in bar chart label. [\#2517](https://github.com/danielgindi/Charts/issues/2517) +- Not working with Xcode 9 Beta1 [\#2514](https://github.com/danielgindi/Charts/issues/2514) +- PieChart: Identify univocally a specific entry [\#2513](https://github.com/danielgindi/Charts/issues/2513) +- Right Align Y Value Labels for Horizontal Bar Chart [\#2512](https://github.com/danielgindi/Charts/issues/2512) +- Swift 3 Cubic line chart [\#2510](https://github.com/danielgindi/Charts/issues/2510) +- Inserting dataPoint "labels" in Radar Chart [\#2508](https://github.com/danielgindi/Charts/issues/2508) +- How to remove decimals from y values in iOS Charts? [\#2506](https://github.com/danielgindi/Charts/issues/2506) +- Add background to chart's legend [\#2505](https://github.com/danielgindi/Charts/issues/2505) +- Combine Bar, Line and Pie chart [\#2503](https://github.com/danielgindi/Charts/issues/2503) +- Chart not in centre of view [\#2502](https://github.com/danielgindi/Charts/issues/2502) +- Can't use different Charts Framework with different versions of Xcode [\#2499](https://github.com/danielgindi/Charts/issues/2499) +- How to change the label colors of certain XAxis values? [\#2498](https://github.com/danielgindi/Charts/issues/2498) +- Chart points are being clipped out in ScatterChart [\#2496](https://github.com/danielgindi/Charts/issues/2496) +- PieChart render very small [\#2495](https://github.com/danielgindi/Charts/issues/2495) +- Bar values inside bar horizontally? [\#2494](https://github.com/danielgindi/Charts/issues/2494) +- I used Charts in my iOS project and when I start to zoom the chart labels on xAxis get repeated again and again. How can I fix my problem? [\#2493](https://github.com/danielgindi/Charts/issues/2493) +- linechart shadow [\#2492](https://github.com/danielgindi/Charts/issues/2492) +- Set a fixed bar width in BarChartView [\#2491](https://github.com/danielgindi/Charts/issues/2491) +- Linechart inverted [\#2490](https://github.com/danielgindi/Charts/issues/2490) +- Pie chart not accepting more than one dataSet [\#2489](https://github.com/danielgindi/Charts/issues/2489) +- Graph x-axis values not displaying in swift 3.0 [\#2488](https://github.com/danielgindi/Charts/issues/2488) +- How to round corner in Radar Charts? [\#2487](https://github.com/danielgindi/Charts/issues/2487) +- Display header label on xAxis and yAxis [\#2485](https://github.com/danielgindi/Charts/issues/2485) +- XAxis label issue with multiple/grouped bar chart [\#2481](https://github.com/danielgindi/Charts/issues/2481) +- After integration, the project package becomes bigger. [\#2480](https://github.com/danielgindi/Charts/issues/2480) +- Pinch to Zoom is not working as expected over Bar Chart [\#2479](https://github.com/danielgindi/Charts/issues/2479) +- Two markers on one line \[LineChartView\] [\#2476](https://github.com/danielgindi/Charts/issues/2476) +- Adjust the spacing between bars. \(not grouped\) [\#2475](https://github.com/danielgindi/Charts/issues/2475) +- Issue with order of x-values and Multi LineChart [\#2474](https://github.com/danielgindi/Charts/issues/2474) +- Show Integer values on LineChart [\#2473](https://github.com/danielgindi/Charts/issues/2473) +- Loading a blank chart [\#2472](https://github.com/danielgindi/Charts/issues/2472) +- LineChart isn't shown correct [\#2471](https://github.com/danielgindi/Charts/issues/2471) +- Device Orientation not detected when using Charts module [\#2469](https://github.com/danielgindi/Charts/issues/2469) +- How to set spacing between bars? [\#2467](https://github.com/danielgindi/Charts/issues/2467) +- what happened to sliceSpace function in piechartdataset? [\#2466](https://github.com/danielgindi/Charts/issues/2466) +- How to scroll between charts on carousel [\#2465](https://github.com/danielgindi/Charts/issues/2465) +- PieChartData and NSNumberFormatter memory leak about demo project [\#2464](https://github.com/danielgindi/Charts/issues/2464) +- Custom View within the PieChart Center [\#2463](https://github.com/danielgindi/Charts/issues/2463) +- toggle highlight for pie chart slice [\#2462](https://github.com/danielgindi/Charts/issues/2462) +- HorizontalBarChartView [\#2461](https://github.com/danielgindi/Charts/issues/2461) +- Cubic Line Distorted [\#2459](https://github.com/danielgindi/Charts/issues/2459) +- Plotband support [\#2458](https://github.com/danielgindi/Charts/issues/2458) +- Bubble charts: Can i set the size same to all the bubbles? [\#2456](https://github.com/danielgindi/Charts/issues/2456) +- Single point on line chart not showing - Swift 3 [\#2455](https://github.com/danielgindi/Charts/issues/2455) +- Plotting large amount of data slows down the Graph. [\#2454](https://github.com/danielgindi/Charts/issues/2454) +- Error on Manually adding on my project [\#2453](https://github.com/danielgindi/Charts/issues/2453) +- How to implement Gantt charts using iOS-Charts? [\#2451](https://github.com/danielgindi/Charts/issues/2451) +- How come I can't set a default color theme in ChartColorTemplate.swift? [\#2450](https://github.com/danielgindi/Charts/issues/2450) +- What is relation between the BubbleSize and the axis value?Can we control the size of Bubble in Bubble Chart? [\#2448](https://github.com/danielgindi/Charts/issues/2448) +- chart 3.0 xAxis labels not mapped [\#2447](https://github.com/danielgindi/Charts/issues/2447) +- fatal error: Index out of range while subclassing renderer [\#2446](https://github.com/danielgindi/Charts/issues/2446) +- Bug in line chart yAxis when range are less than 1 [\#2445](https://github.com/danielgindi/Charts/issues/2445) +- Help with custom graphic/chart [\#2442](https://github.com/danielgindi/Charts/issues/2442) +- PieChart center Attributed Text [\#2441](https://github.com/danielgindi/Charts/issues/2441) +- PieChart center Attributed Text [\#2440](https://github.com/danielgindi/Charts/issues/2440) +- show tooltip on click [\#2438](https://github.com/danielgindi/Charts/issues/2438) +- Got Error : “\_OBJC\_CLASS\_$\_\_TtC10ChartsDemo12XYMarkerView” in Charts [\#2437](https://github.com/danielgindi/Charts/issues/2437) +- Change color label over circle [\#2436](https://github.com/danielgindi/Charts/issues/2436) +- How to set labels based on max and min value of the plot? [\#2434](https://github.com/danielgindi/Charts/issues/2434) +- How to make the pie chart selected by default? [\#2431](https://github.com/danielgindi/Charts/issues/2431) +- Animate 3 dataSets one by one [\#2428](https://github.com/danielgindi/Charts/issues/2428) +- Marker points on wrong position [\#2426](https://github.com/danielgindi/Charts/issues/2426) +- Legend leak in version 3.0.1 [\#2425](https://github.com/danielgindi/Charts/issues/2425) +- Show Two Circles in Pie Chart [\#2424](https://github.com/danielgindi/Charts/issues/2424) +- restrainViewPort is not working. Chart stays the same! [\#2423](https://github.com/danielgindi/Charts/issues/2423) +- Line Chart show value on specific coordinate [\#2420](https://github.com/danielgindi/Charts/issues/2420) +- Is it possible to extend the gesture handler? [\#2419](https://github.com/danielgindi/Charts/issues/2419) +- Memory Leak in BarChartView Data [\#2416](https://github.com/danielgindi/Charts/issues/2416) +- Track Scroll Left or Right [\#2415](https://github.com/danielgindi/Charts/issues/2415) +- How can I add the xVals to LineChartData object? [\#2412](https://github.com/danielgindi/Charts/issues/2412) +- Line chart doesn't redraw correctly after removeEntry\(\) [\#2411](https://github.com/danielgindi/Charts/issues/2411) +- Bar width [\#2410](https://github.com/danielgindi/Charts/issues/2410) +- There is no way to restrict zoom level after certain zoom level [\#2409](https://github.com/danielgindi/Charts/issues/2409) +- Half Pie Chart no full view [\#2408](https://github.com/danielgindi/Charts/issues/2408) +- How to use gradient colors for each column in a histogram? [\#2407](https://github.com/danielgindi/Charts/issues/2407) +- Fill line chart when drag with two fingers [\#2405](https://github.com/danielgindi/Charts/issues/2405) +- chartValueSelected Delegate Method Not Called [\#2404](https://github.com/danielgindi/Charts/issues/2404) +- Draw bar line even though the value is zero [\#2403](https://github.com/danielgindi/Charts/issues/2403) +- Adding line/dataset on line chart that already has a line [\#2401](https://github.com/danielgindi/Charts/issues/2401) +- help with labels [\#2400](https://github.com/danielgindi/Charts/issues/2400) +- 'Charts/Charts.h' file not found when tried build using "XCODEBUILD" command in terminal [\#2397](https://github.com/danielgindi/Charts/issues/2397) +- moveViewToX\(\) has no affect on a chart whose frame has not been set yet [\#2395](https://github.com/danielgindi/Charts/issues/2395) +- Appending Units\(i.e. m/s, mpg, etc\) to yaxis?? [\#2394](https://github.com/danielgindi/Charts/issues/2394) +- Chart Top label Issue [\#2392](https://github.com/danielgindi/Charts/issues/2392) +- How to just draw one circle value for LineChartView [\#2391](https://github.com/danielgindi/Charts/issues/2391) +- Support for 3D charts [\#2389](https://github.com/danielgindi/Charts/issues/2389) +- Y Axis range calculation is incorrect for Bar Charts [\#2386](https://github.com/danielgindi/Charts/issues/2386) +- Is having a ChartViewBase inside a custom UIView even possible? [\#2384](https://github.com/danielgindi/Charts/issues/2384) +- "chartValueSelected" is not getting called. [\#2383](https://github.com/danielgindi/Charts/issues/2383) +- Does it support XO line\(American CandleStick\)? [\#2382](https://github.com/danielgindi/Charts/issues/2382) +- Chart Won't Display [\#2381](https://github.com/danielgindi/Charts/issues/2381) +- autoScaleMinMaxEnabled Not Working [\#2374](https://github.com/danielgindi/Charts/issues/2374) +- Graph is being drawn outside of visible area [\#2373](https://github.com/danielgindi/Charts/issues/2373) +- Compile error on Release build configuration [\#2372](https://github.com/danielgindi/Charts/issues/2372) +- moveViewToX clips bar [\#2370](https://github.com/danielgindi/Charts/issues/2370) +- swift 3.x -\> New ChartMarker? [\#2369](https://github.com/danielgindi/Charts/issues/2369) +- Crash on computeAxisValues of Bar Chart [\#2368](https://github.com/danielgindi/Charts/issues/2368) +- How to properly reset zoom on data refresh? [\#2367](https://github.com/danielgindi/Charts/issues/2367) +- What is the meaning of xValue in moveViewToAnimated? [\#2366](https://github.com/danielgindi/Charts/issues/2366) +- Horizontal Bar Chart rightAxis default maximum space [\#2363](https://github.com/danielgindi/Charts/issues/2363) +- Why my LineChartDataSet's line is behind the bar? [\#2354](https://github.com/danielgindi/Charts/issues/2354) +- charts2.5 bottom line render issue [\#2352](https://github.com/danielgindi/Charts/issues/2352) +- Limit the number of bars to 10 when the x-axis is made of strings [\#2351](https://github.com/danielgindi/Charts/issues/2351) +- Not able to plot values in linechart [\#2349](https://github.com/danielgindi/Charts/issues/2349) +- Text in Marker [\#2348](https://github.com/danielgindi/Charts/issues/2348) +- PieChart overlay lines or dots for select slices in the pie chart [\#2347](https://github.com/danielgindi/Charts/issues/2347) +- Multiple colors grid background [\#2346](https://github.com/danielgindi/Charts/issues/2346) +- The direction of the two BarChart [\#2345](https://github.com/danielgindi/Charts/issues/2345) +- how to format y-axix values [\#2343](https://github.com/danielgindi/Charts/issues/2343) +- different Bar color based on values [\#2342](https://github.com/danielgindi/Charts/issues/2342) +- XCode wants to convert Chart [\#2341](https://github.com/danielgindi/Charts/issues/2341) +- Population Pyramid [\#2340](https://github.com/danielgindi/Charts/issues/2340) +- Not all labels shown on horizontal bar chart with large datasets [\#2339](https://github.com/danielgindi/Charts/issues/2339) +- Using ChartViewBase as the type and instantiating the chart later as a specific type [\#2338](https://github.com/danielgindi/Charts/issues/2338) +- Remove Highlight from bar graph [\#2337](https://github.com/danielgindi/Charts/issues/2337) +- Set diffent style to single line graph [\#2336](https://github.com/danielgindi/Charts/issues/2336) +- change the color of the highlight point [\#2334](https://github.com/danielgindi/Charts/issues/2334) +- Extra space to the right of chart [\#2333](https://github.com/danielgindi/Charts/issues/2333) +- xcode 8.3 swift 3.1 [\#2332](https://github.com/danielgindi/Charts/issues/2332) +- AxisDependencyRight Question~~ [\#2331](https://github.com/danielgindi/Charts/issues/2331) +- Module Charts not found XCODE 8.1 Error [\#2330](https://github.com/danielgindi/Charts/issues/2330) +- How to remove Grid [\#2329](https://github.com/danielgindi/Charts/issues/2329) +- The spacing between the two points is wider than the distance between the labels [\#2327](https://github.com/danielgindi/Charts/issues/2327) +- Skipped installing realm-cocoa.framework binary due to the error: [\#2326](https://github.com/danielgindi/Charts/issues/2326) +- Pie Chart view as Int instead of double on segment? [\#2325](https://github.com/danielgindi/Charts/issues/2325) +- Not able to give X axis Values [\#2324](https://github.com/danielgindi/Charts/issues/2324) +- Labels to PieChart? v 3.0.2 [\#2323](https://github.com/danielgindi/Charts/issues/2323) +- How to prevent static data sets from redrawing and hogging CPU [\#2322](https://github.com/danielgindi/Charts/issues/2322) +- BarChart xAxis labels a moving [\#2321](https://github.com/danielgindi/Charts/issues/2321) +- How to add a fade background for data values [\#2320](https://github.com/danielgindi/Charts/issues/2320) +- Limit Line after update to 3.0.2 no longer shown [\#2319](https://github.com/danielgindi/Charts/issues/2319) +- Charts v3.0.2 does not build using Carthage [\#2317](https://github.com/danielgindi/Charts/issues/2317) +- spaceMin and spaceMax are not percentages [\#2314](https://github.com/danielgindi/Charts/issues/2314) +- API for increasing or decreasing condition for CandleStick Chart [\#2311](https://github.com/danielgindi/Charts/issues/2311) +- Create Tag to include 'fix for Xcode 8.3' [\#2309](https://github.com/danielgindi/Charts/issues/2309) +- Ambiguous use of 'data' [\#2304](https://github.com/danielgindi/Charts/issues/2304) +- Default backgroundColor \(nil\) displays as black instead of clear. [\#2222](https://github.com/danielgindi/Charts/issues/2222) +- pdf report with Line Chart blurry from iphone 7 [\#2204](https://github.com/danielgindi/Charts/issues/2204) +- how to add Values to Pie Chart? and how to show complete pie chart instead of doughnut [\#2150](https://github.com/danielgindi/Charts/issues/2150) +- 'LineChartView' is unavailable: cannot find Swift declaration for this class [\#2145](https://github.com/danielgindi/Charts/issues/2145) +- Display label MMyyyy for barChart [\#2142](https://github.com/danielgindi/Charts/issues/2142) +- barSpace attribute [\#2137](https://github.com/danielgindi/Charts/issues/2137) +- Bar Chart, Shifting Y Position [\#2134](https://github.com/danielgindi/Charts/issues/2134) +- highlightValue is throwing "fatal error: Index out of range" in Combined Chart [\#2076](https://github.com/danielgindi/Charts/issues/2076) **Merged pull requests:** @@ -267,6 +1789,326 @@ [Full Changelog](https://github.com/danielgindi/Charts/compare/v3.0.1...v3.0.2) +**Implemented enhancements:** + +- Plotting Realm data in Swift. RLMResults not available [\#898](https://github.com/danielgindi/Charts/issues/898) + +**Fixed bugs:** + +- \[Bug\] Double BarChart second value text mispaced [\#1191](https://github.com/danielgindi/Charts/issues/1191) +- \: CGAffineTransformInvert: singular matrix [\#802](https://github.com/danielgindi/Charts/issues/802) + +**Closed issues:** + +- Please give option for installing via Swift Package Manager too [\#2313](https://github.com/danielgindi/Charts/issues/2313) +- Adjust spacing between axis labels and axes? [\#2310](https://github.com/danielgindi/Charts/issues/2310) +- \*PieChart\* Get color of top 3 largest percent [\#2308](https://github.com/danielgindi/Charts/issues/2308) +- Set the x axis data problems, and 2.3.0 apis are quite different.Need your help [\#2307](https://github.com/danielgindi/Charts/issues/2307) +- little issue with chart custoemView size & chart data [\#2305](https://github.com/danielgindi/Charts/issues/2305) +- hello,A small problem. [\#2303](https://github.com/danielgindi/Charts/issues/2303) +- Running 1 of 1 custom shell scripts [\#2302](https://github.com/danielgindi/Charts/issues/2302) +- Multiple warnings xCode 8.3 [\#2298](https://github.com/danielgindi/Charts/issues/2298) +- Remove color label in pie-chart [\#2297](https://github.com/danielgindi/Charts/issues/2297) +- Charts 2.3 with Swift 3 \(xCode 8.3\) [\#2295](https://github.com/danielgindi/Charts/issues/2295) +- Modify Marker before showing value [\#2294](https://github.com/danielgindi/Charts/issues/2294) +- Xcode 8.3: 62 deprecation warnings [\#2293](https://github.com/danielgindi/Charts/issues/2293) +- Fix warning for Xcode8.3 [\#2292](https://github.com/danielgindi/Charts/issues/2292) +- Chart Selected function is not called on click of every Bar. [\#2291](https://github.com/danielgindi/Charts/issues/2291) +- “Swift Language Version” [\#2290](https://github.com/danielgindi/Charts/issues/2290) +- Swift 3.1 support [\#2288](https://github.com/danielgindi/Charts/issues/2288) +- Swift 3.1 Build [\#2287](https://github.com/danielgindi/Charts/issues/2287) +- ChartTouchDelegate never called [\#2286](https://github.com/danielgindi/Charts/issues/2286) +- Radar map size setting [\#2284](https://github.com/danielgindi/Charts/issues/2284) +- How do I set the radar map size? [\#2283](https://github.com/danielgindi/Charts/issues/2283) +- Adjust circle radius for individual line chart data point [\#2282](https://github.com/danielgindi/Charts/issues/2282) +- Get current axis interval between labels [\#2281](https://github.com/danielgindi/Charts/issues/2281) +- Only allow slice space for the selected item in a pie chart [\#2278](https://github.com/danielgindi/Charts/issues/2278) +- PieChartDataSet [\#2277](https://github.com/danielgindi/Charts/issues/2277) +- I want to un-highlight a line chart when dragging has stopped, among other things. Am I missing it? Thanks [\#2276](https://github.com/danielgindi/Charts/issues/2276) +- Demo for Swift 3 [\#2274](https://github.com/danielgindi/Charts/issues/2274) +- Getting the percentage and label for a slice [\#2273](https://github.com/danielgindi/Charts/issues/2273) +- Line chart - LineChartDataSet Background color. [\#2272](https://github.com/danielgindi/Charts/issues/2272) +- place image at top of each bar in bar graph [\#2271](https://github.com/danielgindi/Charts/issues/2271) +- How to draw circle at the end of a data set on line chart [\#2270](https://github.com/danielgindi/Charts/issues/2270) +- when i install pod 'Charts'. its install Old Version Of library 2.3 and give me error convert code into latest swift. [\#2269](https://github.com/danielgindi/Charts/issues/2269) +- ChartsDemo Buildtime Error: No such module 'RealmSwift' [\#2268](https://github.com/danielgindi/Charts/issues/2268) +- Total Data [\#2267](https://github.com/danielgindi/Charts/issues/2267) +- Line Chart Highlight, Remove X axis line and display label [\#2266](https://github.com/danielgindi/Charts/issues/2266) +- Increasing bar width in grouped sets of BarChartView [\#2263](https://github.com/danielgindi/Charts/issues/2263) +- lineChart.leftAxis.startAtZeroEnabled is not available in Swift 3 library [\#2262](https://github.com/danielgindi/Charts/issues/2262) +- Can't find highlightcolor [\#2256](https://github.com/danielgindi/Charts/issues/2256) +- Custom yAxis values [\#2254](https://github.com/danielgindi/Charts/issues/2254) +- Dynamic generate Int values for axis [\#2253](https://github.com/danielgindi/Charts/issues/2253) +- viewController can't be dealloc [\#2252](https://github.com/danielgindi/Charts/issues/2252) +- How to include a gap between data points & lines [\#2251](https://github.com/danielgindi/Charts/issues/2251) +- Highlight particular X and Y coordinations in the iOS charts [\#2250](https://github.com/danielgindi/Charts/issues/2250) +- Bar shapes are overlapped with other bars [\#2248](https://github.com/danielgindi/Charts/issues/2248) +- Xaxis Label value in range \(2.5-5.0,5.0-7.5\) [\#2246](https://github.com/danielgindi/Charts/issues/2246) +- Multiline axis labels are cut off [\#2244](https://github.com/danielgindi/Charts/issues/2244) +- Problems with creating CombinedChart \(Line + grouped BarChart\) in Swift 3.0 [\#2243](https://github.com/danielgindi/Charts/issues/2243) +- Convert to Current Swift Syntax [\#2242](https://github.com/danielgindi/Charts/issues/2242) +- Line chart real time data - memory leak [\#2241](https://github.com/danielgindi/Charts/issues/2241) +- Radar chart bug - grey view shown on 6 plus and 7 plus [\#2238](https://github.com/danielgindi/Charts/issues/2238) +- How to set dual axis in line chart [\#2237](https://github.com/danielgindi/Charts/issues/2237) +- Tableview stuttering when rendering a pie chart [\#2234](https://github.com/danielgindi/Charts/issues/2234) +- Set vertical legend [\#2233](https://github.com/danielgindi/Charts/issues/2233) +- how to join XAxisLabel in MultipleBarChart under every Bar [\#2232](https://github.com/danielgindi/Charts/issues/2232) +- Custom xAxisRenderer [\#2230](https://github.com/danielgindi/Charts/issues/2230) +- demo can not run [\#2227](https://github.com/danielgindi/Charts/issues/2227) +- Change color of lineChartDataSet when chartValueSelected [\#2226](https://github.com/danielgindi/Charts/issues/2226) +- Legend Label problem when the device changes orientation [\#2224](https://github.com/danielgindi/Charts/issues/2224) +- Legend vertical offset for horizontally aligned legends [\#2223](https://github.com/danielgindi/Charts/issues/2223) +- Don't display or load all Variables on the Left of the Bar \(iOS - Swift 3\) [\#2221](https://github.com/danielgindi/Charts/issues/2221) +- Horizontal Bar Chart lines not visible with two BarChartDataSet in chart data [\#2220](https://github.com/danielgindi/Charts/issues/2220) +- Bar chart with limit line for each Bar [\#2219](https://github.com/danielgindi/Charts/issues/2219) +- why the zero can't show at the first [\#2218](https://github.com/danielgindi/Charts/issues/2218) +- About BalloonMarker [\#2216](https://github.com/danielgindi/Charts/issues/2216) +- How can I have these values in positive? Thanks. [\#2212](https://github.com/danielgindi/Charts/issues/2212) +- Line Graph is not showing line on the Chart [\#2209](https://github.com/danielgindi/Charts/issues/2209) +- Issue of enum description [\#2208](https://github.com/danielgindi/Charts/issues/2208) +- I find a issues in HorizontalBarChartView [\#2205](https://github.com/danielgindi/Charts/issues/2205) +- My ipa\(used Charts\) is 40M ;another ipa\(unused Charts\) is 13M,how to be sliming??? [\#2203](https://github.com/danielgindi/Charts/issues/2203) +- Legend vertical offset [\#2202](https://github.com/danielgindi/Charts/issues/2202) +- Charts not showing on tvOS [\#2201](https://github.com/danielgindi/Charts/issues/2201) +- Is it enable to keep the origin visible X Range when I appended more data [\#2198](https://github.com/danielgindi/Charts/issues/2198) +- Issue with Realm [\#2195](https://github.com/danielgindi/Charts/issues/2195) +- External lines - Pie Chart [\#2194](https://github.com/danielgindi/Charts/issues/2194) +- Hide labels - Pie chart [\#2193](https://github.com/danielgindi/Charts/issues/2193) +- is two sided bar graph possible ? [\#2192](https://github.com/danielgindi/Charts/issues/2192) +- Optimisation of drawing many points on line graph [\#2190](https://github.com/danielgindi/Charts/issues/2190) +- Bar Chart with dual axis [\#2188](https://github.com/danielgindi/Charts/issues/2188) +- Customize Text inside Ballon Marker [\#2186](https://github.com/danielgindi/Charts/issues/2186) +- "Shell Script Invocation Error: Command /bin/sh failed with exit code 1' [\#2185](https://github.com/danielgindi/Charts/issues/2185) +- Increase space between bars with only one dataset and assign font for specific value and xAxis label [\#2184](https://github.com/danielgindi/Charts/issues/2184) +- "noDataText" does not work [\#2179](https://github.com/danielgindi/Charts/issues/2179) +- Change color of one label [\#2178](https://github.com/danielgindi/Charts/issues/2178) +- Line Chart not show empty values - Charts 3.0 [\#2176](https://github.com/danielgindi/Charts/issues/2176) +- Bottom Label is not printing whole array list. [\#2175](https://github.com/danielgindi/Charts/issues/2175) +- Stacked Horizontal Chart Scaling [\#2174](https://github.com/danielgindi/Charts/issues/2174) +- How to set different colors for intervals on LineChart? [\#2172](https://github.com/danielgindi/Charts/issues/2172) +- Could you tell me how to forbidden line chart scroll up and down? [\#2171](https://github.com/danielgindi/Charts/issues/2171) +- Fixed BarWidth based on Pixel for BarChart [\#2170](https://github.com/danielgindi/Charts/issues/2170) +- Branch Chart3.0-Swift2.3 not found. [\#2166](https://github.com/danielgindi/Charts/issues/2166) +- "clipValuesToContentEnabled" does not work [\#2163](https://github.com/danielgindi/Charts/issues/2163) +- BarChartView with TableView [\#2161](https://github.com/danielgindi/Charts/issues/2161) +- How to show label on x-axis at regular interval and tail end on the graph line [\#2160](https://github.com/danielgindi/Charts/issues/2160) +- Set line cap to CGMutablePath [\#2159](https://github.com/danielgindi/Charts/issues/2159) +- why we set the y value 2.57,but the chart show 3,if i set y value2.44,the chart show 2.how to do the problem. [\#2157](https://github.com/danielgindi/Charts/issues/2157) +- Demo crush !!! [\#2154](https://github.com/danielgindi/Charts/issues/2154) +- Fixing the Segmentation fault issue after Convert to Swift 3.0 [\#2151](https://github.com/danielgindi/Charts/issues/2151) +- GitHub API request failed [\#2149](https://github.com/danielgindi/Charts/issues/2149) +- y-Values and x-Values as string in barchart, [\#2147](https://github.com/danielgindi/Charts/issues/2147) +- Piechart with smooth edges? [\#2146](https://github.com/danielgindi/Charts/issues/2146) +- Pie chart highlighted slice offset [\#2144](https://github.com/danielgindi/Charts/issues/2144) +- Formatter data on OS X [\#2141](https://github.com/danielgindi/Charts/issues/2141) +- How to add dates to line chart? [\#2136](https://github.com/danielgindi/Charts/issues/2136) +- 'backgroundColor' is inaccessible due to 'internal' protection level on mac OS X [\#2135](https://github.com/danielgindi/Charts/issues/2135) +- Some object files have incompatible Objective-C category definitions. Some category metadata may be lost. All files containing Objective-C categories should be built using the same compiler. [\#2133](https://github.com/danielgindi/Charts/issues/2133) +- Any Demo of all charts in Swift 3 [\#2132](https://github.com/danielgindi/Charts/issues/2132) +- How to access the Position of labels on x axis of Combined Line and Bar chart on swift\(3.0.1\) [\#2131](https://github.com/danielgindi/Charts/issues/2131) +- Wrong Limit line positioning when axisMinimum is set to 0 [\#2128](https://github.com/danielgindi/Charts/issues/2128) +- Extremely Slow compile Times on XCode 8.2.1 and swift 3.0.2 [\#2127](https://github.com/danielgindi/Charts/issues/2127) +- How to add TrackBall and edit label above BarCharts in Charts swift2 and swift 3?? [\#2126](https://github.com/danielgindi/Charts/issues/2126) +- Xcode 8.3 Compatible [\#2125](https://github.com/danielgindi/Charts/issues/2125) +- LineChartData\(dataSets: dataSets\) Missing xVals [\#2124](https://github.com/danielgindi/Charts/issues/2124) +- How to assign custom String values to XAxis? [\#2122](https://github.com/danielgindi/Charts/issues/2122) +- Simple Radar Chart causing hang / cpu 99% [\#2121](https://github.com/danielgindi/Charts/issues/2121) +- Can i use the framework without including the whole project ? [\#2118](https://github.com/danielgindi/Charts/issues/2118) +- Undefined symbols for architecture arm64 - Charts 3.0 CocoaPods [\#2117](https://github.com/danielgindi/Charts/issues/2117) +- method setlabelstoskip missing from XAxis.swift [\#2115](https://github.com/danielgindi/Charts/issues/2115) +- SocketIOClientConfiguration.swift wont compile [\#2113](https://github.com/danielgindi/Charts/issues/2113) +- No code signing identities found: No valid signing identities \(i.e. certificate and private key pair\) were found [\#2112](https://github.com/danielgindi/Charts/issues/2112) +- Can I custom draw circle in LineChart in version 3.0 ?\[help\] [\#2104](https://github.com/danielgindi/Charts/issues/2104) +- App crash XCode 8.2 Chart version 3.0 [\#2103](https://github.com/danielgindi/Charts/issues/2103) +- Charts 3.0.1 - Align x labels \(dates\) with plots [\#2094](https://github.com/danielgindi/Charts/issues/2094) +- Demo in Swift 3 [\#2092](https://github.com/danielgindi/Charts/issues/2092) +- How to set xAxis values from array in Swift 3.0 [\#2090](https://github.com/danielgindi/Charts/issues/2090) +- error to Methode [\#2089](https://github.com/danielgindi/Charts/issues/2089) +- fitBars doesnt seems to work [\#2088](https://github.com/danielgindi/Charts/issues/2088) +- oh, no!!!!!! Demo code can't run [\#2087](https://github.com/danielgindi/Charts/issues/2087) +- In BarChartView leftAxis labels cutdown, does-not fit on screen. [\#2086](https://github.com/danielgindi/Charts/issues/2086) +- accessing .rightAxis gives EXC\_BAD\_ACCESS [\#2082](https://github.com/danielgindi/Charts/issues/2082) +- leftAxis and value overlap in lineChartView [\#2080](https://github.com/danielgindi/Charts/issues/2080) +- I want to add 4 colours to the background of the chart. The colour zones depend on the y values. [\#2079](https://github.com/danielgindi/Charts/issues/2079) +- Value labels for multiple ChartDataSets all aligned at the beginning \(left\) of each bar in HorizontalBarChart [\#2077](https://github.com/danielgindi/Charts/issues/2077) +- How to Resize Labels in Pie Chart Legend [\#2075](https://github.com/danielgindi/Charts/issues/2075) +- Bar chart data entry [\#2074](https://github.com/danielgindi/Charts/issues/2074) +- How can I have a limit zone \(in android library mpandroidchart\) like feature in this iOS library [\#2073](https://github.com/danielgindi/Charts/issues/2073) +- BarChartView is unavailable, cannot find swift declaration [\#2072](https://github.com/danielgindi/Charts/issues/2072) +- Not enable to draw custom shape which is based on the XValue or YValue ? [\#2071](https://github.com/danielgindi/Charts/issues/2071) +- Can horizontalBarChartView invert the Axis ? [\#2070](https://github.com/danielgindi/Charts/issues/2070) +- can't set different padding of each side [\#2068](https://github.com/danielgindi/Charts/issues/2068) +- Area chart with missing points [\#2067](https://github.com/danielgindi/Charts/issues/2067) +- Demo code can't run [\#2066](https://github.com/danielgindi/Charts/issues/2066) +- Positioning the XAxis inconsistent with Y-axis and the Wiki in Swift 3 [\#2065](https://github.com/danielgindi/Charts/issues/2065) +- Radar chart title [\#2061](https://github.com/danielgindi/Charts/issues/2061) +- fixed increment [\#2059](https://github.com/danielgindi/Charts/issues/2059) +- Line Chart with callouts [\#2058](https://github.com/danielgindi/Charts/issues/2058) +- Delegate ChartValueSelected Not Called. [\#2057](https://github.com/danielgindi/Charts/issues/2057) +- IValueFormatter protocol not working [\#2055](https://github.com/danielgindi/Charts/issues/2055) +- "BalloonMarker“ cannot be find in my project [\#2051](https://github.com/danielgindi/Charts/issues/2051) +- How to use marker when I use CombinedChart? [\#2046](https://github.com/danielgindi/Charts/issues/2046) +- yVals have decimal point [\#2045](https://github.com/danielgindi/Charts/issues/2045) +- LeftAxis Labels will disappear [\#2044](https://github.com/danielgindi/Charts/issues/2044) +- Can't addEntry to a set in Swift 3 [\#2043](https://github.com/danielgindi/Charts/issues/2043) +- Will not compile in existing Objective-C Project. [\#2041](https://github.com/danielgindi/Charts/issues/2041) +- labels on xAxis not showing up and incorrect values on yAxis [\#2040](https://github.com/danielgindi/Charts/issues/2040) +- xAxis.valueFormatter = self create retain cycle [\#2039](https://github.com/danielgindi/Charts/issues/2039) +- Label's point of view [\#2038](https://github.com/danielgindi/Charts/issues/2038) +- How to show limited visible xValues labels? [\#2037](https://github.com/danielgindi/Charts/issues/2037) +- BarChart XAxis between Positive & Negative Values [\#2036](https://github.com/danielgindi/Charts/issues/2036) +- Error when trying to run ChartsDemo on iOS Simulator \(image not found\) [\#2035](https://github.com/danielgindi/Charts/issues/2035) +- big snap shot [\#2034](https://github.com/danielgindi/Charts/issues/2034) +- module file's minimum deployment target is ios9.3 [\#2031](https://github.com/danielgindi/Charts/issues/2031) +- Date formatter doesn't show up properly when using multiple bars in a chart. [\#2030](https://github.com/danielgindi/Charts/issues/2030) +- Y axis dynamic sampling ? [\#2029](https://github.com/danielgindi/Charts/issues/2029) +- Convert line chart entry to take dictionary [\#2027](https://github.com/danielgindi/Charts/issues/2027) +- How to set string value line \(27 Oct\) in xAxis [\#2025](https://github.com/danielgindi/Charts/issues/2025) +- Build \[ChartsDemo\] Error : 「ChartsRealm Reason: image not found 」alaway [\#2024](https://github.com/danielgindi/Charts/issues/2024) +- \[LineChartView\] setting xAxis.axisMinimum affects xAxis.spaceMin [\#2022](https://github.com/danielgindi/Charts/issues/2022) +- c vcgffrgfffgffgfgffffrfrfrrfdfdfdfdfdfdfggkjhghghghghjhjhjhjkjkjkkkklklklklikii0987654321poijkl;';lk;l; [\#2021](https://github.com/danielgindi/Charts/issues/2021) +- How to make the highlight line work with UIPanGestureRecognizer [\#2019](https://github.com/danielgindi/Charts/issues/2019) +- BarChart Issue for plotting the value on x-axis serially [\#2017](https://github.com/danielgindi/Charts/issues/2017) +- Please help me with the Pie Charts in Charts 3.0.1. [\#2016](https://github.com/danielgindi/Charts/issues/2016) +- ipa becomes larger after using Charts [\#2015](https://github.com/danielgindi/Charts/issues/2015) +- BarChartView highlight issues [\#2014](https://github.com/danielgindi/Charts/issues/2014) +- How to set up a line chart, the starting point of the distance from the left margin, border distance end points [\#2013](https://github.com/danielgindi/Charts/issues/2013) +- mult bars not show all [\#2012](https://github.com/danielgindi/Charts/issues/2012) +- how to change legend font size? [\#2011](https://github.com/danielgindi/Charts/issues/2011) +- image instead of text in CenterText in pie chart [\#2010](https://github.com/danielgindi/Charts/issues/2010) +- Change PieChart Center Color [\#2009](https://github.com/danielgindi/Charts/issues/2009) +- Demo issues [\#2008](https://github.com/danielgindi/Charts/issues/2008) +- How to display last label in X-Axis [\#2007](https://github.com/danielgindi/Charts/issues/2007) +- One point different values on the axis X [\#2005](https://github.com/danielgindi/Charts/issues/2005) +- Hide all text/labels/values in pieChart [\#2004](https://github.com/danielgindi/Charts/issues/2004) +- it is not an issue. it is related to OHLC chart [\#2003](https://github.com/danielgindi/Charts/issues/2003) +- Disable PieChart Label in Chart [\#2002](https://github.com/danielgindi/Charts/issues/2002) +- \[LineChartViewController stringForValue:axis:\] [\#2001](https://github.com/danielgindi/Charts/issues/2001) +- Values are cut out of the window [\#2000](https://github.com/danielgindi/Charts/issues/2000) +- XAxis in top AND bottom position [\#1999](https://github.com/danielgindi/Charts/issues/1999) +- Can't compile under Xcode 8.1 with Swift 3.0 [\#1998](https://github.com/danielgindi/Charts/issues/1998) +- Always display max 5 visible bars in BarChartView [\#1997](https://github.com/danielgindi/Charts/issues/1997) +- I want touchpoint in the bar to do something [\#1996](https://github.com/danielgindi/Charts/issues/1996) +- Is there any way to change chart data label from bottom of table to top? [\#1995](https://github.com/danielgindi/Charts/issues/1995) +- Installation not clear, for me [\#1994](https://github.com/danielgindi/Charts/issues/1994) +- Add space between bar chart [\#1993](https://github.com/danielgindi/Charts/issues/1993) +- How to fix the distance between each point on the X-coordinate? [\#1992](https://github.com/danielgindi/Charts/issues/1992) +- How to add tips to RadarChartView [\#1991](https://github.com/danielgindi/Charts/issues/1991) +- Piechart issue [\#1990](https://github.com/danielgindi/Charts/issues/1990) +- Multiple colors issue in stacked bar line charts swift3 [\#1989](https://github.com/danielgindi/Charts/issues/1989) +- ChartViewDelegate is not called. [\#1988](https://github.com/danielgindi/Charts/issues/1988) +- Always display vertical scrolling indicator on horizontal bar chart [\#1987](https://github.com/danielgindi/Charts/issues/1987) +- Can't compile DemoProject [\#1986](https://github.com/danielgindi/Charts/issues/1986) +- My pie chart legends still not showing [\#1985](https://github.com/danielgindi/Charts/issues/1985) +- no yValCount in ChartData [\#1982](https://github.com/danielgindi/Charts/issues/1982) +- no limitLineSegmentsBuffer in YAxisRenderer [\#1981](https://github.com/danielgindi/Charts/issues/1981) +- Legend label missing in pie chart [\#1980](https://github.com/danielgindi/Charts/issues/1980) +- For X axis the values are not adding [\#1979](https://github.com/danielgindi/Charts/issues/1979) +- When I have two data, charts shows the three data automatically [\#1978](https://github.com/danielgindi/Charts/issues/1978) +- Two legends for stacked bar chart [\#1977](https://github.com/danielgindi/Charts/issues/1977) +- X axis coordinate point spacing [\#1975](https://github.com/danielgindi/Charts/issues/1975) +- Carthage was not found [\#1974](https://github.com/danielgindi/Charts/issues/1974) +- How to Show XAxis Label On YAxis Bar In BarView Charts? [\#1973](https://github.com/danielgindi/Charts/issues/1973) +- Labels on Mac OS X application : place and title [\#1972](https://github.com/danielgindi/Charts/issues/1972) +- I am gettign @import AppKit is missing in Charts-Swift.h under charts.framework [\#1971](https://github.com/danielgindi/Charts/issues/1971) +- Multiline chart with common data point [\#1970](https://github.com/danielgindi/Charts/issues/1970) +- Version 3.0.1: Fill gradient fills out the wrong side of the chart [\#1968](https://github.com/danielgindi/Charts/issues/1968) +- How to pass data to the X axis?? [\#1967](https://github.com/danielgindi/Charts/issues/1967) +- How do I implement a legend click event? [\#1965](https://github.com/danielgindi/Charts/issues/1965) +- can't set the XVals [\#1964](https://github.com/danielgindi/Charts/issues/1964) +- Color for Legend label [\#1962](https://github.com/danielgindi/Charts/issues/1962) +- Two y axis plot on a side? [\#1961](https://github.com/danielgindi/Charts/issues/1961) +- Scrolling feature? [\#1960](https://github.com/danielgindi/Charts/issues/1960) +- Can you add the chart Of the triangle? [\#1958](https://github.com/danielgindi/Charts/issues/1958) +- Multiple y-data for single x-index [\#1955](https://github.com/danielgindi/Charts/issues/1955) +- LineChartView: axisMaximum and axisMinimum work wrong in rightAxis [\#1953](https://github.com/danielgindi/Charts/issues/1953) +- Radar Chart axis maximum [\#1952](https://github.com/danielgindi/Charts/issues/1952) +- Adding a single x-axis label for two data points. [\#1951](https://github.com/danielgindi/Charts/issues/1951) +- Adding title to X-axis and Y-axis [\#1950](https://github.com/danielgindi/Charts/issues/1950) +- Find screen location for bars in a bar chart [\#1949](https://github.com/danielgindi/Charts/issues/1949) +- \(3.0 Regression\) Scatter chart cuts off data at the edges [\#1946](https://github.com/danielgindi/Charts/issues/1946) +- How automatic showing marker? [\#1944](https://github.com/danielgindi/Charts/issues/1944) +- Right and left margins [\#1942](https://github.com/danielgindi/Charts/issues/1942) +- Displaying an overlay with extra / more detailed information on mouse hover [\#1940](https://github.com/danielgindi/Charts/issues/1940) +- Can we have flexible y Axis scale [\#1939](https://github.com/danielgindi/Charts/issues/1939) +- Charts3.0 - Can not show all the xAxis label if more than 8 value - Swift [\#1938](https://github.com/danielgindi/Charts/issues/1938) +- Barchart xAxis interval [\#1937](https://github.com/danielgindi/Charts/issues/1937) +- Avoiding chart legend [\#1936](https://github.com/danielgindi/Charts/issues/1936) +- Module compiled with Swift 2.3 cannot be imported in Swift 3.0.1 [\#1935](https://github.com/danielgindi/Charts/issues/1935) +- Charts-2.3.0/Source/ChartsRealm/Data/RealmPieData.swift:19:8: No such module 'Realm' [\#1934](https://github.com/danielgindi/Charts/issues/1934) +- iOS Demo Fails to build [\#1933](https://github.com/danielgindi/Charts/issues/1933) +- Pie chart Outside values, Inside Value and legend value [\#1932](https://github.com/danielgindi/Charts/issues/1932) +- Mermory Leak in "specialized ChartXAxisRenderer.drawLabels\(context : CGContext, pos : CGFloat, anchor : CGPoint\) -\> \(\)" [\#1928](https://github.com/danielgindi/Charts/issues/1928) +- stringForValue method return unexpected value when reload TableView data. [\#1927](https://github.com/danielgindi/Charts/issues/1927) +- Can't render CombinedChartView [\#1926](https://github.com/danielgindi/Charts/issues/1926) +- Migration to Chart 3.0, Problem with Stack BarChartView [\#1925](https://github.com/danielgindi/Charts/issues/1925) +- PieChartData issue in Swift 3 [\#1924](https://github.com/danielgindi/Charts/issues/1924) +- Values overlap for bar chart and labels of X-Axis [\#1923](https://github.com/danielgindi/Charts/issues/1923) +- Please Please Help, I can’t get Charts installed properly [\#1922](https://github.com/danielgindi/Charts/issues/1922) +- Chart bar finance \(OHLC Chart\) [\#1921](https://github.com/danielgindi/Charts/issues/1921) +- Double value cannot be converted to Int in AxisRendererBase.swift on line 125 [\#1920](https://github.com/danielgindi/Charts/issues/1920) +- Highlighted values on piechart too high? [\#1919](https://github.com/danielgindi/Charts/issues/1919) +- How to achieve this effect? [\#1918](https://github.com/danielgindi/Charts/issues/1918) +- SOLVED: Round number less than zero x values issue [\#1916](https://github.com/danielgindi/Charts/issues/1916) +- Charts does not install correctly [\#1915](https://github.com/danielgindi/Charts/issues/1915) +- Xcode 8.1 is reporting 'No such Module 'Charts' & Build/Compilation Errors [\#1914](https://github.com/danielgindi/Charts/issues/1914) +- Hide legend [\#1913](https://github.com/danielgindi/Charts/issues/1913) +- xAxis force show last label [\#1912](https://github.com/danielgindi/Charts/issues/1912) +- How to install in Xcode 7.3.1 [\#1911](https://github.com/danielgindi/Charts/issues/1911) +- Can we resurrect Chart2.2.5-Swift3.0? [\#1910](https://github.com/danielgindi/Charts/issues/1910) +- Chart Swift files not running on Obj-C XCODE8.0 install [\#1908](https://github.com/danielgindi/Charts/issues/1908) +- How to draw two circles and compare? [\#1906](https://github.com/danielgindi/Charts/issues/1906) +- custom xAxis for line chart I need an example [\#1905](https://github.com/danielgindi/Charts/issues/1905) +- QUESTION - How mask the ranges values in a Graph [\#1904](https://github.com/danielgindi/Charts/issues/1904) +- How to give xAxis customized labels for linechartview [\#1903](https://github.com/danielgindi/Charts/issues/1903) +- How to set the axis options of radar chart? [\#1902](https://github.com/danielgindi/Charts/issues/1902) +- no match color bar chart with label [\#1900](https://github.com/danielgindi/Charts/issues/1900) +- LineChartView highlightEnabled no work [\#1899](https://github.com/danielgindi/Charts/issues/1899) +- Can i change the value Above bar from double to int? [\#1898](https://github.com/danielgindi/Charts/issues/1898) +- Scrolling x-axis labels [\#1897](https://github.com/danielgindi/Charts/issues/1897) +- noDataText doesn't work on CombinedChart \(works fine on PieChart and BarChart\) [\#1896](https://github.com/danielgindi/Charts/issues/1896) +- StringForValue in class IValueFormatter receives dataSetIndex as 0 [\#1895](https://github.com/danielgindi/Charts/issues/1895) +- Cannot build in big project using cocoapods [\#1894](https://github.com/danielgindi/Charts/issues/1894) +- Carthage build error with xcode 8.1 and Charts 2.3.0 [\#1893](https://github.com/danielgindi/Charts/issues/1893) +- Unable to select BarChartView from storyboard \(iOS\) [\#1892](https://github.com/danielgindi/Charts/issues/1892) +- XAxis entry count is greater than it should be. [\#1890](https://github.com/danielgindi/Charts/issues/1890) +- pod update failed - ARC Semantic Issue [\#1888](https://github.com/danielgindi/Charts/issues/1888) +- How to show marker on y-Axis data? [\#1887](https://github.com/danielgindi/Charts/issues/1887) +- Can't building and run the ChartsDemo [\#1886](https://github.com/danielgindi/Charts/issues/1886) +- how to resolve label overlapping problem with stack bar chart [\#1885](https://github.com/danielgindi/Charts/issues/1885) +- PieChart values [\#1884](https://github.com/danielgindi/Charts/issues/1884) +- Custom marker gets displayed wrong on the latest value [\#1883](https://github.com/danielgindi/Charts/issues/1883) +- Tap gesture inside the candle bar [\#1882](https://github.com/danielgindi/Charts/issues/1882) +- rotating chartview [\#1881](https://github.com/danielgindi/Charts/issues/1881) +- \[Question\] Scatter Chart && Bubble Chart: How to show out whole radius instead of hiding half radius of first data entry? [\#1879](https://github.com/danielgindi/Charts/issues/1879) +- Horizontal bar chart dose not show all xAxis labels. [\#1878](https://github.com/danielgindi/Charts/issues/1878) +- X axis values [\#1877](https://github.com/danielgindi/Charts/issues/1877) +- Pie Chart no xAxis [\#1875](https://github.com/danielgindi/Charts/issues/1875) +- want the demo application in swift 3.0 for Charts [\#1872](https://github.com/danielgindi/Charts/issues/1872) +- Pie Bar Chart issues [\#1870](https://github.com/danielgindi/Charts/issues/1870) +- PieChartView a strange arrow [\#1869](https://github.com/danielgindi/Charts/issues/1869) +- custom gradient color of BarChatView [\#1868](https://github.com/danielgindi/Charts/issues/1868) +- Set space between labels in xAxis [\#1865](https://github.com/danielgindi/Charts/issues/1865) +- label over sample point [\#1864](https://github.com/danielgindi/Charts/issues/1864) +- Realtime Scatterplot crashes when each ChartDataEntry is added dynamically on ScatterView.data [\#1863](https://github.com/danielgindi/Charts/issues/1863) +- Assign Bar Colours Selectively [\#1862](https://github.com/danielgindi/Charts/issues/1862) +- Detect when finger leaves the chart area [\#1861](https://github.com/danielgindi/Charts/issues/1861) +- Pie chart touch event conflict [\#1860](https://github.com/danielgindi/Charts/issues/1860) +- Customize X-axis and grid lines [\#1859](https://github.com/danielgindi/Charts/issues/1859) +- Issue with candle stick when used in combined chart [\#1858](https://github.com/danielgindi/Charts/issues/1858) +- CandleStick Background Color [\#1857](https://github.com/danielgindi/Charts/issues/1857) +- Line Support Gradient Color? [\#1856](https://github.com/danielgindi/Charts/issues/1856) +- Piechart has no xAxis? [\#1855](https://github.com/danielgindi/Charts/issues/1855) +- Retain cycle setting delegate to valueFormatter [\#1854](https://github.com/danielgindi/Charts/issues/1854) +- how to show Xaxis label value as my array value [\#1852](https://github.com/danielgindi/Charts/issues/1852) +- Skip Drawing Circles for LineCharts [\#1795](https://github.com/danielgindi/Charts/issues/1795) +- Realm update [\#1789](https://github.com/danielgindi/Charts/issues/1789) +- "Module compiled with Swift 3.0 cannot be imported in Swift 3.0.1" [\#1788](https://github.com/danielgindi/Charts/issues/1788) +- Move Realm integration to another repository [\#1756](https://github.com/danielgindi/Charts/issues/1756) +- limit line real time update [\#1755](https://github.com/danielgindi/Charts/issues/1755) +- Travis does not use github token for pull request build [\#1734](https://github.com/danielgindi/Charts/issues/1734) +- custom string value at top of bar. [\#1109](https://github.com/danielgindi/Charts/issues/1109) + **Merged pull requests:** - Minor typo fix in console alert message "it's" -\> "its" [\#2301](https://github.com/danielgindi/Charts/pull/2301) ([simonbromberg](https://github.com/simonbromberg)) @@ -292,6 +2134,70 @@ [Full Changelog](https://github.com/danielgindi/Charts/compare/2.3.1...3.0.1) +**Closed issues:** + +- Legend under the bar in bar Chart [\#1850](https://github.com/danielgindi/Charts/issues/1850) +- MultipleBarChart barSpace does not work [\#1849](https://github.com/danielgindi/Charts/issues/1849) +- Can not show decimal in y value on BarChart [\#1848](https://github.com/danielgindi/Charts/issues/1848) +- Cannot add labels to a simple Bar Chart [\#1846](https://github.com/danielgindi/Charts/issues/1846) +- when running my project on iphone device but not simulator it has error"image not found" [\#1845](https://github.com/danielgindi/Charts/issues/1845) +- Removing red selector cross on Line Chart nodes [\#1844](https://github.com/danielgindi/Charts/issues/1844) +- Get screen\(x,y\) value from the plotted points [\#1843](https://github.com/danielgindi/Charts/issues/1843) +- Color between two limit lines [\#1842](https://github.com/danielgindi/Charts/issues/1842) +- Charts-umbrella.h [\#1841](https://github.com/danielgindi/Charts/issues/1841) +- Unable to call 'data' from lineChartView. [\#1839](https://github.com/danielgindi/Charts/issues/1839) +- How to use charts library in my objective c program?.. [\#1837](https://github.com/danielgindi/Charts/issues/1837) +- Migration to Swift 3.x [\#1836](https://github.com/danielgindi/Charts/issues/1836) +- How to hide BarChart hide bottom description color & text ? [\#1835](https://github.com/danielgindi/Charts/issues/1835) +- please help Line Graph not working on Charts 2.3.0 \(for Xcode8 and Swift 2.3.0\) [\#1834](https://github.com/danielgindi/Charts/issues/1834) +- Error when adding embedded binaries [\#1832](https://github.com/danielgindi/Charts/issues/1832) +- X-Axis for different different charts [\#1831](https://github.com/danielgindi/Charts/issues/1831) +- Setting values label [\#1829](https://github.com/danielgindi/Charts/issues/1829) +- Adding background color between two limit lines [\#1828](https://github.com/danielgindi/Charts/issues/1828) +- Horizontal bar chart doesn't start at 0 [\#1827](https://github.com/danielgindi/Charts/issues/1827) +- Gradient Background for LineChart. \(Not Working\) [\#1826](https://github.com/danielgindi/Charts/issues/1826) +- y axis label show wiered value 1.11022302462516e- when passed 0 as value [\#1825](https://github.com/danielgindi/Charts/issues/1825) +- Pie chart specific colors [\#1824](https://github.com/danielgindi/Charts/issues/1824) +- Help ? [\#1823](https://github.com/danielgindi/Charts/issues/1823) +- Its possible change the thickness of the pie chart? [\#1822](https://github.com/danielgindi/Charts/issues/1822) +- BarChart moveToX wrong [\#1820](https://github.com/danielgindi/Charts/issues/1820) +- How to set multiple Stackbar with Charts 3 [\#1819](https://github.com/danielgindi/Charts/issues/1819) +- How do i set [\#1818](https://github.com/danielgindi/Charts/issues/1818) +- LimitLine Label Value Overlap with BarChartData Label [\#1817](https://github.com/danielgindi/Charts/issues/1817) +- What is the replacement for xVals for BarChartData? in swift 3.0 [\#1816](https://github.com/danielgindi/Charts/issues/1816) +- Updated Demo Example for swift3 [\#1815](https://github.com/danielgindi/Charts/issues/1815) +- Line Chart: how to change background color through every odd label on YAxis? [\#1812](https://github.com/danielgindi/Charts/issues/1812) +- Can Radar Chart draw backgroud like this? [\#1811](https://github.com/danielgindi/Charts/issues/1811) +- Can i customize the X axis text a different color? [\#1810](https://github.com/danielgindi/Charts/issues/1810) +- Can we make a 3D Barchart with this Library?? [\#1809](https://github.com/danielgindi/Charts/issues/1809) +- 3.0.0 - adding X Values to LineChartData no longer supported? [\#1808](https://github.com/danielgindi/Charts/issues/1808) +- Swift 3 BarChart with image and title. [\#1807](https://github.com/danielgindi/Charts/issues/1807) +- How to make horizontal dotted lines or remove it? [\#1806](https://github.com/danielgindi/Charts/issues/1806) +- Full control over x labels in 3.0.0 [\#1804](https://github.com/danielgindi/Charts/issues/1804) +- How to change stackbar according to order? [\#1803](https://github.com/danielgindi/Charts/issues/1803) +- How to change stackbar according to order [\#1802](https://github.com/danielgindi/Charts/issues/1802) +- How to set multiple StackBar ? [\#1801](https://github.com/danielgindi/Charts/issues/1801) +- \[Swift 3\] LineChartData without xVals on constructor [\#1800](https://github.com/danielgindi/Charts/issues/1800) +- Zooming X and Y axis independently? [\#1799](https://github.com/danielgindi/Charts/issues/1799) +- Auto scroll xAxis [\#1798](https://github.com/danielgindi/Charts/issues/1798) +- How to add “%” to data in ios-chart [\#1797](https://github.com/danielgindi/Charts/issues/1797) +- can we set y axis max value to chart on horizontal bar graphs?? [\#1794](https://github.com/danielgindi/Charts/issues/1794) +- Fix the xAxis to use the values from my dataset [\#1791](https://github.com/danielgindi/Charts/issues/1791) +- PieChart values outside of chart? [\#1790](https://github.com/danielgindi/Charts/issues/1790) +- ChartLimitLine: How to customize label background and Position center of line [\#1787](https://github.com/danielgindi/Charts/issues/1787) +- With Xcode 8.1 can't build [\#1786](https://github.com/danielgindi/Charts/issues/1786) +- CandleStickChartView can not inherit [\#1784](https://github.com/danielgindi/Charts/issues/1784) +- Chart adds a -1 x-axis entry [\#1782](https://github.com/danielgindi/Charts/issues/1782) +- BarChart - Is It possible to limit the number of bars visible at a given time, and allow users to scroll through the rest horizontally ? [\#1781](https://github.com/danielgindi/Charts/issues/1781) +- Unable to Override some properties of LineChartView in Charts version 2.2.5 [\#1777](https://github.com/danielgindi/Charts/issues/1777) +- CandleStickChartView how to fixed-width, or based on the data dynamically calculate the zoom factor [\#1776](https://github.com/danielgindi/Charts/issues/1776) +- Scroll UIImageView on X-axes along with x-vals [\#1775](https://github.com/danielgindi/Charts/issues/1775) +- How to make BarChart Bar Sizes proportional? [\#1774](https://github.com/danielgindi/Charts/issues/1774) +- how can I set the spacing between bars ? [\#1773](https://github.com/danielgindi/Charts/issues/1773) +- Charts 3.0 labelCount bug? [\#1767](https://github.com/danielgindi/Charts/issues/1767) +- use lineCharts ,if i want show custom string at x, don't show int number, how to do it? [\#1760](https://github.com/danielgindi/Charts/issues/1760) +- ChartUtils Crash on 32 Bit Devices [\#1737](https://github.com/danielgindi/Charts/issues/1737) + **Merged pull requests:** - Updated Width Constraints - Fixes \#1770 [\#1771](https://github.com/danielgindi/Charts/pull/1771) ([SumoSimo](https://github.com/SumoSimo)) @@ -306,6 +2212,103 @@ [Full Changelog](https://github.com/danielgindi/Charts/compare/v3.0.0...v2.3.1) +**Fixed bugs:** + +- \[BUG\] multiple bar chart in ChartsDemo not display full for last x value [\#1770](https://github.com/danielgindi/Charts/issues/1770) +- PieChartDataSet no slice space shown when an entry has 0 value [\#1730](https://github.com/danielgindi/Charts/issues/1730) +- Bar on BarChart and CombinedChart doesn't start one Zero line [\#1729](https://github.com/danielgindi/Charts/issues/1729) +- Weird highlight rect in Stacked Bar Chart Negative [\#1726](https://github.com/danielgindi/Charts/issues/1726) +- CombinedChartView with CandleData - first/last candlesticks are cut in half [\#1717](https://github.com/danielgindi/Charts/issues/1717) +- Bug with showing negative values and vertical zooming Horizontal Bar Chart [\#1702](https://github.com/danielgindi/Charts/issues/1702) +- Setting circleHoleColor to clear causes artifact [\#1691](https://github.com/danielgindi/Charts/issues/1691) +- Charts 3.0 Carthage update issue [\#1690](https://github.com/danielgindi/Charts/issues/1690) + +**Closed issues:** + +- Problem with Formatter [\#1779](https://github.com/danielgindi/Charts/issues/1779) +- Could not cast value of type 'Charts.BarChartData' \(0x109bd1010\) to 'Charts.PieChartData' \(0x109be0320\). [\#1778](https://github.com/danielgindi/Charts/issues/1778) +- BarChartView - The first column and last column show only half? [\#1772](https://github.com/danielgindi/Charts/issues/1772) +- Stacked Bar Chart Opacity of Some Colors [\#1769](https://github.com/danielgindi/Charts/issues/1769) +- Custom Format YAxis [\#1768](https://github.com/danielgindi/Charts/issues/1768) +- to run ChartsDemo [\#1765](https://github.com/danielgindi/Charts/issues/1765) +- There is something wrong with LineChartView,ChartDataEntry,LineChartData and ChartDataEntry [\#1764](https://github.com/danielgindi/Charts/issues/1764) +- Strange margin/space in a grouped BarChart [\#1763](https://github.com/danielgindi/Charts/issues/1763) +- How to get the chart data entry points [\#1762](https://github.com/danielgindi/Charts/issues/1762) +- the newest version ,it can't build successes in xcode8,it pause at half,no stop or fail. [\#1761](https://github.com/danielgindi/Charts/issues/1761) +- Sorry, I no speak English, 3.0版本的LineChartView [\#1759](https://github.com/danielgindi/Charts/issues/1759) +- How to set x-axis labels with ios charts [\#1758](https://github.com/danielgindi/Charts/issues/1758) +- After 3.0 Upgrade, Marker not automatically showing [\#1757](https://github.com/danielgindi/Charts/issues/1757) +- How to set horizontal Value with a string array at my code using Charts 3.0 [\#1754](https://github.com/danielgindi/Charts/issues/1754) +- Issue with centering xAxis labels [\#1750](https://github.com/danielgindi/Charts/issues/1750) +- Charts / Swift 3.0 - Fatal error: Index out of range [\#1749](https://github.com/danielgindi/Charts/issues/1749) +- ChartsDemo dependency on realm-cocoa ~\> 1.1 issue [\#1748](https://github.com/danielgindi/Charts/issues/1748) +- Carthage realm-cocoa ~\> 1.1 dependency conflict [\#1747](https://github.com/danielgindi/Charts/issues/1747) +- how to set a Array of String for X-axis in swift 3? [\#1746](https://github.com/danielgindi/Charts/issues/1746) +- Xcode 8.1 is reporting 'No such Module 'Charts'' [\#1743](https://github.com/danielgindi/Charts/issues/1743) +- Swift: Custom Xaxis and Yaxis problem. [\#1740](https://github.com/danielgindi/Charts/issues/1740) +- xAxis value starting at "-1" instead of "0" in grouped barchart [\#1739](https://github.com/danielgindi/Charts/issues/1739) +- Compiling issue - xcode 8 [\#1736](https://github.com/danielgindi/Charts/issues/1736) +- How to make Radar five top angle tap enabled? [\#1735](https://github.com/danielgindi/Charts/issues/1735) +- Strings for Labels in Swift 3 [\#1732](https://github.com/danielgindi/Charts/issues/1732) +- HorizontalBarChart values not showing Charts 3.0 [\#1731](https://github.com/danielgindi/Charts/issues/1731) +- getMarkerPositionWithHighlight: always return CGPointZero [\#1728](https://github.com/danielgindi/Charts/issues/1728) +- Why drawValues is outside of clipping contentRect [\#1727](https://github.com/danielgindi/Charts/issues/1727) +- Set max highlight distance [\#1725](https://github.com/danielgindi/Charts/issues/1725) +- Trouble making custom labels along the X and Y Axis of my bar chart [\#1724](https://github.com/danielgindi/Charts/issues/1724) +- Swift 3 - BarChartData, resetLabelsToSkip\(\) and setLabelsToSkip\(0\) not working [\#1723](https://github.com/danielgindi/Charts/issues/1723) +- When zooming in, x-axis shows more labels than values [\#1722](https://github.com/danielgindi/Charts/issues/1722) +- How to set the xValues to the BarchartData ? [\#1721](https://github.com/danielgindi/Charts/issues/1721) +- How to show custom text on Y-axis of Line Chart? [\#1720](https://github.com/danielgindi/Charts/issues/1720) +- Add UIButtons to data points in a line graph, plotting date and time in X-axis [\#1719](https://github.com/danielgindi/Charts/issues/1719) +- How to set the xValues to the BarchartData ? [\#1718](https://github.com/danielgindi/Charts/issues/1718) +- \: Error: this application, or a library it uses, has passed an invalid numeric value \(NaN, or not-a-number\) to CoreGraphics API and this value is being ignored.Please fix this problem. [\#1714](https://github.com/danielgindi/Charts/issues/1714) +- cancel group display in BarChart [\#1713](https://github.com/danielgindi/Charts/issues/1713) +- PieChart, label is a little of values ,labels is overlap [\#1710](https://github.com/danielgindi/Charts/issues/1710) +- how to port calls to getEntriesAtIndex [\#1709](https://github.com/danielgindi/Charts/issues/1709) +- Exception upon calling \[ChartDataEntry initWithX:y:\] via ObjC + Charts using Pods as Framework [\#1708](https://github.com/danielgindi/Charts/issues/1708) +- Multiple bar Chart Xvalues Doesn't come centre to the grouped bars... [\#1707](https://github.com/danielgindi/Charts/issues/1707) +- \[BarChartDataEntry\] axis to accept NSString [\#1706](https://github.com/danielgindi/Charts/issues/1706) +- Conflict: Charts's Range conflict with Apple NSRange\(Swift 3: Range\). It makes me can not use the Apple's Range [\#1705](https://github.com/danielgindi/Charts/issues/1705) +- Excuse me, BarChartData the " initWithXVals:\(NSArray \*data\) dataSets:\(NSArray \*data\)" in Swift 3.0 V "XVals" is what method is the?I can't find the way,Help me。 [\#1704](https://github.com/danielgindi/Charts/issues/1704) +- Excuse me,BarChartData the initWithXVals:\(NSArray \*data\) dataSets:\(NSArray \*data\) in Swift 3.0 V What method is the?I can't find the way,Help me。 [\#1703](https://github.com/danielgindi/Charts/issues/1703) +- X-Axis and Y-Axis is not shown in swift 3 [\#1701](https://github.com/danielgindi/Charts/issues/1701) +- Can i use 2.2.5 version with Swift3 [\#1700](https://github.com/danielgindi/Charts/issues/1700) +- I update the pod to 3.0.0 but Xcode still wants to convert to Swift 3 [\#1699](https://github.com/danielgindi/Charts/issues/1699) +- \[Question\] Multiple lines with different units [\#1698](https://github.com/danielgindi/Charts/issues/1698) +- \[Question\] Missing intermediate values [\#1697](https://github.com/danielgindi/Charts/issues/1697) +- What happened to X-Axis labels in 3.0? [\#1696](https://github.com/danielgindi/Charts/issues/1696) +- What is the new delegate for selection of values in the chart swift 3.0 [\#1695](https://github.com/danielgindi/Charts/issues/1695) +- Can I have two different Yaxis scale on combined chart [\#1694](https://github.com/danielgindi/Charts/issues/1694) +- Zooming LineChart xAxis on 32bit device doesn't work correctly. [\#1693](https://github.com/danielgindi/Charts/issues/1693) +- How to show xAxis All value and Rotate Label? v3.0 [\#1692](https://github.com/danielgindi/Charts/issues/1692) +- \[LineChartView\] Wrong position Highlight and xAxis [\#1689](https://github.com/danielgindi/Charts/issues/1689) +- How to get back x-values for BarChart\[Charts 3 migration problem\] [\#1688](https://github.com/danielgindi/Charts/issues/1688) +- How to move data labels outside the chart. [\#1687](https://github.com/danielgindi/Charts/issues/1687) +- RadarChartView implementation [\#1686](https://github.com/danielgindi/Charts/issues/1686) +- problem with custom xaxis labels [\#1685](https://github.com/danielgindi/Charts/issues/1685) +- Update spec on cocoapods to 3.0 [\#1683](https://github.com/danielgindi/Charts/issues/1683) +- Pod install: SSL: certificate verification failed [\#1682](https://github.com/danielgindi/Charts/issues/1682) +- Setting a pieChartDataSet on 3.0 [\#1681](https://github.com/danielgindi/Charts/issues/1681) +- String value at x Axis of BarChart [\#1680](https://github.com/danielgindi/Charts/issues/1680) +- Zooming LineChart x axis on 32bit processor doesn't work as expected [\#1679](https://github.com/danielgindi/Charts/issues/1679) +- ChartLimitLine background color [\#1678](https://github.com/danielgindi/Charts/issues/1678) +- Left and right slide bar chart only half and remove background grid [\#1654](https://github.com/danielgindi/Charts/issues/1654) +- Setting centerAxisLabelsEnabled with a granularity set does not centre [\#1652](https://github.com/danielgindi/Charts/issues/1652) +- Realm and Charts 3.0 tutorial [\#1651](https://github.com/danielgindi/Charts/issues/1651) +- HorizontalBarChartView text for xValues -- charts 3.0 [\#1646](https://github.com/danielgindi/Charts/issues/1646) +- 'spaceBetweenLabels' not found on object XAxis [\#1643](https://github.com/danielgindi/Charts/issues/1643) +- this func -nsuiTouchesEnded does not work [\#1642](https://github.com/danielgindi/Charts/issues/1642) +- Adjust circle for selected point [\#1597](https://github.com/danielgindi/Charts/issues/1597) +- CombinedChartView fitBars property [\#1569](https://github.com/danielgindi/Charts/issues/1569) +- How to show x-axis labels only when value is a DataEntry in Line Chart? [\#1536](https://github.com/danielgindi/Charts/issues/1536) +- Why the coordinate points and the X axis the above data is not aligned? [\#1492](https://github.com/danielgindi/Charts/issues/1492) +- \*\*\*\*\*\*\*\*\*\*\*\*\* Migrating to Charts 3.0 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* [\#1474](https://github.com/danielgindi/Charts/issues/1474) +- How to show ChartMarker in CombinedChart? [\#1454](https://github.com/danielgindi/Charts/issues/1454) +- How to set the data margin Align right? [\#1372](https://github.com/danielgindi/Charts/issues/1372) +- Correct date on x axis [\#1325](https://github.com/danielgindi/Charts/issues/1325) +- The chart above and the chart below how to align [\#1276](https://github.com/danielgindi/Charts/issues/1276) +- Unable to select BarChartView from storyboard \(OS X\) [\#1197](https://github.com/danielgindi/Charts/issues/1197) + **Merged pull requests:** - Fix png image using JPEG type when being saved on macOS [\#1783](https://github.com/danielgindi/Charts/pull/1783) ([petester42](https://github.com/petester42)) @@ -318,6 +2321,186 @@ [Full Changelog](https://github.com/danielgindi/Charts/compare/2.3.0...3.0.0) +**Implemented enhancements:** + +- Chart description is drawn on top of markers [\#1344](https://github.com/danielgindi/Charts/issues/1344) + +**Fixed bugs:** + +- CandleStickChart - last CandleStick cut in half [\#1668](https://github.com/danielgindi/Charts/issues/1668) +- X labels Issues [\#1639](https://github.com/danielgindi/Charts/issues/1639) +- Marker display is abnormal [\#1575](https://github.com/danielgindi/Charts/issues/1575) +- Misplaced Radar Marker [\#1556](https://github.com/danielgindi/Charts/issues/1556) +- fatal error: Double value cannot be converted to Int because it is either infinite or NaN [\#1550](https://github.com/danielgindi/Charts/issues/1550) +- Problem with the xValue begins at 0 [\#1547](https://github.com/danielgindi/Charts/issues/1547) +- \(v3.0 + Swift3.0\)LineChart crash when dataSets is a empty array [\#1491](https://github.com/danielgindi/Charts/issues/1491) +- \(v3.0 + swift3.0\) charts' top are cropped/overlapped in ChartsDemo [\#1489](https://github.com/danielgindi/Charts/issues/1489) +- \(v3.0 + Swift3.0\) Time Line Chart Demo crash [\#1488](https://github.com/danielgindi/Charts/issues/1488) +- Last Value doesn't appear in barCharts and lineCharts [\#1384](https://github.com/danielgindi/Charts/issues/1384) +- Distance between chart legend and the chart is to big in case of rotated labels [\#1360](https://github.com/danielgindi/Charts/issues/1360) +- xAxis labels not align with values in Multiple Bar Chart [\#1334](https://github.com/danielgindi/Charts/issues/1334) +- text value on the last entry is missing from line chart [\#1323](https://github.com/danielgindi/Charts/issues/1323) + +**Closed issues:** + +- Finding the RadarChartView center position in a view [\#1677](https://github.com/danielgindi/Charts/issues/1677) +- How do I Use IValueFormatter to format XAxis labels in swift? [\#1676](https://github.com/danielgindi/Charts/issues/1676) +- How to set lineChart type to cubic lines [\#1674](https://github.com/danielgindi/Charts/issues/1674) +- In IOS 10 Xcode 8,I got some issues [\#1673](https://github.com/danielgindi/Charts/issues/1673) +- the first and last point have a line [\#1672](https://github.com/danielgindi/Charts/issues/1672) +- Last value on line graph has no text [\#1671](https://github.com/danielgindi/Charts/issues/1671) +- can I fix number of overlapping this problem? [\#1670](https://github.com/danielgindi/Charts/issues/1670) +- chartValueSelected delegate not called [\#1669](https://github.com/danielgindi/Charts/issues/1669) +- Charts.frameworkiOS did not show up [\#1667](https://github.com/danielgindi/Charts/issues/1667) +- Half a bar the first one of chart [\#1666](https://github.com/danielgindi/Charts/issues/1666) +- Charts : iOS 10, Xcode 8 - Embedded Framework iTunes Store operation failed while uploading on App Store [\#1665](https://github.com/danielgindi/Charts/issues/1665) +- We need an old version for Xcode 7.0 [\#1664](https://github.com/danielgindi/Charts/issues/1664) +- LineChartView is rotating LineChartData in 3.0 [\#1663](https://github.com/danielgindi/Charts/issues/1663) +- Showing all xAxis labels in a BarChart no matter the number of bars [\#1661](https://github.com/danielgindi/Charts/issues/1661) +- Can I set different color Label in lineChart?ForExample [\#1660](https://github.com/danielgindi/Charts/issues/1660) +- Combined Charts - Negative values for Line Chart are not rendered [\#1659](https://github.com/danielgindi/Charts/issues/1659) +- Swift 2.2 : How to show custom labels on x-axis ? [\#1658](https://github.com/danielgindi/Charts/issues/1658) +- Legends for multiple dataSets and multiple bar charts allignment [\#1657](https://github.com/danielgindi/Charts/issues/1657) +- Multi chart setup xAxis value format [\#1656](https://github.com/danielgindi/Charts/issues/1656) +- xAxis when zooming [\#1655](https://github.com/danielgindi/Charts/issues/1655) +- Request to solve a sort of bug [\#1653](https://github.com/danielgindi/Charts/issues/1653) +- Updating the last Candlestick entry. [\#1649](https://github.com/danielgindi/Charts/issues/1649) +- Use of '@import' when modules are disabled [\#1647](https://github.com/danielgindi/Charts/issues/1647) +- Didn't show last Y Axis [\#1645](https://github.com/danielgindi/Charts/issues/1645) +- noDataText is not working [\#1644](https://github.com/danielgindi/Charts/issues/1644) +- Custom background color [\#1641](https://github.com/danielgindi/Charts/issues/1641) +- Cannot get my Linechart to work since Xcode 8 update [\#1640](https://github.com/danielgindi/Charts/issues/1640) +- Horizontal Highlight at touch/click point... ?? [\#1636](https://github.com/danielgindi/Charts/issues/1636) +- Some acute questions about ZDLineChartView [\#1635](https://github.com/danielgindi/Charts/issues/1635) +- \[Travis\] Travis won't build issue [\#1633](https://github.com/danielgindi/Charts/issues/1633) +- PieChartView cannot show values name . [\#1632](https://github.com/danielgindi/Charts/issues/1632) +- How to make points interactive/draggable [\#1631](https://github.com/danielgindi/Charts/issues/1631) +- Charts 3.0 with Swift 3.0 [\#1630](https://github.com/danielgindi/Charts/issues/1630) +- LineChartData is nolonger allow initWithXVals, what should I do? [\#1629](https://github.com/danielgindi/Charts/issues/1629) +- BarChartData do not find this method initWithXVals: dataSets: [\#1628](https://github.com/danielgindi/Charts/issues/1628) +- Charts 3.0: How to set x-values for a line chart? [\#1627](https://github.com/danielgindi/Charts/issues/1627) +- How can I display the x Axis values on a LineChartView? [\#1625](https://github.com/danielgindi/Charts/issues/1625) +- Xcode - 8.0, Working Fine in Xcode 7.3 -up to iOS\(9.3\) Crash in Xcode 8 - iOS 10 [\#1624](https://github.com/danielgindi/Charts/issues/1624) +- I can't see the final number on the chart. [\#1623](https://github.com/danielgindi/Charts/issues/1623) +- can I Achieve this? Using this framework [\#1622](https://github.com/danielgindi/Charts/issues/1622) +- When Will Charts 3.0 Be Version Tagged? [\#1620](https://github.com/danielgindi/Charts/issues/1620) +- RadarChartData xVals cant use [\#1619](https://github.com/danielgindi/Charts/issues/1619) +- Extract ChartsRealm and Realm from the Charts project [\#1618](https://github.com/danielgindi/Charts/issues/1618) +- Crashing xcode 7.3.1 [\#1617](https://github.com/danielgindi/Charts/issues/1617) +- Method does not override any method from its superclass [\#1616](https://github.com/danielgindi/Charts/issues/1616) +- warning: Swift Charts 2.3.0 - error in module ChartsDebug info from this module will be unavailable in the debugger. [\#1615](https://github.com/danielgindi/Charts/issues/1615) +- ChartViewDelegate's chartValueSelected is tied up with Highlights [\#1614](https://github.com/danielgindi/Charts/issues/1614) +- 'ChartViewDelegate' is unavailable: cannot find Swift declaration for this class. [\#1613](https://github.com/danielgindi/Charts/issues/1613) +- \[NOT AN ISSUE\] Release for Charts 3.0 [\#1612](https://github.com/danielgindi/Charts/issues/1612) +- Charts/Classes/Utils/ChartUtils.swift error [\#1611](https://github.com/danielgindi/Charts/issues/1611) +- Issue with YAxis max and min in the RadarChart [\#1610](https://github.com/danielgindi/Charts/issues/1610) +- App Crash: could not cast to 'Charts.PieChartData': in 2.3.0 when upgrading to XCode 8.0 [\#1609](https://github.com/danielgindi/Charts/issues/1609) +- customAxisMin and customAxisMax not found on object ChartYAxis [\#1608](https://github.com/danielgindi/Charts/issues/1608) +- Using version 3.0 with Carthage? [\#1607](https://github.com/danielgindi/Charts/issues/1607) +- Chart 3.0 swift 3.0 [\#1606](https://github.com/danielgindi/Charts/issues/1606) +- Chart not centered/middled when having less values [\#1605](https://github.com/danielgindi/Charts/issues/1605) +- How to use a date/string for the X value [\#1604](https://github.com/danielgindi/Charts/issues/1604) +- Setting AxisBase.axisMaximum results in an axisRange of zero [\#1603](https://github.com/danielgindi/Charts/issues/1603) +- Pods failing for swift3.0 [\#1602](https://github.com/danielgindi/Charts/issues/1602) +- BarChart View issues [\#1601](https://github.com/danielgindi/Charts/issues/1601) +- Support for swift 3.0 [\#1600](https://github.com/danielgindi/Charts/issues/1600) +- Pod pointing to master branch code created issue in BarChartDataEntry [\#1599](https://github.com/danielgindi/Charts/issues/1599) +- Swift based library, but OC based Demo. Have you ever thought of provide a Swifty Demo? [\#1598](https://github.com/danielgindi/Charts/issues/1598) +- Grid and xaxis label issues. [\#1596](https://github.com/danielgindi/Charts/issues/1596) +- LeftAxis above bars in BarChartView [\#1595](https://github.com/danielgindi/Charts/issues/1595) +- cannot convert value of type\<\> to expected arguments RLMResults\ [\#1594](https://github.com/danielgindi/Charts/issues/1594) +- Member 'index' cannot be used on value of protocol type 'collection'; use a generic constraint instead [\#1593](https://github.com/danielgindi/Charts/issues/1593) +- Scrollable Graph [\#1592](https://github.com/danielgindi/Charts/issues/1592) +- charts 2.3 unsupported architectures i386 [\#1591](https://github.com/danielgindi/Charts/issues/1591) +- BarChart doesn't refresh after new dataSet [\#1590](https://github.com/danielgindi/Charts/issues/1590) +- Label of ChartLimitLine overlaps limit line a little [\#1589](https://github.com/danielgindi/Charts/issues/1589) +- IChartAxisValueFormatter cound't found [\#1588](https://github.com/danielgindi/Charts/issues/1588) +- How to use v2.2.5 swift3.0 in OC Project? [\#1587](https://github.com/danielgindi/Charts/issues/1587) +- Last LineChart y-label not being rendered [\#1585](https://github.com/danielgindi/Charts/issues/1585) +- Charts 3.0: Custom xAxis labels with gaps in data? [\#1584](https://github.com/danielgindi/Charts/issues/1584) +- BarChart xAxis labels disappear after zooming [\#1583](https://github.com/danielgindi/Charts/issues/1583) +- Add space between bars [\#1582](https://github.com/danielgindi/Charts/issues/1582) +- How to use v2.2.5 swift3.0 in OC Project? [\#1581](https://github.com/danielgindi/Charts/issues/1581) +- malloc: \*\*\* error for object : Invalid pointer dequeued from free list\*\*\* set a breakpoint in malloc\_error\_break to debug [\#1580](https://github.com/danielgindi/Charts/issues/1580) +- i want to add % in value [\#1579](https://github.com/danielgindi/Charts/issues/1579) +- Update the code to Swift 3.0 compliance [\#1578](https://github.com/danielgindi/Charts/issues/1578) +- Can I set a text label underneath each bar of a bar chart? [\#1577](https://github.com/danielgindi/Charts/issues/1577) +- Line Chart X-Axis values as a string [\#1576](https://github.com/danielgindi/Charts/issues/1576) +- Hide values in Combines chart [\#1574](https://github.com/danielgindi/Charts/issues/1574) +- Method does not override any method from its superclass [\#1573](https://github.com/danielgindi/Charts/issues/1573) +- Method does not override any method from its superclass [\#1572](https://github.com/danielgindi/Charts/issues/1572) +- Crash in Charts v2.2.5-Swift3.0 [\#1570](https://github.com/danielgindi/Charts/issues/1570) +- Cocoapods integration with objective c projects - can't resolve [\#1568](https://github.com/danielgindi/Charts/issues/1568) +- How to change x value [\#1567](https://github.com/danielgindi/Charts/issues/1567) +- \[Charts 3.0\] Issue with centerAxisLabelsEnabled [\#1566](https://github.com/danielgindi/Charts/issues/1566) +- \[Chart 3.0 BUG\] xAxis labels disappear after a deep zoom in [\#1564](https://github.com/danielgindi/Charts/issues/1564) +- Extraneous space between axis and bars when there is data with value of 0 [\#1557](https://github.com/danielgindi/Charts/issues/1557) +- Chart clip the Ballon Marker [\#1555](https://github.com/danielgindi/Charts/issues/1555) +- Argument labels '\(value:, xIndex:\)' do not match any available overloads, Cannot invoke initializer for type 'BarChartData' with an argument list of type '\(xVals: \[String\], dataSets: \[BarChartDataSet\]\)' [\#1554](https://github.com/danielgindi/Charts/issues/1554) +- Chart clip the Ballon Marker [\#1553](https://github.com/danielgindi/Charts/issues/1553) +- horizontal bar graphs with different colors and offset values [\#1552](https://github.com/danielgindi/Charts/issues/1552) +- valueFormatter API changes in Swift 3 [\#1551](https://github.com/danielgindi/Charts/issues/1551) +- Calling `setAxisMaxValue` leads to transform error. [\#1549](https://github.com/danielgindi/Charts/issues/1549) +- Demo in Swift? [\#1548](https://github.com/danielgindi/Charts/issues/1548) +- The LineChart is not working swift 3 [\#1546](https://github.com/danielgindi/Charts/issues/1546) +- Charts framework not usable in a Swift class added to an Objective C project [\#1545](https://github.com/danielgindi/Charts/issues/1545) +- How to add charts cocoapods dependency for Swift 3 project? [\#1544](https://github.com/danielgindi/Charts/issues/1544) +- Grouped bars in Combined chart [\#1543](https://github.com/danielgindi/Charts/issues/1543) +- I want to control width between bar [\#1542](https://github.com/danielgindi/Charts/issues/1542) +- Crash while using Combined Chart [\#1540](https://github.com/danielgindi/Charts/issues/1540) +- how can i draw only bar chart without x-axis, y-axis , grid line [\#1539](https://github.com/danielgindi/Charts/issues/1539) +- Charts.framework iOS not exist [\#1538](https://github.com/danielgindi/Charts/issues/1538) +- can i set data's starting point? [\#1537](https://github.com/danielgindi/Charts/issues/1537) +- Scatter Chart View V3.0 an another problem with balloon [\#1535](https://github.com/danielgindi/Charts/issues/1535) +- Granularity in line chart not working \(Chart3.0-Swift2.3 \) [\#1534](https://github.com/danielgindi/Charts/issues/1534) +- Error in ChartsPlatform.swift [\#1533](https://github.com/danielgindi/Charts/issues/1533) +- Still got an error when building Charts\(2.3.0\) with carthage [\#1532](https://github.com/danielgindi/Charts/issues/1532) +- Horizontal bar chart xAxis values missing [\#1531](https://github.com/danielgindi/Charts/issues/1531) +- Selection in a bar chart [\#1530](https://github.com/danielgindi/Charts/issues/1530) +- Multiple bar is not working [\#1529](https://github.com/danielgindi/Charts/issues/1529) +- X -axis - time , sometimes incorrectly displayed \( many of the data points \) [\#1528](https://github.com/danielgindi/Charts/issues/1528) +- Convert x value labels to String? from Double? \[Horizontal Barchart\] \(Swift v3\) [\#1527](https://github.com/danielgindi/Charts/issues/1527) +- Method doesn't override any method from its superclass [\#1526](https://github.com/danielgindi/Charts/issues/1526) +- Bar charts X-Axis labels repeating if the number of bars reduce [\#1524](https://github.com/danielgindi/Charts/issues/1524) +- The latest version can not run [\#1523](https://github.com/danielgindi/Charts/issues/1523) +- how to show the Chart without data? [\#1522](https://github.com/danielgindi/Charts/issues/1522) +- The usage is not correct [\#1521](https://github.com/danielgindi/Charts/issues/1521) +- Charts classes not found in swift class in my Objc Xcode project [\#1519](https://github.com/danielgindi/Charts/issues/1519) +- ChartUtils methods are marked internal and cannot be use to create custom charts [\#1518](https://github.com/danielgindi/Charts/issues/1518) +- Re: Fatal error while loading Bar Chart \#1511 [\#1517](https://github.com/danielgindi/Charts/issues/1517) +- I can't run this demo! [\#1516](https://github.com/danielgindi/Charts/issues/1516) +- Charts.framework iOS [\#1515](https://github.com/danielgindi/Charts/issues/1515) +- Setting x-values of BarChartView in Chart 2.2.6 [\#1514](https://github.com/danielgindi/Charts/issues/1514) +- Xcode 8.0,many errors...... [\#1513](https://github.com/danielgindi/Charts/issues/1513) +- Fatal error while loading Bar Chart [\#1511](https://github.com/danielgindi/Charts/issues/1511) +- Fix Intermittent CI Failures [\#1508](https://github.com/danielgindi/Charts/issues/1508) +- Info.plist Utility Error [\#1507](https://github.com/danielgindi/Charts/issues/1507) +- Bar chart "floats" above x-axis when axisMinValue set to 0 [\#1506](https://github.com/danielgindi/Charts/issues/1506) +- Issue with BarDataEntry Method [\#1504](https://github.com/danielgindi/Charts/issues/1504) +- \(v3.0 + Swift3.0\)IChartAxisValueFormatter's protocol function pass on a unexpected value\(double value discard\) [\#1503](https://github.com/danielgindi/Charts/issues/1503) +- Cannot invoke initializer for type 'LineChartData' [\#1502](https://github.com/danielgindi/Charts/issues/1502) +- when click node call chartValueSelected funtion [\#1499](https://github.com/danielgindi/Charts/issues/1499) +- \[BUG\] LineChart--- about "LineChartModeCubicBezier" [\#1490](https://github.com/danielgindi/Charts/issues/1490) +- Unneeded deprecated warning for Legend.position [\#1483](https://github.com/danielgindi/Charts/issues/1483) +- Scatter Chart View V3.0 bad point displayed with BaloonMaker [\#1482](https://github.com/danielgindi/Charts/issues/1482) +- How to set the LineChart disconnect style, I add NAN to Entry, isInBoundsRight function is crashed. [\#1471](https://github.com/danielgindi/Charts/issues/1471) +- \(v3.0\)Demo: no such module realm [\#1460](https://github.com/danielgindi/Charts/issues/1460) +- Please provide swift 2 version for this project [\#1457](https://github.com/danielgindi/Charts/issues/1457) +- Distinguish LineGraph callback. [\#1448](https://github.com/danielgindi/Charts/issues/1448) +- BarChart right/left bar cut in half [\#1446](https://github.com/danielgindi/Charts/issues/1446) +- Graph clipping while setting Y-axis min ,max Value [\#1444](https://github.com/danielgindi/Charts/issues/1444) +- ChartV3 autoScaleMinMaxEnabled not scaling candle charts correctly. [\#1442](https://github.com/danielgindi/Charts/issues/1442) +- conflict with scrollView [\#1438](https://github.com/danielgindi/Charts/issues/1438) +- Getting error, while assigning xVals to PieChartData. [\#1433](https://github.com/danielgindi/Charts/issues/1433) +- HorizontalBarChartView not show value at bar [\#1396](https://github.com/danielgindi/Charts/issues/1396) +- HorizontalBarCharView incorrect results for bounding box query [\#1382](https://github.com/danielgindi/Charts/issues/1382) +- Data entries are missing on the chart [\#1348](https://github.com/danielgindi/Charts/issues/1348) +- \[HEADS UP\] Realm swift 3.0 support is blocked due to Xcode 8 beta 3 swift compiler bug [\#1269](https://github.com/danielgindi/Charts/issues/1269) +- When the X-Axis's text is too long, it will cover the radar chart. [\#1143](https://github.com/danielgindi/Charts/issues/1143) +- Extracting ChartsRealm to a separate project [\#1119](https://github.com/danielgindi/Charts/issues/1119) +- Disable scrolling parent scrollview when readed end of the chart [\#1115](https://github.com/danielgindi/Charts/issues/1115) +- Pie Chart : Multiline label on legend is cutting off [\#1084](https://github.com/danielgindi/Charts/issues/1084) + **Merged pull requests:** - Enter the matrix [\#1650](https://github.com/danielgindi/Charts/pull/1650) ([petester42](https://github.com/petester42)) @@ -351,6 +2534,319 @@ [Full Changelog](https://github.com/danielgindi/Charts/compare/v2.2.5...v2.3.0) +**Implemented enhancements:** + +- Seek help with CandleStickChartView [\#1297](https://github.com/danielgindi/Charts/issues/1297) +- Support Realm 1.0.1 \(Objective-C\) [\#1201](https://github.com/danielgindi/Charts/issues/1201) + +**Fixed bugs:** + +- macOS demo bar chart's first and last bar got half cut [\#1468](https://github.com/danielgindi/Charts/issues/1468) +- Label drawing glitch when changing data [\#1347](https://github.com/danielgindi/Charts/issues/1347) +- HorizontalBarChartView with multiple data set crashes on tap [\#1339](https://github.com/danielgindi/Charts/issues/1339) +- weird behavior resizing the pie. [\#1286](https://github.com/danielgindi/Charts/issues/1286) +- Line Chart\(Dual YAis\):if i drag the slider,double line only leave the one line \#bug [\#1250](https://github.com/danielgindi/Charts/issues/1250) +- only Have a X-Value,the PieChart too bigger, twinkle [\#1239](https://github.com/danielgindi/Charts/issues/1239) +- Chart always crash when marker added and highlightFullBarEnabled is true [\#1185](https://github.com/danielgindi/Charts/issues/1185) +- App is crashing for certain symbols when granularityEnabled is false [\#1181](https://github.com/danielgindi/Charts/issues/1181) +- Changing chart data + autoScaleMinMaxEnabled causes crash [\#1151](https://github.com/danielgindi/Charts/issues/1151) +- using ChartXAxisValueFormatter doesn't enable 3 lines x axis labels [\#1148](https://github.com/danielgindi/Charts/issues/1148) +- ChartMaker work wrong in a Combined Chart [\#737](https://github.com/danielgindi/Charts/issues/737) +- CombinedChart with grouped bars support [\#169](https://github.com/danielgindi/Charts/issues/169) + +**Closed issues:** + +- Typo in CONTRIBUTING.md [\#1501](https://github.com/danielgindi/Charts/issues/1501) +- noDataText overflows [\#1500](https://github.com/danielgindi/Charts/issues/1500) +- How can I get frame of Line chart? \(with out labels, chart only\) [\#1498](https://github.com/danielgindi/Charts/issues/1498) +- Last label on xAxis is not showing [\#1497](https://github.com/danielgindi/Charts/issues/1497) +- How do I set the value of the x-axis after update ? [\#1496](https://github.com/danielgindi/Charts/issues/1496) +- Xcode 8 swift 3 No Such Module Charts? [\#1494](https://github.com/danielgindi/Charts/issues/1494) +- Give id for node [\#1493](https://github.com/danielgindi/Charts/issues/1493) +- \(v3.0-Swift3.0\)crash because of image not found [\#1487](https://github.com/danielgindi/Charts/issues/1487) +- \(v3.0 LineChart\) xAxis with String/double label issue [\#1481](https://github.com/danielgindi/Charts/issues/1481) +- LineChart. Custom LineChartRenderer does not cross chart border [\#1480](https://github.com/danielgindi/Charts/issues/1480) +- LineChart. Labels for Y axis and Double format [\#1479](https://github.com/danielgindi/Charts/issues/1479) +- stringForValue value argument [\#1478](https://github.com/danielgindi/Charts/issues/1478) +- \[LineChart\] How to Darw "NSString" on xAxis? without Realm.io [\#1477](https://github.com/danielgindi/Charts/issues/1477) +- code 65 result after getting a Carthage update failure [\#1476](https://github.com/danielgindi/Charts/issues/1476) +- How to show xAxis All value and Rotate Label? [\#1475](https://github.com/danielgindi/Charts/issues/1475) +- Compiled with older version of Swift language \(2.0\) [\#1473](https://github.com/danielgindi/Charts/issues/1473) +- Some missing methods in swift 3 version [\#1472](https://github.com/danielgindi/Charts/issues/1472) +- v2.2.5 not support swift2.3 [\#1470](https://github.com/danielgindi/Charts/issues/1470) +- balloon marker [\#1469](https://github.com/danielgindi/Charts/issues/1469) +- How can I highlight single dot in lineChart? [\#1465](https://github.com/danielgindi/Charts/issues/1465) +- release new [\#1464](https://github.com/danielgindi/Charts/issues/1464) +- After the upgrade iOS10 Charts-iOS Change the case [\#1463](https://github.com/danielgindi/Charts/issues/1463) +- \(v3.0\)There is no Chart-iOS framework in Product [\#1462](https://github.com/danielgindi/Charts/issues/1462) +- ios10 the charts can not display! [\#1461](https://github.com/danielgindi/Charts/issues/1461) +- Swift 3.0 and Realm [\#1458](https://github.com/danielgindi/Charts/issues/1458) +- Unable to draw bars [\#1456](https://github.com/danielgindi/Charts/issues/1456) +- \[MC\] System group container issue [\#1455](https://github.com/danielgindi/Charts/issues/1455) +- iOS 10 and swift 3.0 issues [\#1453](https://github.com/danielgindi/Charts/issues/1453) +- Adding additional X index values without the initWithXVals [\#1451](https://github.com/danielgindi/Charts/issues/1451) +- Cannot convert Charts to Swift 3.0 [\#1449](https://github.com/danielgindi/Charts/issues/1449) +- Combine chart have a Bar color gray every bars? [\#1447](https://github.com/danielgindi/Charts/issues/1447) +- Compiling on New XCode 8 [\#1445](https://github.com/danielgindi/Charts/issues/1445) +- Customize scatter chart color for each data in dataSets [\#1443](https://github.com/danielgindi/Charts/issues/1443) +- XCode 8: Crash in xAxis Renderer after upgrade [\#1441](https://github.com/danielgindi/Charts/issues/1441) +- Xcode 8 and swift 3.0 [\#1440](https://github.com/danielgindi/Charts/issues/1440) +- How To use Swift3.0 In Xcode8 [\#1439](https://github.com/danielgindi/Charts/issues/1439) +- Error when running `pod lib lint` from another project [\#1436](https://github.com/danielgindi/Charts/issues/1436) +- Graph cutting off from axisLine while setting axis min ,max Value [\#1435](https://github.com/danielgindi/Charts/issues/1435) +- Cannot compile for targets below iPhone 5s [\#1434](https://github.com/danielgindi/Charts/issues/1434) +- Line chartView, I need a YAxis with the labelNum is inverted order [\#1432](https://github.com/danielgindi/Charts/issues/1432) +- PieChartDataEntry class not found - Swift/CocoaPods [\#1431](https://github.com/danielgindi/Charts/issues/1431) +- How to write a limit for each bar in horizontal bar chart? [\#1429](https://github.com/danielgindi/Charts/issues/1429) +- Bug with 2 candlestick datasets on one chart. [\#1428](https://github.com/danielgindi/Charts/issues/1428) +- getFillLinePosition not calling to create Area graph [\#1427](https://github.com/danielgindi/Charts/issues/1427) +- Lack of documentation [\#1426](https://github.com/danielgindi/Charts/issues/1426) +- Best method to use this in Objective c project [\#1425](https://github.com/danielgindi/Charts/issues/1425) +- Highlight sync between combined and line views [\#1424](https://github.com/danielgindi/Charts/issues/1424) +- How to create two bars one over another for Horizontal bar charts? [\#1423](https://github.com/danielgindi/Charts/issues/1423) +- \[Swift 3.0 specific\] linear line chart has additional line segments wile zooming in [\#1421](https://github.com/danielgindi/Charts/issues/1421) +- Is there a way to import PieChartDataEntry.swift in existing Pod? [\#1419](https://github.com/danielgindi/Charts/issues/1419) +- implement the same behavior as Android api [\#1418](https://github.com/danielgindi/Charts/issues/1418) +- Unable to build project in Xcode 8 [\#1417](https://github.com/danielgindi/Charts/issues/1417) +- Synchronizing scrolling/pan/highlight of multiple views. [\#1415](https://github.com/danielgindi/Charts/issues/1415) +- Custom X-Axis Values [\#1413](https://github.com/danielgindi/Charts/issues/1413) +- Query : When it will be available in CocoaPods? [\#1412](https://github.com/danielgindi/Charts/issues/1412) +- How to set background color of bars [\#1411](https://github.com/danielgindi/Charts/issues/1411) +- Query: Enable gridelines at specific location points. [\#1410](https://github.com/danielgindi/Charts/issues/1410) +- Syntax errors on one of our testing devices [\#1409](https://github.com/danielgindi/Charts/issues/1409) +- how to hide the ValueFormatter [\#1408](https://github.com/danielgindi/Charts/issues/1408) +- I can't see the zero\(float Num\) on ChartYAxis [\#1407](https://github.com/danielgindi/Charts/issues/1407) +- drawSliceTextEnabled = YES not working [\#1404](https://github.com/danielgindi/Charts/issues/1404) +- Customize popup on entry tap [\#1403](https://github.com/danielgindi/Charts/issues/1403) +- Query: How to create an area graph? [\#1402](https://github.com/danielgindi/Charts/issues/1402) +- Negative Bar Chart [\#1401](https://github.com/danielgindi/Charts/issues/1401) +- Cannot invoke initializer for type 'PieChartData' error in Swift 2.3 [\#1400](https://github.com/danielgindi/Charts/issues/1400) +- Get entry location in view when chart value is selected? [\#1399](https://github.com/danielgindi/Charts/issues/1399) +- Can you give me a Charts library wrote by OC. [\#1398](https://github.com/danielgindi/Charts/issues/1398) +- Barchart,,,,draw specific value [\#1397](https://github.com/danielgindi/Charts/issues/1397) +- How to customize left axis with string values? [\#1394](https://github.com/danielgindi/Charts/issues/1394) +- Swift & CocoaPods - Unable to Utilize Charts [\#1393](https://github.com/danielgindi/Charts/issues/1393) +- How to create a Pie chart, no 'how to' ? . The demo app sucks, doesn't compile. [\#1392](https://github.com/danielgindi/Charts/issues/1392) +- Need help in setDrawValues [\#1391](https://github.com/danielgindi/Charts/issues/1391) +- Display Integer value [\#1390](https://github.com/danielgindi/Charts/issues/1390) +- BarChartData Class is Missing InitWithXVals [\#1385](https://github.com/danielgindi/Charts/issues/1385) +- Undeclared or undefined identifiers while trying to compile project [\#1383](https://github.com/danielgindi/Charts/issues/1383) +- How to show/hide one of the line chart during runtime [\#1381](https://github.com/danielgindi/Charts/issues/1381) +- Charts-Swift.h is different [\#1380](https://github.com/danielgindi/Charts/issues/1380) +- infinite recursion in HorizontalBarChartHighlighter [\#1377](https://github.com/danielgindi/Charts/issues/1377) +- Charts errors in xcode beta 6 [\#1375](https://github.com/danielgindi/Charts/issues/1375) +- please tell me how do i handling these problems,thanks! [\#1373](https://github.com/danielgindi/Charts/issues/1373) +- Charts 3.0 and Swift 2.3 branch? [\#1370](https://github.com/danielgindi/Charts/issues/1370) +- Legend. Position is deprecated. [\#1369](https://github.com/danielgindi/Charts/issues/1369) +- App Crash: An instance 0xXXXXXXXX of class Charts.BarChartView was deallocated while key value observers were still registered with it. [\#1368](https://github.com/danielgindi/Charts/issues/1368) +- Unable to compile adding Charts to project via CocoaPods [\#1367](https://github.com/danielgindi/Charts/issues/1367) +- Cannot use PieChartDataSet or PieChartDataEntry when include with Cocoapod [\#1366](https://github.com/danielgindi/Charts/issues/1366) +- Charts is ~20M when built. Desired? [\#1365](https://github.com/danielgindi/Charts/issues/1365) +- swift 3 branch does not compile with Xcode 8 beta 6 [\#1364](https://github.com/danielgindi/Charts/issues/1364) +- There are two lines. The first number starts from scratch, but only one is from zero. The other one has a certain amount of cheap quantity. How do I get the other one from zero. [\#1363](https://github.com/danielgindi/Charts/issues/1363) +- missing class PieChartDataEntry \(macOS\) [\#1358](https://github.com/danielgindi/Charts/issues/1358) +- BarChartView can't show max y value's top label, only show half [\#1357](https://github.com/danielgindi/Charts/issues/1357) +- Horizontal Bar Chart not showing values [\#1356](https://github.com/danielgindi/Charts/issues/1356) +- rightAxis labels are not showing for value less then 1.0 in swift using cocoapod [\#1354](https://github.com/danielgindi/Charts/issues/1354) +- Chart's X-axis labels not resizing to accommodate multi-line text [\#1352](https://github.com/danielgindi/Charts/issues/1352) +- Pie Chart Graph Unusual Visual When Data Of Zero [\#1351](https://github.com/danielgindi/Charts/issues/1351) +- Chart render problem after double tap zoom [\#1350](https://github.com/danielgindi/Charts/issues/1350) +- Chart Bar drawing [\#1349](https://github.com/danielgindi/Charts/issues/1349) +- How to dynamically scale up / down data depends on zoom level [\#1346](https://github.com/danielgindi/Charts/issues/1346) +- Cannot install in ios9.3.2 [\#1345](https://github.com/danielgindi/Charts/issues/1345) +- Where can I find the exact color value of vordiplom colors? [\#1343](https://github.com/danielgindi/Charts/issues/1343) +- How to Modify X Axis values Swift? [\#1340](https://github.com/danielgindi/Charts/issues/1340) +- Line Chart : Data Line Color Change [\#1338](https://github.com/danielgindi/Charts/issues/1338) +- Line Chart x axis and y axis Line Color change? [\#1337](https://github.com/danielgindi/Charts/issues/1337) +- Grouped Bar Charts [\#1333](https://github.com/danielgindi/Charts/issues/1333) +- Integer for ChartDataEntry [\#1332](https://github.com/danielgindi/Charts/issues/1332) +- values from array for x axis on barchart [\#1331](https://github.com/danielgindi/Charts/issues/1331) +- Redundant conformance of 'RLMResults' to protocol 'SequenceType' on RealmChartsUtils [\#1329](https://github.com/danielgindi/Charts/issues/1329) +- Combined Chart Grouped Bar Width Not Changing [\#1328](https://github.com/danielgindi/Charts/issues/1328) +- Undefined symbols for architecture armv7: [\#1327](https://github.com/danielgindi/Charts/issues/1327) +- Error with carthage update ChartsRealm fails to build [\#1326](https://github.com/danielgindi/Charts/issues/1326) +- I am not able to design multicolor bar chart [\#1324](https://github.com/danielgindi/Charts/issues/1324) +- v2.2.5 demo code is different with pod installed version [\#1322](https://github.com/danielgindi/Charts/issues/1322) +- If the all value is 1 or 0, the ChartYAxis is error [\#1321](https://github.com/danielgindi/Charts/issues/1321) +- hide on select grid lines in line chart [\#1320](https://github.com/danielgindi/Charts/issues/1320) +- X data as a Date [\#1317](https://github.com/danielgindi/Charts/issues/1317) +- Also played well, before package, NO error, the recent packaging error, the error is "NO Scuh module 'charts", don't know is what reason to solve, use the xcode 7.1 \(7 b91b\) [\#1316](https://github.com/danielgindi/Charts/issues/1316) +- Crash with marker attached into CombinedChartView [\#1315](https://github.com/danielgindi/Charts/issues/1315) +- How to add more than 3 lines in chart [\#1314](https://github.com/danielgindi/Charts/issues/1314) +- is v3 Ready for production ? [\#1313](https://github.com/danielgindi/Charts/issues/1313) +- xAxis.axisMaxValue not working [\#1312](https://github.com/danielgindi/Charts/issues/1312) +- Symbol not found: \_\_TMVVSS17UnicodeScalarView9Generator Referenced from: Frameworks/Charts.framework/Charts [\#1311](https://github.com/danielgindi/Charts/issues/1311) +- how to named SWIFT\_CLASS\("....."\) [\#1310](https://github.com/danielgindi/Charts/issues/1310) +- How to set the length and color outside pie chart when a slice is highlighted? [\#1309](https://github.com/danielgindi/Charts/issues/1309) +- How to set the length and color outside pie chart when a slice is highlighted? [\#1308](https://github.com/danielgindi/Charts/issues/1308) +- I want set circle empty in Line Chart. Which properties i have to change? [\#1307](https://github.com/danielgindi/Charts/issues/1307) +- noDataText font and color [\#1305](https://github.com/danielgindi/Charts/issues/1305) +- how to let centerAttributedText line feed in bar chart ? [\#1304](https://github.com/danielgindi/Charts/issues/1304) +- Can Legend be selected or multi-selected? [\#1303](https://github.com/danielgindi/Charts/issues/1303) +- add financial bar chart \(Open-high-low-close chart\) [\#1302](https://github.com/danielgindi/Charts/issues/1302) +- How to select the first pie in bar chart? [\#1301](https://github.com/danielgindi/Charts/issues/1301) +- PieChartView Narrow with one value [\#1298](https://github.com/danielgindi/Charts/issues/1298) +- xAxis.axisMaxValue is never considered [\#1293](https://github.com/danielgindi/Charts/issues/1293) +- Please add Swift demo project also [\#1292](https://github.com/danielgindi/Charts/issues/1292) +- Swift 2.3 & 3.0 support: news, issues, PRs and state [\#1291](https://github.com/danielgindi/Charts/issues/1291) +- 2 lines on the charts with the same values [\#1289](https://github.com/danielgindi/Charts/issues/1289) +- How to set the y axis descript text [\#1285](https://github.com/danielgindi/Charts/issues/1285) +- how to setTouchEnabled to false [\#1283](https://github.com/danielgindi/Charts/issues/1283) +- legend set different form for different set [\#1282](https://github.com/danielgindi/Charts/issues/1282) +- Change Label Text Color PieChart [\#1280](https://github.com/danielgindi/Charts/issues/1280) +- Everyone welcome to try out `v3` branch before Charts 3.0 is released! [\#1279](https://github.com/danielgindi/Charts/issues/1279) +- \[FR\] make Marker a protocol [\#1278](https://github.com/danielgindi/Charts/issues/1278) +- Unable to convert charts to Swift3 [\#1277](https://github.com/danielgindi/Charts/issues/1277) +- Start at zero and draw cubic [\#1275](https://github.com/danielgindi/Charts/issues/1275) +- Customised size of x data points and Scatter Graph with Linear Trend Line [\#1274](https://github.com/danielgindi/Charts/issues/1274) +- How can i add null values to my chart? [\#1273](https://github.com/danielgindi/Charts/issues/1273) +- PIE-CHART how to get the index of the selected slice.??? [\#1267](https://github.com/danielgindi/Charts/issues/1267) +- How to select a value in line chart data point and same for bar chart [\#1265](https://github.com/danielgindi/Charts/issues/1265) +- update to the latest realm [\#1262](https://github.com/danielgindi/Charts/issues/1262) +- horizontal bar graph value different decimal places each time [\#1260](https://github.com/danielgindi/Charts/issues/1260) +- Charts vs. ShinobiCharts? [\#1259](https://github.com/danielgindi/Charts/issues/1259) +- LineChart overlap value label and y-Axis [\#1257](https://github.com/danielgindi/Charts/issues/1257) +- how to hide stacked bar chart label having 0 values [\#1256](https://github.com/danielgindi/Charts/issues/1256) +- fillColor for negative values [\#1255](https://github.com/danielgindi/Charts/issues/1255) +- Set custom x-value spacing in graph [\#1254](https://github.com/danielgindi/Charts/issues/1254) +- Hide specific labels on y axis [\#1253](https://github.com/danielgindi/Charts/issues/1253) +- Marker near edges got clipped [\#1251](https://github.com/danielgindi/Charts/issues/1251) +- Custom label for LineChart [\#1248](https://github.com/danielgindi/Charts/issues/1248) +- Chart in TableViewCell [\#1247](https://github.com/danielgindi/Charts/issues/1247) +- Line Chart : Can I drag a vertical line to any point on the screen and get values? Instead of individual touches [\#1246](https://github.com/danielgindi/Charts/issues/1246) +- Line Chart label count not calculating properly [\#1244](https://github.com/danielgindi/Charts/issues/1244) +- CandleChartView screen show count limit [\#1243](https://github.com/danielgindi/Charts/issues/1243) +- addEntryOrdered behavior - clarification [\#1242](https://github.com/danielgindi/Charts/issues/1242) +- Display Max Value on X-axis [\#1241](https://github.com/danielgindi/Charts/issues/1241) +- Value not display for Multiple DataSet in LineChart [\#1240](https://github.com/danielgindi/Charts/issues/1240) +- rightAxis are rounded [\#1238](https://github.com/danielgindi/Charts/issues/1238) +- Now working if “Compile Sources As” option to “Objective C++” [\#1237](https://github.com/danielgindi/Charts/issues/1237) +- Line is drawn below the x axis when the drawCubicEnabled is YES. [\#1236](https://github.com/danielgindi/Charts/issues/1236) +- Label value is cut off in horizontal bar [\#1235](https://github.com/danielgindi/Charts/issues/1235) +- ChartValueSelected Only While Finger Pressed [\#1234](https://github.com/danielgindi/Charts/issues/1234) +- YAxis Labels are clipped with some settings [\#1233](https://github.com/danielgindi/Charts/issues/1233) +- xVals隐藏问题 [\#1232](https://github.com/danielgindi/Charts/issues/1232) +- About the Lable number of x and y [\#1231](https://github.com/danielgindi/Charts/issues/1231) +- How to control not draws a specified point [\#1229](https://github.com/danielgindi/Charts/issues/1229) +- Location have a little problem [\#1228](https://github.com/danielgindi/Charts/issues/1228) +- BarChartView bars do not start at the x-axis. [\#1225](https://github.com/danielgindi/Charts/issues/1225) +- Unable to run on iOS/tvOS 10.0 beta [\#1223](https://github.com/danielgindi/Charts/issues/1223) +- two CombinedChartView's in the same screen changes axis format in the first [\#1222](https://github.com/danielgindi/Charts/issues/1222) +- Horizontal bar chart crashing after tap when more than one data set [\#1221](https://github.com/danielgindi/Charts/issues/1221) +- no suitable image found. [\#1220](https://github.com/danielgindi/Charts/issues/1220) +- wrong offset when using mutiple bar chart in combined chart [\#1219](https://github.com/danielgindi/Charts/issues/1219) +- UnsafeMutablePointer.moveInitializeFrom with negative count [\#1218](https://github.com/danielgindi/Charts/issues/1218) +- Is there any way to hide the label of a DataSet? [\#1217](https://github.com/danielgindi/Charts/issues/1217) +- How can I not be highlighted when I touch ended ? [\#1216](https://github.com/danielgindi/Charts/issues/1216) +- poor styling documentation, how can i make my charts look beautiful? [\#1215](https://github.com/danielgindi/Charts/issues/1215) +- X Axis for Candle Sticks from Realm [\#1214](https://github.com/danielgindi/Charts/issues/1214) +- drawHighlighted\(\) not calling [\#1212](https://github.com/danielgindi/Charts/issues/1212) +- how to set marker for line chart [\#1211](https://github.com/danielgindi/Charts/issues/1211) +- Error when using Charts library with Xcode 8 bet and Swift 3.0 [\#1210](https://github.com/danielgindi/Charts/issues/1210) +- I have an immature small suggestion [\#1209](https://github.com/danielgindi/Charts/issues/1209) +- I have a question BarChart [\#1208](https://github.com/danielgindi/Charts/issues/1208) +- HorizontalBarChart in Combined Chart [\#1207](https://github.com/danielgindi/Charts/issues/1207) +- drawvalue when stack is selected [\#1200](https://github.com/danielgindi/Charts/issues/1200) +- Remove labels from Radar Chart [\#1199](https://github.com/danielgindi/Charts/issues/1199) +- reduce height of grids [\#1198](https://github.com/danielgindi/Charts/issues/1198) +- reduce grid size [\#1194](https://github.com/danielgindi/Charts/issues/1194) +- ChartsView [\#1189](https://github.com/danielgindi/Charts/issues/1189) +- Custom LineChart marker image [\#1188](https://github.com/danielgindi/Charts/issues/1188) +- moveViewToAnimatedWithXIndex high cpu usage [\#1186](https://github.com/danielgindi/Charts/issues/1186) +- can we implement group bar chart and line chart as combined chart [\#1184](https://github.com/danielgindi/Charts/issues/1184) +- Such a difficult chart, can be realized? [\#1183](https://github.com/danielgindi/Charts/issues/1183) +- How to achieve the effect of the picture? Please look carefully [\#1182](https://github.com/danielgindi/Charts/issues/1182) +- Designed initializer of BarChartDataSet crash [\#1180](https://github.com/danielgindi/Charts/issues/1180) +- To judge whether the initial state [\#1178](https://github.com/danielgindi/Charts/issues/1178) +- use cocoa pods mistakes [\#1177](https://github.com/danielgindi/Charts/issues/1177) +- hide description label on charts [\#1176](https://github.com/danielgindi/Charts/issues/1176) +- axis values are rounded [\#1175](https://github.com/danielgindi/Charts/issues/1175) +- how can i add a % on leftAxis [\#1174](https://github.com/danielgindi/Charts/issues/1174) +- Add percent label for pie chart [\#1172](https://github.com/danielgindi/Charts/issues/1172) +- can't add swipe gesture [\#1170](https://github.com/danielgindi/Charts/issues/1170) +- Chart not drawing completely left to right [\#1168](https://github.com/danielgindi/Charts/issues/1168) +- Horizontal-BarChart: change color of bar's value [\#1167](https://github.com/danielgindi/Charts/issues/1167) +- ScatterChartData not working in Swift? [\#1166](https://github.com/danielgindi/Charts/issues/1166) +- Compile error on iPhone 4s simulator [\#1165](https://github.com/danielgindi/Charts/issues/1165) +- Adding an average line to a BarChartView [\#1162](https://github.com/danielgindi/Charts/issues/1162) +- About Swift3.0 [\#1161](https://github.com/danielgindi/Charts/issues/1161) +- How to add images on some points? [\#1160](https://github.com/danielgindi/Charts/issues/1160) +- Suggest combo type chart support gouped bar type [\#1159](https://github.com/danielgindi/Charts/issues/1159) +- Adding Entries dynamicly [\#1157](https://github.com/danielgindi/Charts/issues/1157) +- how can i add a button in redmark and i can click .. [\#1156](https://github.com/danielgindi/Charts/issues/1156) +- How can I select the close value in the candle chart view? [\#1155](https://github.com/danielgindi/Charts/issues/1155) +- Charts setup in Obj C project question [\#1154](https://github.com/danielgindi/Charts/issues/1154) +- I want datasetvalues according leftAxis and RigthAxis different display [\#1153](https://github.com/danielgindi/Charts/issues/1153) +- Unable to build project in new environment and it shows build error [\#1152](https://github.com/danielgindi/Charts/issues/1152) +- Chart Clipping [\#1149](https://github.com/danielgindi/Charts/issues/1149) +- How to handle small interval [\#1147](https://github.com/danielgindi/Charts/issues/1147) +- How to show the label [\#1146](https://github.com/danielgindi/Charts/issues/1146) +- specify certain point custom color [\#1144](https://github.com/danielgindi/Charts/issues/1144) +- when scaled touch move can't toggle highlight [\#1141](https://github.com/danielgindi/Charts/issues/1141) +- Support Swift 3.0 \(Xcode 8\) [\#1140](https://github.com/danielgindi/Charts/issues/1140) +- How to show bar chart value labels only on selection [\#1139](https://github.com/danielgindi/Charts/issues/1139) +- BalloonMarker overlapping issue [\#1137](https://github.com/danielgindi/Charts/issues/1137) +- Customize Axis visible distance [\#1135](https://github.com/danielgindi/Charts/issues/1135) +- Different width for stacked charts [\#1134](https://github.com/danielgindi/Charts/issues/1134) +- Properly setting up a fork of this project [\#1133](https://github.com/danielgindi/Charts/issues/1133) +- Issues with xcode 8.0 beta [\#1132](https://github.com/danielgindi/Charts/issues/1132) +- Disable touch events, so do not show Label [\#1129](https://github.com/danielgindi/Charts/issues/1129) +- custom chart label layout [\#1128](https://github.com/danielgindi/Charts/issues/1128) +- BarChartView yAxis origin y are not start from y:0.0? [\#1127](https://github.com/danielgindi/Charts/issues/1127) +- Space at the bottom of the Line Chart View in landscape view [\#1125](https://github.com/danielgindi/Charts/issues/1125) +- Failing to build the project [\#1124](https://github.com/danielgindi/Charts/issues/1124) +- Rounding error on Y-axis when all Y values are zeroes [\#1123](https://github.com/danielgindi/Charts/issues/1123) +- Can't hide small slice labels from pie chart. [\#1122](https://github.com/danielgindi/Charts/issues/1122) +- Customizing the x-axes labels. [\#1120](https://github.com/danielgindi/Charts/issues/1120) +- Using prebuilt frameworks is not recommended [\#1118](https://github.com/danielgindi/Charts/issues/1118) +- chartValueSelected on TVOS [\#1117](https://github.com/danielgindi/Charts/issues/1117) +- Single LineChartDataSet in LineChartView [\#1116](https://github.com/danielgindi/Charts/issues/1116) +- how to show only positive values in barchart? [\#1114](https://github.com/danielgindi/Charts/issues/1114) +- Slow Build Time [\#1113](https://github.com/danielgindi/Charts/issues/1113) +- BarChartDataEntry with Int instead of Double [\#1112](https://github.com/danielgindi/Charts/issues/1112) +- Embedded Binaries charts.framewor But nothing happen! [\#1111](https://github.com/danielgindi/Charts/issues/1111) +- How to draw Combined Chart on the left [\#1110](https://github.com/danielgindi/Charts/issues/1110) +- BarChartDataSet.values is a get-only [\#1108](https://github.com/danielgindi/Charts/issues/1108) +- 有没有 oc版的? [\#1107](https://github.com/danielgindi/Charts/issues/1107) +- Change color of highlight in chart [\#1106](https://github.com/danielgindi/Charts/issues/1106) +- Sync selected value in 2 chart [\#1105](https://github.com/danielgindi/Charts/issues/1105) +- Are two charts can be linked ? [\#1103](https://github.com/danielgindi/Charts/issues/1103) +- BarChart bottom not on the Xaxis [\#1102](https://github.com/danielgindi/Charts/issues/1102) +- BUG::: leftAxis.axisMinValue !!!=== 0.0 [\#1101](https://github.com/danielgindi/Charts/issues/1101) +- CandleStickView Memory leak [\#1100](https://github.com/danielgindi/Charts/issues/1100) +- application doesn't compile for iphone 4s and iphone 5 device. [\#1098](https://github.com/danielgindi/Charts/issues/1098) +- ChartHighlight init data in function of highlightValue error [\#1096](https://github.com/danielgindi/Charts/issues/1096) +- improvement: custom labels on BarChart [\#1095](https://github.com/danielgindi/Charts/issues/1095) +- Missing alternate x-axis labels in vertical bar chart [\#1093](https://github.com/danielgindi/Charts/issues/1093) +- ChartHighlight class initialization is error in ChartViewBase [\#1090](https://github.com/danielgindi/Charts/issues/1090) +- how can I change the mark view [\#1086](https://github.com/danielgindi/Charts/issues/1086) +- Pie Chart with value lines [\#1085](https://github.com/danielgindi/Charts/issues/1085) +- Chart Demo not Compiling [\#1083](https://github.com/danielgindi/Charts/issues/1083) +- set the Y range [\#1079](https://github.com/danielgindi/Charts/issues/1079) +- Sync zoom in 2 chart [\#1078](https://github.com/danielgindi/Charts/issues/1078) +- The rotated xAxis label out of the view [\#1068](https://github.com/danielgindi/Charts/issues/1068) +- visibleXRangeMaximum not refreshing [\#1037](https://github.com/danielgindi/Charts/issues/1037) +- Fill area between two line in Line chart [\#1032](https://github.com/danielgindi/Charts/issues/1032) +- Left Axis not showing labels after update to Swift 2.3 [\#997](https://github.com/danielgindi/Charts/issues/997) +- highestVisibleXIndex has regression issue [\#985](https://github.com/danielgindi/Charts/issues/985) +- Problem with bitcode [\#979](https://github.com/danielgindi/Charts/issues/979) +- BarChartView height is not reflecting the values assigned to it. [\#977](https://github.com/danielgindi/Charts/issues/977) +- I use the RadarChartView,when displaying two sets of data [\#974](https://github.com/danielgindi/Charts/issues/974) +- Overlapping with multiple data styles [\#972](https://github.com/danielgindi/Charts/issues/972) +- XAxis Values label rotation [\#953](https://github.com/danielgindi/Charts/issues/953) +- Custom Y Value Formatter [\#943](https://github.com/danielgindi/Charts/issues/943) +- Bar chart missing y axis label [\#858](https://github.com/danielgindi/Charts/issues/858) +- Overlapping bar chart [\#857](https://github.com/danielgindi/Charts/issues/857) +- iOS-charts Get Currently visible bars for MultipleBarChartViewController demo [\#782](https://github.com/danielgindi/Charts/issues/782) +- Live data Line Chart [\#754](https://github.com/danielgindi/Charts/issues/754) +- Support custom formatting of chart labels [\#750](https://github.com/danielgindi/Charts/issues/750) +- Horizontally flipped x-axis [\#738](https://github.com/danielgindi/Charts/issues/738) +- Annotations issues and asking for supporting more types of markers [\#722](https://github.com/danielgindi/Charts/issues/722) +- Drop iOS 7 support in readme [\#601](https://github.com/danielgindi/Charts/issues/601) +- HorizontalBarChartView displays bar shadow when left and right axis hidden [\#311](https://github.com/danielgindi/Charts/issues/311) +- Making X-Values Properly Scaled \(Not Equidistant\) [\#194](https://github.com/danielgindi/Charts/issues/194) +- LineChart Axis Inset? [\#46](https://github.com/danielgindi/Charts/issues/46) + **Merged pull requests:** - Few more changes needed to build with Swift 2.3 [\#1281](https://github.com/danielgindi/Charts/pull/1281) ([EpicDraws](https://github.com/EpicDraws)) @@ -361,6 +2857,165 @@ [Full Changelog](https://github.com/danielgindi/Charts/compare/v2.2.4...v2.2.5) +**Implemented enhancements:** + +- Support for Xamarin.Forms [\#606](https://github.com/danielgindi/Charts/issues/606) + +**Fixed bugs:** + +- fatal error: stride size must not be zero [\#981](https://github.com/danielgindi/Charts/issues/981) +- highestVisibleXIndex is smaller than lowestVisibleXIndex [\#940](https://github.com/danielgindi/Charts/issues/940) +- Crash on zoom [\#931](https://github.com/danielgindi/Charts/issues/931) +- ChartLegend yEntrySpace not work [\#886](https://github.com/danielgindi/Charts/issues/886) +- Selection on bubble chart [\#654](https://github.com/danielgindi/Charts/issues/654) +- Cubic Line goes too much over the top or below bottom. Needs flattening. [\#407](https://github.com/danielgindi/Charts/issues/407) + +**Closed issues:** + +- Podspec prepare command fails on `pod install` [\#1080](https://github.com/danielgindi/Charts/issues/1080) +- Why not the same as Android and IOS parameters? RendererBase.calcXBounds\(\) [\#1077](https://github.com/danielgindi/Charts/issues/1077) +- Why not the same parameters ?RendererBase.calcXBounds\(\) [\#1076](https://github.com/danielgindi/Charts/issues/1076) +- Crash: fatal error: Can't form Range with end \< start [\#1075](https://github.com/danielgindi/Charts/issues/1075) +- automatically calculated labels with a custom roof \(axisMaxValue only if exceeding it\) [\#1074](https://github.com/danielgindi/Charts/issues/1074) +- Swift Version [\#1073](https://github.com/danielgindi/Charts/issues/1073) +- CodeSign for "Framework" in SDK "iOS 9.3" [\#1072](https://github.com/danielgindi/Charts/issues/1072) +- Changing size of centre section - pie chart [\#1071](https://github.com/danielgindi/Charts/issues/1071) +- PieChartView does not draw chart ! [\#1070](https://github.com/danielgindi/Charts/issues/1070) +- Real-time Charts [\#1069](https://github.com/danielgindi/Charts/issues/1069) +- swift2.2, I have a pieChartView problem [\#1067](https://github.com/danielgindi/Charts/issues/1067) +- carthage compatibility [\#1064](https://github.com/danielgindi/Charts/issues/1064) +- LineChart set a great amount data to LineChartDataSet, cpu increase highly to 97% [\#1063](https://github.com/danielgindi/Charts/issues/1063) +- Realm.io Horizontal combine bar chart - iOS [\#1062](https://github.com/danielgindi/Charts/issues/1062) +- Line chart font size problem [\#1061](https://github.com/danielgindi/Charts/issues/1061) +- BarChart won't sit on bottom of screen for some datasets, Why? How to fix? [\#1059](https://github.com/danielgindi/Charts/issues/1059) +- Very odd line at top of graph [\#1058](https://github.com/danielgindi/Charts/issues/1058) +- After upgrading to Xcode 7.3.1, getting bridging issue [\#1057](https://github.com/danielgindi/Charts/issues/1057) +- How can I remove the gap between the bar [\#1056](https://github.com/danielgindi/Charts/issues/1056) +- Pie Chart label position [\#1055](https://github.com/danielgindi/Charts/issues/1055) +- Cant understand .axisMaxValue [\#1054](https://github.com/danielgindi/Charts/issues/1054) +- Is there a way to get a different background colour for different values of the x axis? [\#1053](https://github.com/danielgindi/Charts/issues/1053) +- Without drawLimitLinesBehindDataEnabled, limit lines go outside chart area [\#1052](https://github.com/danielgindi/Charts/issues/1052) +- The horizontal line that forms the grid of the LineChartView are not the same color [\#1051](https://github.com/danielgindi/Charts/issues/1051) +- Issue with coloring grouped datasets in barchart [\#1050](https://github.com/danielgindi/Charts/issues/1050) +- Issues with y axis values [\#1047](https://github.com/danielgindi/Charts/issues/1047) +- Marker out of view [\#1046](https://github.com/danielgindi/Charts/issues/1046) +- How to draw OHLC chart \( Open high low close \) ? [\#1045](https://github.com/danielgindi/Charts/issues/1045) +- How to achieve this effect [\#1044](https://github.com/danielgindi/Charts/issues/1044) +- Changing the size of the interception \(dots\) font in Line Chart ? [\#1043](https://github.com/danielgindi/Charts/issues/1043) +- Multiple entries of the same item in legend [\#1042](https://github.com/danielgindi/Charts/issues/1042) +- How to draw this bar Chart [\#1039](https://github.com/danielgindi/Charts/issues/1039) +- Right axis display decimals [\#1036](https://github.com/danielgindi/Charts/issues/1036) +- Crash on getMarkerPosition [\#1034](https://github.com/danielgindi/Charts/issues/1034) +- Set the bar at the top of the number animation [\#1033](https://github.com/danielgindi/Charts/issues/1033) +- Bar height is calculated wrong [\#1031](https://github.com/danielgindi/Charts/issues/1031) +- How to draw gridBackground by Dashed Line [\#1030](https://github.com/danielgindi/Charts/issues/1030) +- setVisibleYRangeMaximum puts line data off screen [\#1029](https://github.com/danielgindi/Charts/issues/1029) +- How to set max value of xAxis is last object of xVals [\#1028](https://github.com/danielgindi/Charts/issues/1028) +- Can't set text of Legend? [\#1027](https://github.com/danielgindi/Charts/issues/1027) +- conflict between auto scale and axis.axisMin/MaxValue [\#1026](https://github.com/danielgindi/Charts/issues/1026) +- Extend beyond values \(feature request\) [\#1025](https://github.com/danielgindi/Charts/issues/1025) +- Error: "Assignment to readonly property" when updating charts data [\#1024](https://github.com/danielgindi/Charts/issues/1024) +- Scrolling in a scroll view is blocked if the chart in the scroll view is not fully zoomed out. [\#1023](https://github.com/danielgindi/Charts/issues/1023) +- Print statements \(Logs\) [\#1021](https://github.com/danielgindi/Charts/issues/1021) +- How to get to the origin of the chartView.marker? [\#1020](https://github.com/danielgindi/Charts/issues/1020) +- Target Line for Bar Chart [\#1019](https://github.com/danielgindi/Charts/issues/1019) +- Different code between github and pod [\#1018](https://github.com/danielgindi/Charts/issues/1018) +- BarChart Can‘t display Markers [\#1017](https://github.com/danielgindi/Charts/issues/1017) +- Can't buliding in XCode7.1 [\#1016](https://github.com/danielgindi/Charts/issues/1016) +- Show Bar Borders in Combined Chart Demo Crash [\#1014](https://github.com/danielgindi/Charts/issues/1014) +- ChartDataEntry can't initialize with float value [\#1013](https://github.com/danielgindi/Charts/issues/1013) +- Override with Wrong Argument Label? [\#1009](https://github.com/danielgindi/Charts/issues/1009) +- On Y Axis "0" may be displayed as "-0" [\#1008](https://github.com/danielgindi/Charts/issues/1008) +- Change x-axis in bubble chart [\#1007](https://github.com/danielgindi/Charts/issues/1007) +- Change the width of chart [\#1005](https://github.com/danielgindi/Charts/issues/1005) +- OC project BalloonMarker.swift error [\#1004](https://github.com/danielgindi/Charts/issues/1004) +- How to let the Y axis shows is not only a number, but the custom string [\#1003](https://github.com/danielgindi/Charts/issues/1003) +- ask questions about CombinedChartViewController.h [\#1001](https://github.com/danielgindi/Charts/issues/1001) +- Crash when debug build, works on release build [\#999](https://github.com/danielgindi/Charts/issues/999) +- Demo crashed when running on phone\( iOS 9.0\),but can run on iPhone \(iOS 7.0\) [\#998](https://github.com/danielgindi/Charts/issues/998) +- Emergency Problem [\#996](https://github.com/danielgindi/Charts/issues/996) +- Radar Chart- Setting the maximum Y-Axis value. [\#994](https://github.com/danielgindi/Charts/issues/994) +- Y-Axis labels zooming issue [\#991](https://github.com/danielgindi/Charts/issues/991) +- XY Bubble Chart [\#990](https://github.com/danielgindi/Charts/issues/990) +- Adding text labels to Y- Axis? [\#988](https://github.com/danielgindi/Charts/issues/988) +- Build Failed: expression in list of expression [\#987](https://github.com/danielgindi/Charts/issues/987) +- autoScaleMinMaxEnabled does not work with Candle Charts [\#986](https://github.com/danielgindi/Charts/issues/986) +- gesture conflict when lineChartView in tableView [\#984](https://github.com/danielgindi/Charts/issues/984) +- Conflicting other pod depencies [\#983](https://github.com/danielgindi/Charts/issues/983) +- NaN makes highestVisibleXIndex crash [\#980](https://github.com/danielgindi/Charts/issues/980) +- Draw Horiztontal Line on Bar Chart [\#976](https://github.com/danielgindi/Charts/issues/976) +- Show empty Chart when there are no data [\#975](https://github.com/danielgindi/Charts/issues/975) +- Unexpected problem with Import Charts [\#973](https://github.com/danielgindi/Charts/issues/973) +- In which file can I edit the yaxis maximum??? [\#971](https://github.com/danielgindi/Charts/issues/971) +- Help with customizing [\#970](https://github.com/danielgindi/Charts/issues/970) +- Where and how can I set a y axis custom max value? [\#968](https://github.com/danielgindi/Charts/issues/968) +- The horizontal bar graph data values are exceeding the graph space. [\#967](https://github.com/danielgindi/Charts/issues/967) +- Where can I add data to my bar chart? [\#966](https://github.com/danielgindi/Charts/issues/966) +- Getting Error cannot load underlying module XCTest [\#965](https://github.com/danielgindi/Charts/issues/965) +- Don't show the horizontal line [\#964](https://github.com/danielgindi/Charts/issues/964) +- Where do I use the import line? [\#963](https://github.com/danielgindi/Charts/issues/963) +- changing bottom 'key' label? [\#962](https://github.com/danielgindi/Charts/issues/962) +- move "{" to the right side of last line [\#961](https://github.com/danielgindi/Charts/issues/961) +- Overriding Highlight [\#960](https://github.com/danielgindi/Charts/issues/960) +- hide values under 10% [\#959](https://github.com/danielgindi/Charts/issues/959) +- x axis label gets cut [\#958](https://github.com/danielgindi/Charts/issues/958) +- enlarge the spacing between the x axis labels to the y axis labels [\#957](https://github.com/danielgindi/Charts/issues/957) +- Cubic line chart is not full bleed [\#956](https://github.com/danielgindi/Charts/issues/956) +- Several properties work in emulator but don't \(or crash\) on iPhone [\#955](https://github.com/danielgindi/Charts/issues/955) +- Cannot pass in struct to ChartDataEntry [\#954](https://github.com/danielgindi/Charts/issues/954) +- A "divide by 0" bug [\#952](https://github.com/danielgindi/Charts/issues/952) +- Line Chart Dynamic Updating [\#951](https://github.com/danielgindi/Charts/issues/951) +- Updating version alters bar chart layout [\#950](https://github.com/danielgindi/Charts/issues/950) +- Bar chart floating y position [\#947](https://github.com/danielgindi/Charts/issues/947) +- setVisibleXRangeMinimum cause crash [\#946](https://github.com/danielgindi/Charts/issues/946) +- Carthage [\#942](https://github.com/danielgindi/Charts/issues/942) +- How to draw 2 lineCharts in a combinedChart? [\#939](https://github.com/danielgindi/Charts/issues/939) +- highlight last data in bar chart [\#938](https://github.com/danielgindi/Charts/issues/938) +- 我想用charts显示的数据为'int'类型 [\#936](https://github.com/danielgindi/Charts/issues/936) +- Don't see updates in PieChartDataSet from 2.2.4 [\#933](https://github.com/danielgindi/Charts/issues/933) +- Bubbles size of bubble chart [\#930](https://github.com/danielgindi/Charts/issues/930) +- Binding for Xamarin [\#929](https://github.com/danielgindi/Charts/issues/929) +- Line chart with 2 colours [\#928](https://github.com/danielgindi/Charts/issues/928) +- Disable top/bottom YAxis line drawing [\#927](https://github.com/danielgindi/Charts/issues/927) +- Coloring by bars and not by stacks in a StackBar chart [\#925](https://github.com/danielgindi/Charts/issues/925) +- How to set the scaling for the left/right axis. [\#924](https://github.com/danielgindi/Charts/issues/924) +- Use of undeclared 'CGFloat' [\#923](https://github.com/danielgindi/Charts/issues/923) +- Diffrent X-axis label color [\#921](https://github.com/danielgindi/Charts/issues/921) +- Vertical bar chart: capture of scrollView delegate callbacks and load additional data [\#920](https://github.com/danielgindi/Charts/issues/920) +- groupspace doesn't work [\#919](https://github.com/danielgindi/Charts/issues/919) +- Could the label of the LineChartDataSet be hidden [\#918](https://github.com/danielgindi/Charts/issues/918) +- if use pod Charts/Realm ,than @import Charts: could not build module "Charts" [\#917](https://github.com/danielgindi/Charts/issues/917) +- @import Charts: could not build module "Charts" [\#916](https://github.com/danielgindi/Charts/issues/916) +- LineChard with different color for filling [\#915](https://github.com/danielgindi/Charts/issues/915) +- start animation at minimum visible y-Position [\#914](https://github.com/danielgindi/Charts/issues/914) +- Line chart yAxis data interval [\#912](https://github.com/danielgindi/Charts/issues/912) +- Unable to display empty bars in barcharts [\#911](https://github.com/danielgindi/Charts/issues/911) +- Bar chart y axis interval digits [\#910](https://github.com/danielgindi/Charts/issues/910) +- How to use any chart in My App. [\#909](https://github.com/danielgindi/Charts/issues/909) +- Specifiy axisMinimum and axisMaximum range [\#908](https://github.com/danielgindi/Charts/issues/908) +- Symbol not Found on Xcode 7.3 [\#907](https://github.com/danielgindi/Charts/issues/907) +- noDataTextDescription not display [\#906](https://github.com/danielgindi/Charts/issues/906) +- Bar chart starting point non zero [\#905](https://github.com/danielgindi/Charts/issues/905) +- Do pod install with cocoapods [\#904](https://github.com/danielgindi/Charts/issues/904) +- Feature request :\) blur shadow for line chart [\#903](https://github.com/danielgindi/Charts/issues/903) +- Add Lines between labels [\#902](https://github.com/danielgindi/Charts/issues/902) +- Real number x axis line for BarChartView [\#901](https://github.com/danielgindi/Charts/issues/901) +- Piechart with vertical legend [\#840](https://github.com/danielgindi/Charts/issues/840) +- ChartEasingOption causes entire background to be filled with color [\#826](https://github.com/danielgindi/Charts/issues/826) +- Could not cast value of type 'Charts.BarChartData' \(0x10bbd31f0\) to 'MYPROJ.BarChartData' \(0x10aeed700\). [\#825](https://github.com/danielgindi/Charts/issues/825) +- BarChartView: Rectangle with borders and without filling color [\#822](https://github.com/danielgindi/Charts/issues/822) +- Is there any possibility for grouping x axis values in line chart? [\#798](https://github.com/danielgindi/Charts/issues/798) +- Being OSX too, should we rename repo to just `Charts`? [\#787](https://github.com/danielgindi/Charts/issues/787) +- Missing a piece of data to the left [\#785](https://github.com/danielgindi/Charts/issues/785) +- How to remove these white/gray lines [\#758](https://github.com/danielgindi/Charts/issues/758) +- If data is not set \(e.g. public var noDataText = "No chart data available."\) [\#756](https://github.com/danielgindi/Charts/issues/756) +- ChartEasingOption properties \(animate\) [\#726](https://github.com/danielgindi/Charts/issues/726) +- Moving pie chart location \(legend overlaps chart\) [\#707](https://github.com/danielgindi/Charts/issues/707) +- CombinedChartView bubbleData size not working [\#692](https://github.com/danielgindi/Charts/issues/692) +- Stop axis labels duplicating. [\#315](https://github.com/danielgindi/Charts/issues/315) +- Can we show Pie chart Value out of slice instead showing inside the slice ? [\#90](https://github.com/danielgindi/Charts/issues/90) +- Double tap to zoom into the chart should center to Point that was tapped [\#83](https://github.com/danielgindi/Charts/issues/83) + **Merged pull requests:** - Revert "Simple changes to allow OS X 10.10 support" [\#1088](https://github.com/danielgindi/Charts/pull/1088) ([danielgindi](https://github.com/danielgindi)) @@ -382,6 +3037,114 @@ [Full Changelog](https://github.com/danielgindi/Charts/compare/v2.2.3...v2.2.4) +**Fixed bugs:** + +- Cubic line goes over the last point [\#683](https://github.com/danielgindi/Charts/issues/683) +- drawCubicEnabled on LineChartView is missing points when Y Values are missing [\#157](https://github.com/danielgindi/Charts/issues/157) + +**Closed issues:** + +- can not run ChartsDemo. [\#900](https://github.com/danielgindi/Charts/issues/900) +- Barchart xAxis always displaying [\#899](https://github.com/danielgindi/Charts/issues/899) +- Multiple 'Charts.framework'. Build fails due to dependencies. [\#897](https://github.com/danielgindi/Charts/issues/897) +- Custom X Axis for BarChartView [\#896](https://github.com/danielgindi/Charts/issues/896) +- UISwipeGestureRecognizer for BarChartView [\#895](https://github.com/danielgindi/Charts/issues/895) +- The view hierarchy is not prepared for the constraint [\#893](https://github.com/danielgindi/Charts/issues/893) +- Could not find `Charts.framework` in the "Embedded Binaries" [\#891](https://github.com/danielgindi/Charts/issues/891) +- Barchart with diffrent width bar [\#890](https://github.com/danielgindi/Charts/issues/890) +- Weird numbers on BarChart [\#889](https://github.com/danielgindi/Charts/issues/889) +- Two line in X-Axis [\#888](https://github.com/danielgindi/Charts/issues/888) +- Set the leftAxis label color differently [\#885](https://github.com/danielgindi/Charts/issues/885) +- Could leftAxis and rightAxis's border be hidden? [\#884](https://github.com/danielgindi/Charts/issues/884) +- The barchart data not filled the whole container [\#883](https://github.com/danielgindi/Charts/issues/883) +- Barchart positive negtive label and xAxis overlapping [\#882](https://github.com/danielgindi/Charts/issues/882) +- How to remove the edge's border of time line chart filled shaped [\#881](https://github.com/danielgindi/Charts/issues/881) +- Master branch is not compiling [\#879](https://github.com/danielgindi/Charts/issues/879) +- App Submission - API analysis file too large [\#878](https://github.com/danielgindi/Charts/issues/878) +- Swift 2.2 [\#877](https://github.com/danielgindi/Charts/issues/877) +- avoidFirstLastClippingEnabled Still be clipped in CombinedChartView [\#876](https://github.com/danielgindi/Charts/issues/876) +- How to make the ChartXAxis has an offset between the zero point [\#875](https://github.com/danielgindi/Charts/issues/875) +- Carthage & Xcode 7.3 Pre-Built Binaries Error [\#874](https://github.com/danielgindi/Charts/issues/874) +- Scrolling glitch [\#873](https://github.com/danielgindi/Charts/issues/873) +- Request for enhancement: combined chart\(BarChart \(grouped DataSets\) and linechart\) [\#871](https://github.com/danielgindi/Charts/issues/871) +- CandleStickChartView.shadowColor [\#870](https://github.com/danielgindi/Charts/issues/870) +- Marker behind line limit [\#867](https://github.com/danielgindi/Charts/issues/867) +- Horizontal Chart Issue [\#866](https://github.com/danielgindi/Charts/issues/866) +- How to move data points with finger drag at run time. [\#865](https://github.com/danielgindi/Charts/issues/865) +- Chart customAxisMax and customAxisMin doesn't update correctly [\#864](https://github.com/danielgindi/Charts/issues/864) +- auto scale min/max option doesn't seem to change anything [\#863](https://github.com/danielgindi/Charts/issues/863) +- Confused as to how to install using CocoaPods [\#862](https://github.com/danielgindi/Charts/issues/862) +- Different spacing between same width bars in BarChartView [\#860](https://github.com/danielgindi/Charts/issues/860) +- Get color of the specify data? [\#859](https://github.com/danielgindi/Charts/issues/859) +- DrawCubicEnabled line starts from wrong position [\#855](https://github.com/danielgindi/Charts/issues/855) +- How to prevent xAxis values and dataset value get overlapped ? [\#854](https://github.com/danielgindi/Charts/issues/854) +- Program crash [\#853](https://github.com/danielgindi/Charts/issues/853) +- Zoomin Graphview [\#852](https://github.com/danielgindi/Charts/issues/852) +- Make ChartXAxisRenderer calculate labelsWidth based on string output by custom ChartXAxisValueFormatter [\#851](https://github.com/danielgindi/Charts/issues/851) +- Zooming an already zoomed view [\#850](https://github.com/danielgindi/Charts/issues/850) +- BarChart adds double x axis [\#849](https://github.com/danielgindi/Charts/issues/849) +- Remove text above dot in iOS Charts [\#848](https://github.com/danielgindi/Charts/issues/848) +- how to start graph from \(0,0\) points instead of 60 on y-Axis? [\#846](https://github.com/danielgindi/Charts/issues/846) +- Change dataSet axis dependency [\#845](https://github.com/danielgindi/Charts/issues/845) +- integrate native chart display incorrectly [\#842](https://github.com/danielgindi/Charts/issues/842) +- How can I draw bubble charts in swift project. [\#841](https://github.com/danielgindi/Charts/issues/841) +- Making HorizontalBarChartView scrolling vertically [\#839](https://github.com/danielgindi/Charts/issues/839) +- custom BallonMaker text [\#838](https://github.com/danielgindi/Charts/issues/838) +- Horizontal zoom in line chart [\#837](https://github.com/danielgindi/Charts/issues/837) +- ScatterChart - Is it possible to create a background color like this? [\#835](https://github.com/danielgindi/Charts/issues/835) +- How to create Stacked Bar Chart and Grouped Bar Chart [\#834](https://github.com/danielgindi/Charts/issues/834) +- fatal error: unexpectedly found nil while unwrapping an Optional value error when I set barChartView.noDataText [\#833](https://github.com/danielgindi/Charts/issues/833) +- Can I change fonts of labels on x And y axis in a bar graph. [\#832](https://github.com/danielgindi/Charts/issues/832) +- LineChartView avoid painting 0 values [\#830](https://github.com/danielgindi/Charts/issues/830) +- \[Feature\] Double-tap Gesture [\#829](https://github.com/danielgindi/Charts/issues/829) +- How to draw a rectangle,or how to get the last point's CGPoint? [\#827](https://github.com/danielgindi/Charts/issues/827) +- Changing width of the bar in bar chart [\#820](https://github.com/danielgindi/Charts/issues/820) +- The return value is a problem with the calculateMinimumRadiusForSpacedSlice method [\#819](https://github.com/danielgindi/Charts/issues/819) +- import Charts: Error No Such Module Charts? [\#818](https://github.com/danielgindi/Charts/issues/818) +- Can we define minor and major grid lines 
with specification like \(line color, line thickness, on/off \)? [\#817](https://github.com/danielgindi/Charts/issues/817) +- LineChart Delegate for line values [\#816](https://github.com/danielgindi/Charts/issues/816) +- Linechart X Labels overlap feature [\#813](https://github.com/danielgindi/Charts/issues/813) +- Can we support 2 more than y scales/ multiple Y axis ? [\#812](https://github.com/danielgindi/Charts/issues/812) +- Codesign error to physical device on latest [\#810](https://github.com/danielgindi/Charts/issues/810) +- Programatically scroll to end of line chart [\#809](https://github.com/danielgindi/Charts/issues/809) +- BalloonMarker - display X data [\#808](https://github.com/danielgindi/Charts/issues/808) +- multiple datasets with different x-values in chart [\#807](https://github.com/danielgindi/Charts/issues/807) +- Will ios-charts supoprt non-uniform data [\#806](https://github.com/danielgindi/Charts/issues/806) +- Not able to build for iPhone 6 [\#805](https://github.com/danielgindi/Charts/issues/805) +- Gap issues on latest version [\#804](https://github.com/danielgindi/Charts/issues/804) +- Error in 'ChartPlatform.swift' while compiling : Expected \#else or \#endif at the end of configuration block [\#803](https://github.com/danielgindi/Charts/issues/803) +- In iOS-Chart how to hide the x and y axis and all the grid lines. [\#801](https://github.com/danielgindi/Charts/issues/801) +- Create Chart from data in Firebase db [\#800](https://github.com/danielgindi/Charts/issues/800) +- How to make the chart and the other chart with the same translation [\#799](https://github.com/danielgindi/Charts/issues/799) +- Color of crosshairs? [\#796](https://github.com/danielgindi/Charts/issues/796) +- How to make horizontal dotted line to solid line same as vertical line. [\#793](https://github.com/danielgindi/Charts/issues/793) +- ios 8.1 fatal error:value failed to bridge from Swift type to a Objective-C type [\#792](https://github.com/danielgindi/Charts/issues/792) +- xAxis end label is cutting down in Line chart [\#791](https://github.com/danielgindi/Charts/issues/791) +- Is there a way to have multi line labels in x axis. [\#790](https://github.com/danielgindi/Charts/issues/790) +- help! [\#788](https://github.com/danielgindi/Charts/issues/788) +- Positioning on changing of the screen orientation [\#786](https://github.com/danielgindi/Charts/issues/786) +- Scatter chart data set color not working [\#784](https://github.com/danielgindi/Charts/issues/784) +- fatal error: value failed to bridge from Swift type to a Objective-C type [\#783](https://github.com/danielgindi/Charts/issues/783) +- Error on RadarChart \(drawFilledEnabled set to true\) [\#760](https://github.com/danielgindi/Charts/issues/760) +- Can't set x axis offset [\#677](https://github.com/danielgindi/Charts/issues/677) +- Right Y-Axis values displaying incorrectly in LineChartDemo [\#665](https://github.com/danielgindi/Charts/issues/665) +- Y - Axis Values stick together [\#608](https://github.com/danielgindi/Charts/issues/608) +- Charts over scrollview not scrolling in iPad only [\#550](https://github.com/danielgindi/Charts/issues/550) +- Stepped line charts [\#539](https://github.com/danielgindi/Charts/issues/539) +- Line chart circle positions [\#535](https://github.com/danielgindi/Charts/issues/535) +- Y-Axis values "stick together" occasionally [\#469](https://github.com/danielgindi/Charts/issues/469) +- Feature : initial display of the graph [\#468](https://github.com/danielgindi/Charts/issues/468) +- Candle Stick not filled make the stick and the gridline show within the candle [\#444](https://github.com/danielgindi/Charts/issues/444) +- Unit tests? ;\) [\#414](https://github.com/danielgindi/Charts/issues/414) +- How to draw a line only for the 5th value of dataset along x axis? [\#409](https://github.com/danielgindi/Charts/issues/409) +- Data Showing 0 and 1 only in y-axis if array contains only 0.0 double values. [\#338](https://github.com/danielgindi/Charts/issues/338) +- Extending lines between data points when zoomed and panning [\#330](https://github.com/danielgindi/Charts/issues/330) +- lowestVisibleXIndex never gets zero after zooming out [\#294](https://github.com/danielgindi/Charts/issues/294) +- on candle graph, when the candle is small then its not showing [\#281](https://github.com/danielgindi/Charts/issues/281) +- Bar Chart \> Range bar [\#100](https://github.com/danielgindi/Charts/issues/100) +- General discussion & news [\#92](https://github.com/danielgindi/Charts/issues/92) +- Core Data interfacing? [\#15](https://github.com/danielgindi/Charts/issues/15) + **Merged pull requests:** - remove duplicated statement [\#894](https://github.com/danielgindi/Charts/pull/894) ([liuxuan30](https://github.com/liuxuan30)) @@ -398,6 +3161,30 @@ [Full Changelog](https://github.com/danielgindi/Charts/compare/v2.2.2...v2.2.3) +**Closed issues:** + +- How to create the chartmarker with swift? [\#776](https://github.com/danielgindi/Charts/issues/776) +- CombinedChartView: Wrong positions of bars when using multiple Bar and Graph -Datasets [\#775](https://github.com/danielgindi/Charts/issues/775) +- Getting co-ordinates of all plotted points in LineChartView [\#774](https://github.com/danielgindi/Charts/issues/774) +- Multiline label on xAxis cutting off [\#773](https://github.com/danielgindi/Charts/issues/773) +- Can't set ChartViewBase's data property back to nil to clear out data [\#771](https://github.com/danielgindi/Charts/issues/771) +- How to set position label radar chart. in Swift . [\#770](https://github.com/danielgindi/Charts/issues/770) +- How to control which entries on xAxis be shown? [\#768](https://github.com/danielgindi/Charts/issues/768) +- Tests failing after startAtZero was removed [\#767](https://github.com/danielgindi/Charts/issues/767) +- When a value repeats, bars are not showed [\#766](https://github.com/danielgindi/Charts/issues/766) +- Proposal: shall we unify yAxis.entries and yAxis.axisRange to have same max and min value? [\#763](https://github.com/danielgindi/Charts/issues/763) +- Ability to set linechart with fixed amount of x values shown and pan to other data points [\#762](https://github.com/danielgindi/Charts/issues/762) +- PieChart setMaxAngle [\#757](https://github.com/danielgindi/Charts/issues/757) +- Simply not installing [\#749](https://github.com/danielgindi/Charts/issues/749) +- Line charts have unintended breaks when next or previous point not visible. [\#748](https://github.com/danielgindi/Charts/issues/748) +- Remove border around linechart with gradient fill [\#747](https://github.com/danielgindi/Charts/issues/747) +- Old graphics not removed when adding new data [\#745](https://github.com/danielgindi/Charts/issues/745) +- Display values outside of the piechart [\#743](https://github.com/danielgindi/Charts/issues/743) +- Cubic line charts don't get filled correctly if data doesn't start at index 0 [\#711](https://github.com/danielgindi/Charts/issues/711) +- Center text vertically [\#682](https://github.com/danielgindi/Charts/issues/682) +- Animated moveViewToX\(\) [\#318](https://github.com/danielgindi/Charts/issues/318) +- Any chance of porting this to OSX? [\#43](https://github.com/danielgindi/Charts/issues/43) + **Merged pull requests:** - Add "Toggle Data" option to demo charts. \(\#771 Support\) [\#781](https://github.com/danielgindi/Charts/pull/781) ([ospr](https://github.com/ospr)) @@ -415,6 +3202,21 @@ [Full Changelog](https://github.com/danielgindi/Charts/compare/v2.2.1...v2.2.2) +**Fixed bugs:** + +- Using BarChartDataSet default initializer causes a crash [\#734](https://github.com/danielgindi/Charts/issues/734) + +**Closed issues:** + +- Display dataSet labels on axis for horizontal bar [\#741](https://github.com/danielgindi/Charts/issues/741) +- Getting x,y values of points in LineChart [\#739](https://github.com/danielgindi/Charts/issues/739) +- Module 'Realm' not found in v2.2.1 [\#735](https://github.com/danielgindi/Charts/issues/735) +- cannot compile ios charts because of Ream environment missing. [\#733](https://github.com/danielgindi/Charts/issues/733) +- Issue in valueFormatter [\#732](https://github.com/danielgindi/Charts/issues/732) +- Multi colors for linechart's circles [\#730](https://github.com/danielgindi/Charts/issues/730) +- LineChartData omits and misaligns values when data isn't continuous [\#728](https://github.com/danielgindi/Charts/issues/728) +- Apache license and correct attribution in an iOS app? [\#678](https://github.com/danielgindi/Charts/issues/678) + ## [v2.2.1](https://github.com/danielgindi/Charts/tree/v2.2.1) (2016-02-01) [Full Changelog](https://github.com/danielgindi/Charts/compare/2.2.1...v2.2.1) @@ -423,6 +3225,24 @@ [Full Changelog](https://github.com/danielgindi/Charts/compare/v2.2.0...2.2.1) +**Fixed bugs:** + +- Can't set hole color to nil for Pie Chart [\#646](https://github.com/danielgindi/Charts/issues/646) + +**Closed issues:** + +- X-Axis at bottom of chart? [\#727](https://github.com/danielgindi/Charts/issues/727) +- 2.2.0 not published yet [\#723](https://github.com/danielgindi/Charts/issues/723) +- Highlight selected line by changing line width or line color [\#721](https://github.com/danielgindi/Charts/issues/721) +- Draw a Line that connects dots in Scatter Chart \(Simulate Line Chart not equidistant\) [\#720](https://github.com/danielgindi/Charts/issues/720) +- drawCubicEnabled performance issues [\#717](https://github.com/danielgindi/Charts/issues/717) +- how to disable zooming of graph on double click? [\#716](https://github.com/danielgindi/Charts/issues/716) +- Convert it to percent bar graph system [\#674](https://github.com/danielgindi/Charts/issues/674) +- Refresh charts view when the data change [\#672](https://github.com/danielgindi/Charts/issues/672) +- The most top label of ChartYAxis doesn't render which seems a bug. [\#647](https://github.com/danielgindi/Charts/issues/647) +- RadarChart animation [\#574](https://github.com/danielgindi/Charts/issues/574) +- Having the area below a line graph be gradient layer instead of background color [\#186](https://github.com/danielgindi/Charts/issues/186) + **Merged pull requests:** - Update podspec for realm and 2.2.0 [\#725](https://github.com/danielgindi/Charts/pull/725) ([petester42](https://github.com/petester42)) @@ -431,6 +3251,133 @@ [Full Changelog](https://github.com/danielgindi/Charts/compare/v2.1.6...v2.2.0) +**Fixed bugs:** + +- ChartDataSet calcYValueSum\(\) bug [\#604](https://github.com/danielgindi/Charts/issues/604) + +**Closed issues:** + +- Realm module not found when using a static library of Realm in my pod project in Objective-C [\#714](https://github.com/danielgindi/Charts/issues/714) +- how to get a custom legend [\#710](https://github.com/danielgindi/Charts/issues/710) +- I can't change the default grey background on the line chart [\#706](https://github.com/danielgindi/Charts/issues/706) +- I couldn't find Charts.xcodeproj [\#705](https://github.com/danielgindi/Charts/issues/705) +- Background Colour Changes [\#701](https://github.com/danielgindi/Charts/issues/701) +- Continuing the last closed \#695 [\#700](https://github.com/danielgindi/Charts/issues/700) +- Realm error [\#699](https://github.com/danielgindi/Charts/issues/699) +- Grid with constant width cells [\#697](https://github.com/danielgindi/Charts/issues/697) +- Pie chart is too small in tableview header view [\#696](https://github.com/danielgindi/Charts/issues/696) +- The delegate method is not getting called [\#695](https://github.com/danielgindi/Charts/issues/695) +- Not compatible with app extensions as a framework [\#693](https://github.com/danielgindi/Charts/issues/693) +- Set label for each column in group bar chart [\#691](https://github.com/danielgindi/Charts/issues/691) +- How to custom XAxis [\#689](https://github.com/danielgindi/Charts/issues/689) +- Need Help to setup this library on application with Objective C\(No auto layout\) with deployment target iOS 7.0 [\#688](https://github.com/danielgindi/Charts/issues/688) +- RadarChartView - Unknown type name [\#687](https://github.com/danielgindi/Charts/issues/687) +- How to make CandleStickChart and BarChart do the same action [\#685](https://github.com/danielgindi/Charts/issues/685) +- Issue with x-axis fixed label width [\#684](https://github.com/danielgindi/Charts/issues/684) +- Can I package the project in a dynamic library \(.framework\)? [\#681](https://github.com/danielgindi/Charts/issues/681) +- Dynamic LineChartView [\#680](https://github.com/danielgindi/Charts/issues/680) +- Horizontal Bar Chart Rounding [\#676](https://github.com/danielgindi/Charts/issues/676) +- Line Chart Highlight Styling [\#671](https://github.com/danielgindi/Charts/issues/671) +- Allow control of circle line width in Line Chart. [\#669](https://github.com/danielgindi/Charts/issues/669) +- Programatically highlight a data point in line chart [\#668](https://github.com/danielgindi/Charts/issues/668) +- Question: X-Axis set range of displayed entries, LineChart [\#667](https://github.com/danielgindi/Charts/issues/667) +- "No such module" error for archive with custom configuration in objc project. [\#664](https://github.com/danielgindi/Charts/issues/664) +- How to run this chart in iOS7? [\#663](https://github.com/danielgindi/Charts/issues/663) +- draw only the maximum and minimum values on the LineChartView [\#662](https://github.com/danielgindi/Charts/issues/662) +- Combine horizontal bar chart and line chart [\#661](https://github.com/danielgindi/Charts/issues/661) +- Can't import charts in Swift [\#659](https://github.com/danielgindi/Charts/issues/659) +- Realtime data [\#657](https://github.com/danielgindi/Charts/issues/657) +- xcode7.2 iOS 9 crash [\#656](https://github.com/danielgindi/Charts/issues/656) +- draw line chart with Gradient background [\#653](https://github.com/danielgindi/Charts/issues/653) +- Draw Straight Line on Line Chart with 2 fingers and show the Gradient of it [\#652](https://github.com/danielgindi/Charts/issues/652) +- Add To existing project and that too for iOS 7 [\#650](https://github.com/danielgindi/Charts/issues/650) +- xcode 7.1 error at xctest [\#644](https://github.com/danielgindi/Charts/issues/644) +- How to work out this in objective c [\#642](https://github.com/danielgindi/Charts/issues/642) +- 【StackedBarChartView】How to handle 0? [\#637](https://github.com/danielgindi/Charts/issues/637) +- Not able to archive build : Command failed due to signal: Segmentation fault: 11 [\#634](https://github.com/danielgindi/Charts/issues/634) +- Xcode7.1.1 contains error [\#633](https://github.com/danielgindi/Charts/issues/633) +- ChartDataSet's entryCount computed property raises a signal when \_yVals is nil [\#631](https://github.com/danielgindi/Charts/issues/631) +- Not able to set custom class as a BarChartViewController in objective c [\#628](https://github.com/danielgindi/Charts/issues/628) +- I want to know the project name - swift. h class of how to generate [\#627](https://github.com/danielgindi/Charts/issues/627) +- LineChart xAxis can't match the point [\#626](https://github.com/danielgindi/Charts/issues/626) +- set width of highlight in pie [\#625](https://github.com/danielgindi/Charts/issues/625) +- what's wrong with:\_OBJC\_CLASS\_$\_\_TtC6Charts13LineChartView [\#623](https://github.com/danielgindi/Charts/issues/623) +- How to draw a LineChartDataSet skipping certain data points [\#622](https://github.com/danielgindi/Charts/issues/622) +- Show % Percentage value with Legend data [\#621](https://github.com/danielgindi/Charts/issues/621) +- \[Enhancement\] avoidFirstLastClipping should keep the labels centered [\#619](https://github.com/danielgindi/Charts/issues/619) +- yAxis label shows only when i touch the view [\#618](https://github.com/danielgindi/Charts/issues/618) +- Legend colors not correct [\#617](https://github.com/danielgindi/Charts/issues/617) +- \[suggestion\] Warning when wrong ChartDataSet is used for view [\#616](https://github.com/danielgindi/Charts/issues/616) +- How to make the chart and the other chart with the same action [\#615](https://github.com/danielgindi/Charts/issues/615) +- touchesEnded event in BarChartView not called [\#613](https://github.com/danielgindi/Charts/issues/613) +- I put the deployment of XCODE target to 8.0 is an error, but change to 8.3 won't go wrong, what's the matter? [\#612](https://github.com/danielgindi/Charts/issues/612) +- why drawValues has some condition which uses break, some uses continue? [\#611](https://github.com/danielgindi/Charts/issues/611) +- Real Time Data and Moving X happens automatically ? [\#610](https://github.com/danielgindi/Charts/issues/610) +- A way to add data to chart data entries in real time ? [\#609](https://github.com/danielgindi/Charts/issues/609) +- Min and max number of horizontal lines [\#603](https://github.com/danielgindi/Charts/issues/603) +- Pie Chart only one Legend data is visible [\#602](https://github.com/danielgindi/Charts/issues/602) +- Myproject-swift.h has not founded in my project why?? [\#599](https://github.com/danielgindi/Charts/issues/599) +- Charts pulled from cocoapods is still of version 2.1.3 and it has compile errors against Swift 2.0 [\#598](https://github.com/danielgindi/Charts/issues/598) +- Fetch Stack Label at the click of the stack bar in the bar chart [\#596](https://github.com/danielgindi/Charts/issues/596) +- Cannot load underlying module for 'XCTest' when i am using charts in xcode7.1 [\#595](https://github.com/danielgindi/Charts/issues/595) +- setLabelsToSkip does not seem to function properly [\#594](https://github.com/danielgindi/Charts/issues/594) +- Work around for scalable xaxis for line chart [\#593](https://github.com/danielgindi/Charts/issues/593) +- unknown class Issue [\#592](https://github.com/danielgindi/Charts/issues/592) +- Selective fill colors on LineChartView [\#591](https://github.com/danielgindi/Charts/issues/591) +- how to set the YAxis or XAxis for custom value [\#590](https://github.com/danielgindi/Charts/issues/590) +- Finger drawing \(draw values into the chart with touch-gesture\) implemented? [\#589](https://github.com/danielgindi/Charts/issues/589) +- how to limit the YAxis Label's width? [\#588](https://github.com/danielgindi/Charts/issues/588) +- how to combine chart as follows [\#587](https://github.com/danielgindi/Charts/issues/587) +- no data available [\#585](https://github.com/danielgindi/Charts/issues/585) +- Is there a way to add arrows to highlight line? [\#584](https://github.com/danielgindi/Charts/issues/584) +- Getting question \(?\) mark while importing the library. How to get it resolved [\#583](https://github.com/danielgindi/Charts/issues/583) +- Mixed Font Style for Line Chart of X-Axis [\#581](https://github.com/danielgindi/Charts/issues/581) +- How to remove background gridlines from Bar Chart [\#579](https://github.com/danielgindi/Charts/issues/579) +- Question: Gesture Detection [\#578](https://github.com/danielgindi/Charts/issues/578) +- Crash originating in ChartViewPortHandler [\#576](https://github.com/danielgindi/Charts/issues/576) +- Add gaps in LineChart [\#572](https://github.com/danielgindi/Charts/issues/572) +- Cannot call getBarBounds from objective-c [\#570](https://github.com/danielgindi/Charts/issues/570) +- issue with Bar width [\#569](https://github.com/danielgindi/Charts/issues/569) +- UIPanGesture blocked while zoomed out completely [\#566](https://github.com/danielgindi/Charts/issues/566) +- Using Charts library for real-time plotting [\#565](https://github.com/danielgindi/Charts/issues/565) +- iOS-Charts not working on Jenkins [\#564](https://github.com/danielgindi/Charts/issues/564) +- Swift 2 \(Xcode 7\) Bad address on accessing chart view [\#563](https://github.com/danielgindi/Charts/issues/563) +- Custom offsets [\#562](https://github.com/danielgindi/Charts/issues/562) +- iOS 7 && Xcode 7.1.1 build not success, 'Charts' Module no found [\#560](https://github.com/danielgindi/Charts/issues/560) +- ChartYAxisValueFormatter in iOS [\#559](https://github.com/danielgindi/Charts/issues/559) +- can i add this? [\#557](https://github.com/danielgindi/Charts/issues/557) +- Problem uploading the archive. [\#556](https://github.com/danielgindi/Charts/issues/556) +- A strange issue when the APP second launch in debug mode [\#554](https://github.com/danielgindi/Charts/issues/554) +- Auto-adjusting graph scale on moving [\#553](https://github.com/danielgindi/Charts/issues/553) +- Bar Chart view group in Swift [\#551](https://github.com/danielgindi/Charts/issues/551) +- how to change the bar width [\#549](https://github.com/danielgindi/Charts/issues/549) +- Calculating space \(in px\) between two points [\#548](https://github.com/danielgindi/Charts/issues/548) +- CocoaPods can only install Charts with Version `2.1.3` [\#547](https://github.com/danielgindi/Charts/issues/547) +- App didn't started with Charts [\#546](https://github.com/danielgindi/Charts/issues/546) +- Setting custom values on top of bar chart [\#545](https://github.com/danielgindi/Charts/issues/545) +- Issues submitting app to Apple store [\#544](https://github.com/danielgindi/Charts/issues/544) +- Guidance on scrollable/pannable charts [\#543](https://github.com/danielgindi/Charts/issues/543) +- Line chart in tableview cell [\#542](https://github.com/danielgindi/Charts/issues/542) +- center lineChart value label to circle [\#541](https://github.com/danielgindi/Charts/issues/541) +- Use LineChartView create chartview will not slide, [\#540](https://github.com/danielgindi/Charts/issues/540) +- Getting some interesting errors when trying to upload our project to ITC with the latest ios-charts. [\#538](https://github.com/danielgindi/Charts/issues/538) +- Running demo direct error, this is how it happened [\#536](https://github.com/danielgindi/Charts/issues/536) +- StackLabels [\#534](https://github.com/danielgindi/Charts/issues/534) +- Legend at bottom of graph show on more than one line. [\#532](https://github.com/danielgindi/Charts/issues/532) +- Do we have any static library for ios-charts? [\#531](https://github.com/danielgindi/Charts/issues/531) +- Highlight a label in xAxis [\#530](https://github.com/danielgindi/Charts/issues/530) +- BalloonMarker shows float number with many digits after '.' [\#529](https://github.com/danielgindi/Charts/issues/529) +- Get the visible max and min yAxis values [\#528](https://github.com/danielgindi/Charts/issues/528) +- Scale and displacement by code [\#527](https://github.com/danielgindi/Charts/issues/527) +- My own app is crashed and got error is fatal error: value failed to bridge from Swift type to a Objective-C type [\#525](https://github.com/danielgindi/Charts/issues/525) +- if I want to set the RadarLabel like this! [\#524](https://github.com/danielgindi/Charts/issues/524) +- Pie Chart Legends Missing with the dynamically filled data. [\#518](https://github.com/danielgindi/Charts/issues/518) +- Resize chart due to data update [\#517](https://github.com/danielgindi/Charts/issues/517) +- How to detect end of chart event? [\#508](https://github.com/danielgindi/Charts/issues/508) +- Cannot distribute inhouse build with ios-charts library embedded to my project [\#486](https://github.com/danielgindi/Charts/issues/486) +- Excessive Printing to Console [\#417](https://github.com/danielgindi/Charts/issues/417) +- Module is not extensible [\#357](https://github.com/danielgindi/Charts/issues/357) + **Merged pull requests:** - Activate require app extension safe API to be able to use library inside an app extension [\#708](https://github.com/danielgindi/Charts/pull/708) ([ghost](https://github.com/ghost)) @@ -452,6 +3399,41 @@ [Full Changelog](https://github.com/danielgindi/Charts/compare/v2.1.5...v2.1.6) +**Implemented enhancements:** + +- X axis names visibility \(Rotation\) [\#61](https://github.com/danielgindi/Charts/issues/61) + +**Closed issues:** + +- hello,this library is very great!!! [\#523](https://github.com/danielgindi/Charts/issues/523) +- \[BUG\] highlight when triggering pan gesture in default scale not working [\#520](https://github.com/danielgindi/Charts/issues/520) +- Implementing Gestures [\#519](https://github.com/danielgindi/Charts/issues/519) +- Does ios-charts work for Mac Cocoa programming? [\#516](https://github.com/danielgindi/Charts/issues/516) +- No 'setHighlightPerTapEnabled\(boolean enabled\)' in iosCharts? [\#515](https://github.com/danielgindi/Charts/issues/515) +- This application is modifying the autolayout engine from a background thread, which can lead to engine corruption and weird crashes. This will cause an exception in a future release. [\#514](https://github.com/danielgindi/Charts/issues/514) +- How to set position of description? [\#512](https://github.com/danielgindi/Charts/issues/512) +- Can't update library to 2.1.5 by cocoapods [\#511](https://github.com/danielgindi/Charts/issues/511) +- How in your chart on the basis of the modified? [\#510](https://github.com/danielgindi/Charts/issues/510) +- How can I reset bargraph total width ? [\#509](https://github.com/danielgindi/Charts/issues/509) +- ComboChartView highlight [\#507](https://github.com/danielgindi/Charts/issues/507) +- Making a line chart set with images on the chart [\#506](https://github.com/danielgindi/Charts/issues/506) +- the text rotation (Cry for help) [\#505](https://github.com/danielgindi/Charts/issues/505) +- StackedBar Chart highlighting complete single bar [\#504](https://github.com/danielgindi/Charts/issues/504) +- LineChart crashes if no entries [\#496](https://github.com/danielgindi/Charts/issues/496) +- Background color and floats on Y axis. [\#495](https://github.com/danielgindi/Charts/issues/495) +- Facing problem while achieving the build on Xcode7 [\#492](https://github.com/danielgindi/Charts/issues/492) +- About method setCircleColor & setCircleHoleColor [\#491](https://github.com/danielgindi/Charts/issues/491) +- inner web lines missing. [\#490](https://github.com/danielgindi/Charts/issues/490) +- Positioning using screen points instead of xIndex [\#487](https://github.com/danielgindi/Charts/issues/487) +- Selectable marker view & images at Y axis [\#485](https://github.com/danielgindi/Charts/issues/485) +- Could you draw a discontinuous line? [\#484](https://github.com/danielgindi/Charts/issues/484) +- Using image as marker in the chart [\#483](https://github.com/danielgindi/Charts/issues/483) +- Line chart can set the position of the x axis, such as in the chart below [\#482](https://github.com/danielgindi/Charts/issues/482) +- ```xAxis.avoidFirstLastClippingEnabled=YES``` problem.Version 2.1.4a [\#479](https://github.com/danielgindi/Charts/issues/479) +- Zombie exception [\#477](https://github.com/danielgindi/Charts/issues/477) +- chartView does't overlay with dark color highlighted value in bar chart [\#449](https://github.com/danielgindi/Charts/issues/449) +- viewPortHandler.setMaximumScaleX not working for horizontal bar chart [\#256](https://github.com/danielgindi/Charts/issues/256) + **Merged pull requests:** - Implemented support for rotated labels on the x-axis [\#513](https://github.com/danielgindi/Charts/pull/513) ([danielgindi](https://github.com/danielgindi)) @@ -469,6 +3451,46 @@ [Full Changelog](https://github.com/danielgindi/Charts/compare/v2.1.4a...v2.1.5) +**Fixed bugs:** + +- chart is scrolling to top when reach maxScaleY and try zoom in again [\#463](https://github.com/danielgindi/Charts/issues/463) +- Pie chart does not work well with separate animations on x and y axis simultaneously [\#456](https://github.com/danielgindi/Charts/issues/456) + +**Closed issues:** + +- YAxis size calculations [\#480](https://github.com/danielgindi/Charts/issues/480) +- Can't install app due to non matching architecture. [\#476](https://github.com/danielgindi/Charts/issues/476) +- compiling for iPhone4s gives error like \#344 [\#475](https://github.com/danielgindi/Charts/issues/475) +- Compilation issue [\#473](https://github.com/danielgindi/Charts/issues/473) +- Problem with marker in Swift [\#472](https://github.com/danielgindi/Charts/issues/472) +- Crash: function signature specialization \ of Charts.BarLineChartViewBase.calcModulus \(Charts.BarLineChartViewBase\)\(\) -\> \(\), line 444 [\#471](https://github.com/danielgindi/Charts/issues/471) +- Pinch to Zoom is not being disabled properly. [\#470](https://github.com/danielgindi/Charts/issues/470) +- how to draw a graph having x value but no values in y [\#467](https://github.com/danielgindi/Charts/issues/467) +- Why set barRect.size.height = bottom - top to be negative? [\#465](https://github.com/danielgindi/Charts/issues/465) +- swift 1.2 branch [\#459](https://github.com/danielgindi/Charts/issues/459) +- Has anyone meet the '\# has been removed from swift' problem under XCode version 7.0.1? [\#458](https://github.com/danielgindi/Charts/issues/458) +- Multiple negative-able values in Stack bar chart [\#455](https://github.com/danielgindi/Charts/issues/455) +- Limit Line Label Text Color [\#454](https://github.com/danielgindi/Charts/issues/454) +- problems using autoScaleMinMaxEnabled [\#453](https://github.com/danielgindi/Charts/issues/453) +- how to update the ios-charts in existing projects. [\#452](https://github.com/danielgindi/Charts/issues/452) +- Provide callbacks on ChartViewDelegate to better handle dragging, touch, etc [\#451](https://github.com/danielgindi/Charts/issues/451) +- moveViewToX problem [\#450](https://github.com/danielgindi/Charts/issues/450) +- bar width [\#448](https://github.com/danielgindi/Charts/issues/448) +- Can we show title of Axis? [\#447](https://github.com/danielgindi/Charts/issues/447) +- Make \_chart in CombinedChartRenderer internal [\#446](https://github.com/danielgindi/Charts/issues/446) +- Dynamic graph display [\#445](https://github.com/danielgindi/Charts/issues/445) +- Demo project is not working [\#443](https://github.com/danielgindi/Charts/issues/443) +- xcode 7 issue? - non-existent file for the CFBundleExecutable key [\#442](https://github.com/danielgindi/Charts/issues/442) +- Custom Y Axis entries with String values [\#441](https://github.com/danielgindi/Charts/issues/441) +- Change size of the view that contain the chart [\#440](https://github.com/danielgindi/Charts/issues/440) +- Label lines with different style, larger and not for all lines in grid [\#439](https://github.com/danielgindi/Charts/issues/439) +- Pie chart data labels not in correct position. [\#436](https://github.com/danielgindi/Charts/issues/436) +- Glitch while scrolling [\#430](https://github.com/danielgindi/Charts/issues/430) +- A field crash issue for highestVisibleXIndex [\#329](https://github.com/danielgindi/Charts/issues/329) +- Empty configuration over full configuration [\#308](https://github.com/danielgindi/Charts/issues/308) +- \[BarChart\] single dataSet + force groupSpace=0.8 leads to wrong xAxis label rendering and highlight [\#284](https://github.com/danielgindi/Charts/issues/284) +- Prebuilt Frameworks & Tagged Releases [\#217](https://github.com/danielgindi/Charts/issues/217) + **Merged pull requests:** - Changed \_chart access modifier from private to internal [\#478](https://github.com/danielgindi/Charts/pull/478) ([AlBirdie](https://github.com/AlBirdie)) @@ -480,6 +3502,53 @@ [Full Changelog](https://github.com/danielgindi/Charts/compare/v2.1.4...v2.1.4a) +**Fixed bugs:** + +- CGContextAddLineToPoint no current point. [\#419](https://github.com/danielgindi/Charts/issues/419) +- Crash by initialize\(\) of CombinedChartView [\#406](https://github.com/danielgindi/Charts/issues/406) +- Radar chart + Bar Line chart Base + startAtZeroEnabled = false + negative values [\#166](https://github.com/danielgindi/Charts/issues/166) + +**Closed issues:** + +- RadarChart \(spider web chart\) issue [\#435](https://github.com/danielgindi/Charts/issues/435) +- dyld\_fatal\_error [\#434](https://github.com/danielgindi/Charts/issues/434) +- Xcode 6.4 compilation errors [\#433](https://github.com/danielgindi/Charts/issues/433) +- Error: Can't build demo project with XCode Version 6.4 \(6E35b\) [\#431](https://github.com/danielgindi/Charts/issues/431) +- Custom ChartXAxisValueFormatter not Being Called with Data containing NSObjects [\#429](https://github.com/danielgindi/Charts/issues/429) +- Error Swift 2 - ChartViewBase.swift [\#428](https://github.com/danielgindi/Charts/issues/428) +- How to return xIndex that be selected in chart? [\#427](https://github.com/danielgindi/Charts/issues/427) +- always return 0 in chartValueSelected function [\#426](https://github.com/danielgindi/Charts/issues/426) +- Radar Chart can not open in Charts Demo project [\#424](https://github.com/danielgindi/Charts/issues/424) +- ScatterChartRenderer - create a custom shape [\#423](https://github.com/danielgindi/Charts/issues/423) +- How to add custom text to the diagram [\#421](https://github.com/danielgindi/Charts/issues/421) +- App/Xcode crashing when charts are loaded [\#410](https://github.com/danielgindi/Charts/issues/410) +- Max Y value sometimes get clipped [\#405](https://github.com/danielgindi/Charts/issues/405) +- Display X-axis and y-axis names and Can i display x axis values vertically [\#403](https://github.com/danielgindi/Charts/issues/403) +- How to show time values in horizontal Bar chart? [\#402](https://github.com/danielgindi/Charts/issues/402) +- ios 9 - xcode 7 [\#400](https://github.com/danielgindi/Charts/issues/400) +- bar chart with gradient [\#398](https://github.com/danielgindi/Charts/issues/398) +- Multiple Lines in LineChart. [\#397](https://github.com/danielgindi/Charts/issues/397) +- Line Graph error [\#396](https://github.com/danielgindi/Charts/issues/396) +- Charts running on Simulator only [\#381](https://github.com/danielgindi/Charts/issues/381) +- Multiple axis - line charts drawing [\#366](https://github.com/danielgindi/Charts/issues/366) +- Marker frame adjustment according to bounds [\#364](https://github.com/danielgindi/Charts/issues/364) +- Sequencing of legend titles [\#363](https://github.com/danielgindi/Charts/issues/363) +- Legend has only one label [\#361](https://github.com/danielgindi/Charts/issues/361) +- Can add the missing value support [\#355](https://github.com/danielgindi/Charts/issues/355) +- CombinedChartView line + bar [\#353](https://github.com/danielgindi/Charts/issues/353) +- drawFillEnabled in line chart bug? [\#351](https://github.com/danielgindi/Charts/issues/351) +- \[BUG\] highlighted bar animation on Y Axis for all bar charts is wrong and not same speed [\#349](https://github.com/danielgindi/Charts/issues/349) +- HELP : some problem never met about iOS-charts [\#341](https://github.com/danielgindi/Charts/issues/341) +- Multiple line Chart, same view [\#340](https://github.com/danielgindi/Charts/issues/340) +- Position Pie Chart over the View [\#337](https://github.com/danielgindi/Charts/issues/337) +- Having multiple colour bands with an area that changes dynamically over time [\#336](https://github.com/danielgindi/Charts/issues/336) +- Adding Large number of data points -- addEntry\(\) [\#333](https://github.com/danielgindi/Charts/issues/333) +- Can I implement this kind of chart with this library? [\#328](https://github.com/danielgindi/Charts/issues/328) +- iOS Chart Y-Axis High Limit [\#317](https://github.com/danielgindi/Charts/issues/317) +- how to place the Y axis label at the bottom of the chart? [\#314](https://github.com/danielgindi/Charts/issues/314) +- Real-time Charts [\#263](https://github.com/danielgindi/Charts/issues/263) +- Drawing circles for values on the radar chart [\#138](https://github.com/danielgindi/Charts/issues/138) + **Merged pull requests:** - Start of pan gesture should not be cancelled by no drag [\#420](https://github.com/danielgindi/Charts/pull/420) ([niraj-rayalla](https://github.com/niraj-rayalla)) @@ -492,6 +3561,82 @@ [Full Changelog](https://github.com/danielgindi/Charts/compare/v2.1.3...v2.1.4) +**Fixed bugs:** + +- UIPanGestureRecognizer causes index out of bounds crash [\#327](https://github.com/danielgindi/Charts/issues/327) +- Radar chart radius is still affected by label size when label drawing is disabled [\#153](https://github.com/danielgindi/Charts/issues/153) +- XGrid not in sync for identical x values but different chart types [\#99](https://github.com/danielgindi/Charts/issues/99) + +**Closed issues:** + +- Xcode 7 and iOS 9 Support \(Deployment Target iOS 7.0\) [\#404](https://github.com/danielgindi/Charts/issues/404) +- Legend titles aren't printing if there are more than 5 [\#401](https://github.com/danielgindi/Charts/issues/401) +- Swift 2.0 branch not found [\#399](https://github.com/danielgindi/Charts/issues/399) +- Values are not drawn in the correct location when the y-axis does not start at zero [\#391](https://github.com/danielgindi/Charts/issues/391) +- Swift-2.0 branch runtime crashes after distributed on the TestFlight [\#390](https://github.com/danielgindi/Charts/issues/390) +- ios-charts Integration problem [\#389](https://github.com/danielgindi/Charts/issues/389) +- Can't change X-axis label color [\#387](https://github.com/danielgindi/Charts/issues/387) +- StackedBarChart in horizontal manner [\#384](https://github.com/danielgindi/Charts/issues/384) +- Add ios-charts to existing project in XCode 7 [\#383](https://github.com/danielgindi/Charts/issues/383) +- Xcode7 Swift 2.0 issue \[ChartSelectionDetail.swift\] [\#380](https://github.com/danielgindi/Charts/issues/380) +- Installing ios-charts in an existing project [\#379](https://github.com/danielgindi/Charts/issues/379) +- I upgraded my UXcode 7,I can't use charts framework. [\#378](https://github.com/danielgindi/Charts/issues/378) +- How to achieve 0 spacing between bars? [\#365](https://github.com/danielgindi/Charts/issues/365) +- Xcode 7.0 and Swift 2.0 issue [\#358](https://github.com/danielgindi/Charts/issues/358) +- Unable to run a demo [\#356](https://github.com/danielgindi/Charts/issues/356) +- Using Embedded Binaries giving build failed error in xcode 7 ? [\#354](https://github.com/danielgindi/Charts/issues/354) +- is there a object-c version this project? [\#352](https://github.com/danielgindi/Charts/issues/352) +- adding cross platform feature [\#350](https://github.com/danielgindi/Charts/issues/350) +- Some problems about CandleStickChart [\#348](https://github.com/danielgindi/Charts/issues/348) +- Some problems about CandleStickChart [\#347](https://github.com/danielgindi/Charts/issues/347) +- Pie chart is getting drawn again and again on rotation in iOS [\#346](https://github.com/danielgindi/Charts/issues/346) +- 对于高于限制线的点,我怎么改变点的样式和颜色呢? [\#345](https://github.com/danielgindi/Charts/issues/345) +- Swift-2.0 Branch Error [\#344](https://github.com/danielgindi/Charts/issues/344) +- Multiple lines [\#342](https://github.com/danielgindi/Charts/issues/342) +- Daniel are you really fit? [\#339](https://github.com/danielgindi/Charts/issues/339) +- For CandleStickChart, how can I limit according to the count of candles [\#334](https://github.com/danielgindi/Charts/issues/334) +- how can i disable the doubles? i only need the chat show int data [\#332](https://github.com/danielgindi/Charts/issues/332) +- Bug: Xcode 7 beta 5: dyld: Library not loaded: @rpath/Charts.framework/Charts [\#326](https://github.com/danielgindi/Charts/issues/326) +- Disappearing Line Segment when scrolling [\#325](https://github.com/danielgindi/Charts/issues/325) +- CombinedChart with BarChartData cuts the first and last bars in half [\#323](https://github.com/danielgindi/Charts/issues/323) +- Bug \(?\) in CandleStickChartRenderer when showing empty dataset among multiple datasets [\#320](https://github.com/danielgindi/Charts/issues/320) +- Xcode 7 Beta 6 print\(.. appendNewLine\) - Swift 2.0 branch [\#316](https://github.com/danielgindi/Charts/issues/316) +- Ability to disable legends completely [\#312](https://github.com/danielgindi/Charts/issues/312) +- BarChart draws additional horizontal grid lines when setting custom customAxisMax/labelCount [\#310](https://github.com/danielgindi/Charts/issues/310) +- Take selectionShift into account when displaying pie chart [\#309](https://github.com/danielgindi/Charts/issues/309) +- Line Chart Line is not drawing properly for the large yValues [\#307](https://github.com/danielgindi/Charts/issues/307) +- Zero valued slices overlap [\#305](https://github.com/danielgindi/Charts/issues/305) +- setVisibleXRangeMaximum working differently than expected [\#304](https://github.com/danielgindi/Charts/issues/304) +- MyProject-Swift.h header not found when embedding framework into ObjectiveC project [\#303](https://github.com/danielgindi/Charts/issues/303) +- Using NSNumberFormatter or .getBarBounds\(\) to Display Custom Values [\#302](https://github.com/danielgindi/Charts/issues/302) +- Unknown class \_TtC6Charts12BarChartView in Interface Builder file. [\#301](https://github.com/danielgindi/Charts/issues/301) +- Possible regression because of recent `startAtZeroEnabled` changes [\#300](https://github.com/danielgindi/Charts/issues/300) +- Axis titles? [\#299](https://github.com/danielgindi/Charts/issues/299) +- xcode 6.4 , Swift 1.2 build fail [\#298](https://github.com/danielgindi/Charts/issues/298) +- it has this problem "'\#' has been removed from Swift" in many places [\#296](https://github.com/danielgindi/Charts/issues/296) +- chartScaled not so useful without the touch location [\#295](https://github.com/danielgindi/Charts/issues/295) +- ChartMarker don't draw [\#293](https://github.com/danielgindi/Charts/issues/293) +- Multiple line charts on the same graph [\#292](https://github.com/danielgindi/Charts/issues/292) +- Release Version 2.1.3 on CocoaPods [\#289](https://github.com/danielgindi/Charts/issues/289) +- saveToCameraRoll strange behavior [\#288](https://github.com/danielgindi/Charts/issues/288) +- ios-charts for swift 2.0 cannot compile on XCode7 beta 5 - self.dynamicType.allocWithZone\(zone\) issue [\#287](https://github.com/danielgindi/Charts/issues/287) +- installing with cocoapods [\#283](https://github.com/danielgindi/Charts/issues/283) +- iOS 9 Won't Compile \(Also, no such module 'Charts'\) [\#282](https://github.com/danielgindi/Charts/issues/282) +- Allow to align the Legend! [\#279](https://github.com/danielgindi/Charts/issues/279) +- Demo chart for Swift? [\#278](https://github.com/danielgindi/Charts/issues/278) +- Cocoapods support [\#277](https://github.com/danielgindi/Charts/issues/277) +- ios-charts different plotting activity than MKAndroidChart [\#276](https://github.com/danielgindi/Charts/issues/276) +- Highlight Doest'n work properly on UIPageViewController in LineChart. [\#275](https://github.com/danielgindi/Charts/issues/275) +- command failed due to signal: Abort trap: 6 charts [\#271](https://github.com/danielgindi/Charts/issues/271) +- having hard time to put working on version iOS 7.1 [\#270](https://github.com/danielgindi/Charts/issues/270) +- Library not found while building application through distribution certificate [\#266](https://github.com/danielgindi/Charts/issues/266) +- Crash on one entry point in charts [\#265](https://github.com/danielgindi/Charts/issues/265) +- when add points dynamicly, scale is changeing, [\#264](https://github.com/danielgindi/Charts/issues/264) +- About Auto-scaling on axis [\#259](https://github.com/danielgindi/Charts/issues/259) +- \[CombinedChart\] Grouped Bars + line chart [\#252](https://github.com/danielgindi/Charts/issues/252) +- \*\*\* Announcements \*\*\* [\#236](https://github.com/danielgindi/Charts/issues/236) +- \[BUG\] xAxis label too long causes radar chart cannot render correctly [\#205](https://github.com/danielgindi/Charts/issues/205) + **Merged pull requests:** - Allow setting maximum y-scale factor [\#388](https://github.com/danielgindi/Charts/pull/388) ([noais](https://github.com/noais)) @@ -510,6 +3655,32 @@ [Full Changelog](https://github.com/danielgindi/Charts/compare/v2.1.2...v2.1.3) +**Closed issues:** + +- Limit Legend for combined charts [\#272](https://github.com/danielgindi/Charts/issues/272) +- Default zoom level at a position. [\#267](https://github.com/danielgindi/Charts/issues/267) +- drawValuesForWholeStackEnabled deprecated? [\#261](https://github.com/danielgindi/Charts/issues/261) +- Another Command failed due to signal: Segmentation fault: 11 [\#260](https://github.com/danielgindi/Charts/issues/260) +- moveViewToX [\#258](https://github.com/danielgindi/Charts/issues/258) +- How to add point dynamicly [\#257](https://github.com/danielgindi/Charts/issues/257) +- Real time graph - X-axis moving? [\#255](https://github.com/danielgindi/Charts/issues/255) +- 2.1.2 Not Yet in CocoaPods Master Repo [\#251](https://github.com/danielgindi/Charts/issues/251) +- Heads up [\#250](https://github.com/danielgindi/Charts/issues/250) +- Disable HorizontalHighlightIndicator on LineChart. [\#249](https://github.com/danielgindi/Charts/issues/249) +- double vision in the chart [\#245](https://github.com/danielgindi/Charts/issues/245) +- Can't find anything like "isWordWrapEnabled" in PieChart [\#244](https://github.com/danielgindi/Charts/issues/244) +- Grouped columns misplaced [\#242](https://github.com/danielgindi/Charts/issues/242) +- Swift2 upgrade problem "Redundant conformance of 'ChartDataEntry' to protocol 'Equatable'" [\#241](https://github.com/danielgindi/Charts/issues/241) +- App created by Archive cannot run on devices. [\#240](https://github.com/danielgindi/Charts/issues/240) +- What's the differences between setAxisMaximum and customAxisMax [\#239](https://github.com/danielgindi/Charts/issues/239) +- Problem importing framework to Xcode 6.4 in Swift Project [\#233](https://github.com/danielgindi/Charts/issues/233) +- PieChartData initialisers ambiguous when xVals parameter is nil [\#224](https://github.com/danielgindi/Charts/issues/224) +- \[BUG\] all-negative Stacked horizontal Bar Chart size is not correct [\#222](https://github.com/danielgindi/Charts/issues/222) +- \[BUG\] Bar Chart incorrect rendering for special data [\#214](https://github.com/danielgindi/Charts/issues/214) +- Projects using Charts [\#145](https://github.com/danielgindi/Charts/issues/145) +- Legend Height Adjustment [\#81](https://github.com/danielgindi/Charts/issues/81) +- Multiple legend entrys will be rendered outside of the view [\#80](https://github.com/danielgindi/Charts/issues/80) + **Merged pull requests:** - Add a Code Hunt vote badge to README.md [\#262](https://github.com/danielgindi/Charts/pull/262) ([CodeHuntIO](https://github.com/CodeHuntIO)) @@ -524,6 +3695,120 @@ [Full Changelog](https://github.com/danielgindi/Charts/compare/v2.1.0...v2.1.1) +**Fixed bugs:** + +- Render Crash Due to Rect NAN from rectValueToPixel in BarChartRenderer.swift [\#177](https://github.com/danielgindi/Charts/issues/177) +- Can we add nil values to a dataset yet? [\#113](https://github.com/danielgindi/Charts/issues/113) +- Incorrect chart view adjustment after moveViewtoX\(xIndex: Int\) [\#82](https://github.com/danielgindi/Charts/issues/82) +- Margin insets not changing during zoom when formatter changes output width [\#72](https://github.com/danielgindi/Charts/issues/72) +- Line chart crashes with a big float [\#62](https://github.com/danielgindi/Charts/issues/62) + +**Closed issues:** + +- App is crashing when line chart is scrolled into view and then back out. [\#238](https://github.com/danielgindi/Charts/issues/238) +- Demo Project: In BalloonMarker.swift : "Error: No such module 'charts' " XCode 6.4 [\#237](https://github.com/danielgindi/Charts/issues/237) +- How to draw Line segments in one Line Chart. [\#235](https://github.com/danielgindi/Charts/issues/235) +- How to disable the continuos selection in chart with swipe? [\#234](https://github.com/danielgindi/Charts/issues/234) +- Podspec 3 months old [\#231](https://github.com/danielgindi/Charts/issues/231) +- Setting background in Objective C [\#230](https://github.com/danielgindi/Charts/issues/230) +- ChartYAxis valueFormatter NSFormatter instead of NSNumberFormatter [\#228](https://github.com/danielgindi/Charts/issues/228) +- How to setup up y-axis with min, max value and a fixed step between the grid lines? [\#227](https://github.com/danielgindi/Charts/issues/227) +- What's the proper way to manually set chart's scale and scroll offset? [\#226](https://github.com/danielgindi/Charts/issues/226) +- How could you set the Y values at the bottom in LineChart? [\#223](https://github.com/danielgindi/Charts/issues/223) +- Is there guidance to beginner to use this? [\#220](https://github.com/danielgindi/Charts/issues/220) +- Chart's PanGesture conflicts with UITableView PanGesture [\#219](https://github.com/danielgindi/Charts/issues/219) +- \(swift-2.0 branch\) building Charts.xcodeproj fails \(exit code 65\) with Release configuration [\#218](https://github.com/danielgindi/Charts/issues/218) +- Crash on device - iOS 8.3 [\#216](https://github.com/danielgindi/Charts/issues/216) +- Remove dependencies warning [\#215](https://github.com/danielgindi/Charts/issues/215) +- Update Podspec to reflect commits since early May? [\#213](https://github.com/danielgindi/Charts/issues/213) +- \[BUG\]negative values rendering +highlight rect rendering not correct for stacked bar + stacked horizontal bar chart [\#212](https://github.com/danielgindi/Charts/issues/212) +- \[BUG\]postive bars in demo Stack BarChart Negative disappear after scrolling [\#211](https://github.com/danielgindi/Charts/issues/211) +- Horizontal bar chart in combined bar chart. [\#210](https://github.com/danielgindi/Charts/issues/210) +- Can I use this library in an objective-c project targeting iOS 7 & 8? [\#206](https://github.com/danielgindi/Charts/issues/206) +- When animating charts after reload, chart is shown fully drawn before animating. [\#204](https://github.com/danielgindi/Charts/issues/204) +- Array index out of range when removing entries from DataSet [\#203](https://github.com/danielgindi/Charts/issues/203) +- Issue while displaying the chart \(HorizontalBarChartView\) [\#202](https://github.com/danielgindi/Charts/issues/202) +- Charts stuttering when reloaded [\#201](https://github.com/danielgindi/Charts/issues/201) +- Scaling Yaxis [\#199](https://github.com/danielgindi/Charts/issues/199) +- Don't draw zero value label [\#197](https://github.com/danielgindi/Charts/issues/197) +- Library not loaded: @rpath/Charts.framework/Charts [\#196](https://github.com/danielgindi/Charts/issues/196) +- How can i get this chart? [\#195](https://github.com/danielgindi/Charts/issues/195) +- Crashing on adding the null value to and array [\#193](https://github.com/danielgindi/Charts/issues/193) +- ChartDataEntry not drawn after certain xIndex [\#190](https://github.com/danielgindi/Charts/issues/190) +- Highlight multiple values [\#187](https://github.com/danielgindi/Charts/issues/187) +- ChartData.removeEntryByXIndex removes the wrong entry [\#182](https://github.com/danielgindi/Charts/issues/182) +- Label on Limit Lines cause crash [\#181](https://github.com/danielgindi/Charts/issues/181) +- \[feature request\] render xAxis like yAxis style Namely from discrete way to continuous way [\#176](https://github.com/danielgindi/Charts/issues/176) +- Annotation label support? [\#175](https://github.com/danielgindi/Charts/issues/175) +- Multiple DataSet Error [\#174](https://github.com/danielgindi/Charts/issues/174) +- AddEntry issue in ChartData [\#173](https://github.com/danielgindi/Charts/issues/173) +- Bar Chart Bars Disappears On Zoom And Highlight Bars Don't Match [\#172](https://github.com/danielgindi/Charts/issues/172) +- Clearing all highlighted values [\#171](https://github.com/danielgindi/Charts/issues/171) +- BarChartView work with TableView [\#167](https://github.com/danielgindi/Charts/issues/167) +- Make scroll to graph without pinch [\#164](https://github.com/danielgindi/Charts/issues/164) +- When i set valueformatter , Have problem. [\#163](https://github.com/danielgindi/Charts/issues/163) +- Combined Chart With array of line charts [\#162](https://github.com/danielgindi/Charts/issues/162) +- Issues with chart rendering... [\#161](https://github.com/danielgindi/Charts/issues/161) +- How to set yAxis to normal number [\#160](https://github.com/danielgindi/Charts/issues/160) +- How to set yValue display 0 2 3 5 [\#159](https://github.com/danielgindi/Charts/issues/159) +- \[BUG\] \_yAxis.entries will not be cleaned up in computeAxisValues in radar chart [\#158](https://github.com/danielgindi/Charts/issues/158) +- \[feature request\] support fixed yAxis interval and xAxis labelCount [\#155](https://github.com/danielgindi/Charts/issues/155) +- app crashes at launch as in house release build on iPhone - but debugging is fine [\#154](https://github.com/danielgindi/Charts/issues/154) +- \[feature request\] enable legend view scrollable [\#151](https://github.com/danielgindi/Charts/issues/151) +- \[feature request\] support custom handler for gestures [\#148](https://github.com/danielgindi/Charts/issues/148) +- unsuccessful at installing for ios 7.0 [\#144](https://github.com/danielgindi/Charts/issues/144) +- cannot po swift local variable in my Objective-C project [\#143](https://github.com/danielgindi/Charts/issues/143) +- Real time line chart [\#142](https://github.com/danielgindi/Charts/issues/142) +- Bar chart some values \< 0 [\#141](https://github.com/danielgindi/Charts/issues/141) +- Any demo in swift ? [\#139](https://github.com/danielgindi/Charts/issues/139) +- compiling time costs 2-3 minutes after import swift code files, is it normal? [\#137](https://github.com/danielgindi/Charts/issues/137) +- iOS7 can't build success [\#136](https://github.com/danielgindi/Charts/issues/136) +- Warnings on the comments [\#135](https://github.com/danielgindi/Charts/issues/135) +- Still seeing undeclared UIColor, CGFloat error with latest code [\#133](https://github.com/danielgindi/Charts/issues/133) +- Error while drawing radar chart [\#132](https://github.com/danielgindi/Charts/issues/132) +- Cannot assign a value of type 'ChartLimitLabelPosition' to a value of type 'ChartLimitLine.ChartLimitLabelPosition' [\#131](https://github.com/danielgindi/Charts/issues/131) +- Data disappearing while zooming/panning when y-values are not ordered by x [\#130](https://github.com/danielgindi/Charts/issues/130) +- Cannot load underlying module for 'Charts' [\#129](https://github.com/danielgindi/Charts/issues/129) +- Any way to add/use image for xVals? [\#126](https://github.com/danielgindi/Charts/issues/126) +- Install with cocoapod into project supporting iOS 7 and later [\#125](https://github.com/danielgindi/Charts/issues/125) +- Lines clipping top and bottom with lineWidth \> 1 [\#123](https://github.com/danielgindi/Charts/issues/123) +- Candle chart - make the shadow same color as an increasing/decreasing candle color [\#122](https://github.com/danielgindi/Charts/issues/122) +- Down-casted Array element failed to match the target type [\#121](https://github.com/danielgindi/Charts/issues/121) +- y axis spaces between labels are too wide [\#120](https://github.com/danielgindi/Charts/issues/120) +- Different colors for single data set in Bar Chart [\#118](https://github.com/danielgindi/Charts/issues/118) +- The new version demo has a problem. [\#117](https://github.com/danielgindi/Charts/issues/117) +- non-public selectors while submitting app [\#116](https://github.com/danielgindi/Charts/issues/116) +- Adding a minimum parameter to setVisibleXRange [\#115](https://github.com/danielgindi/Charts/issues/115) +- Add 'drawHighlightEnabled' to ChartDataSet [\#114](https://github.com/danielgindi/Charts/issues/114) +- Pull to refresh [\#112](https://github.com/danielgindi/Charts/issues/112) +- Can we create thumb for each chart? [\#111](https://github.com/danielgindi/Charts/issues/111) +- Issue setting the chartView.delegate to self. [\#110](https://github.com/danielgindi/Charts/issues/110) +- combine swift in Objective-C project [\#108](https://github.com/danielgindi/Charts/issues/108) +- get X translation distance on the x-axis [\#105](https://github.com/danielgindi/Charts/issues/105) +- Horizontal Bar Chart Screenshot on README is Broken [\#103](https://github.com/danielgindi/Charts/issues/103) +- Bars [\#102](https://github.com/danielgindi/Charts/issues/102) +- Crash when redraw graph from 2 lines to 1 line with click on highlight [\#101](https://github.com/danielgindi/Charts/issues/101) +- Release Bug [\#98](https://github.com/danielgindi/Charts/issues/98) +- Add '@objc' to ChartViewPortHandler [\#97](https://github.com/danielgindi/Charts/issues/97) +- Bar Chart Delegate. [\#96](https://github.com/danielgindi/Charts/issues/96) +- Cannot turn off Barchart Zoom Propertry [\#91](https://github.com/danielgindi/Charts/issues/91) +- calcMinMax\(\) during scrolling / panning [\#89](https://github.com/danielgindi/Charts/issues/89) +- defaultTouchEventsEnabled [\#88](https://github.com/danielgindi/Charts/issues/88) +- 'chartsample-Swift.h' file not found [\#87](https://github.com/danielgindi/Charts/issues/87) +- Infinite loop when setting data on ChartDataEntry object [\#86](https://github.com/danielgindi/Charts/issues/86) +- Custom text over bar chart. [\#84](https://github.com/danielgindi/Charts/issues/84) +- Stop hiding of xAxis label. [\#79](https://github.com/danielgindi/Charts/issues/79) +- Consider draw map chart without location, navigation stuff? [\#78](https://github.com/danielgindi/Charts/issues/78) +- Line Chart - Simple Design [\#77](https://github.com/danielgindi/Charts/issues/77) +- Can you give me a swift's demo [\#75](https://github.com/danielgindi/Charts/issues/75) +- What files exactly should I drag to my project to make it work on iOS 7.0? [\#73](https://github.com/danielgindi/Charts/issues/73) +- How to check chart is zoomed in ? [\#71](https://github.com/danielgindi/Charts/issues/71) +- Changing descriptionTextColor not possible [\#70](https://github.com/danielgindi/Charts/issues/70) +- Confused by this snippet code [\#69](https://github.com/danielgindi/Charts/issues/69) +- XAxis Co-Ordination with Y Axis [\#68](https://github.com/danielgindi/Charts/issues/68) +- Is there a way can make LineDataSets not selected when their visible property is no? [\#67](https://github.com/danielgindi/Charts/issues/67) +- Multiple Chart View Within ScrollView [\#65](https://github.com/danielgindi/Charts/issues/65) + **Merged pull requests:** - Candle chart - make the shadow same color as an candle color \#122 [\#191](https://github.com/danielgindi/Charts/pull/191) ([dorsoft](https://github.com/dorsoft)) @@ -544,6 +3829,49 @@ [Full Changelog](https://github.com/danielgindi/Charts/compare/v2.0.9...v2.1.0) +**Implemented enhancements:** + +- Drawing CubicLineChart based on NSDates [\#38](https://github.com/danielgindi/Charts/issues/38) +- Skip first and last value [\#23](https://github.com/danielgindi/Charts/issues/23) + +**Fixed bugs:** + +- Chart Line vanishes on pinch to zoom [\#63](https://github.com/danielgindi/Charts/issues/63) + +**Closed issues:** + +- Expose chartYMin and chartYMax to rendererDelegates [\#64](https://github.com/danielgindi/Charts/issues/64) +- dyld\_fatal\_error [\#60](https://github.com/danielgindi/Charts/issues/60) +- Unknown class LineChartView in Interface Builder file [\#59](https://github.com/danielgindi/Charts/issues/59) +- Is there any inertia effect in the library? [\#58](https://github.com/danielgindi/Charts/issues/58) +- Library not loaded: @rpath/Charts.framework/Charts Xcode 6.3.1, iOS 8.3 [\#57](https://github.com/danielgindi/Charts/issues/57) +- i am getting this issue? [\#55](https://github.com/danielgindi/Charts/issues/55) +- sample swift project of danielgindi/ios-charts? [\#54](https://github.com/danielgindi/Charts/issues/54) +- i want develop charts in swift? [\#53](https://github.com/danielgindi/Charts/issues/53) +- When I used iOS-charts in iOS 7 project [\#52](https://github.com/danielgindi/Charts/issues/52) +- Changing the specific data point \(circle color\) in Line Chart [\#51](https://github.com/danielgindi/Charts/issues/51) +- When i use ios-charts with swift .. [\#50](https://github.com/danielgindi/Charts/issues/50) +- Charts won't draw unless initialized with a frame [\#49](https://github.com/danielgindi/Charts/issues/49) +- PieChart chartValueSelected don't return the good entry [\#48](https://github.com/danielgindi/Charts/issues/48) +- Cannot find this repo through Cocoapods.org [\#47](https://github.com/danielgindi/Charts/issues/47) +- Use of undeclared type 'CGFloat' [\#44](https://github.com/danielgindi/Charts/issues/44) +- CandleChartData isn't combinable with other data types [\#42](https://github.com/danielgindi/Charts/issues/42) +- Two graphs overlaying each other [\#41](https://github.com/danielgindi/Charts/issues/41) +- Charts with long Title [\#40](https://github.com/danielgindi/Charts/issues/40) +- piechart - yOffset [\#39](https://github.com/danielgindi/Charts/issues/39) +- Two different-scale axis support for different data sets [\#36](https://github.com/danielgindi/Charts/issues/36) +- IBInspectable support? [\#34](https://github.com/danielgindi/Charts/issues/34) +- ChartsDemo-swift.h file not found [\#31](https://github.com/danielgindi/Charts/issues/31) +- Pinch zoom release triggers pan [\#30](https://github.com/danielgindi/Charts/issues/30) +- UISwipeGestureRecognizer [\#28](https://github.com/danielgindi/Charts/issues/28) +- pod not support iOS 7.0 ??? [\#27](https://github.com/danielgindi/Charts/issues/27) +- How to add a line-chart view in UITableViewCell ? [\#26](https://github.com/danielgindi/Charts/issues/26) +- Charts/Charts.h file not found [\#24](https://github.com/danielgindi/Charts/issues/24) +- Carthage support [\#21](https://github.com/danielgindi/Charts/issues/21) +- Unresolved identifier `CGFloat` in iOS 7 project [\#19](https://github.com/danielgindi/Charts/issues/19) +- Last item's visibility issue when zooming [\#18](https://github.com/danielgindi/Charts/issues/18) +- Unable to hide Y values [\#17](https://github.com/danielgindi/Charts/issues/17) + **Merged pull requests:** - Fix x-axis limit line render issue. [\#66](https://github.com/danielgindi/Charts/pull/66) ([mkubenka](https://github.com/mkubenka)) @@ -558,6 +3886,10 @@ [Full Changelog](https://github.com/danielgindi/Charts/compare/0.0.1...v2.0.9) +**Closed issues:** + +- Import with Swift\(not objc\) not working [\#14](https://github.com/danielgindi/Charts/issues/14) + **Merged pull requests:** - Added a podspec [\#13](https://github.com/danielgindi/Charts/pull/13) ([petester42](https://github.com/petester42)) @@ -566,6 +3898,18 @@ [Full Changelog](https://github.com/danielgindi/Charts/compare/72652ef3ef988664c9b543bb9f38617e46cc68d7...0.0.1) +**Closed issues:** + +- Need Version to be compatible with Xcode 6.2 [\#12](https://github.com/danielgindi/Charts/issues/12) +- Can't import "module-swift.h" [\#11](https://github.com/danielgindi/Charts/issues/11) +- A lot of compile errors. [\#10](https://github.com/danielgindi/Charts/issues/10) +- 357 Compile Errors on framework files [\#8](https://github.com/danielgindi/Charts/issues/8) +- demo crashes, and no swift examples? [\#7](https://github.com/danielgindi/Charts/issues/7) +- xcode complains ChartsDemo-Swift.h can't be found [\#6](https://github.com/danielgindi/Charts/issues/6) +- Cocoapod [\#4](https://github.com/danielgindi/Charts/issues/4) +- Trying to compile demo code,but tons of compiler errors [\#3](https://github.com/danielgindi/Charts/issues/3) +- Command failed due to signal: Segmentation fault: 11 [\#2](https://github.com/danielgindi/Charts/issues/2) + **Merged pull requests:** - Fix README typo [\#5](https://github.com/danielgindi/Charts/pull/5) ([nwest](https://github.com/nwest)) diff --git a/Cartfile.private b/Cartfile.private deleted file mode 100644 index ca931038c5..0000000000 --- a/Cartfile.private +++ /dev/null @@ -1 +0,0 @@ -github "uber/ios-snapshot-test-case" diff --git a/Cartfile.resolved b/Cartfile.resolved deleted file mode 100644 index 8f69010a98..0000000000 --- a/Cartfile.resolved +++ /dev/null @@ -1 +0,0 @@ -github "uber/ios-snapshot-test-case" "6.1.0" diff --git a/Charts.podspec b/Charts.podspec index 4e48e4d9d1..6fa80ed448 100644 --- a/Charts.podspec +++ b/Charts.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "Charts" - s.version = "3.6.0" + s.version = "4.0.0" s.summary = "Charts is a powerful & easy to use chart library for iOS, tvOS and OSX (and Android)" s.homepage = "https://github.com/danielgindi/Charts" s.license = { :type => "Apache License, Version 2.0", :file => "LICENSE" } diff --git a/Charts.xcodeproj/project.pbxproj b/Charts.xcodeproj/project.pbxproj index 7ca07ea581..18abb7650e 100644 --- a/Charts.xcodeproj/project.pbxproj +++ b/Charts.xcodeproj/project.pbxproj @@ -3,31 +3,34 @@ archiveVersion = 1; classes = { }; - objectVersion = 46; + objectVersion = 52; objects = { /* Begin PBXBuildFile section */ - 00B8BF5901C2D220357B0B2A /* Media.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 41DDB768A1D033A34F0EF9E0 /* Media.xcassets */; }; 00BC23EF0E04E17188344403 /* BarChartDataProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9D7184C8A5A60A3522AB9B05 /* BarChartDataProvider.swift */; }; 02A6E6E1A82A27A66B8D08C4 /* MoveViewJob.swift in Sources */ = {isa = PBXBuildFile; fileRef = 266E162DA8B29D9AEB6A9397 /* MoveViewJob.swift */; }; - 03960E8148C6AEDACE4B77CC /* IMarker.swift in Sources */ = {isa = PBXBuildFile; fileRef = 596963A429D485E3894C4666 /* IMarker.swift */; }; + 03960E8148C6AEDACE4B77CC /* Marker.swift in Sources */ = {isa = PBXBuildFile; fileRef = 596963A429D485E3894C4666 /* Marker.swift */; }; 0511E43EF3FD2CDE7F7F15DB /* ScatterChartDataProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2FD37A55B4D85D883E29C744 /* ScatterChartDataProvider.swift */; }; 05253AFC448C107DEF54C2FE /* CombinedChartRenderer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52265C1B343CCC41AF2300E3 /* CombinedChartRenderer.swift */; }; 0529DD51622C8769C1121F90 /* CrossShapeRenderer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 823F7DB281C6C6F069A69605 /* CrossShapeRenderer.swift */; }; 0577C2B38BCE4C871F262714 /* AnimatedZoomViewJob.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C2EA58CB336967198D30D20 /* AnimatedZoomViewJob.swift */; }; - 064989461F5C99C7006E8BB3 /* Snapshot.swift in Sources */ = {isa = PBXBuildFile; fileRef = 064989451F5C99C7006E8BB3 /* Snapshot.swift */; }; + 064989461F5C99C7006E8BB3 /* Utilities.swift in Sources */ = {isa = PBXBuildFile; fileRef = 064989451F5C99C7006E8BB3 /* Utilities.swift */; }; + 06AB297F20FA726600BAD505 /* Highlighter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 06AB297E20FA726500BAD505 /* Highlighter.swift */; }; 0A772AEC08246FEC480673E5 /* PieRadarChartViewBase.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4A6C9631C69B2D772BBD9232 /* PieRadarChartViewBase.swift */; }; 0C52C70C6E6EA09BD7426386 /* RadarChartData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4BBB57D6FA41029B08F26D7B /* RadarChartData.swift */; }; 0CAF514A280FF6A14E2A1A23 /* CombinedChartView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11EF1FE22549E885C8F40738 /* CombinedChartView.swift */; }; - 0D8A89398F9BD5DCC8D7F976 /* ICandleChartDataSet.swift in Sources */ = {isa = PBXBuildFile; fileRef = 18BFB0A14A5C47A302A597D9 /* ICandleChartDataSet.swift */; }; + 0D8A89398F9BD5DCC8D7F976 /* CandleChartDataSetProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 18BFB0A14A5C47A302A597D9 /* CandleChartDataSetProtocol.swift */; }; 11F68AA2EBF822D7208EE002 /* YAxisRendererRadarChart.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA5A16F4A382813C4FE8BDF9 /* YAxisRendererRadarChart.swift */; }; - 1311BEC21E9CC264E971EFAF /* ILineRadarChartDataSet.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4F7E6A99D82E6AE3804D5A39 /* ILineRadarChartDataSet.swift */; }; + 1311BEC21E9CC264E971EFAF /* LineRadarChartDataSetProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4F7E6A99D82E6AE3804D5A39 /* LineRadarChartDataSetProtocol.swift */; }; 135F11CE20425AF600D655A3 /* PieChartTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 135F11CD20425AF600D655A3 /* PieChartTests.swift */; }; - 146EE16342C2BADC92E45BF2 /* ILineScatterCandleRadarChartDataSet.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9249AD9AEC8C85772365A128 /* ILineScatterCandleRadarChartDataSet.swift */; }; + 146EE16342C2BADC92E45BF2 /* LineScatterCandleRadarChartDataSetProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9249AD9AEC8C85772365A128 /* LineScatterCandleRadarChartDataSetProtocol.swift */; }; 17E994DA88777AA1D8CCFC58 /* BarChartDataSet.swift in Sources */ = {isa = PBXBuildFile; fileRef = C31AA65EA27776F8C653C7E8 /* BarChartDataSet.swift */; }; - 203A39685CC96FC625F616E4 /* IHighlighter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 998F2BFE318471AFC05B50AC /* IHighlighter.swift */; }; 219192CA6B4895319AB49DCA /* BarLineScatterCandleBubbleRenderer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B1C588E9DF6FFD56D7ADF8E /* BarLineScatterCandleBubbleRenderer.swift */; }; - 224EFF991FBAAC4700CF9B3B /* EquatableTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 224EFF981FBAAC4700CF9B3B /* EquatableTests.swift */; }; + 221CA2922588FCBC00C2DD1E /* Sequence+KeyPath.swift in Sources */ = {isa = PBXBuildFile; fileRef = 221CA2912588FCBC00C2DD1E /* Sequence+KeyPath.swift */; }; + 2243BBFD1FF156EC00B49D0B /* EquatableTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2243BBFB1FF156D000B49D0B /* EquatableTests.swift */; }; + 22786E8525CD96620051335B /* Media.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 22786E8325CD96620051335B /* Media.xcassets */; }; + 228D56232554F27A00BEE75E /* Algorithms in Frameworks */ = {isa = PBXBuildFile; productRef = 228D56222554F27A00BEE75E /* Algorithms */; }; + 22BBDA0825CC4C2F00435670 /* SnapshotTesting in Frameworks */ = {isa = PBXBuildFile; productRef = 22BBDA0725CC4C2F00435670 /* SnapshotTesting */; }; 23649EFC635A76022F07FFA6 /* PieChartDataEntry.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD02157CF8CEE1189BF681DA /* PieChartDataEntry.swift */; }; 23FA50B2730D8C7ACA091C4F /* BarChartRenderer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75F279974FE650E57A061B09 /* BarChartRenderer.swift */; }; 24151B0729D77251A8494D70 /* LineRadarRenderer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 105FFC9D3773A9C7A60A897F /* LineRadarRenderer.swift */; }; @@ -38,7 +41,7 @@ 2B821AAC3EBD60A73EACBCE6 /* LegendRenderer.swift in Sources */ = {isa = PBXBuildFile; fileRef = F715DB2C56C9E0615542625B /* LegendRenderer.swift */; }; 2BA03CEC36BADCF682F1328B /* LineChartDataProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFABD027DAF6851088F002AC /* LineChartDataProvider.swift */; }; 2BF85BEA981B359A65E9BF67 /* LineChartTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2E1819D72CD7B6C4A4E8048 /* LineChartTests.swift */; }; - 2C40CFFC8D88BEA70E0A50B0 /* IBubbleChartDataSet.swift in Sources */ = {isa = PBXBuildFile; fileRef = F3788EC55EF908B0805D7C2F /* IBubbleChartDataSet.swift */; }; + 2C40CFFC8D88BEA70E0A50B0 /* BubbleChartDataSetProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = F3788EC55EF908B0805D7C2F /* BubbleChartDataSetProtocol.swift */; }; 2C879FC24D7A15D70BE4063F /* PieChartData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6E03A4987F72414A02A0631B /* PieChartData.swift */; }; 2FBA7E982EB57932B9F3E9B5 /* YAxis.swift in Sources */ = {isa = PBXBuildFile; fileRef = FB92A80F861C1362EED8D946 /* YAxis.swift */; }; 3097296AC7FFA994FE4AD312 /* PieRadarHighlighter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04F7B9DF1F2D66E7279771D4 /* PieRadarHighlighter.swift */; }; @@ -58,7 +61,7 @@ 48E875BBD6540BDE1C1B7D3D /* AxisBase.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B7AEFBF4D85B9D2EAAB3071 /* AxisBase.swift */; }; 4E98788ABEF6496C23F3E6C6 /* HorizontalBarHighlighter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33BE9A97FFA41D3D85CAFFC7 /* HorizontalBarHighlighter.swift */; }; 4FACC6FD308AFB231EB4A93D /* XAxisRendererRadarChart.swift in Sources */ = {isa = PBXBuildFile; fileRef = BC19DC2434D65FFB446A61B7 /* XAxisRendererRadarChart.swift */; }; - 50476F8E6662CAFC1EFE0723 /* IScatterChartDataSet.swift in Sources */ = {isa = PBXBuildFile; fileRef = 219BC9CEA037F897E92E45D1 /* IScatterChartDataSet.swift */; }; + 50476F8E6662CAFC1EFE0723 /* ScatterChartDataSetProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 219BC9CEA037F897E92E45D1 /* ScatterChartDataSetProtocol.swift */; }; 515E286E6C47594D3FFA3DD1 /* ViewPortHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 72EAEBB7CF73E33565FC2896 /* ViewPortHandler.swift */; }; 53A91F6F86740E26FE733639 /* BarLineScatterCandleBubbleChartDataSet.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D717F0808DE7EC8A4AE9C2A /* BarLineScatterCandleBubbleChartDataSet.swift */; }; 56E0F5EA9255B9B92876E040 /* BubbleChartRenderer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2194AA554712E6BA2677F114 /* BubbleChartRenderer.swift */; }; @@ -85,10 +88,10 @@ 7EE6EFE70CF4D8B09CAFCD01 /* AnimatedMoveViewJob.swift in Sources */ = {isa = PBXBuildFile; fileRef = BA157EFF2F952192C11DF937 /* AnimatedMoveViewJob.swift */; }; 8102A555DD6C93AC1290EA7C /* Fill.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5A4CFFFB65819121595F06F1 /* Fill.swift */; }; 81892994002C0640AD858748 /* ChartData.swift in Sources */ = {isa = PBXBuildFile; fileRef = E120E76C6F1B5877D56126DD /* ChartData.swift */; }; - 83BBAF3EDC31FD452F8BF1DB /* IRadarChartDataSet.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2EAD807534620E3B53327F04 /* IRadarChartDataSet.swift */; }; + 83BBAF3EDC31FD452F8BF1DB /* RadarChartDataSetProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2EAD807534620E3B53327F04 /* RadarChartDataSetProtocol.swift */; }; 846AC09831FA93F66732591B /* YAxisRendererHorizontalBarChart.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAE417AAA0FCA0DD00E77489 /* YAxisRendererHorizontalBarChart.swift */; }; 8A463E2947F211C594CA5E95 /* TransformerHorizontalBarChart.swift in Sources */ = {isa = PBXBuildFile; fileRef = 324C9127B53A8D39C8B49277 /* TransformerHorizontalBarChart.swift */; }; - 8A9FF54E2075A9047CC8E953 /* IShapeRenderer.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA1D3D13180C2E3893A82546 /* IShapeRenderer.swift */; }; + 8A9FF54E2075A9047CC8E953 /* ShapeRenderer.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA1D3D13180C2E3893A82546 /* ShapeRenderer.swift */; }; 8BCCD709AACC565613D9DA68 /* CandleStickChartRenderer.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD5C6D20243EC2F19069AACD /* CandleStickChartRenderer.swift */; }; 8E1192F7A7152E9DA92C56A9 /* ChartUtilsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7AB9062A28AAB9469752A954 /* ChartUtilsTests.swift */; }; 8EF7B3FBE37F72CC030CD865 /* SquareShapeRenderer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 32FC01A016DFF1BA73AF9182 /* SquareShapeRenderer.swift */; }; @@ -104,16 +107,16 @@ 9A26C8DB1F87B01700367599 /* DataApproximator+N.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A26C8DA1F87B01700367599 /* DataApproximator+N.swift */; }; 9C91C151608E2D6E19B1EAD1 /* Range.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0F099502DA50C56204E7B744 /* Range.swift */; }; 9F760570BCECB0BF5727AF90 /* BarLineChartViewBase.swift in Sources */ = {isa = PBXBuildFile; fileRef = 45C6D3723C4E001B119CA0C8 /* BarLineChartViewBase.swift */; }; - A40ACF0CCE96EEE104B0463D /* IValueFormatter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EAA8AA30C377D54D22A577A /* IValueFormatter.swift */; }; + A40ACF0CCE96EEE104B0463D /* ValueFormatter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EAA8AA30C377D54D22A577A /* ValueFormatter.swift */; }; A692D8BDE42717F69DB790BE /* HorizontalBarChartView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6021C9E424C36116AEA78CC9 /* HorizontalBarChartView.swift */; }; AEE9C4E4AC02B8FB3CD21975 /* ZoomViewJob.swift in Sources */ = {isa = PBXBuildFile; fileRef = FB3A4F5987E58F3E5BE855F9 /* ZoomViewJob.swift */; }; - AF4AAF3709ED9DDF6362EAE8 /* IBarLineScatterCandleBubbleChartDataSet.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5649B272BF3EBFC8A1EF0C1 /* IBarLineScatterCandleBubbleChartDataSet.swift */; }; + AF4AAF3709ED9DDF6362EAE8 /* BarLineScatterCandleBubbleChartDataSetProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5649B272BF3EBFC8A1EF0C1 /* BarLineScatterCandleBubbleChartDataSetProtocol.swift */; }; B0D28C68BB9A958DC56EB214 /* DefaultValueFormatter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 107D8F8163EE54D6D9E916B0 /* DefaultValueFormatter.swift */; }; - B13C74B4FF705D7B595D01EF /* IAxisValueFormatter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0BD9DF16AF59680A3BB49452 /* IAxisValueFormatter.swift */; }; + B13C74B4FF705D7B595D01EF /* AxisValueFormatter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0BD9DF16AF59680A3BB49452 /* AxisValueFormatter.swift */; }; B539114951455C35BADAE3F3 /* PieChartDataSet.swift in Sources */ = {isa = PBXBuildFile; fileRef = A4FB5E3761EF8B4D1E1E1014 /* PieChartDataSet.swift */; }; B66817462241E3CC00017CF1 /* HorizontalBarChartTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = B66817452241E3CC00017CF1 /* HorizontalBarChartTests.swift */; }; B6BF9A561F91993A00E62A5D /* CombinedChartTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = B6BF9A551F91993A00E62A5D /* CombinedChartTests.swift */; }; - B6C9F450D937B87224D29D5C /* IFillFormatter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 818AC6B12505B7C0A53D62F9 /* IFillFormatter.swift */; }; + B6C9F450D937B87224D29D5C /* FillFormatter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 818AC6B12505B7C0A53D62F9 /* FillFormatter.swift */; }; B6DCC229615EFE706F64A37D /* LineScatterCandleRadarRenderer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 923206233CA89FD03565FF87 /* LineScatterCandleRadarRenderer.swift */; }; B85DEB06B4C1AFFC8A0E3295 /* CircleShapeRenderer.swift in Sources */ = {isa = PBXBuildFile; fileRef = ECE1B1623D3AF69CECAE8562 /* CircleShapeRenderer.swift */; }; BEFD9518F3A74ACF8FA33308 /* Charts.h in Headers */ = {isa = PBXBuildFile; fileRef = 4F9922F0641F7955DC6CD324 /* Charts.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -123,7 +126,7 @@ C20A62D8CB9120523D5FB650 /* LegendEntry.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9E7C673B9ED4340F550A9283 /* LegendEntry.swift */; }; C2EFB4EC8C97FA9987F1B50D /* RadarChartDataEntry.swift in Sources */ = {isa = PBXBuildFile; fileRef = 91EEEDE2AB8F2DA3AFCF0733 /* RadarChartDataEntry.swift */; }; C33E1AF5471A60BA42DAF52E /* RadarHighlighter.swift in Sources */ = {isa = PBXBuildFile; fileRef = F368CF209744D8F3B85B1028 /* RadarHighlighter.swift */; }; - C3F0DDB7F0A922F0BB7EDB8A /* IBarChartDataSet.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A53A9E42FC07FFDACA937C1 /* IBarChartDataSet.swift */; }; + C3F0DDB7F0A922F0BB7EDB8A /* BarChartDataSetProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A53A9E42FC07FFDACA937C1 /* BarChartDataSetProtocol.swift */; }; C7B150D740255670DEB9F455 /* Charts.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 65AD9E95D9ED4DC0BD73A743 /* Charts.framework */; }; C9AA360A2355F01F00C97D93 /* Platform+Color.swift in Sources */ = {isa = PBXBuildFile; fileRef = C9AA36092355F01F00C97D93 /* Platform+Color.swift */; }; C9F3DC262355F791000C3215 /* Platform+Graphics.swift in Sources */ = {isa = PBXBuildFile; fileRef = C9F3DC242355F791000C3215 /* Platform+Graphics.swift */; }; @@ -143,20 +146,20 @@ E4B2F363414E84C4D4B8A885 /* BubbleChartView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EED352A98860E031F13AFB7 /* BubbleChartView.swift */; }; E50D291A6B6E69BF0B56A67C /* ChartBaseDataSet.swift in Sources */ = {isa = PBXBuildFile; fileRef = C9FE42E868A225C116537368 /* ChartBaseDataSet.swift */; }; E68CA3DC66EB638C956E09B8 /* BubbleChartData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7EDA3AD550AEFC93C8D15B9C /* BubbleChartData.swift */; }; - E8F0F4F47CD7D72B4EE5A794 /* IChartDataSet.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3A32510073A303CBB38E094A /* IChartDataSet.swift */; }; + E8F0F4F47CD7D72B4EE5A794 /* ChartDataSetProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3A32510073A303CBB38E094A /* ChartDataSetProtocol.swift */; }; E9FF0ECB5E0CA92DBF4C1BC4 /* Platform.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3ED23C354AFE81818D78E645 /* Platform.swift */; }; EAEA60D22CA8C1B7E18D3F7D /* ChartDataEntry.swift in Sources */ = {isa = PBXBuildFile; fileRef = F22750328058DEC2F019646F /* ChartDataEntry.swift */; }; EB56849433A76B08606B73EB /* ScatterChartDataSet.swift in Sources */ = {isa = PBXBuildFile; fileRef = CB1DD1A0F64266A10EE94194 /* ScatterChartDataSet.swift */; }; ECE7EAE7179A7F57CE9BBD8F /* Legend.swift in Sources */ = {isa = PBXBuildFile; fileRef = E64A75540C627E09080B402A /* Legend.swift */; }; - ECECC58CEF03B1718F8267E8 /* AxisRendererBase.swift in Sources */ = {isa = PBXBuildFile; fileRef = C75935E899183DDFA181E2CC /* AxisRendererBase.swift */; }; + ECECC58CEF03B1718F8267E8 /* AxisRenderer.swift in Sources */ = {isa = PBXBuildFile; fileRef = C75935E899183DDFA181E2CC /* AxisRenderer.swift */; }; F100D68395F169B93590FA96 /* HorizontalBarChartRenderer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 539382766378B702660FDFB2 /* HorizontalBarChartRenderer.swift */; }; F103D90FC5DEEA0D7BB4407E /* ChevronUpShapeRenderer.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA70259ED16FF80D8EEB0F94 /* ChevronUpShapeRenderer.swift */; }; - F37B07008B8AE7F3909FFB9C /* ChartDataRendererBase.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0216EDC6A1FE272F4EB19FCF /* ChartDataRendererBase.swift */; }; + F37B07008B8AE7F3909FFB9C /* DataRenderer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0216EDC6A1FE272F4EB19FCF /* DataRenderer.swift */; }; F5A209116FAC68F5903D0B46 /* ChartAnimationEasing.swift in Sources */ = {isa = PBXBuildFile; fileRef = DFB762958EE8E6521563665D /* ChartAnimationEasing.swift */; }; F744C510DA9B85C228BBB335 /* DefaultFillFormatter.swift in Sources */ = {isa = PBXBuildFile; fileRef = D6C1BEFDF17404666C7B6054 /* DefaultFillFormatter.swift */; }; - F941C88BF814DF51C465CB95 /* ILineChartDataSet.swift in Sources */ = {isa = PBXBuildFile; fileRef = 429E88F2729735DC092EE556 /* ILineChartDataSet.swift */; }; + F941C88BF814DF51C465CB95 /* LineChartDataSetProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 429E88F2729735DC092EE556 /* LineChartDataSetProtocol.swift */; }; FA07D034D9C3BC7795184ACA /* LineScatterCandleRadarChartDataSet.swift in Sources */ = {isa = PBXBuildFile; fileRef = C58BD7B14BEA440783ED8D2B /* LineScatterCandleRadarChartDataSet.swift */; }; - FAAD9FF6565DED2652188584 /* IPieChartDataSet.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA2AA6CC89F809DCCD7605B4 /* IPieChartDataSet.swift */; }; + FAAD9FF6565DED2652188584 /* PieChartDataSetProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA2AA6CC89F809DCCD7605B4 /* PieChartDataSetProtocol.swift */; }; FD37AAC0270F390FFC470A65 /* ChartDataProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 62B73FCEDD3841E7B958F6A9 /* ChartDataProvider.swift */; }; FDBDAFA7A5337C6E3992DACE /* ComponentBase.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8C9A105A7DB64F39DDA648B /* ComponentBase.swift */; }; /* End PBXBuildFile section */ @@ -173,11 +176,12 @@ /* Begin PBXFileReference section */ 0108D5925E21A47DA36A66AA /* BarChartData.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = BarChartData.swift; path = Source/Charts/Data/Implementations/Standard/BarChartData.swift; sourceTree = ""; }; - 0216EDC6A1FE272F4EB19FCF /* ChartDataRendererBase.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ChartDataRendererBase.swift; path = Source/Charts/Renderers/ChartDataRendererBase.swift; sourceTree = ""; }; + 0216EDC6A1FE272F4EB19FCF /* DataRenderer.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = DataRenderer.swift; path = Source/Charts/Renderers/DataRenderer.swift; sourceTree = ""; }; 04F7B9DF1F2D66E7279771D4 /* PieRadarHighlighter.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = PieRadarHighlighter.swift; path = Source/Charts/Highlight/PieRadarHighlighter.swift; sourceTree = ""; }; 0619A877C69A95ECCC440A44 /* LineChartView.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = LineChartView.swift; path = Source/Charts/Charts/LineChartView.swift; sourceTree = ""; }; - 064989451F5C99C7006E8BB3 /* Snapshot.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = Snapshot.swift; path = Tests/Charts/Snapshot.swift; sourceTree = ""; }; - 0BD9DF16AF59680A3BB49452 /* IAxisValueFormatter.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = IAxisValueFormatter.swift; path = Source/Charts/Formatters/IAxisValueFormatter.swift; sourceTree = ""; }; + 064989451F5C99C7006E8BB3 /* Utilities.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Utilities.swift; sourceTree = ""; }; + 06AB297E20FA726500BAD505 /* Highlighter.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Highlighter.swift; path = Source/Charts/Highlight/Highlighter.swift; sourceTree = ""; }; + 0BD9DF16AF59680A3BB49452 /* AxisValueFormatter.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AxisValueFormatter.swift; path = Source/Charts/Formatters/AxisValueFormatter.swift; sourceTree = ""; }; 0DABDBBCCE6B3620C967F04A /* LineChartRenderer.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = LineChartRenderer.swift; path = Source/Charts/Renderers/LineChartRenderer.swift; sourceTree = ""; }; 0DDE409E9ECF54D2C146A6F0 /* CombinedChartData.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = CombinedChartData.swift; path = Source/Charts/Data/Implementations/Standard/CombinedChartData.swift; sourceTree = ""; }; 0F099502DA50C56204E7B744 /* Range.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Range.swift; path = Source/Charts/Highlight/Range.swift; sourceTree = ""; }; @@ -186,21 +190,24 @@ 10DD0A02E3CF611BD11EBA9B /* IndexAxisValueFormatter.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = IndexAxisValueFormatter.swift; path = Source/Charts/Formatters/IndexAxisValueFormatter.swift; sourceTree = ""; }; 11EF1FE22549E885C8F40738 /* CombinedChartView.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = CombinedChartView.swift; path = Source/Charts/Charts/CombinedChartView.swift; sourceTree = ""; }; 12409C3EA15787C11AF0D2BC /* ChartDataEntryBase.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ChartDataEntryBase.swift; path = Source/Charts/Data/Implementations/Standard/ChartDataEntryBase.swift; sourceTree = ""; }; - 135F11CD20425AF600D655A3 /* PieChartTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = PieChartTests.swift; path = Tests/Charts/PieChartTests.swift; sourceTree = ""; }; + 135F11CD20425AF600D655A3 /* PieChartTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PieChartTests.swift; sourceTree = ""; }; 18462BFDD9DEE76D51D40503 /* ScatterChartView.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ScatterChartView.swift; path = Source/Charts/Charts/ScatterChartView.swift; sourceTree = ""; }; - 18BFB0A14A5C47A302A597D9 /* ICandleChartDataSet.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ICandleChartDataSet.swift; path = Source/Charts/Data/Interfaces/ICandleChartDataSet.swift; sourceTree = ""; }; + 18BFB0A14A5C47A302A597D9 /* CandleChartDataSetProtocol.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = CandleChartDataSetProtocol.swift; path = Source/Charts/Data/Interfaces/CandleChartDataSetProtocol.swift; sourceTree = ""; }; 1C02C3AF5C92FCFC18224C35 /* XAxisRenderer.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = XAxisRenderer.swift; path = Source/Charts/Renderers/XAxisRenderer.swift; sourceTree = ""; }; 1CBBC58C6CE1EBEE9852CE41 /* ChartsTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ChartsTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 1F3D55A7E6176D52DC957D27 /* XAxisRendererHorizontalBarChart.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = XAxisRendererHorizontalBarChart.swift; path = Source/Charts/Renderers/XAxisRendererHorizontalBarChart.swift; sourceTree = ""; }; 2194AA554712E6BA2677F114 /* BubbleChartRenderer.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = BubbleChartRenderer.swift; path = Source/Charts/Renderers/BubbleChartRenderer.swift; sourceTree = ""; }; - 219BC9CEA037F897E92E45D1 /* IScatterChartDataSet.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = IScatterChartDataSet.swift; path = Source/Charts/Data/Interfaces/IScatterChartDataSet.swift; sourceTree = ""; }; - 224EFF981FBAAC4700CF9B3B /* EquatableTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = EquatableTests.swift; path = Tests/Charts/EquatableTests.swift; sourceTree = ""; }; + 219BC9CEA037F897E92E45D1 /* ScatterChartDataSetProtocol.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ScatterChartDataSetProtocol.swift; path = Source/Charts/Data/Interfaces/ScatterChartDataSetProtocol.swift; sourceTree = ""; }; + 221CA2912588FCBC00C2DD1E /* Sequence+KeyPath.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = "Sequence+KeyPath.swift"; path = "Source/Charts/Utils/Sequence+KeyPath.swift"; sourceTree = ""; }; + 2243BBFB1FF156D000B49D0B /* EquatableTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EquatableTests.swift; sourceTree = ""; }; + 22786E8325CD96620051335B /* Media.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Media.xcassets; sourceTree = ""; }; + 22786E8425CD96620051335B /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 23D35CF6F9177D77B6B97AE1 /* XShapeRenderer.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = XShapeRenderer.swift; path = Source/Charts/Renderers/Scatter/XShapeRenderer.swift; sourceTree = ""; }; 2440DB759AB93B4A928A3F6F /* RadarChartView.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = RadarChartView.swift; path = Source/Charts/Charts/RadarChartView.swift; sourceTree = ""; }; 2465CB73738EBAFB46C57288 /* CombinedHighlighter.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = CombinedHighlighter.swift; path = Source/Charts/Highlight/CombinedHighlighter.swift; sourceTree = ""; }; 266E162DA8B29D9AEB6A9397 /* MoveViewJob.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = MoveViewJob.swift; path = Source/Charts/Jobs/MoveViewJob.swift; sourceTree = ""; }; 274116834B1B0345D622E027 /* CandleChartDataSet.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = CandleChartDataSet.swift; path = Source/Charts/Data/Implementations/Standard/CandleChartDataSet.swift; sourceTree = ""; }; - 2EAD807534620E3B53327F04 /* IRadarChartDataSet.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = IRadarChartDataSet.swift; path = Source/Charts/Data/Interfaces/IRadarChartDataSet.swift; sourceTree = ""; }; + 2EAD807534620E3B53327F04 /* RadarChartDataSetProtocol.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = RadarChartDataSetProtocol.swift; path = Source/Charts/Data/Interfaces/RadarChartDataSetProtocol.swift; sourceTree = ""; }; 2FD37A55B4D85D883E29C744 /* ScatterChartDataProvider.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ScatterChartDataProvider.swift; path = Source/Charts/Interfaces/ScatterChartDataProvider.swift; sourceTree = ""; }; 30EFAD7920F76360ADB3B5F5 /* ChartViewBase.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ChartViewBase.swift; path = Source/Charts/Charts/ChartViewBase.swift; sourceTree = ""; }; 324C9127B53A8D39C8B49277 /* TransformerHorizontalBarChart.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = TransformerHorizontalBarChart.swift; path = Source/Charts/Utils/TransformerHorizontalBarChart.swift; sourceTree = ""; }; @@ -208,13 +215,12 @@ 33BE9A97FFA41D3D85CAFFC7 /* HorizontalBarHighlighter.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = HorizontalBarHighlighter.swift; path = Source/Charts/Highlight/HorizontalBarHighlighter.swift; sourceTree = ""; }; 392AAEB02DD7B351D92907C2 /* MarkerImage.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = MarkerImage.swift; path = Source/Charts/Components/MarkerImage.swift; sourceTree = ""; }; 3976E5F9D60E30CD94CE6156 /* Animator.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Animator.swift; path = Source/Charts/Animation/Animator.swift; sourceTree = ""; }; - 3A32510073A303CBB38E094A /* IChartDataSet.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = IChartDataSet.swift; path = Source/Charts/Data/Interfaces/IChartDataSet.swift; sourceTree = ""; }; + 3A32510073A303CBB38E094A /* ChartDataSetProtocol.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ChartDataSetProtocol.swift; path = Source/Charts/Data/Interfaces/ChartDataSetProtocol.swift; sourceTree = ""; }; 3D64616883374310C505EC39 /* Highlight.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Highlight.swift; path = Source/Charts/Highlight/Highlight.swift; sourceTree = ""; }; 3ED23C354AFE81818D78E645 /* Platform.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Platform.swift; path = Source/Charts/Utils/Platform.swift; sourceTree = ""; }; 3F8146ABC9FC311AF8CA699C /* CandleChartDataProvider.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = CandleChartDataProvider.swift; path = Source/Charts/Interfaces/CandleChartDataProvider.swift; sourceTree = ""; }; 3FDA09EF973925A110506799 /* ChartUtils.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ChartUtils.swift; path = Source/Charts/Utils/ChartUtils.swift; sourceTree = ""; }; - 41DDB768A1D033A34F0EF9E0 /* Media.xcassets */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = folder.assetcatalog; name = Media.xcassets; path = "Tests/Supporting Files/Media.xcassets"; sourceTree = ""; }; - 429E88F2729735DC092EE556 /* ILineChartDataSet.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ILineChartDataSet.swift; path = Source/Charts/Data/Interfaces/ILineChartDataSet.swift; sourceTree = ""; }; + 429E88F2729735DC092EE556 /* LineChartDataSetProtocol.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = LineChartDataSetProtocol.swift; path = Source/Charts/Data/Interfaces/LineChartDataSetProtocol.swift; sourceTree = ""; }; 45C6D3723C4E001B119CA0C8 /* BarLineChartViewBase.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = BarLineChartViewBase.swift; path = Source/Charts/Charts/BarLineChartViewBase.swift; sourceTree = ""; }; 45E31A4356CC6F283C29954B /* LineRadarChartDataSet.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = LineRadarChartDataSet.swift; path = Source/Charts/Data/Implementations/Standard/LineRadarChartDataSet.swift; sourceTree = ""; }; 46D8013D44629521B1746364 /* PieChartRenderer.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = PieChartRenderer.swift; path = Source/Charts/Renderers/PieChartRenderer.swift; sourceTree = ""; }; @@ -224,20 +230,20 @@ 4BBB57D6FA41029B08F26D7B /* RadarChartData.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = RadarChartData.swift; path = Source/Charts/Data/Implementations/Standard/RadarChartData.swift; sourceTree = ""; }; 4C2EA58CB336967198D30D20 /* AnimatedZoomViewJob.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AnimatedZoomViewJob.swift; path = Source/Charts/Jobs/AnimatedZoomViewJob.swift; sourceTree = ""; }; 4C978F31F23C7D21197DC2A1 /* LineChartData.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = LineChartData.swift; path = Source/Charts/Data/Implementations/Standard/LineChartData.swift; sourceTree = ""; }; - 4EAA8AA30C377D54D22A577A /* IValueFormatter.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = IValueFormatter.swift; path = Source/Charts/Formatters/IValueFormatter.swift; sourceTree = ""; }; + 4EAA8AA30C377D54D22A577A /* ValueFormatter.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ValueFormatter.swift; path = Source/Charts/Formatters/ValueFormatter.swift; sourceTree = ""; }; 4EED352A98860E031F13AFB7 /* BubbleChartView.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = BubbleChartView.swift; path = Source/Charts/Charts/BubbleChartView.swift; sourceTree = ""; }; - 4F7E6A99D82E6AE3804D5A39 /* ILineRadarChartDataSet.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ILineRadarChartDataSet.swift; path = Source/Charts/Data/Interfaces/ILineRadarChartDataSet.swift; sourceTree = ""; }; + 4F7E6A99D82E6AE3804D5A39 /* LineRadarChartDataSetProtocol.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = LineRadarChartDataSetProtocol.swift; path = Source/Charts/Data/Interfaces/LineRadarChartDataSetProtocol.swift; sourceTree = ""; }; 4F9922F0641F7955DC6CD324 /* Charts.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = Charts.h; path = "Source/Supporting Files/Charts.h"; sourceTree = ""; }; 5225ABC3C0C2F65FC094EEBB /* XAxis.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = XAxis.swift; path = Source/Charts/Components/XAxis.swift; sourceTree = ""; }; 52265C1B343CCC41AF2300E3 /* CombinedChartRenderer.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = CombinedChartRenderer.swift; path = Source/Charts/Renderers/CombinedChartRenderer.swift; sourceTree = ""; }; 539382766378B702660FDFB2 /* HorizontalBarChartRenderer.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = HorizontalBarChartRenderer.swift; path = Source/Charts/Renderers/HorizontalBarChartRenderer.swift; sourceTree = ""; }; 543729805D897CC03E5F78D3 /* BarHighlighter.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = BarHighlighter.swift; path = Source/Charts/Highlight/BarHighlighter.swift; sourceTree = ""; }; 559DB735FEA17AB90676D6CA /* BarLineScatterCandleBubbleChartData.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = BarLineScatterCandleBubbleChartData.swift; path = Source/Charts/Data/Implementations/Standard/BarLineScatterCandleBubbleChartData.swift; sourceTree = ""; }; - 596963A429D485E3894C4666 /* IMarker.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = IMarker.swift; path = Source/Charts/Components/IMarker.swift; sourceTree = ""; }; + 596963A429D485E3894C4666 /* Marker.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Marker.swift; path = Source/Charts/Components/Marker.swift; sourceTree = ""; }; 5983826927D825EF5F855C28 /* ChartHighlighter.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ChartHighlighter.swift; path = Source/Charts/Highlight/ChartHighlighter.swift; sourceTree = ""; }; 5A4CFFFB65819121595F06F1 /* Fill.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Fill.swift; path = Source/Charts/Utils/Fill.swift; sourceTree = ""; }; 5B1C588E9DF6FFD56D7ADF8E /* BarLineScatterCandleBubbleRenderer.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = BarLineScatterCandleBubbleRenderer.swift; path = Source/Charts/Renderers/BarLineScatterCandleBubbleRenderer.swift; sourceTree = ""; }; - 5C3F5E1A69EC06E86505F7B1 /* BarChartTests.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = BarChartTests.swift; path = Tests/Charts/BarChartTests.swift; sourceTree = ""; }; + 5C3F5E1A69EC06E86505F7B1 /* BarChartTests.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = BarChartTests.swift; sourceTree = ""; }; 6021C9E424C36116AEA78CC9 /* HorizontalBarChartView.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = HorizontalBarChartView.swift; path = Source/Charts/Charts/HorizontalBarChartView.swift; sourceTree = ""; }; 62B73FCEDD3841E7B958F6A9 /* ChartDataProvider.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ChartDataProvider.swift; path = Source/Charts/Interfaces/ChartDataProvider.swift; sourceTree = ""; }; 65AD9E95D9ED4DC0BD73A743 /* Charts.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Charts.framework; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -251,36 +257,35 @@ 710D7C9B2F1DB4A331EE405A /* AnimatedViewPortJob.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AnimatedViewPortJob.swift; path = Source/Charts/Jobs/AnimatedViewPortJob.swift; sourceTree = ""; }; 72EAEBB7CF73E33565FC2896 /* ViewPortHandler.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ViewPortHandler.swift; path = Source/Charts/Utils/ViewPortHandler.swift; sourceTree = ""; }; 75F279974FE650E57A061B09 /* BarChartRenderer.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = BarChartRenderer.swift; path = Source/Charts/Renderers/BarChartRenderer.swift; sourceTree = ""; }; - 7A53A9E42FC07FFDACA937C1 /* IBarChartDataSet.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = IBarChartDataSet.swift; path = Source/Charts/Data/Interfaces/IBarChartDataSet.swift; sourceTree = ""; }; - 7AB9062A28AAB9469752A954 /* ChartUtilsTests.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ChartUtilsTests.swift; path = Tests/Charts/ChartUtilsTests.swift; sourceTree = ""; }; + 7A53A9E42FC07FFDACA937C1 /* BarChartDataSetProtocol.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = BarChartDataSetProtocol.swift; path = Source/Charts/Data/Interfaces/BarChartDataSetProtocol.swift; sourceTree = ""; }; + 7AB9062A28AAB9469752A954 /* ChartUtilsTests.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ChartUtilsTests.swift; sourceTree = ""; }; 7AC9C3D69ACB5BDE22421E15 /* RadarChartRenderer.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = RadarChartRenderer.swift; path = Source/Charts/Renderers/RadarChartRenderer.swift; sourceTree = ""; }; 7EDA3AD550AEFC93C8D15B9C /* BubbleChartData.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = BubbleChartData.swift; path = Source/Charts/Data/Implementations/Standard/BubbleChartData.swift; sourceTree = ""; }; 80D5B764EC0AE1E17E55DC67 /* ScatterChartRenderer.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ScatterChartRenderer.swift; path = Source/Charts/Renderers/ScatterChartRenderer.swift; sourceTree = ""; }; - 818AC6B12505B7C0A53D62F9 /* IFillFormatter.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = IFillFormatter.swift; path = Source/Charts/Formatters/IFillFormatter.swift; sourceTree = ""; }; + 818AC6B12505B7C0A53D62F9 /* FillFormatter.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = FillFormatter.swift; path = Source/Charts/Formatters/FillFormatter.swift; sourceTree = ""; }; 823F7DB281C6C6F069A69605 /* CrossShapeRenderer.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = CrossShapeRenderer.swift; path = Source/Charts/Renderers/Scatter/CrossShapeRenderer.swift; sourceTree = ""; }; 8FF03960A871A092F5B54315 /* BarLineScatterCandleBubbleChartDataProvider.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = BarLineScatterCandleBubbleChartDataProvider.swift; path = Source/Charts/Interfaces/BarLineScatterCandleBubbleChartDataProvider.swift; sourceTree = ""; }; 910DBFE1DA1B2CA237A736DF /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; name = Info.plist; path = "Source/Supporting Files/Info.plist"; sourceTree = ""; }; 91EEEDE2AB8F2DA3AFCF0733 /* RadarChartDataEntry.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = RadarChartDataEntry.swift; path = Source/Charts/Data/Implementations/Standard/RadarChartDataEntry.swift; sourceTree = ""; }; 923206233CA89FD03565FF87 /* LineScatterCandleRadarRenderer.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = LineScatterCandleRadarRenderer.swift; path = Source/Charts/Renderers/LineScatterCandleRadarRenderer.swift; sourceTree = ""; }; - 9249AD9AEC8C85772365A128 /* ILineScatterCandleRadarChartDataSet.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ILineScatterCandleRadarChartDataSet.swift; path = Source/Charts/Data/Interfaces/ILineScatterCandleRadarChartDataSet.swift; sourceTree = ""; }; + 9249AD9AEC8C85772365A128 /* LineScatterCandleRadarChartDataSetProtocol.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = LineScatterCandleRadarChartDataSetProtocol.swift; path = Source/Charts/Data/Interfaces/LineScatterCandleRadarChartDataSetProtocol.swift; sourceTree = ""; }; 93EF9709CF635BEE70D1ABC5 /* DataApproximator.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = DataApproximator.swift; path = Source/Charts/Filters/DataApproximator.swift; sourceTree = ""; }; 97AD2D4520AF917100F9C24A /* Platform+Accessibility.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "Platform+Accessibility.swift"; path = "Source/Charts/Utils/Platform+Accessibility.swift"; sourceTree = ""; }; - 998F2BFE318471AFC05B50AC /* IHighlighter.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = IHighlighter.swift; path = Source/Charts/Highlight/IHighlighter.swift; sourceTree = ""; }; 9A26C8DA1F87B01700367599 /* DataApproximator+N.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "DataApproximator+N.swift"; path = "Source/Charts/Filters/DataApproximator+N.swift"; sourceTree = ""; }; 9D7184C8A5A60A3522AB9B05 /* BarChartDataProvider.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = BarChartDataProvider.swift; path = Source/Charts/Interfaces/BarChartDataProvider.swift; sourceTree = ""; }; 9DCD13D558BA177D5952AD66 /* PieChartView.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = PieChartView.swift; path = Source/Charts/Charts/PieChartView.swift; sourceTree = ""; }; 9E7C673B9ED4340F550A9283 /* LegendEntry.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = LegendEntry.swift; path = Source/Charts/Components/LegendEntry.swift; sourceTree = ""; }; A140F644332704916947B58C /* CombinedChartDataProvider.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = CombinedChartDataProvider.swift; path = Source/Charts/Interfaces/CombinedChartDataProvider.swift; sourceTree = ""; }; A4FB5E3761EF8B4D1E1E1014 /* PieChartDataSet.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = PieChartDataSet.swift; path = Source/Charts/Data/Implementations/Standard/PieChartDataSet.swift; sourceTree = ""; }; - A5649B272BF3EBFC8A1EF0C1 /* IBarLineScatterCandleBubbleChartDataSet.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = IBarLineScatterCandleBubbleChartDataSet.swift; path = Source/Charts/Data/Interfaces/IBarLineScatterCandleBubbleChartDataSet.swift; sourceTree = ""; }; + A5649B272BF3EBFC8A1EF0C1 /* BarLineScatterCandleBubbleChartDataSetProtocol.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = BarLineScatterCandleBubbleChartDataSetProtocol.swift; path = Source/Charts/Data/Interfaces/BarLineScatterCandleBubbleChartDataSetProtocol.swift; sourceTree = ""; }; A5A75AA73C5AA381DA517959 /* LineChartDataSet.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = LineChartDataSet.swift; path = Source/Charts/Data/Implementations/Standard/LineChartDataSet.swift; sourceTree = ""; }; AA5A16F4A382813C4FE8BDF9 /* YAxisRendererRadarChart.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = YAxisRendererRadarChart.swift; path = Source/Charts/Renderers/YAxisRendererRadarChart.swift; sourceTree = ""; }; AA70259ED16FF80D8EEB0F94 /* ChevronUpShapeRenderer.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ChevronUpShapeRenderer.swift; path = Source/Charts/Renderers/Scatter/ChevronUpShapeRenderer.swift; sourceTree = ""; }; B137428B41C143D5115726C4 /* Description.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Description.swift; path = Source/Charts/Components/Description.swift; sourceTree = ""; }; B1BA6B21CBDF77A15848994F /* RadarChartDataSet.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = RadarChartDataSet.swift; path = Source/Charts/Data/Implementations/Standard/RadarChartDataSet.swift; sourceTree = ""; }; B44829AF0ADA583F1F0279B7 /* BubbleChartDataSet.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = BubbleChartDataSet.swift; path = Source/Charts/Data/Implementations/Standard/BubbleChartDataSet.swift; sourceTree = ""; }; - B66817452241E3CC00017CF1 /* HorizontalBarChartTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = HorizontalBarChartTests.swift; path = Tests/Charts/HorizontalBarChartTests.swift; sourceTree = ""; }; - B6BF9A551F91993A00E62A5D /* CombinedChartTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = CombinedChartTests.swift; path = Tests/Charts/CombinedChartTests.swift; sourceTree = ""; }; + B66817452241E3CC00017CF1 /* HorizontalBarChartTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HorizontalBarChartTests.swift; sourceTree = ""; }; + B6BF9A551F91993A00E62A5D /* CombinedChartTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CombinedChartTests.swift; sourceTree = ""; }; BA157EFF2F952192C11DF937 /* AnimatedMoveViewJob.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AnimatedMoveViewJob.swift; path = Source/Charts/Jobs/AnimatedMoveViewJob.swift; sourceTree = ""; }; BA1A58428DC4780BAB4EAADC /* CandleStickChartView.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = CandleStickChartView.swift; path = Source/Charts/Charts/CandleStickChartView.swift; sourceTree = ""; }; BC19DC2434D65FFB446A61B7 /* XAxisRendererRadarChart.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = XAxisRendererRadarChart.swift; path = Source/Charts/Renderers/XAxisRendererRadarChart.swift; sourceTree = ""; }; @@ -290,9 +295,8 @@ C03E6D8023DAAB2600083010 /* ChartDataTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChartDataTests.swift; sourceTree = ""; }; C31AA65EA27776F8C653C7E8 /* BarChartDataSet.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = BarChartDataSet.swift; path = Source/Charts/Data/Implementations/Standard/BarChartDataSet.swift; sourceTree = ""; }; C52E8344160B5E689DA3C25C /* ChevronDownShapeRenderer.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ChevronDownShapeRenderer.swift; path = Source/Charts/Renderers/Scatter/ChevronDownShapeRenderer.swift; sourceTree = ""; }; - C574E1BC7E12D937A5471EF8 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; name = Info.plist; path = "Tests/Supporting Files/Info.plist"; sourceTree = ""; }; C58BD7B14BEA440783ED8D2B /* LineScatterCandleRadarChartDataSet.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = LineScatterCandleRadarChartDataSet.swift; path = Source/Charts/Data/Implementations/Standard/LineScatterCandleRadarChartDataSet.swift; sourceTree = ""; }; - C75935E899183DDFA181E2CC /* AxisRendererBase.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AxisRendererBase.swift; path = Source/Charts/Renderers/AxisRendererBase.swift; sourceTree = ""; }; + C75935E899183DDFA181E2CC /* AxisRenderer.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AxisRenderer.swift; path = Source/Charts/Renderers/AxisRenderer.swift; sourceTree = ""; }; C8C9A105A7DB64F39DDA648B /* ComponentBase.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ComponentBase.swift; path = Source/Charts/Components/ComponentBase.swift; sourceTree = ""; }; C8FB6219B143F8F7DA762950 /* TriangleShapeRenderer.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = TriangleShapeRenderer.swift; path = Source/Charts/Renderers/Scatter/TriangleShapeRenderer.swift; sourceTree = ""; }; C9AA36092355F01F00C97D93 /* Platform+Color.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "Platform+Color.swift"; path = "Source/Charts/Utils/Platform+Color.swift"; sourceTree = ""; }; @@ -301,10 +305,10 @@ C9F3DC282355FA2F000C3215 /* Platform+Touch Handling.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = "Platform+Touch Handling.swift"; path = "Source/Charts/Utils/Platform+Touch Handling.swift"; sourceTree = ""; }; C9FE42E868A225C116537368 /* ChartBaseDataSet.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ChartBaseDataSet.swift; path = Source/Charts/Data/Implementations/ChartBaseDataSet.swift; sourceTree = ""; }; CB1DD1A0F64266A10EE94194 /* ScatterChartDataSet.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ScatterChartDataSet.swift; path = Source/Charts/Data/Implementations/Standard/ScatterChartDataSet.swift; sourceTree = ""; }; - D2E1819D72CD7B6C4A4E8048 /* LineChartTests.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = LineChartTests.swift; path = Tests/Charts/LineChartTests.swift; sourceTree = ""; }; + D2E1819D72CD7B6C4A4E8048 /* LineChartTests.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = LineChartTests.swift; sourceTree = ""; }; D2E698FF540029B70AC97AD7 /* CandleChartDataEntry.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = CandleChartDataEntry.swift; path = Source/Charts/Data/Implementations/Standard/CandleChartDataEntry.swift; sourceTree = ""; }; D6C1BEFDF17404666C7B6054 /* DefaultFillFormatter.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = DefaultFillFormatter.swift; path = Source/Charts/Formatters/DefaultFillFormatter.swift; sourceTree = ""; }; - DA2AA6CC89F809DCCD7605B4 /* IPieChartDataSet.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = IPieChartDataSet.swift; path = Source/Charts/Data/Interfaces/IPieChartDataSet.swift; sourceTree = ""; }; + DA2AA6CC89F809DCCD7605B4 /* PieChartDataSetProtocol.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = PieChartDataSetProtocol.swift; path = Source/Charts/Data/Interfaces/PieChartDataSetProtocol.swift; sourceTree = ""; }; DD8ED233775EEC31243A6919 /* BubbleChartDataEntry.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = BubbleChartDataEntry.swift; path = Source/Charts/Data/Implementations/Standard/BubbleChartDataEntry.swift; sourceTree = ""; }; DFB762958EE8E6521563665D /* ChartAnimationEasing.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ChartAnimationEasing.swift; path = Source/Charts/Animation/ChartAnimationEasing.swift; sourceTree = ""; }; E120E76C6F1B5877D56126DD /* ChartData.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ChartData.swift; path = Source/Charts/Data/Implementations/Standard/ChartData.swift; sourceTree = ""; }; @@ -317,12 +321,12 @@ EDEAF554FD0D68EA4C0E7E49 /* BubbleChartDataProvider.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = BubbleChartDataProvider.swift; path = Source/Charts/Interfaces/BubbleChartDataProvider.swift; sourceTree = ""; }; F22750328058DEC2F019646F /* ChartDataEntry.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ChartDataEntry.swift; path = Source/Charts/Data/Implementations/Standard/ChartDataEntry.swift; sourceTree = ""; }; F368CF209744D8F3B85B1028 /* RadarHighlighter.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = RadarHighlighter.swift; path = Source/Charts/Highlight/RadarHighlighter.swift; sourceTree = ""; }; - F3788EC55EF908B0805D7C2F /* IBubbleChartDataSet.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = IBubbleChartDataSet.swift; path = Source/Charts/Data/Interfaces/IBubbleChartDataSet.swift; sourceTree = ""; }; + F3788EC55EF908B0805D7C2F /* BubbleChartDataSetProtocol.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = BubbleChartDataSetProtocol.swift; path = Source/Charts/Data/Interfaces/BubbleChartDataSetProtocol.swift; sourceTree = ""; }; F4785FEACAE4367F36FB8868 /* CandleChartData.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = CandleChartData.swift; path = Source/Charts/Data/Implementations/Standard/CandleChartData.swift; sourceTree = ""; }; F6227A646166E248F90F86AD /* ChartColorTemplates.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ChartColorTemplates.swift; path = Source/Charts/Utils/ChartColorTemplates.swift; sourceTree = ""; }; F6DEBFAB1D73E944ED430B4F /* ChartLimitLine.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ChartLimitLine.swift; path = Source/Charts/Components/ChartLimitLine.swift; sourceTree = ""; }; F715DB2C56C9E0615542625B /* LegendRenderer.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = LegendRenderer.swift; path = Source/Charts/Renderers/LegendRenderer.swift; sourceTree = ""; }; - FA1D3D13180C2E3893A82546 /* IShapeRenderer.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = IShapeRenderer.swift; path = Source/Charts/Renderers/Scatter/IShapeRenderer.swift; sourceTree = ""; }; + FA1D3D13180C2E3893A82546 /* ShapeRenderer.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ShapeRenderer.swift; path = Source/Charts/Renderers/Scatter/ShapeRenderer.swift; sourceTree = ""; }; FA7BDB22C97F39A4B33E38A7 /* ViewPortJob.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ViewPortJob.swift; path = Source/Charts/Jobs/ViewPortJob.swift; sourceTree = ""; }; FB3A4F5987E58F3E5BE855F9 /* ZoomViewJob.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ZoomViewJob.swift; path = Source/Charts/Jobs/ZoomViewJob.swift; sourceTree = ""; }; FB92A80F861C1362EED8D946 /* YAxis.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = YAxis.swift; path = Source/Charts/Components/YAxis.swift; sourceTree = ""; }; @@ -335,6 +339,7 @@ buildActionMask = 2147483647; files = ( C7B150D740255670DEB9F455 /* Charts.framework in Frameworks */, + 22BBDA0825CC4C2F00435670 /* SnapshotTesting in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -342,13 +347,14 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 228D56232554F27A00BEE75E /* Algorithms in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - 031D7C33F3BF172E30664862 /* Interfaces */ = { + 031D7C33F3BF172E30664862 /* DataProviders */ = { isa = PBXGroup; children = ( 9D7184C8A5A60A3522AB9B05 /* BarChartDataProvider.swift */, @@ -360,7 +366,7 @@ BFABD027DAF6851088F002AC /* LineChartDataProvider.swift */, 2FD37A55B4D85D883E29C744 /* ScatterChartDataProvider.swift */, ); - name = Interfaces; + name = DataProviders; sourceTree = ""; }; 033FD152BB2F906750106A85 /* Frameworks */ = { @@ -373,8 +379,10 @@ 098621EDFBF928494B94BEA1 /* Data */ = { isa = PBXGroup; children = ( - 3B9DD76FCE8D873300A822C7 /* Implementations */, - DB2D9648877455028EBEAA8F /* Interfaces */, + 22C014222006FFE800D5B025 /* ChartData */, + 3B9DD76FCE8D873300A822C7 /* ChartDataSet */, + 22C014232006FFFA00D5B025 /* ChartEntry */, + DB2D9648877455028EBEAA8F /* DataSet Protocols */, ); name = Data; sourceTree = ""; @@ -388,6 +396,80 @@ name = Source; sourceTree = ""; }; + 2227EA571FF1F219007D98D9 /* AxisRenderers */ = { + isa = PBXGroup; + children = ( + C75935E899183DDFA181E2CC /* AxisRenderer.swift */, + 1C02C3AF5C92FCFC18224C35 /* XAxisRenderer.swift */, + 1F3D55A7E6176D52DC957D27 /* XAxisRendererHorizontalBarChart.swift */, + BC19DC2434D65FFB446A61B7 /* XAxisRendererRadarChart.swift */, + 688B80F1AA88AE54152BE768 /* YAxisRenderer.swift */, + EAE417AAA0FCA0DD00E77489 /* YAxisRendererHorizontalBarChart.swift */, + AA5A16F4A382813C4FE8BDF9 /* YAxisRendererRadarChart.swift */, + ); + name = AxisRenderers; + sourceTree = ""; + }; + 2227EA581FF1F224007D98D9 /* ChartRenderers */ = { + isa = PBXGroup; + children = ( + 0216EDC6A1FE272F4EB19FCF /* DataRenderer.swift */, + 75F279974FE650E57A061B09 /* BarChartRenderer.swift */, + 5B1C588E9DF6FFD56D7ADF8E /* BarLineScatterCandleBubbleRenderer.swift */, + 2194AA554712E6BA2677F114 /* BubbleChartRenderer.swift */, + BD5C6D20243EC2F19069AACD /* CandleStickChartRenderer.swift */, + 52265C1B343CCC41AF2300E3 /* CombinedChartRenderer.swift */, + 539382766378B702660FDFB2 /* HorizontalBarChartRenderer.swift */, + 0DABDBBCCE6B3620C967F04A /* LineChartRenderer.swift */, + 105FFC9D3773A9C7A60A897F /* LineRadarRenderer.swift */, + 923206233CA89FD03565FF87 /* LineScatterCandleRadarRenderer.swift */, + 46D8013D44629521B1746364 /* PieChartRenderer.swift */, + 7AC9C3D69ACB5BDE22421E15 /* RadarChartRenderer.swift */, + 80D5B764EC0AE1E17E55DC67 /* ScatterChartRenderer.swift */, + ); + name = ChartRenderers; + sourceTree = ""; + }; + 22786E8225CD96620051335B /* Resources */ = { + isa = PBXGroup; + children = ( + 22786E8325CD96620051335B /* Media.xcassets */, + 22786E8425CD96620051335B /* Info.plist */, + ); + path = Resources; + sourceTree = ""; + }; + 22C014222006FFE800D5B025 /* ChartData */ = { + isa = PBXGroup; + children = ( + 0108D5925E21A47DA36A66AA /* BarChartData.swift */, + 559DB735FEA17AB90676D6CA /* BarLineScatterCandleBubbleChartData.swift */, + 7EDA3AD550AEFC93C8D15B9C /* BubbleChartData.swift */, + F4785FEACAE4367F36FB8868 /* CandleChartData.swift */, + E120E76C6F1B5877D56126DD /* ChartData.swift */, + 0DDE409E9ECF54D2C146A6F0 /* CombinedChartData.swift */, + 4C978F31F23C7D21197DC2A1 /* LineChartData.swift */, + 6E03A4987F72414A02A0631B /* PieChartData.swift */, + 4BBB57D6FA41029B08F26D7B /* RadarChartData.swift */, + E7AD2FC320A16CA1EE0A52F4 /* ScatterChartData.swift */, + ); + name = ChartData; + sourceTree = ""; + }; + 22C014232006FFFA00D5B025 /* ChartEntry */ = { + isa = PBXGroup; + children = ( + E3F8BFF1CBC58D5B9DBFFB9B /* BarChartDataEntry.swift */, + DD8ED233775EEC31243A6919 /* BubbleChartDataEntry.swift */, + D2E698FF540029B70AC97AD7 /* CandleChartDataEntry.swift */, + F22750328058DEC2F019646F /* ChartDataEntry.swift */, + 12409C3EA15787C11AF0D2BC /* ChartDataEntryBase.swift */, + BD02157CF8CEE1189BF681DA /* PieChartDataEntry.swift */, + 91EEEDE2AB8F2DA3AFCF0733 /* RadarChartDataEntry.swift */, + ); + name = ChartEntry; + sourceTree = ""; + }; 2647844720BC6574A544A337 /* Charts */ = { isa = PBXGroup; children = ( @@ -398,7 +480,7 @@ AA79AB82B0ADCA926510B73E /* Filters */, 74A391010038924F637D6752 /* Formatters */, 42824E1F334B0C484AF4C594 /* Highlight */, - 031D7C33F3BF172E30664862 /* Interfaces */, + 031D7C33F3BF172E30664862 /* DataProviders */, AD1224C45A29A5C88D6B7450 /* Jobs */, E7589D3E7C2BD2449960AD59 /* Renderers */, D047819AB7170595896D6FE8 /* Utils */, @@ -406,24 +488,34 @@ name = Charts; sourceTree = ""; }; - 3B9DD76FCE8D873300A822C7 /* Implementations */ = { + 3B9DD76FCE8D873300A822C7 /* ChartDataSet */ = { isa = PBXGroup; children = ( C9FE42E868A225C116537368 /* ChartBaseDataSet.swift */, - 740017197A160047EBB8A9A0 /* Standard */, + C31AA65EA27776F8C653C7E8 /* BarChartDataSet.swift */, + 6D717F0808DE7EC8A4AE9C2A /* BarLineScatterCandleBubbleChartDataSet.swift */, + B44829AF0ADA583F1F0279B7 /* BubbleChartDataSet.swift */, + 274116834B1B0345D622E027 /* CandleChartDataSet.swift */, + 6CEC0C69C89CE9B99F3B4409 /* ChartDataSet.swift */, + A5A75AA73C5AA381DA517959 /* LineChartDataSet.swift */, + 45E31A4356CC6F283C29954B /* LineRadarChartDataSet.swift */, + C58BD7B14BEA440783ED8D2B /* LineScatterCandleRadarChartDataSet.swift */, + A4FB5E3761EF8B4D1E1E1014 /* PieChartDataSet.swift */, + B1BA6B21CBDF77A15848994F /* RadarChartDataSet.swift */, + CB1DD1A0F64266A10EE94194 /* ScatterChartDataSet.swift */, ); - name = Implementations; + name = ChartDataSet; sourceTree = ""; }; 42824E1F334B0C484AF4C594 /* Highlight */ = { isa = PBXGroup; children = ( + 06AB297E20FA726500BAD505 /* Highlighter.swift */, 543729805D897CC03E5F78D3 /* BarHighlighter.swift */, 5983826927D825EF5F855C28 /* ChartHighlighter.swift */, 2465CB73738EBAFB46C57288 /* CombinedHighlighter.swift */, 3D64616883374310C505EC39 /* Highlight.swift */, 33BE9A97FFA41D3D85CAFFC7 /* HorizontalBarHighlighter.swift */, - 998F2BFE318471AFC05B50AC /* IHighlighter.swift */, 7036F11832C017E26AC750A4 /* PieHighlighter.swift */, 04F7B9DF1F2D66E7279771D4 /* PieRadarHighlighter.swift */, F368CF209744D8F3B85B1028 /* RadarHighlighter.swift */, @@ -439,7 +531,7 @@ F6DEBFAB1D73E944ED430B4F /* ChartLimitLine.swift */, C8C9A105A7DB64F39DDA648B /* ComponentBase.swift */, B137428B41C143D5115726C4 /* Description.swift */, - 596963A429D485E3894C4666 /* IMarker.swift */, + 596963A429D485E3894C4666 /* Marker.swift */, E64A75540C627E09080B402A /* Legend.swift */, 9E7C673B9ED4340F550A9283 /* LegendEntry.swift */, 392AAEB02DD7B351D92907C2 /* MarkerImage.swift */, @@ -450,51 +542,16 @@ name = Components; sourceTree = ""; }; - 740017197A160047EBB8A9A0 /* Standard */ = { - isa = PBXGroup; - children = ( - 0108D5925E21A47DA36A66AA /* BarChartData.swift */, - E3F8BFF1CBC58D5B9DBFFB9B /* BarChartDataEntry.swift */, - C31AA65EA27776F8C653C7E8 /* BarChartDataSet.swift */, - 559DB735FEA17AB90676D6CA /* BarLineScatterCandleBubbleChartData.swift */, - 6D717F0808DE7EC8A4AE9C2A /* BarLineScatterCandleBubbleChartDataSet.swift */, - 7EDA3AD550AEFC93C8D15B9C /* BubbleChartData.swift */, - DD8ED233775EEC31243A6919 /* BubbleChartDataEntry.swift */, - B44829AF0ADA583F1F0279B7 /* BubbleChartDataSet.swift */, - F4785FEACAE4367F36FB8868 /* CandleChartData.swift */, - D2E698FF540029B70AC97AD7 /* CandleChartDataEntry.swift */, - 274116834B1B0345D622E027 /* CandleChartDataSet.swift */, - E120E76C6F1B5877D56126DD /* ChartData.swift */, - F22750328058DEC2F019646F /* ChartDataEntry.swift */, - 12409C3EA15787C11AF0D2BC /* ChartDataEntryBase.swift */, - 6CEC0C69C89CE9B99F3B4409 /* ChartDataSet.swift */, - 0DDE409E9ECF54D2C146A6F0 /* CombinedChartData.swift */, - 4C978F31F23C7D21197DC2A1 /* LineChartData.swift */, - A5A75AA73C5AA381DA517959 /* LineChartDataSet.swift */, - 45E31A4356CC6F283C29954B /* LineRadarChartDataSet.swift */, - C58BD7B14BEA440783ED8D2B /* LineScatterCandleRadarChartDataSet.swift */, - 6E03A4987F72414A02A0631B /* PieChartData.swift */, - BD02157CF8CEE1189BF681DA /* PieChartDataEntry.swift */, - A4FB5E3761EF8B4D1E1E1014 /* PieChartDataSet.swift */, - 4BBB57D6FA41029B08F26D7B /* RadarChartData.swift */, - 91EEEDE2AB8F2DA3AFCF0733 /* RadarChartDataEntry.swift */, - B1BA6B21CBDF77A15848994F /* RadarChartDataSet.swift */, - E7AD2FC320A16CA1EE0A52F4 /* ScatterChartData.swift */, - CB1DD1A0F64266A10EE94194 /* ScatterChartDataSet.swift */, - ); - name = Standard; - sourceTree = ""; - }; 74A391010038924F637D6752 /* Formatters */ = { isa = PBXGroup; children = ( 6A4770E0F75EFFC30707A7C8 /* DefaultAxisValueFormatter.swift */, D6C1BEFDF17404666C7B6054 /* DefaultFillFormatter.swift */, 107D8F8163EE54D6D9E916B0 /* DefaultValueFormatter.swift */, - 0BD9DF16AF59680A3BB49452 /* IAxisValueFormatter.swift */, - 818AC6B12505B7C0A53D62F9 /* IFillFormatter.swift */, + 0BD9DF16AF59680A3BB49452 /* AxisValueFormatter.swift */, + 818AC6B12505B7C0A53D62F9 /* FillFormatter.swift */, 10DD0A02E3CF611BD11EBA9B /* IndexAxisValueFormatter.swift */, - 4EAA8AA30C377D54D22A577A /* IValueFormatter.swift */, + 4EAA8AA30C377D54D22A577A /* ValueFormatter.swift */, ); name = Formatters; sourceTree = ""; @@ -531,17 +588,19 @@ 9613A7C800C7F065A823D587 /* Charts */ = { isa = PBXGroup; children = ( + 22786E8225CD96620051335B /* Resources */, 5C3F5E1A69EC06E86505F7B1 /* BarChartTests.swift */, B66817452241E3CC00017CF1 /* HorizontalBarChartTests.swift */, - 224EFF981FBAAC4700CF9B3B /* EquatableTests.swift */, 7AB9062A28AAB9469752A954 /* ChartUtilsTests.swift */, + 2243BBFB1FF156D000B49D0B /* EquatableTests.swift */, B6BF9A551F91993A00E62A5D /* CombinedChartTests.swift */, D2E1819D72CD7B6C4A4E8048 /* LineChartTests.swift */, 135F11CD20425AF600D655A3 /* PieChartTests.swift */, - 064989451F5C99C7006E8BB3 /* Snapshot.swift */, + 064989451F5C99C7006E8BB3 /* Utilities.swift */, C03E6D8023DAAB2600083010 /* ChartDataTests.swift */, ); name = Charts; + path = Tests/ChartsTests; sourceTree = ""; }; A49C1F0F9CCD6E5C143C29F4 /* Animation */ = { @@ -584,15 +643,6 @@ name = Jobs; sourceTree = ""; }; - BF662941E21BC049994B2598 /* Supporting Files */ = { - isa = PBXGroup; - children = ( - C574E1BC7E12D937A5471EF8 /* Info.plist */, - 41DDB768A1D033A34F0EF9E0 /* Media.xcassets */, - ); - name = "Supporting Files"; - sourceTree = ""; - }; D047819AB7170595896D6FE8 /* Utils */ = { isa = PBXGroup; children = ( @@ -605,6 +655,7 @@ C9F3DC252355F791000C3215 /* Platform+Gestures.swift */, C9F3DC242355F791000C3215 /* Platform+Graphics.swift */, C9F3DC282355FA2F000C3215 /* Platform+Touch Handling.swift */, + 221CA2912588FCBC00C2DD1E /* Sequence+KeyPath.swift */, FF475B9593B9898853814340 /* Transformer.swift */, 324C9127B53A8D39C8B49277 /* TransformerHorizontalBarChart.swift */, 72EAEBB7CF73E33565FC2896 /* ViewPortHandler.swift */, @@ -615,56 +666,37 @@ D2C26AC015E753014C7571E4 /* Tests */ = { isa = PBXGroup; children = ( - BF662941E21BC049994B2598 /* Supporting Files */, 9613A7C800C7F065A823D587 /* Charts */, ); name = Tests; sourceTree = ""; }; - DB2D9648877455028EBEAA8F /* Interfaces */ = { + DB2D9648877455028EBEAA8F /* DataSet Protocols */ = { isa = PBXGroup; children = ( - 7A53A9E42FC07FFDACA937C1 /* IBarChartDataSet.swift */, - A5649B272BF3EBFC8A1EF0C1 /* IBarLineScatterCandleBubbleChartDataSet.swift */, - F3788EC55EF908B0805D7C2F /* IBubbleChartDataSet.swift */, - 18BFB0A14A5C47A302A597D9 /* ICandleChartDataSet.swift */, - 3A32510073A303CBB38E094A /* IChartDataSet.swift */, - 429E88F2729735DC092EE556 /* ILineChartDataSet.swift */, - 4F7E6A99D82E6AE3804D5A39 /* ILineRadarChartDataSet.swift */, - 9249AD9AEC8C85772365A128 /* ILineScatterCandleRadarChartDataSet.swift */, - DA2AA6CC89F809DCCD7605B4 /* IPieChartDataSet.swift */, - 2EAD807534620E3B53327F04 /* IRadarChartDataSet.swift */, - 219BC9CEA037F897E92E45D1 /* IScatterChartDataSet.swift */, + 7A53A9E42FC07FFDACA937C1 /* BarChartDataSetProtocol.swift */, + A5649B272BF3EBFC8A1EF0C1 /* BarLineScatterCandleBubbleChartDataSetProtocol.swift */, + F3788EC55EF908B0805D7C2F /* BubbleChartDataSetProtocol.swift */, + 18BFB0A14A5C47A302A597D9 /* CandleChartDataSetProtocol.swift */, + 3A32510073A303CBB38E094A /* ChartDataSetProtocol.swift */, + 429E88F2729735DC092EE556 /* LineChartDataSetProtocol.swift */, + 4F7E6A99D82E6AE3804D5A39 /* LineRadarChartDataSetProtocol.swift */, + 9249AD9AEC8C85772365A128 /* LineScatterCandleRadarChartDataSetProtocol.swift */, + DA2AA6CC89F809DCCD7605B4 /* PieChartDataSetProtocol.swift */, + 2EAD807534620E3B53327F04 /* RadarChartDataSetProtocol.swift */, + 219BC9CEA037F897E92E45D1 /* ScatterChartDataSetProtocol.swift */, ); - name = Interfaces; + name = "DataSet Protocols"; sourceTree = ""; }; E7589D3E7C2BD2449960AD59 /* Renderers */ = { isa = PBXGroup; children = ( - C75935E899183DDFA181E2CC /* AxisRendererBase.swift */, - 75F279974FE650E57A061B09 /* BarChartRenderer.swift */, - 5B1C588E9DF6FFD56D7ADF8E /* BarLineScatterCandleBubbleRenderer.swift */, - 2194AA554712E6BA2677F114 /* BubbleChartRenderer.swift */, - BD5C6D20243EC2F19069AACD /* CandleStickChartRenderer.swift */, - 0216EDC6A1FE272F4EB19FCF /* ChartDataRendererBase.swift */, - 52265C1B343CCC41AF2300E3 /* CombinedChartRenderer.swift */, - 539382766378B702660FDFB2 /* HorizontalBarChartRenderer.swift */, F715DB2C56C9E0615542625B /* LegendRenderer.swift */, - 0DABDBBCCE6B3620C967F04A /* LineChartRenderer.swift */, - 105FFC9D3773A9C7A60A897F /* LineRadarRenderer.swift */, - 923206233CA89FD03565FF87 /* LineScatterCandleRadarRenderer.swift */, - 46D8013D44629521B1746364 /* PieChartRenderer.swift */, - 7AC9C3D69ACB5BDE22421E15 /* RadarChartRenderer.swift */, 6F66B32AD8A878CBD6DB6ED2 /* Renderer.swift */, - F7059584CB30EF419CFB3335 /* Scatter */, - 80D5B764EC0AE1E17E55DC67 /* ScatterChartRenderer.swift */, - 1C02C3AF5C92FCFC18224C35 /* XAxisRenderer.swift */, - 1F3D55A7E6176D52DC957D27 /* XAxisRendererHorizontalBarChart.swift */, - BC19DC2434D65FFB446A61B7 /* XAxisRendererRadarChart.swift */, - 688B80F1AA88AE54152BE768 /* YAxisRenderer.swift */, - EAE417AAA0FCA0DD00E77489 /* YAxisRendererHorizontalBarChart.swift */, - AA5A16F4A382813C4FE8BDF9 /* YAxisRendererRadarChart.swift */, + 2227EA571FF1F219007D98D9 /* AxisRenderers */, + 2227EA581FF1F224007D98D9 /* ChartRenderers */, + F7059584CB30EF419CFB3335 /* ShapeRenderer */, ); name = Renderers; sourceTree = ""; @@ -678,19 +710,19 @@ name = "Supporting Files"; sourceTree = ""; }; - F7059584CB30EF419CFB3335 /* Scatter */ = { + F7059584CB30EF419CFB3335 /* ShapeRenderer */ = { isa = PBXGroup; children = ( C52E8344160B5E689DA3C25C /* ChevronDownShapeRenderer.swift */, AA70259ED16FF80D8EEB0F94 /* ChevronUpShapeRenderer.swift */, ECE1B1623D3AF69CECAE8562 /* CircleShapeRenderer.swift */, 823F7DB281C6C6F069A69605 /* CrossShapeRenderer.swift */, - FA1D3D13180C2E3893A82546 /* IShapeRenderer.swift */, + FA1D3D13180C2E3893A82546 /* ShapeRenderer.swift */, 32FC01A016DFF1BA73AF9182 /* SquareShapeRenderer.swift */, C8FB6219B143F8F7DA762950 /* TriangleShapeRenderer.swift */, 23D35CF6F9177D77B6B97AE1 /* XShapeRenderer.swift */, ); - name = Scatter; + name = ShapeRenderer; sourceTree = ""; }; /* End PBXGroup section */ @@ -721,6 +753,9 @@ dependencies = ( ); name = Charts; + packageProductDependencies = ( + 228D56222554F27A00BEE75E /* Algorithms */, + ); productName = Charts; productReference = 65AD9E95D9ED4DC0BD73A743 /* Charts.framework */; productType = "com.apple.product-type.framework"; @@ -729,11 +764,9 @@ isa = PBXNativeTarget; buildConfigurationList = E61E9728E2BF9CC4048B13D5 /* Build configuration list for PBXNativeTarget "ChartsTests" */; buildPhases = ( - D6BF00523905132F162A7710 /* Build Dependencies */, E356A2384A2368AB3D2C7912 /* Sources */, 5B102E31AA8399941CC6248D /* Resources */, 77997192275C47C45A0A2E9A /* Frameworks */, - 6BA68666BDA3FCF79C2A6801 /* Copy Carthage Frameworks */, ); buildRules = ( ); @@ -741,6 +774,9 @@ 8676F8A013D87F9961E92465 /* PBXTargetDependency */, ); name = ChartsTests; + packageProductDependencies = ( + 22BBDA0725CC4C2F00435670 /* SnapshotTesting */, + ); productName = ChartsTests; productReference = 1CBBC58C6CE1EBEE9852CE41 /* ChartsTests.xctest */; productType = "com.apple.product-type.bundle.unit-test"; @@ -755,7 +791,7 @@ LastUpgradeCheck = 1200; TargetAttributes = { A58A4ED274A941CA248EA921 = { - LastSwiftMigration = 0900; + LastSwiftMigration = 1150; }; F2749BD5443C1CB5FE2080C2 = { LastSwiftMigration = 0900; @@ -771,6 +807,10 @@ Base, ); mainGroup = 865A1CF149F52850CAB7F177; + packageReferences = ( + 228D56212554F27A00BEE75E /* XCRemoteSwiftPackageReference "swift-algorithms" */, + 22BBDA0625CC4C2F00435670 /* XCRemoteSwiftPackageReference "swift-snapshot-testing" */, + ); productRefGroup = AB2D554102718F209377399E /* Products */; projectDirPath = ""; projectRoot = ""; @@ -786,7 +826,7 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - 00B8BF5901C2D220357B0B2A /* Media.xcassets in Resources */, + 22786E8525CD96620051335B /* Media.xcassets in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -799,36 +839,6 @@ }; /* End PBXResourcesBuildPhase section */ -/* Begin PBXShellScriptBuildPhase section */ - 6BA68666BDA3FCF79C2A6801 /* Copy Carthage Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - FBSnapshotTestCase.framework, - ); - name = "Copy Carthage Frameworks"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = " exec \"${SRCROOT}/scripts/copy-carthage-frameworks.sh\""; - }; - D6BF00523905132F162A7710 /* Build Dependencies */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - name = "Build Dependencies"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "exec \"${SRCROOT}/scripts/build-dependencies.sh\""; - }; -/* End PBXShellScriptBuildPhase section */ - /* Begin PBXSourcesBuildPhase section */ B5996DB2D9B6F0DB0E9D3F3E /* Sources */ = { isa = PBXSourcesBuildPhase; @@ -852,7 +862,7 @@ 4390D74986A92DEF4F4F2BF0 /* ChartLimitLine.swift in Sources */, FDBDAFA7A5337C6E3992DACE /* ComponentBase.swift in Sources */, DBC9DB402CC9BB84B76968C4 /* Description.swift in Sources */, - 03960E8148C6AEDACE4B77CC /* IMarker.swift in Sources */, + 03960E8148C6AEDACE4B77CC /* Marker.swift in Sources */, ECE7EAE7179A7F57CE9BBD8F /* Legend.swift in Sources */, C9F3DC272355F791000C3215 /* Platform+Gestures.swift in Sources */, C20A62D8CB9120523D5FB650 /* LegendEntry.swift in Sources */, @@ -887,36 +897,36 @@ B539114951455C35BADAE3F3 /* PieChartDataSet.swift in Sources */, 0C52C70C6E6EA09BD7426386 /* RadarChartData.swift in Sources */, C2EFB4EC8C97FA9987F1B50D /* RadarChartDataEntry.swift in Sources */, + 221CA2922588FCBC00C2DD1E /* Sequence+KeyPath.swift in Sources */, E3B28EA1E21279DF3889BCE8 /* RadarChartDataSet.swift in Sources */, 9A26C8DB1F87B01700367599 /* DataApproximator+N.swift in Sources */, 2B791E64E7C4523B1A63F72A /* ScatterChartData.swift in Sources */, EB56849433A76B08606B73EB /* ScatterChartDataSet.swift in Sources */, - C3F0DDB7F0A922F0BB7EDB8A /* IBarChartDataSet.swift in Sources */, - AF4AAF3709ED9DDF6362EAE8 /* IBarLineScatterCandleBubbleChartDataSet.swift in Sources */, - 2C40CFFC8D88BEA70E0A50B0 /* IBubbleChartDataSet.swift in Sources */, - 0D8A89398F9BD5DCC8D7F976 /* ICandleChartDataSet.swift in Sources */, - E8F0F4F47CD7D72B4EE5A794 /* IChartDataSet.swift in Sources */, - F941C88BF814DF51C465CB95 /* ILineChartDataSet.swift in Sources */, - 1311BEC21E9CC264E971EFAF /* ILineRadarChartDataSet.swift in Sources */, - 146EE16342C2BADC92E45BF2 /* ILineScatterCandleRadarChartDataSet.swift in Sources */, - FAAD9FF6565DED2652188584 /* IPieChartDataSet.swift in Sources */, - 83BBAF3EDC31FD452F8BF1DB /* IRadarChartDataSet.swift in Sources */, - 50476F8E6662CAFC1EFE0723 /* IScatterChartDataSet.swift in Sources */, + C3F0DDB7F0A922F0BB7EDB8A /* BarChartDataSetProtocol.swift in Sources */, + AF4AAF3709ED9DDF6362EAE8 /* BarLineScatterCandleBubbleChartDataSetProtocol.swift in Sources */, + 2C40CFFC8D88BEA70E0A50B0 /* BubbleChartDataSetProtocol.swift in Sources */, + 0D8A89398F9BD5DCC8D7F976 /* CandleChartDataSetProtocol.swift in Sources */, + E8F0F4F47CD7D72B4EE5A794 /* ChartDataSetProtocol.swift in Sources */, + F941C88BF814DF51C465CB95 /* LineChartDataSetProtocol.swift in Sources */, + 1311BEC21E9CC264E971EFAF /* LineRadarChartDataSetProtocol.swift in Sources */, + 146EE16342C2BADC92E45BF2 /* LineScatterCandleRadarChartDataSetProtocol.swift in Sources */, + FAAD9FF6565DED2652188584 /* PieChartDataSetProtocol.swift in Sources */, + 83BBAF3EDC31FD452F8BF1DB /* RadarChartDataSetProtocol.swift in Sources */, + 50476F8E6662CAFC1EFE0723 /* ScatterChartDataSetProtocol.swift in Sources */, 97E033CC0ABEF0F448DAFA8E /* DataApproximator.swift in Sources */, 779B46E9F13A087BFA47D539 /* DefaultAxisValueFormatter.swift in Sources */, F744C510DA9B85C228BBB335 /* DefaultFillFormatter.swift in Sources */, B0D28C68BB9A958DC56EB214 /* DefaultValueFormatter.swift in Sources */, - B13C74B4FF705D7B595D01EF /* IAxisValueFormatter.swift in Sources */, - B6C9F450D937B87224D29D5C /* IFillFormatter.swift in Sources */, + B13C74B4FF705D7B595D01EF /* AxisValueFormatter.swift in Sources */, + B6C9F450D937B87224D29D5C /* FillFormatter.swift in Sources */, 967EE2EDDE3337C5C4337C59 /* IndexAxisValueFormatter.swift in Sources */, - A40ACF0CCE96EEE104B0463D /* IValueFormatter.swift in Sources */, + A40ACF0CCE96EEE104B0463D /* ValueFormatter.swift in Sources */, C9F3DC262355F791000C3215 /* Platform+Graphics.swift in Sources */, 3CBE95F1E9394FA08CDCF31E /* BarHighlighter.swift in Sources */, D326491E8BCDE54A0921E137 /* ChartHighlighter.swift in Sources */, 64FA1EDB4DC1F65727D52D10 /* CombinedHighlighter.swift in Sources */, 758EB1C75063ED3373542F3B /* Highlight.swift in Sources */, 4E98788ABEF6496C23F3E6C6 /* HorizontalBarHighlighter.swift in Sources */, - 203A39685CC96FC625F616E4 /* IHighlighter.swift in Sources */, 73EDF662AD989E930D365B72 /* PieHighlighter.swift in Sources */, 3097296AC7FFA994FE4AD312 /* PieRadarHighlighter.swift in Sources */, C33E1AF5471A60BA42DAF52E /* RadarHighlighter.swift in Sources */, @@ -930,18 +940,19 @@ 65EA404AE098EBCE8D5DE04B /* CombinedChartDataProvider.swift in Sources */, 2BA03CEC36BADCF682F1328B /* LineChartDataProvider.swift in Sources */, 0511E43EF3FD2CDE7F7F15DB /* ScatterChartDataProvider.swift in Sources */, + 06AB297F20FA726600BAD505 /* Highlighter.swift in Sources */, 7EE6EFE70CF4D8B09CAFCD01 /* AnimatedMoveViewJob.swift in Sources */, CC7F8198A13249B5DEBBF25E /* AnimatedViewPortJob.swift in Sources */, 0577C2B38BCE4C871F262714 /* AnimatedZoomViewJob.swift in Sources */, 02A6E6E1A82A27A66B8D08C4 /* MoveViewJob.swift in Sources */, 9400725714D0DA707DDECD2E /* ViewPortJob.swift in Sources */, AEE9C4E4AC02B8FB3CD21975 /* ZoomViewJob.swift in Sources */, - ECECC58CEF03B1718F8267E8 /* AxisRendererBase.swift in Sources */, + ECECC58CEF03B1718F8267E8 /* AxisRenderer.swift in Sources */, 23FA50B2730D8C7ACA091C4F /* BarChartRenderer.swift in Sources */, 219192CA6B4895319AB49DCA /* BarLineScatterCandleBubbleRenderer.swift in Sources */, 56E0F5EA9255B9B92876E040 /* BubbleChartRenderer.swift in Sources */, 8BCCD709AACC565613D9DA68 /* CandleStickChartRenderer.swift in Sources */, - F37B07008B8AE7F3909FFB9C /* ChartDataRendererBase.swift in Sources */, + F37B07008B8AE7F3909FFB9C /* DataRenderer.swift in Sources */, 05253AFC448C107DEF54C2FE /* CombinedChartRenderer.swift in Sources */, F100D68395F169B93590FA96 /* HorizontalBarChartRenderer.swift in Sources */, 2B821AAC3EBD60A73EACBCE6 /* LegendRenderer.swift in Sources */, @@ -956,7 +967,7 @@ F103D90FC5DEEA0D7BB4407E /* ChevronUpShapeRenderer.swift in Sources */, B85DEB06B4C1AFFC8A0E3295 /* CircleShapeRenderer.swift in Sources */, 0529DD51622C8769C1121F90 /* CrossShapeRenderer.swift in Sources */, - 8A9FF54E2075A9047CC8E953 /* IShapeRenderer.swift in Sources */, + 8A9FF54E2075A9047CC8E953 /* ShapeRenderer.swift in Sources */, 8EF7B3FBE37F72CC030CD865 /* SquareShapeRenderer.swift in Sources */, 8F4B1A9060472764073DFA0B /* TriangleShapeRenderer.swift in Sources */, 93A94E1FF55041A6032891FE /* XShapeRenderer.swift in Sources */, @@ -983,13 +994,13 @@ files = ( 3B11556EB7DC034E2FC958E4 /* BarChartTests.swift in Sources */, 8E1192F7A7152E9DA92C56A9 /* ChartUtilsTests.swift in Sources */, + 2243BBFD1FF156EC00B49D0B /* EquatableTests.swift in Sources */, B6BF9A561F91993A00E62A5D /* CombinedChartTests.swift in Sources */, 2BF85BEA981B359A65E9BF67 /* LineChartTests.swift in Sources */, B66817462241E3CC00017CF1 /* HorizontalBarChartTests.swift in Sources */, 135F11CE20425AF600D655A3 /* PieChartTests.swift in Sources */, - 064989461F5C99C7006E8BB3 /* Snapshot.swift in Sources */, + 064989461F5C99C7006E8BB3 /* Utilities.swift in Sources */, C03E6D8123DAAB2600083010 /* ChartDataTests.swift in Sources */, - 224EFF991FBAAC4700CF9B3B /* EquatableTests.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1022,9 +1033,13 @@ INFOPLIST_FILE = "Source/Supporting Files/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; IPHONEOS_DEPLOYMENT_TARGET = 9.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + "@loader_path/Frameworks", + ); MACOSX_DEPLOYMENT_TARGET = 10.11; - MARKETING_VERSION = 3.6.0; + MARKETING_VERSION = 4.0.0; MTL_ENABLE_DEBUG_INFO = YES; PRODUCT_BUNDLE_IDENTIFIER = com.dcg.Charts; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -1046,19 +1061,19 @@ APPLICATION_EXTENSION_API_ONLY = NO; DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_STRICT_OBJC_MSGSEND = YES; - "FRAMEWORK_SEARCH_PATHS[sdk=appletv*]" = ( - "$(SRCROOT)/Carthage/Build/tvOS/", + GCC_NO_COMMON_BLOCKS = YES; + INFOPLIST_FILE = Tests/ChartsTests/Resources/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; + LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", ); - "FRAMEWORK_SEARCH_PATHS[sdk=iphone*]" = ( - "$(SRCROOT)/Carthage/Build/iOS/", + "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = ( "$(inherited)", + "@executable_path/../Frameworks", + "@loader_path/../Frameworks", ); - GCC_NO_COMMON_BLOCKS = YES; - INFOPLIST_FILE = "Tests/Supporting Files/Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; MTL_ENABLE_DEBUG_INFO = YES; PRODUCT_BUNDLE_IDENTIFIER = com.dcg.ChartsTests; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -1067,7 +1082,7 @@ SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.0; - TVOS_DEPLOYMENT_TARGET = 9.0; + TVOS_DEPLOYMENT_TARGET = 10.0; }; name = Debug; }; @@ -1117,7 +1132,8 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; SDKROOT = macosx; - SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2,3,4"; VALIDATE_PRODUCT = YES; @@ -1178,7 +1194,8 @@ GCC_WARN_UNUSED_VARIABLE = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = macosx; - SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2,3,4"; }; @@ -1201,16 +1218,21 @@ INFOPLIST_FILE = "Source/Supporting Files/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; IPHONEOS_DEPLOYMENT_TARGET = 9.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + "@loader_path/Frameworks", + ); MACOSX_DEPLOYMENT_TARGET = 10.11; - MARKETING_VERSION = 3.6.0; + MARKETING_VERSION = 4.0.0; MTL_ENABLE_DEBUG_INFO = NO; PRODUCT_BUNDLE_IDENTIFIER = com.dcg.Charts; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = macosx; SKIP_INSTALL = YES; SUPPORTED_PLATFORMS = "macosx iphoneos iphonesimulator appletvos appletvsimulator"; - SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; SWIFT_VERSION = 5.0; TVOS_DEPLOYMENT_TARGET = 9.0; VERSIONING_SYSTEM = "apple-generic"; @@ -1224,27 +1246,28 @@ APPLICATION_EXTENSION_API_ONLY = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_STRICT_OBJC_MSGSEND = YES; - "FRAMEWORK_SEARCH_PATHS[sdk=appletv*]" = ( - "$(SRCROOT)/Carthage/Build/tvOS/", + GCC_NO_COMMON_BLOCKS = YES; + INFOPLIST_FILE = Tests/ChartsTests/Resources/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; + LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", ); - "FRAMEWORK_SEARCH_PATHS[sdk=iphone*]" = ( - "$(SRCROOT)/Carthage/Build/iOS/", + "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = ( "$(inherited)", + "@executable_path/../Frameworks", + "@loader_path/../Frameworks", ); - GCC_NO_COMMON_BLOCKS = YES; - INFOPLIST_FILE = "Tests/Supporting Files/Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; MTL_ENABLE_DEBUG_INFO = NO; PRODUCT_BUNDLE_IDENTIFIER = com.dcg.ChartsTests; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = macosx; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator appletvos appletvsimulator"; - SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; SWIFT_VERSION = 5.0; - TVOS_DEPLOYMENT_TARGET = 9.0; + TVOS_DEPLOYMENT_TARGET = 10.0; }; name = Release; }; @@ -1279,6 +1302,38 @@ defaultConfigurationName = Release; }; /* End XCConfigurationList section */ + +/* Begin XCRemoteSwiftPackageReference section */ + 228D56212554F27A00BEE75E /* XCRemoteSwiftPackageReference "swift-algorithms" */ = { + isa = XCRemoteSwiftPackageReference; + repositoryURL = "https://github.com/apple/swift-algorithms"; + requirement = { + kind = upToNextMajorVersion; + minimumVersion = 0.0.2; + }; + }; + 22BBDA0625CC4C2F00435670 /* XCRemoteSwiftPackageReference "swift-snapshot-testing" */ = { + isa = XCRemoteSwiftPackageReference; + repositoryURL = "https://github.com/pointfreeco/swift-snapshot-testing"; + requirement = { + kind = upToNextMajorVersion; + minimumVersion = 1.8.2; + }; + }; +/* End XCRemoteSwiftPackageReference section */ + +/* Begin XCSwiftPackageProductDependency section */ + 228D56222554F27A00BEE75E /* Algorithms */ = { + isa = XCSwiftPackageProductDependency; + package = 228D56212554F27A00BEE75E /* XCRemoteSwiftPackageReference "swift-algorithms" */; + productName = Algorithms; + }; + 22BBDA0725CC4C2F00435670 /* SnapshotTesting */ = { + isa = XCSwiftPackageProductDependency; + package = 22BBDA0625CC4C2F00435670 /* XCRemoteSwiftPackageReference "swift-snapshot-testing" */; + productName = SnapshotTesting; + }; +/* End XCSwiftPackageProductDependency section */ }; rootObject = 193FC8DF32D250560C5F5D77 /* Project object */; } diff --git a/Charts.xcworkspace/xcshareddata/swiftpm/Package.resolved b/Charts.xcworkspace/xcshareddata/swiftpm/Package.resolved new file mode 100644 index 0000000000..1abcae916a --- /dev/null +++ b/Charts.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -0,0 +1,34 @@ +{ + "object": { + "pins": [ + { + "package": "swift-algorithms", + "repositoryURL": "https://github.com/apple/swift-algorithms", + "state": { + "branch": null, + "revision": "bb3bafeca0e164ece3403a9de646b7d38c07dd49", + "version": "0.0.2" + } + }, + { + "package": "swift-numerics", + "repositoryURL": "https://github.com/apple/swift-numerics", + "state": { + "branch": null, + "revision": "6b24333510e9044cf4716a07bed65eeed6bc6393", + "version": "0.0.8" + } + }, + { + "package": "SnapshotTesting", + "repositoryURL": "https://github.com/pointfreeco/swift-snapshot-testing", + "state": { + "branch": null, + "revision": "c466812aa2e22898f27557e2e780d3aad7a27203", + "version": "1.8.2" + } + } + ] + }, + "version": 1 +} diff --git a/ChartsDemo-iOS/ChartsDemo-iOS.xcodeproj/project.pbxproj b/ChartsDemo-iOS/ChartsDemo-iOS.xcodeproj/project.pbxproj index 581836ad2d..c6e200ba95 100644 --- a/ChartsDemo-iOS/ChartsDemo-iOS.xcodeproj/project.pbxproj +++ b/ChartsDemo-iOS/ChartsDemo-iOS.xcodeproj/project.pbxproj @@ -656,12 +656,12 @@ TargetAttributes = { 225B361C1F6EB9A50005B3D5 = { CreatedOnToolsVersion = 9.0; - LastSwiftMigration = 1000; + LastSwiftMigration = 1150; }; 5B57BBAE1A9B26AA0036A6CC = { CreatedOnToolsVersion = 6.1.1; - LastSwiftMigration = 0900; - ProvisioningStyle = Manual; + LastSwiftMigration = 1150; + ProvisioningStyle = Automatic; }; }; }; @@ -897,6 +897,7 @@ CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; DEBUG_INFORMATION_FORMAT = dwarf; + DEVELOPMENT_TEAM = ""; GCC_C_LANGUAGE_STANDARD = gnu11; INFOPLIST_FILE = "$(SRCROOT)/Supporting Files/Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 9.0; @@ -928,6 +929,7 @@ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEVELOPMENT_TEAM = ""; GCC_C_LANGUAGE_STANDARD = gnu11; INFOPLIST_FILE = "$(SRCROOT)/Supporting Files/Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 9.0; @@ -1049,12 +1051,16 @@ ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; + CODE_SIGN_IDENTITY = "Apple Development"; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = ""; FRAMEWORK_SEARCH_PATHS = "$(SOURCE_ROOT)/../Carthage/Build/iOS"; INFOPLIST_FILE = "Supporting Files/Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "com.dcg.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "ChartsDemo-iOS"; + PROVISIONING_PROFILE_SPECIFIER = ""; SUPPORTED_PLATFORMS = "iphonesimulator iphoneos appletvsimulator appletvos"; SWIFT_OBJC_BRIDGING_HEADER = "Supporting Files/ChartsDemo-Bridging-Header.h"; SWIFT_OBJC_INTERFACE_HEADER_NAME = "$(SWIFT_MODULE_NAME)-Swift.h"; @@ -1069,12 +1075,16 @@ ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; + CODE_SIGN_IDENTITY = "Apple Development"; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = ""; FRAMEWORK_SEARCH_PATHS = "$(SOURCE_ROOT)/../Carthage/Build/iOS"; INFOPLIST_FILE = "Supporting Files/Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "com.dcg.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "ChartsDemo-iOS"; + PROVISIONING_PROFILE_SPECIFIER = ""; SUPPORTED_PLATFORMS = "iphonesimulator iphoneos appletvsimulator appletvos"; SWIFT_OBJC_BRIDGING_HEADER = "Supporting Files/ChartsDemo-Bridging-Header.h"; SWIFT_OBJC_INTERFACE_HEADER_NAME = "$(SWIFT_MODULE_NAME)-Swift.h"; diff --git a/ChartsDemo-iOS/Objective-C/Components/XYMarkerView.swift b/ChartsDemo-iOS/Objective-C/Components/XYMarkerView.swift index f985bd50f0..4d2654d485 100644 --- a/ChartsDemo-iOS/Objective-C/Components/XYMarkerView.swift +++ b/ChartsDemo-iOS/Objective-C/Components/XYMarkerView.swift @@ -12,11 +12,11 @@ import Charts open class XYMarkerView: BalloonMarker { - @objc open var xAxisValueFormatter: IAxisValueFormatter? + @objc open var xAxisValueFormatter: AxisValueFormatter? fileprivate var yFormatter = NumberFormatter() @objc public init(color: UIColor, font: UIFont, textColor: UIColor, insets: UIEdgeInsets, - xAxisValueFormatter: IAxisValueFormatter) + xAxisValueFormatter: AxisValueFormatter) { super.init(color: color, font: font, textColor: textColor, insets: insets) self.xAxisValueFormatter = xAxisValueFormatter diff --git a/ChartsDemo-iOS/Objective-C/DemoBaseViewController.m b/ChartsDemo-iOS/Objective-C/DemoBaseViewController.m index 4e6392a91d..a264f2a712 100644 --- a/ChartsDemo-iOS/Objective-C/DemoBaseViewController.m +++ b/ChartsDemo-iOS/Objective-C/DemoBaseViewController.m @@ -75,7 +75,7 @@ - (void)handleOption:(NSString *)key forChartView:(ChartViewBase *)chartView { if ([key isEqualToString:@"toggleValues"]) { - for (id set in chartView.data.dataSets) + for (id set in chartView.data.dataSets) { set.drawValuesEnabled = !set.isDrawValuesEnabled; } @@ -85,7 +85,7 @@ - (void)handleOption:(NSString *)key forChartView:(ChartViewBase *)chartView if ([key isEqualToString:@"toggleIcons"]) { - for (id set in chartView.data.dataSets) + for (id set in chartView.data.dataSets) { set.drawIconsEnabled = !set.isDrawIconsEnabled; } @@ -95,7 +95,7 @@ - (void)handleOption:(NSString *)key forChartView:(ChartViewBase *)chartView if ([key isEqualToString:@"toggleHighlight"]) { - chartView.data.highlightEnabled = !chartView.data.isHighlightEnabled; + chartView.data.isHighlightEnabled = !chartView.data.isHighlightEnabled; [chartView setNeedsDisplay]; } @@ -143,9 +143,9 @@ - (void)handleOption:(NSString *)key forChartView:(ChartViewBase *)chartView if ([key isEqualToString:@"toggleBarBorders"]) { - for (id set in chartView.data.dataSets) + for (id set in chartView.data.dataSets) { - if ([set conformsToProtocol:@protocol(IBarChartDataSet)]) + if ([set conformsToProtocol:@protocol(BarChartDataSetProtocol)]) { set.barBorderWidth = set.barBorderWidth == 1.0 ? 0.0 : 1.0; } diff --git a/ChartsDemo-iOS/Objective-C/Demos/CandleStickChartViewController.m b/ChartsDemo-iOS/Objective-C/Demos/CandleStickChartViewController.m index 25a0e73ca3..740268c892 100644 --- a/ChartsDemo-iOS/Objective-C/Demos/CandleStickChartViewController.m +++ b/ChartsDemo-iOS/Objective-C/Demos/CandleStickChartViewController.m @@ -128,7 +128,7 @@ - (void)optionTapped:(NSString *)key { if ([key isEqualToString:@"toggleShadowColorSameAsCandle"]) { - for (id set in _chartView.data.dataSets) + for (id set in _chartView.data.dataSets) { set.shadowColorSameAsCandle = !set.shadowColorSameAsCandle; } @@ -137,7 +137,7 @@ - (void)optionTapped:(NSString *)key return; } else if ([key isEqualToString:@"toggleShowCandleBar"]) { - for (id set in _chartView.data.dataSets) + for (id set in _chartView.data.dataSets) { set.showCandleBar = !set.showCandleBar; } diff --git a/ChartsDemo-iOS/Objective-C/Demos/ColoredLineChartViewController.m b/ChartsDemo-iOS/Objective-C/Demos/ColoredLineChartViewController.m index 520770f206..a832bc0097 100644 --- a/ChartsDemo-iOS/Objective-C/Demos/ColoredLineChartViewController.m +++ b/ChartsDemo-iOS/Objective-C/Demos/ColoredLineChartViewController.m @@ -44,7 +44,7 @@ - (void)viewDidLoad - (void)setupChart:(LineChartView *)chart data:(LineChartData *)data color:(UIColor *)color { - [(LineChartDataSet *)[data getDataSetByIndex:0] setCircleHoleColor:color]; + [(LineChartDataSet *)[data dataSetAtIndex:0] setCircleHoleColor:color]; chart.delegate = self; chart.backgroundColor = color; diff --git a/ChartsDemo-iOS/Objective-C/Demos/CombinedChartViewController.m b/ChartsDemo-iOS/Objective-C/Demos/CombinedChartViewController.m index 995c419210..a4700b259e 100644 --- a/ChartsDemo-iOS/Objective-C/Demos/CombinedChartViewController.m +++ b/ChartsDemo-iOS/Objective-C/Demos/CombinedChartViewController.m @@ -14,7 +14,7 @@ #define ITEM_COUNT 12 -@interface CombinedChartViewController () +@interface CombinedChartViewController () { NSArray *months; } @@ -122,7 +122,7 @@ - (void)optionTapped:(NSString *)key { if ([key isEqualToString:@"toggleLineValues"]) { - for (NSObject *set in _chartView.data.dataSets) + for (NSObject *set in _chartView.data.dataSets) { if ([set isKindOfClass:LineChartDataSet.class]) { @@ -136,7 +136,7 @@ - (void)optionTapped:(NSString *)key if ([key isEqualToString:@"toggleBarValues"]) { - for (NSObject *set in _chartView.data.dataSets) + for (NSObject *set in _chartView.data.dataSets) { if ([set isKindOfClass:BarChartDataSet.class]) { @@ -151,7 +151,7 @@ - (void)optionTapped:(NSString *)key if ([key isEqualToString:@"removeDataSet"]) { int rnd = (int)arc4random_uniform((float)_chartView.data.dataSetCount); - [_chartView.data removeDataSet:[_chartView.data getDataSetByIndex:rnd]]; + [_chartView.data removeDataSet:[_chartView.data dataSetAtIndex:rnd]]; [_chartView.data notifyDataChanged]; [_chartView notifyDataSetChanged]; } @@ -313,7 +313,7 @@ - (void)chartValueNothingSelected:(ChartViewBase * __nonnull)chartView NSLog(@"chartValueNothingSelected"); } -#pragma mark - IAxisValueFormatter +#pragma mark - AxisValueFormatter - (NSString *)stringForValue:(double)value axis:(ChartAxisBase *)axis diff --git a/ChartsDemo-iOS/Objective-C/Demos/CubicLineChartViewController.m b/ChartsDemo-iOS/Objective-C/Demos/CubicLineChartViewController.m index 0d590fbf1c..1912cf6090 100644 --- a/ChartsDemo-iOS/Objective-C/Demos/CubicLineChartViewController.m +++ b/ChartsDemo-iOS/Objective-C/Demos/CubicLineChartViewController.m @@ -12,7 +12,7 @@ #import "CubicLineChartViewController.h" #import "ChartsDemo_iOS-Swift.h" -@interface CubicLineSampleFillFormatter : NSObject +@interface CubicLineSampleFillFormatter : NSObject { } @end @@ -158,7 +158,7 @@ - (void)optionTapped:(NSString *)key { if ([key isEqualToString:@"toggleFilled"]) { - for (id set in _chartView.data.dataSets) + for (id set in _chartView.data.dataSets) { set.drawFilledEnabled = !set.isDrawFilledEnabled; } @@ -169,7 +169,7 @@ - (void)optionTapped:(NSString *)key if ([key isEqualToString:@"toggleCircles"]) { - for (id set in _chartView.data.dataSets) + for (id set in _chartView.data.dataSets) { set.drawCirclesEnabled = !set.isDrawCirclesEnabled; } @@ -180,7 +180,7 @@ - (void)optionTapped:(NSString *)key if ([key isEqualToString:@"toggleCubic"]) { - for (id set in _chartView.data.dataSets) + for (id set in _chartView.data.dataSets) { set.mode = set.mode == LineChartModeCubicBezier ? LineChartModeLinear : LineChartModeCubicBezier; } @@ -191,7 +191,7 @@ - (void)optionTapped:(NSString *)key if ([key isEqualToString:@"toggleStepped"]) { - for (id set in _chartView.data.dataSets) + for (id set in _chartView.data.dataSets) { set.mode = set.mode == LineChartModeStepped ? LineChartModeLinear : LineChartModeStepped; } @@ -201,7 +201,7 @@ - (void)optionTapped:(NSString *)key if ([key isEqualToString:@"toggleHorizontalCubic"]) { - for (id set in _chartView.data.dataSets) + for (id set in _chartView.data.dataSets) { set.mode = set.mode == LineChartModeCubicBezier ? LineChartModeHorizontalBezier : LineChartModeCubicBezier; } diff --git a/ChartsDemo-iOS/Objective-C/Demos/LineChart1ViewController.m b/ChartsDemo-iOS/Objective-C/Demos/LineChart1ViewController.m index 40297febdb..c191983f40 100644 --- a/ChartsDemo-iOS/Objective-C/Demos/LineChart1ViewController.m +++ b/ChartsDemo-iOS/Objective-C/Demos/LineChart1ViewController.m @@ -61,7 +61,7 @@ - (void)viewDidLoad ChartLimitLine *llXAxis = [[ChartLimitLine alloc] initWithLimit:10.0 label:@"Index 10"]; llXAxis.lineWidth = 4.0; llXAxis.lineDashLengths = @[@(10.f), @(10.f), @(0.f)]; - llXAxis.labelPosition = ChartLimitLabelPositionBottomRight; + llXAxis.labelPosition = ChartLimitLabelPositionRightBottom; llXAxis.valueFont = [UIFont systemFontOfSize:10.f]; //[_chartView.xAxis addLimitLine:llXAxis]; @@ -72,13 +72,13 @@ - (void)viewDidLoad ChartLimitLine *ll1 = [[ChartLimitLine alloc] initWithLimit:150.0 label:@"Upper Limit"]; ll1.lineWidth = 4.0; ll1.lineDashLengths = @[@5.f, @5.f]; - ll1.labelPosition = ChartLimitLabelPositionTopRight; + ll1.labelPosition = ChartLimitLabelPositionRightTop; ll1.valueFont = [UIFont systemFontOfSize:10.0]; ChartLimitLine *ll2 = [[ChartLimitLine alloc] initWithLimit:-30.0 label:@"Lower Limit"]; ll2.lineWidth = 4.0; ll2.lineDashLengths = @[@5.f, @5.f]; - ll2.labelPosition = ChartLimitLabelPositionBottomRight; + ll2.labelPosition = ChartLimitLabelPositionRightBottom; ll2.valueFont = [UIFont systemFontOfSize:10.0]; ChartYAxis *leftAxis = _chartView.leftAxis; @@ -174,7 +174,7 @@ - (void)setDataCount:(int)count range:(double)range CGGradientRef gradient = CGGradientCreateWithColors(nil, (CFArrayRef)gradientColors, nil); set1.fillAlpha = 1.f; - set1.fill = [ChartFill fillWithLinearGradient:gradient angle:90.f]; + set1.fill = [[ChartLinearGradientFill alloc] initWithGradient:gradient angle:90.0f]; set1.drawFilledEnabled = YES; CGGradientRelease(gradient); @@ -192,7 +192,7 @@ - (void)optionTapped:(NSString *)key { if ([key isEqualToString:@"toggleFilled"]) { - for (id set in _chartView.data.dataSets) + for (id set in _chartView.data.dataSets) { set.drawFilledEnabled = !set.isDrawFilledEnabled; } @@ -203,7 +203,7 @@ - (void)optionTapped:(NSString *)key if ([key isEqualToString:@"toggleCircles"]) { - for (id set in _chartView.data.dataSets) + for (id set in _chartView.data.dataSets) { set.drawCirclesEnabled = !set.isDrawCirclesEnabled; } @@ -214,7 +214,7 @@ - (void)optionTapped:(NSString *)key if ([key isEqualToString:@"toggleCubic"]) { - for (id set in _chartView.data.dataSets) + for (id set in _chartView.data.dataSets) { set.mode = set.mode == LineChartModeCubicBezier ? LineChartModeLinear : LineChartModeCubicBezier; } @@ -225,7 +225,7 @@ - (void)optionTapped:(NSString *)key if ([key isEqualToString:@"toggleStepped"]) { - for (id set in _chartView.data.dataSets) + for (id set in _chartView.data.dataSets) { switch (set.mode) { case LineChartModeLinear: @@ -242,7 +242,7 @@ - (void)optionTapped:(NSString *)key if ([key isEqualToString:@"toggleHorizontalCubic"]) { - for (id set in _chartView.data.dataSets) + for (id set in _chartView.data.dataSets) { set.mode = set.mode == LineChartModeHorizontalBezier ? LineChartModeCubicBezier : LineChartModeHorizontalBezier; } diff --git a/ChartsDemo-iOS/Objective-C/Demos/LineChart2ViewController.m b/ChartsDemo-iOS/Objective-C/Demos/LineChart2ViewController.m index 75eceadef6..c6de87c182 100644 --- a/ChartsDemo-iOS/Objective-C/Demos/LineChart2ViewController.m +++ b/ChartsDemo-iOS/Objective-C/Demos/LineChart2ViewController.m @@ -204,7 +204,7 @@ - (void)optionTapped:(NSString *)key { if ([key isEqualToString:@"toggleFilled"]) { - for (id set in _chartView.data.dataSets) + for (id set in _chartView.data.dataSets) { set.drawFilledEnabled = !set.isDrawFilledEnabled; } @@ -215,7 +215,7 @@ - (void)optionTapped:(NSString *)key if ([key isEqualToString:@"toggleCircles"]) { - for (id set in _chartView.data.dataSets) + for (id set in _chartView.data.dataSets) { set.drawCirclesEnabled = !set.isDrawCirclesEnabled; } @@ -226,7 +226,7 @@ - (void)optionTapped:(NSString *)key if ([key isEqualToString:@"toggleCubic"]) { - for (id set in _chartView.data.dataSets) + for (id set in _chartView.data.dataSets) { set.mode = set.mode == LineChartModeCubicBezier ? LineChartModeLinear : LineChartModeCubicBezier; } @@ -237,7 +237,7 @@ - (void)optionTapped:(NSString *)key if ([key isEqualToString:@"toggleStepped"]) { - for (id set in _chartView.data.dataSets) + for (id set in _chartView.data.dataSets) { switch (set.mode) { case LineChartModeLinear: @@ -254,7 +254,7 @@ - (void)optionTapped:(NSString *)key if ([key isEqualToString:@"toggleHorizontalCubic"]) { - for (id set in _chartView.data.dataSets) + for (id set in _chartView.data.dataSets) { set.mode = set.mode == LineChartModeCubicBezier ? LineChartModeHorizontalBezier : LineChartModeCubicBezier; } @@ -282,7 +282,7 @@ - (void)chartValueSelected:(ChartViewBase * __nonnull)chartView entry:(ChartData { NSLog(@"chartValueSelected"); - [_chartView centerViewToAnimatedWithXValue:entry.x yValue:entry.y axis:[_chartView.data getDataSetByIndex:highlight.dataSetIndex].axisDependency duration:1.0]; + [_chartView centerViewToAnimatedWithXValue:entry.x yValue:entry.y axis:[_chartView.data dataSetAtIndex:highlight.dataSetIndex].axisDependency duration:1.0]; //[_chartView moveViewToAnimatedWithXValue:entry.x yValue:entry.y axis:[_chartView.data getDataSetByIndex:dataSetIndex].axisDependency duration:1.0]; //[_chartView zoomAndCenterViewAnimatedWithScaleX:1.8 scaleY:1.8 xValue:entry.x yValue:entry.y axis:[_chartView.data getDataSetByIndex:dataSetIndex].axisDependency duration:1.0]; diff --git a/ChartsDemo-iOS/Objective-C/Demos/LineChartFilledViewController.m b/ChartsDemo-iOS/Objective-C/Demos/LineChartFilledViewController.m index f6ec793465..3d0b3bb839 100644 --- a/ChartsDemo-iOS/Objective-C/Demos/LineChartFilledViewController.m +++ b/ChartsDemo-iOS/Objective-C/Demos/LineChartFilledViewController.m @@ -123,7 +123,7 @@ - (void)setDataCount:(int)count range:(double)range set1.fillColor = UIColor.whiteColor; set1.highlightColor = [UIColor colorWithRed:244/255.0 green:117/255.0 blue:117/255.0 alpha:1.0]; set1.drawCircleHoleEnabled = NO; - set1.fillFormatter = [ChartDefaultFillFormatter withBlock:^CGFloat(id _Nonnull dataSet, id _Nonnull dataProvider) { + set1.fillFormatter = [ChartDefaultFillFormatter withBlock:^CGFloat(id _Nonnull dataSet, id _Nonnull dataProvider) { return self.chartView.leftAxis.axisMinimum; }]; @@ -138,7 +138,7 @@ - (void)setDataCount:(int)count range:(double)range set2.fillColor = UIColor.whiteColor; set2.highlightColor = [UIColor colorWithRed:244/255.0 green:117/255.0 blue:117/255.0 alpha:1.0]; set2.drawCircleHoleEnabled = NO; - set2.fillFormatter = [ChartDefaultFillFormatter withBlock:^CGFloat(id _Nonnull dataSet, id _Nonnull dataProvider) { + set2.fillFormatter = [ChartDefaultFillFormatter withBlock:^CGFloat(id _Nonnull dataSet, id _Nonnull dataProvider) { return self.chartView.leftAxis.axisMaximum; }]; diff --git a/ChartsDemo-iOS/Objective-C/Demos/LineChartTimeViewController.m b/ChartsDemo-iOS/Objective-C/Demos/LineChartTimeViewController.m index 06e6808f4f..7433c4f391 100644 --- a/ChartsDemo-iOS/Objective-C/Demos/LineChartTimeViewController.m +++ b/ChartsDemo-iOS/Objective-C/Demos/LineChartTimeViewController.m @@ -158,7 +158,7 @@ - (void)optionTapped:(NSString *)key { if ([key isEqualToString:@"toggleFilled"]) { - for (id set in _chartView.data.dataSets) + for (id set in _chartView.data.dataSets) { set.drawFilledEnabled = !set.isDrawFilledEnabled; } @@ -169,7 +169,7 @@ - (void)optionTapped:(NSString *)key if ([key isEqualToString:@"toggleCircles"]) { - for (id set in _chartView.data.dataSets) + for (id set in _chartView.data.dataSets) { set.drawCirclesEnabled = !set.isDrawCirclesEnabled; } @@ -180,7 +180,7 @@ - (void)optionTapped:(NSString *)key if ([key isEqualToString:@"toggleCubic"]) { - for (id set in _chartView.data.dataSets) + for (id set in _chartView.data.dataSets) { set.mode = set.mode == LineChartModeCubicBezier ? LineChartModeLinear : LineChartModeCubicBezier; } @@ -191,7 +191,7 @@ - (void)optionTapped:(NSString *)key if ([key isEqualToString:@"toggleStepped"]) { - for (id set in _chartView.data.dataSets) + for (id set in _chartView.data.dataSets) { switch (set.mode) { case LineChartModeLinear: @@ -208,7 +208,7 @@ - (void)optionTapped:(NSString *)key if ([key isEqualToString:@"toggleHorizontalCubic"]) { - for (id set in _chartView.data.dataSets) + for (id set in _chartView.data.dataSets) { set.mode = set.mode == LineChartModeCubicBezier ? LineChartModeHorizontalBezier : LineChartModeCubicBezier; } diff --git a/ChartsDemo-iOS/Objective-C/Demos/MultipleLinesChartViewController.m b/ChartsDemo-iOS/Objective-C/Demos/MultipleLinesChartViewController.m index 358a7e21eb..63ad2519e4 100644 --- a/ChartsDemo-iOS/Objective-C/Demos/MultipleLinesChartViewController.m +++ b/ChartsDemo-iOS/Objective-C/Demos/MultipleLinesChartViewController.m @@ -130,7 +130,7 @@ - (void)optionTapped:(NSString *)key { if ([key isEqualToString:@"toggleFilled"]) { - for (id set in _chartView.data.dataSets) + for (id set in _chartView.data.dataSets) { set.drawFilledEnabled = !set.isDrawFilledEnabled; } @@ -141,7 +141,7 @@ - (void)optionTapped:(NSString *)key if ([key isEqualToString:@"toggleCircles"]) { - for (id set in _chartView.data.dataSets) + for (id set in _chartView.data.dataSets) { set.drawCirclesEnabled = !set.isDrawCirclesEnabled; } @@ -152,7 +152,7 @@ - (void)optionTapped:(NSString *)key if ([key isEqualToString:@"toggleCubic"]) { - for (id set in _chartView.data.dataSets) + for (id set in _chartView.data.dataSets) { set.mode = set.mode == LineChartModeCubicBezier ? LineChartModeLinear : LineChartModeCubicBezier; } @@ -163,7 +163,7 @@ - (void)optionTapped:(NSString *)key if ([key isEqualToString:@"toggleStepped"]) { - for (id set in _chartView.data.dataSets) + for (id set in _chartView.data.dataSets) { switch (set.mode) { case LineChartModeLinear: diff --git a/ChartsDemo-iOS/Objective-C/Demos/NegativeStackedBarChartViewController.m b/ChartsDemo-iOS/Objective-C/Demos/NegativeStackedBarChartViewController.m index b87ef62a13..2083e41540 100644 --- a/ChartsDemo-iOS/Objective-C/Demos/NegativeStackedBarChartViewController.m +++ b/ChartsDemo-iOS/Objective-C/Demos/NegativeStackedBarChartViewController.m @@ -12,7 +12,7 @@ #import "NegativeStackedBarChartViewController.h" #import "ChartsDemo_iOS-Swift.h" -@interface NegativeStackedBarChartViewController () +@interface NegativeStackedBarChartViewController () @property (nonatomic, strong) IBOutlet HorizontalBarChartView *chartView; @@ -184,7 +184,7 @@ - (void)chartValueNothingSelected:(ChartViewBase * __nonnull)chartView NSLog(@"chartValueNothingSelected"); } -#pragma mark - IAxisValueFormatter +#pragma mark - AxisValueFormatter - (NSString *)stringForValue:(double)value axis:(ChartAxisBase *)axis diff --git a/ChartsDemo-iOS/Objective-C/Demos/PieChartViewController.m b/ChartsDemo-iOS/Objective-C/Demos/PieChartViewController.m index 5bc3a9d665..1d35f2ae12 100644 --- a/ChartsDemo-iOS/Objective-C/Demos/PieChartViewController.m +++ b/ChartsDemo-iOS/Objective-C/Demos/PieChartViewController.m @@ -36,6 +36,7 @@ - (void)viewDidLoad @{@"key": @"togglePercent", @"label": @"Toggle Percent"}, @{@"key": @"toggleHole", @"label": @"Toggle Hole"}, @{@"key": @"toggleIcons", @"label": @"Toggle Icons"}, + @{@"key": @"toggleLabelsMinimumAngle", @"label": @"Toggle Labels Minimum Angle"}, @{@"key": @"animateX", @"label": @"Animate X"}, @{@"key": @"animateY", @"label": @"Animate Y"}, @{@"key": @"animateXY", @"label": @"Animate XY"}, @@ -59,7 +60,7 @@ - (void)viewDidLoad l.yOffset = 0.0; // entry label styling - _chartView.entryLabelColor = UIColor.whiteColor; + _chartView.entryLabelColor = UIColor.blackColor; _chartView.entryLabelFont = [UIFont fontWithName:@"HelveticaNeue-Light" size:12.f]; _sliderX.value = 4.0; @@ -125,7 +126,7 @@ - (void)setDataCount:(int)count range:(double)range pFormatter.percentSymbol = @" %"; [data setValueFormatter:[[ChartDefaultValueFormatter alloc] initWithFormatter:pFormatter]]; [data setValueFont:[UIFont fontWithName:@"HelveticaNeue-Light" size:11.f]]; - [data setValueTextColor:UIColor.whiteColor]; + [data setValueTextColor:UIColor.blackColor]; _chartView.data = data; [_chartView highlightValues:nil]; @@ -157,6 +158,12 @@ - (void)optionTapped:(NSString *)key return; } + if ([key isEqualToString:@"toggleLabelsMinimumAngle"]) + { + CGFloat newMinimum = _chartView.sliceTextDrawingThreshold == 20.0 ? 0.0 : 20.0; + _chartView.sliceTextDrawingThreshold = newMinimum; + } + if ([key isEqualToString:@"drawCenter"]) { _chartView.drawCenterTextEnabled = !_chartView.isDrawCenterTextEnabled; diff --git a/ChartsDemo-iOS/Objective-C/Demos/PiePolylineChartViewController.m b/ChartsDemo-iOS/Objective-C/Demos/PiePolylineChartViewController.m index 81f092e9be..3d5db27362 100644 --- a/ChartsDemo-iOS/Objective-C/Demos/PiePolylineChartViewController.m +++ b/ChartsDemo-iOS/Objective-C/Demos/PiePolylineChartViewController.m @@ -31,6 +31,7 @@ - (void)viewDidLoad @{@"key": @"toggleXValues", @"label": @"Toggle X-Values"}, @{@"key": @"togglePercent", @"label": @"Toggle Percent"}, @{@"key": @"toggleHole", @"label": @"Toggle Hole"}, + @{@"key": @"toggleLabelsMinimumAngle", @"label": @"Toggle Labels Minimum Angle"}, @{@"key": @"animateX", @"label": @"Animate X"}, @{@"key": @"animateY", @"label": @"Animate Y"}, @{@"key": @"animateXY", @"label": @"Animate XY"}, @@ -144,6 +145,12 @@ - (void)optionTapped:(NSString *)key return; } + if ([key isEqualToString:@"toggleLabelsMinimumAngle"]) + { + CGFloat newMinimum = _chartView.sliceTextDrawingThreshold == 20.0 ? 0.0 : 20.0; + _chartView.sliceTextDrawingThreshold = newMinimum; + } + if ([key isEqualToString:@"drawCenter"]) { _chartView.drawCenterTextEnabled = !_chartView.isDrawCenterTextEnabled; diff --git a/ChartsDemo-iOS/Objective-C/Demos/PositiveNegativeBarChartViewController.m b/ChartsDemo-iOS/Objective-C/Demos/PositiveNegativeBarChartViewController.m index 2440fe9e1a..fe6e9be935 100644 --- a/ChartsDemo-iOS/Objective-C/Demos/PositiveNegativeBarChartViewController.m +++ b/ChartsDemo-iOS/Objective-C/Demos/PositiveNegativeBarChartViewController.m @@ -12,7 +12,7 @@ #import "PositiveNegativeBarChartViewController.h" #import "ChartsDemo_iOS-Swift.h" -@interface PositiveNegativeBarChartViewController () +@interface PositiveNegativeBarChartViewController () { NSArray *dataList; } @@ -182,7 +182,7 @@ - (void)chartValueNothingSelected:(ChartViewBase * __nonnull)chartView NSLog(@"chartValueNothingSelected"); } -#pragma mark - IAxisValueFormatter +#pragma mark - AxisValueFormatter - (NSString *)stringForValue:(double)value axis:(ChartAxisBase *)axis diff --git a/ChartsDemo-iOS/Objective-C/Demos/RadarChartViewController.m b/ChartsDemo-iOS/Objective-C/Demos/RadarChartViewController.m index 24cfea5b58..e4f5cbcf35 100644 --- a/ChartsDemo-iOS/Objective-C/Demos/RadarChartViewController.m +++ b/ChartsDemo-iOS/Objective-C/Demos/RadarChartViewController.m @@ -12,7 +12,7 @@ #import "RadarChartViewController.h" #import "ChartsDemo_iOS-Swift.h" -@interface RadarChartViewController () +@interface RadarChartViewController () @property (nonatomic, strong) IBOutlet RadarChartView *chartView; @property (nonatomic, strong) NSArray *activities; diff --git a/ChartsDemo-iOS/Objective-C/Formatters/DateValueFormatter.h b/ChartsDemo-iOS/Objective-C/Formatters/DateValueFormatter.h index 2e94536aa7..770ff31643 100644 --- a/ChartsDemo-iOS/Objective-C/Formatters/DateValueFormatter.h +++ b/ChartsDemo-iOS/Objective-C/Formatters/DateValueFormatter.h @@ -12,6 +12,6 @@ #import #import "ChartsDemo_iOS-Swift.h" -@interface DateValueFormatter : NSObject +@interface DateValueFormatter : NSObject @end diff --git a/ChartsDemo-iOS/Objective-C/Formatters/DayAxisValueFormatter.h b/ChartsDemo-iOS/Objective-C/Formatters/DayAxisValueFormatter.h index 4de193d0c5..3189325a90 100644 --- a/ChartsDemo-iOS/Objective-C/Formatters/DayAxisValueFormatter.h +++ b/ChartsDemo-iOS/Objective-C/Formatters/DayAxisValueFormatter.h @@ -7,7 +7,7 @@ #import #import "ChartsDemo_iOS-Swift.h" -@interface DayAxisValueFormatter : NSObject +@interface DayAxisValueFormatter : NSObject - (id)initForChart:(BarLineChartViewBase *)chart; diff --git a/ChartsDemo-iOS/Objective-C/Formatters/IntAxisValueFormatter.h b/ChartsDemo-iOS/Objective-C/Formatters/IntAxisValueFormatter.h index 6401ed07d4..c390c0bcc3 100644 --- a/ChartsDemo-iOS/Objective-C/Formatters/IntAxisValueFormatter.h +++ b/ChartsDemo-iOS/Objective-C/Formatters/IntAxisValueFormatter.h @@ -7,6 +7,6 @@ #import #import "ChartsDemo_iOS-Swift.h" -@interface IntAxisValueFormatter : NSObject +@interface IntAxisValueFormatter : NSObject @end diff --git a/ChartsDemo-iOS/Objective-C/Formatters/LargeValueFormatter.swift b/ChartsDemo-iOS/Objective-C/Formatters/LargeValueFormatter.swift index 47ca78fd5e..1f37660ed3 100644 --- a/ChartsDemo-iOS/Objective-C/Formatters/LargeValueFormatter.swift +++ b/ChartsDemo-iOS/Objective-C/Formatters/LargeValueFormatter.swift @@ -7,7 +7,7 @@ import Foundation import Charts -open class LargeValueFormatter: NSObject, IValueFormatter, IAxisValueFormatter +open class LargeValueFormatter: NSObject, ValueFormatter, AxisValueFormatter { fileprivate static let MAX_LENGTH = 5 diff --git a/ChartsDemo-iOS/Swift/Components/XYMarkerView.swift b/ChartsDemo-iOS/Swift/Components/XYMarkerView.swift index 9fd1174bc9..4958e10f5c 100644 --- a/ChartsDemo-iOS/Swift/Components/XYMarkerView.swift +++ b/ChartsDemo-iOS/Swift/Components/XYMarkerView.swift @@ -13,11 +13,11 @@ import Charts #endif public class XYMarkerView: BalloonMarker { - public var xAxisValueFormatter: IAxisValueFormatter + public var xAxisValueFormatter: AxisValueFormatter fileprivate var yFormatter = NumberFormatter() public init(color: UIColor, font: UIFont, textColor: UIColor, insets: UIEdgeInsets, - xAxisValueFormatter: IAxisValueFormatter) { + xAxisValueFormatter: AxisValueFormatter) { self.xAxisValueFormatter = xAxisValueFormatter yFormatter.minimumFractionDigits = 1 yFormatter.maximumFractionDigits = 1 diff --git a/ChartsDemo-iOS/Swift/DemoBaseViewController.swift b/ChartsDemo-iOS/Swift/DemoBaseViewController.swift index 444d1f4729..3f0f920a51 100644 --- a/ChartsDemo-iOS/Swift/DemoBaseViewController.swift +++ b/ChartsDemo-iOS/Swift/DemoBaseViewController.swift @@ -23,6 +23,8 @@ enum Option { case toggleAutoScaleMinMax case toggleData case toggleBarBorders + // LineChart + case toggleGradientLine // CandleChart case toggleShadowColorSameAsCandle case toggleShowCandleBar @@ -42,6 +44,7 @@ enum Option { case toggleHole case spin case drawCenter + case toggleLabelsMinimumAngle // RadarChart case toggleXLabels case toggleYLabels @@ -61,6 +64,8 @@ enum Option { case .toggleAutoScaleMinMax: return "Toggle auto scale min/max" case .toggleData: return "Toggle Data" case .toggleBarBorders: return "Toggle Bar Borders" + // LineChart + case .toggleGradientLine: return "Toggle Gradient Line" // CandleChart case .toggleShadowColorSameAsCandle: return "Toggle shadow same color" case .toggleShowCandleBar: return "Toggle show candle bar" @@ -80,6 +85,7 @@ enum Option { case .toggleHole: return "Toggle Hole" case .spin: return "Spin" case .drawCenter: return "Draw CenterText" + case .toggleLabelsMinimumAngle: return "Toggle Labels Minimum Angle" // RadarChart case .toggleXLabels: return "Toggle X-Labels" case .toggleYLabels: return "Toggle Y-Labels" @@ -121,19 +127,19 @@ class DemoBaseViewController: UIViewController, ChartViewDelegate { func handleOption(_ option: Option, forChartView chartView: ChartViewBase) { switch option { case .toggleValues: - for set in chartView.data!.dataSets { + for set in chartView.data! { set.drawValuesEnabled = !set.drawValuesEnabled } chartView.setNeedsDisplay() case .toggleIcons: - for set in chartView.data!.dataSets { + for set in chartView.data! { set.drawIconsEnabled = !set.drawIconsEnabled } chartView.setNeedsDisplay() case .toggleHighlight: - chartView.data!.highlightEnabled = !chartView.data!.isHighlightEnabled + chartView.data!.isHighlightEnabled = !chartView.data!.isHighlightEnabled chartView.setNeedsDisplay() case .animateX: @@ -163,7 +169,7 @@ class DemoBaseViewController: UIViewController, ChartViewDelegate { updateChartData() case .toggleBarBorders: - for set in chartView.data!.dataSets { + for set in chartView.data! { if let set = set as? BarChartDataSet { set.barBorderWidth = set.barBorderWidth == 1.0 ? 0.0 : 1.0 } @@ -238,7 +244,7 @@ class DemoBaseViewController: UIViewController, ChartViewDelegate { chartView.drawSlicesUnderHoleEnabled = false chartView.holeRadiusPercent = 0.58 chartView.transparentCircleRadiusPercent = 0.61 - chartView.chartDescription?.enabled = false + chartView.chartDescription.enabled = false chartView.setExtraOffsets(left: 5, top: 10, right: 5, bottom: 5) chartView.drawCenterTextEnabled = true @@ -273,11 +279,11 @@ class DemoBaseViewController: UIViewController, ChartViewDelegate { } func setup(radarChartView chartView: RadarChartView) { - chartView.chartDescription?.enabled = false + chartView.chartDescription.enabled = false } func setup(barLineChartView chartView: BarLineChartViewBase) { - chartView.chartDescription?.enabled = false + chartView.chartDescription.enabled = false chartView.dragEnabled = true chartView.setScaleEnabled(true) diff --git a/ChartsDemo-iOS/Swift/Demos/AnotherBarChartViewController.swift b/ChartsDemo-iOS/Swift/Demos/AnotherBarChartViewController.swift index 45391a05b2..568c3c9949 100644 --- a/ChartsDemo-iOS/Swift/Demos/AnotherBarChartViewController.swift +++ b/ChartsDemo-iOS/Swift/Demos/AnotherBarChartViewController.swift @@ -37,7 +37,7 @@ class AnotherBarChartViewController: DemoBaseViewController { chartView.delegate = self - chartView.chartDescription?.enabled = false + chartView.chartDescription.enabled = false chartView.maxVisibleCount = 60 chartView.pinchZoomEnabled = false chartView.drawBarShadowEnabled = false @@ -70,7 +70,7 @@ class AnotherBarChartViewController: DemoBaseViewController { } var set1: BarChartDataSet! = nil - if let set = chartView.data?.dataSets.first as? BarChartDataSet { + if let set = chartView.data?.first as? BarChartDataSet { set1 = set set1?.replaceEntries(yVals) chartView.data?.notifyDataChanged() diff --git a/ChartsDemo-iOS/Swift/Demos/BarChartViewController.swift b/ChartsDemo-iOS/Swift/Demos/BarChartViewController.swift index 5400646822..7f66cda378 100644 --- a/ChartsDemo-iOS/Swift/Demos/BarChartViewController.swift +++ b/ChartsDemo-iOS/Swift/Demos/BarChartViewController.swift @@ -124,7 +124,7 @@ class BarChartViewController: DemoBaseViewController { } var set1: BarChartDataSet! = nil - if let set = chartView.data?.dataSets.first as? BarChartDataSet { + if let set = chartView.data?.first as? BarChartDataSet { set1 = set set1.replaceEntries(yVals) chartView.data?.notifyDataChanged() diff --git a/ChartsDemo-iOS/Swift/Demos/BubbleChartViewController.swift b/ChartsDemo-iOS/Swift/Demos/BubbleChartViewController.swift index 064354021c..b6db99cfb8 100644 --- a/ChartsDemo-iOS/Swift/Demos/BubbleChartViewController.swift +++ b/ChartsDemo-iOS/Swift/Demos/BubbleChartViewController.swift @@ -37,7 +37,7 @@ class BubbleChartViewController: DemoBaseViewController { chartView.delegate = self - chartView.chartDescription?.enabled = false + chartView.chartDescription.enabled = false chartView.dragEnabled = false chartView.setScaleEnabled(true) @@ -106,7 +106,7 @@ class BubbleChartViewController: DemoBaseViewController { set3.setColor(ChartColorTemplates.colorful()[2], alpha: 0.5) set3.drawValuesEnabled = true - let data = BubbleChartData(dataSets: [set1, set2, set3]) + let data = [set1, set2, set3] as BubbleChartData data.setDrawValues(false) data.setValueFont(UIFont(name: "HelveticaNeue-Light", size: 7)!) data.setHighlightCircleWidth(1.5) diff --git a/ChartsDemo-iOS/Swift/Demos/CandleStickChartViewController.swift b/ChartsDemo-iOS/Swift/Demos/CandleStickChartViewController.swift index 42460be98e..33cb7edc1d 100644 --- a/ChartsDemo-iOS/Swift/Demos/CandleStickChartViewController.swift +++ b/ChartsDemo-iOS/Swift/Demos/CandleStickChartViewController.swift @@ -39,7 +39,7 @@ class CandleStickChartViewController: DemoBaseViewController { chartView.delegate = self - chartView.chartDescription?.enabled = false + chartView.chartDescription.enabled = false chartView.dragEnabled = false chartView.setScaleEnabled(true) @@ -108,7 +108,7 @@ class CandleStickChartViewController: DemoBaseViewController { override func optionTapped(_ option: Option) { switch option { case .toggleShadowColorSameAsCandle: - for set in chartView.data!.dataSets as! [CandleChartDataSet] { + for case let set as CandleChartDataSet in chartView.data! { set.shadowColorSameAsCandle = !set.shadowColorSameAsCandle } chartView.notifyDataSetChanged() diff --git a/ChartsDemo-iOS/Swift/Demos/ColoredLineChartViewController.swift b/ChartsDemo-iOS/Swift/Demos/ColoredLineChartViewController.swift index c5dd3566c6..0586923f79 100644 --- a/ChartsDemo-iOS/Swift/Demos/ColoredLineChartViewController.swift +++ b/ChartsDemo-iOS/Swift/Demos/ColoredLineChartViewController.swift @@ -33,12 +33,12 @@ class ColoredLineChartViewController: DemoBaseViewController { } func setupChart(_ chart: LineChartView, data: LineChartData, color: UIColor) { - (data.getDataSetByIndex(0) as! LineChartDataSet).circleHoleColor = color + (data[0] as! LineChartDataSet).circleHoleColor = color chart.delegate = self chart.backgroundColor = color - chart.chartDescription?.enabled = false + chart.chartDescription.enabled = false chart.dragEnabled = true chart.setScaleEnabled(true) diff --git a/ChartsDemo-iOS/Swift/Demos/CombinedChartViewController.swift b/ChartsDemo-iOS/Swift/Demos/CombinedChartViewController.swift index 8ec5263bf2..c6d2619c32 100644 --- a/ChartsDemo-iOS/Swift/Demos/CombinedChartViewController.swift +++ b/ChartsDemo-iOS/Swift/Demos/CombinedChartViewController.swift @@ -39,7 +39,7 @@ class CombinedChartViewController: DemoBaseViewController { chartView.delegate = self - chartView.chartDescription?.enabled = false + chartView.chartDescription.enabled = false chartView.drawBarShadowEnabled = false chartView.highlightFullBarEnabled = false @@ -99,7 +99,7 @@ class CombinedChartViewController: DemoBaseViewController { override func optionTapped(_ option: Option) { switch option { case .toggleLineValues: - for set in chartView.data!.dataSets { + for set in chartView.data! { if let set = set as? LineChartDataSet { set.drawValuesEnabled = !set .drawValuesEnabled @@ -108,7 +108,7 @@ class CombinedChartViewController: DemoBaseViewController { chartView.setNeedsDisplay() case .toggleBarValues: - for set in chartView.data!.dataSets { + for set in chartView.data! { if let set = set as? BarChartDataSet { set.drawValuesEnabled = !set .drawValuesEnabled } @@ -117,7 +117,7 @@ class CombinedChartViewController: DemoBaseViewController { case .removeDataSet: let rnd = Int(arc4random_uniform(UInt32(chartView.data!.dataSetCount))) - chartView.data?.removeDataSet(chartView.data!.getDataSetByIndex(rnd)) + chartView.data?.removeDataSet(chartView.data![rnd]) chartView.data?.notifyDataChanged() chartView.notifyDataSetChanged() @@ -176,7 +176,7 @@ class CombinedChartViewController: DemoBaseViewController { let barWidth = 0.45 // x2 dataset // (0.45 + 0.02) * 2 + 0.06 = 1.00 -> interval per "group" - let data = BarChartData(dataSets: [set1, set2]) + let data: BarChartData = [set1, set2] data.barWidth = barWidth // make this BarData object grouped @@ -231,7 +231,7 @@ class CombinedChartViewController: DemoBaseViewController { } } -extension CombinedChartViewController: IAxisValueFormatter { +extension CombinedChartViewController: AxisValueFormatter { func stringForValue(_ value: Double, axis: AxisBase?) -> String { return months[Int(value) % months.count] } diff --git a/ChartsDemo-iOS/Swift/Demos/CubicLineChartViewController.swift b/ChartsDemo-iOS/Swift/Demos/CubicLineChartViewController.swift index c1a65a2d4f..022ea71cd3 100644 --- a/ChartsDemo-iOS/Swift/Demos/CubicLineChartViewController.swift +++ b/ChartsDemo-iOS/Swift/Demos/CubicLineChartViewController.swift @@ -11,8 +11,8 @@ #endif import Charts -private class CubicLineSampleFillFormatter: IFillFormatter { - func getFillLinePosition(dataSet: ILineChartDataSet, dataProvider: LineChartDataProvider) -> CGFloat { +private class CubicLineSampleFillFormatter: FillFormatter { + func getFillLinePosition(dataSet: LineChartDataSetProtocol, dataProvider: LineChartDataProvider) -> CGFloat { return -10 } } @@ -111,33 +111,35 @@ class CubicLineChartViewController: DemoBaseViewController { } override func optionTapped(_ option: Option) { + guard let data = chartView.data else { return } + switch option { case .toggleFilled: - for set in chartView.data!.dataSets as! [LineChartDataSet] { + for case let set as LineChartDataSet in data { set.drawFilledEnabled = !set.drawFilledEnabled } chartView.setNeedsDisplay() case .toggleCircles: - for set in chartView.data!.dataSets as! [LineChartDataSet] { + for case let set as LineChartDataSet in data { set.drawCirclesEnabled = !set.drawCirclesEnabled } chartView.setNeedsDisplay() case .toggleCubic: - for set in chartView.data!.dataSets as! [LineChartDataSet] { + for case let set as LineChartDataSet in data { set.mode = (set.mode == .cubicBezier) ? .linear : .cubicBezier } chartView.setNeedsDisplay() case .toggleStepped: - for set in chartView.data!.dataSets as! [LineChartDataSet] { + for case let set as LineChartDataSet in data { set.mode = (set.mode == .stepped) ? .linear : .stepped } chartView.setNeedsDisplay() case .toggleHorizontalCubic: - for set in chartView.data!.dataSets as! [LineChartDataSet] { + for case let set as LineChartDataSet in data { set.mode = (set.mode == .cubicBezier) ? .horizontalBezier : .cubicBezier } chartView.setNeedsDisplay() diff --git a/ChartsDemo-iOS/Swift/Demos/LineChart1ViewController.swift b/ChartsDemo-iOS/Swift/Demos/LineChart1ViewController.swift index 43e5ff4f78..e676cd9e1a 100644 --- a/ChartsDemo-iOS/Swift/Demos/LineChart1ViewController.swift +++ b/ChartsDemo-iOS/Swift/Demos/LineChart1ViewController.swift @@ -6,9 +6,7 @@ // Copyright © 2017 jc. All rights reserved. // -#if canImport(UIKit) - import UIKit -#endif +import UIKit import Charts class LineChart1ViewController: DemoBaseViewController { @@ -32,6 +30,7 @@ class LineChart1ViewController: DemoBaseViewController { .toggleIcons, .toggleStepped, .toggleHighlight, + .toggleGradientLine, .animateX, .animateY, .animateXY, @@ -39,36 +38,36 @@ class LineChart1ViewController: DemoBaseViewController { .togglePinchZoom, .toggleAutoScaleMinMax, .toggleData] - + chartView.delegate = self - - chartView.chartDescription?.enabled = false + + chartView.chartDescription.enabled = false chartView.dragEnabled = true chartView.setScaleEnabled(true) chartView.pinchZoomEnabled = true - + // x-axis limit line let llXAxis = ChartLimitLine(limit: 10, label: "Index 10") llXAxis.lineWidth = 4 llXAxis.lineDashLengths = [10, 10, 0] - llXAxis.labelPosition = .bottomRight + llXAxis.labelPosition = .rightBottom llXAxis.valueFont = .systemFont(ofSize: 10) - + chartView.xAxis.gridLineDashLengths = [10, 10] chartView.xAxis.gridLineDashPhase = 0 - + let ll1 = ChartLimitLine(limit: 150, label: "Upper Limit") ll1.lineWidth = 4 ll1.lineDashLengths = [5, 5] - ll1.labelPosition = .topRight + ll1.labelPosition = .rightTop ll1.valueFont = .systemFont(ofSize: 10) - + let ll2 = ChartLimitLine(limit: -30, label: "Lower Limit") ll2.lineWidth = 4 ll2.lineDashLengths = [5,5] - ll2.labelPosition = .bottomRight + ll2.labelPosition = .rightBottom ll2.valueFont = .systemFont(ofSize: 10) - + let leftAxis = chartView.leftAxis leftAxis.removeAllLimitLines() leftAxis.addLimitLine(ll1) @@ -77,9 +76,9 @@ class LineChart1ViewController: DemoBaseViewController { leftAxis.axisMinimum = -50 leftAxis.gridLineDashLengths = [5, 5] leftAxis.drawLimitLinesBehindDataEnabled = true - + chartView.rightAxis.enabled = false - + //[_chartView.viewPortHandler setMaximumScaleY: 2.f]; //[_chartView.viewPortHandler setMaximumScaleX: 2.f]; @@ -90,13 +89,13 @@ class LineChart1ViewController: DemoBaseViewController { marker.chartView = chartView marker.minimumSize = CGSize(width: 80, height: 40) chartView.marker = marker - + chartView.legend.form = .line - + sliderX.value = 45 sliderY.value = 100 slidersValueChanged(nil) - + chartView.animate(xAxisDuration: 2.5) } @@ -105,7 +104,7 @@ class LineChart1ViewController: DemoBaseViewController { chartView.data = nil return } - + self.setDataCount(Int(sliderX.value), range: UInt32(sliderY.value)) } @@ -114,67 +113,95 @@ class LineChart1ViewController: DemoBaseViewController { let val = Double(arc4random_uniform(range) + 3) return ChartDataEntry(x: Double(i), y: val, icon: #imageLiteral(resourceName: "icon")) } - + let set1 = LineChartDataSet(entries: values, label: "DataSet 1") set1.drawIconsEnabled = false - - set1.lineDashLengths = [5, 2.5] - set1.highlightLineDashLengths = [5, 2.5] - set1.setColor(.black) - set1.setCircleColor(.black) - set1.lineWidth = 1 - set1.circleRadius = 3 - set1.drawCircleHoleEnabled = false - set1.valueFont = .systemFont(ofSize: 9) - set1.formLineDashLengths = [5, 2.5] - set1.formLineWidth = 1 - set1.formSize = 15 - + setup(set1) + + let value = ChartDataEntry(x: Double(3), y: 3) + set1.addEntryOrdered(value) let gradientColors = [ChartColorTemplates.colorFromString("#00ff0000").cgColor, ChartColorTemplates.colorFromString("#ffff0000").cgColor] let gradient = CGGradient(colorsSpace: nil, colors: gradientColors as CFArray, locations: nil)! - + set1.fillAlpha = 1 - set1.fill = Fill(linearGradient: gradient, angle: 90) //.linearGradient(gradient, angle: 90) + set1.fill = LinearGradientFill(gradient: gradient, angle: 90) set1.drawFilledEnabled = true - + let data = LineChartData(dataSet: set1) - + chartView.data = data } - + + private func setup(_ dataSet: LineChartDataSet) { + if dataSet.isDrawLineWithGradientEnabled { + dataSet.lineDashLengths = nil + dataSet.highlightLineDashLengths = nil + dataSet.setColors(.black, .red, .white) + dataSet.setCircleColor(.black) + dataSet.gradientPositions = [0, 40, 100] + dataSet.lineWidth = 1 + dataSet.circleRadius = 3 + dataSet.drawCircleHoleEnabled = false + dataSet.valueFont = .systemFont(ofSize: 9) + dataSet.formLineDashLengths = nil + dataSet.formLineWidth = 1 + dataSet.formSize = 15 + } else { + dataSet.lineDashLengths = [5, 2.5] + dataSet.highlightLineDashLengths = [5, 2.5] + dataSet.setColor(.black) + dataSet.setCircleColor(.black) + dataSet.gradientPositions = nil + dataSet.lineWidth = 1 + dataSet.circleRadius = 3 + dataSet.drawCircleHoleEnabled = false + dataSet.valueFont = .systemFont(ofSize: 9) + dataSet.formLineDashLengths = [5, 2.5] + dataSet.formLineWidth = 1 + dataSet.formSize = 15 + } + } + override func optionTapped(_ option: Option) { + guard let data = chartView.data else { return } + switch option { case .toggleFilled: - for set in chartView.data!.dataSets as! [LineChartDataSet] { + for case let set as LineChartDataSet in data { set.drawFilledEnabled = !set.drawFilledEnabled } chartView.setNeedsDisplay() - + case .toggleCircles: - for set in chartView.data!.dataSets as! [LineChartDataSet] { + for case let set as LineChartDataSet in data { set.drawCirclesEnabled = !set.drawCirclesEnabled } chartView.setNeedsDisplay() - + case .toggleCubic: - for set in chartView.data!.dataSets as! [LineChartDataSet] { + for case let set as LineChartDataSet in data { set.mode = (set.mode == .cubicBezier) ? .linear : .cubicBezier } chartView.setNeedsDisplay() - + case .toggleStepped: - for set in chartView.data!.dataSets as! [LineChartDataSet] { + for case let set as LineChartDataSet in data { set.mode = (set.mode == .stepped) ? .linear : .stepped } chartView.setNeedsDisplay() - + case .toggleHorizontalCubic: - for set in chartView.data!.dataSets as! [LineChartDataSet] { + for case let set as LineChartDataSet in data { set.mode = (set.mode == .cubicBezier) ? .horizontalBezier : .cubicBezier } chartView.setNeedsDisplay() - + case .toggleGradientLine: + for set in chartView.data!.dataSets as! [LineChartDataSet] { + set.isDrawLineWithGradientEnabled = !set.isDrawLineWithGradientEnabled + setup(set) + } + chartView.setNeedsDisplay() default: super.handleOption(option, forChartView: chartView) } @@ -183,7 +210,7 @@ class LineChart1ViewController: DemoBaseViewController { @IBAction func slidersValueChanged(_ sender: Any?) { sliderTextX.text = "\(Int(sliderX.value))" sliderTextY.text = "\(Int(sliderY.value))" - + self.updateChartData() } } diff --git a/ChartsDemo-iOS/Swift/Demos/LineChart2ViewController.swift b/ChartsDemo-iOS/Swift/Demos/LineChart2ViewController.swift index d2ee8c8297..9ae9688f9c 100644 --- a/ChartsDemo-iOS/Swift/Demos/LineChart2ViewController.swift +++ b/ChartsDemo-iOS/Swift/Demos/LineChart2ViewController.swift @@ -41,7 +41,7 @@ class LineChart2ViewController: DemoBaseViewController { chartView.delegate = self - chartView.chartDescription?.enabled = false + chartView.chartDescription.enabled = false chartView.dragEnabled = true chartView.setScaleEnabled(true) chartView.pinchZoomEnabled = true @@ -137,7 +137,7 @@ class LineChart2ViewController: DemoBaseViewController { set3.highlightColor = UIColor(red: 244/255, green: 117/255, blue: 117/255, alpha: 1) set3.drawCircleHoleEnabled = false - let data = LineChartData(dataSets: [set1, set2, set3]) + let data: LineChartData = [set1, set2, set3] data.setValueTextColor(.white) data.setValueFont(.systemFont(ofSize: 9)) @@ -145,33 +145,35 @@ class LineChart2ViewController: DemoBaseViewController { } override func optionTapped(_ option: Option) { + guard let data = chartView.data else { return } + switch option { case .toggleFilled: - for set in chartView.data!.dataSets as! [LineChartDataSet] { + for case let set as LineChartDataSet in data { set.drawFilledEnabled = !set.drawFilledEnabled } chartView.setNeedsDisplay() case .toggleCircles: - for set in chartView.data!.dataSets as! [LineChartDataSet] { + for case let set as LineChartDataSet in data { set.drawCirclesEnabled = !set.drawCirclesEnabled } chartView.setNeedsDisplay() case .toggleCubic: - for set in chartView.data!.dataSets as! [LineChartDataSet] { + for case let set as LineChartDataSet in data { set.mode = (set.mode == .cubicBezier) ? .linear : .cubicBezier } chartView.setNeedsDisplay() case .toggleStepped: - for set in chartView.data!.dataSets as! [LineChartDataSet] { + for case let set as LineChartDataSet in data { set.mode = (set.mode == .stepped) ? .linear : .stepped } chartView.setNeedsDisplay() case .toggleHorizontalCubic: - for set in chartView.data!.dataSets as! [LineChartDataSet] { + for case let set as LineChartDataSet in data { set.mode = (set.mode == .cubicBezier) ? .horizontalBezier : .cubicBezier } chartView.setNeedsDisplay() @@ -194,7 +196,7 @@ class LineChart2ViewController: DemoBaseViewController { super.chartValueSelected(chartView, entry: entry, highlight: highlight) self.chartView.centerViewToAnimated(xValue: entry.x, yValue: entry.y, - axis: self.chartView.data!.getDataSetByIndex(highlight.dataSetIndex).axisDependency, + axis: self.chartView.data![highlight.dataSetIndex].axisDependency, duration: 1) //[_chartView moveViewToAnimatedWithXValue:entry.x yValue:entry.y axis:[_chartView.data getDataSetByIndex:dataSetIndex].axisDependency duration:1.0]; //[_chartView zoomAndCenterViewAnimatedWithScaleX:1.8 scaleY:1.8 xValue:entry.x yValue:entry.y axis:[_chartView.data getDataSetByIndex:dataSetIndex].axisDependency duration:1.0]; diff --git a/ChartsDemo-iOS/Swift/Demos/LineChartFilledViewController.swift b/ChartsDemo-iOS/Swift/Demos/LineChartFilledViewController.swift index 3d17d968a7..ad99136a7b 100644 --- a/ChartsDemo-iOS/Swift/Demos/LineChartFilledViewController.swift +++ b/ChartsDemo-iOS/Swift/Demos/LineChartFilledViewController.swift @@ -33,7 +33,7 @@ class LineChartFilledViewController: DemoBaseViewController { chartView.drawBordersEnabled = true - chartView.chartDescription?.enabled = false + chartView.chartDescription.enabled = false chartView.pinchZoomEnabled = false chartView.dragEnabled = true @@ -104,7 +104,7 @@ class LineChartFilledViewController: DemoBaseViewController { return CGFloat(self.chartView.leftAxis.axisMaximum) } - let data = LineChartData(dataSets: [set1, set2]) + let data: LineChartData = [set1, set2] data.setDrawValues(false) chartView.data = data diff --git a/ChartsDemo-iOS/Swift/Demos/LineChartTimeViewController.swift b/ChartsDemo-iOS/Swift/Demos/LineChartTimeViewController.swift index b5e14da3de..303c636139 100644 --- a/ChartsDemo-iOS/Swift/Demos/LineChartTimeViewController.swift +++ b/ChartsDemo-iOS/Swift/Demos/LineChartTimeViewController.swift @@ -38,7 +38,7 @@ class LineChartTimeViewController: DemoBaseViewController { chartView.delegate = self - chartView.chartDescription?.enabled = false + chartView.chartDescription.enabled = false chartView.dragEnabled = true chartView.setScaleEnabled(true) @@ -120,33 +120,35 @@ class LineChartTimeViewController: DemoBaseViewController { } override func optionTapped(_ option: Option) { + guard let data = chartView.data else { return } + switch option { case .toggleFilled: - for set in chartView.data!.dataSets as! [LineChartDataSet] { + for case let set as LineChartDataSet in data { set.drawFilledEnabled = !set.drawFilledEnabled } chartView.setNeedsDisplay() case .toggleCircles: - for set in chartView.data!.dataSets as! [LineChartDataSet] { + for case let set as LineChartDataSet in data { set.drawCirclesEnabled = !set.drawCirclesEnabled } chartView.setNeedsDisplay() case .toggleCubic: - for set in chartView.data!.dataSets as! [LineChartDataSet] { + for case let set as LineChartDataSet in data { set.mode = (set.mode == .cubicBezier) ? .linear : .cubicBezier } chartView.setNeedsDisplay() case .toggleStepped: - for set in chartView.data!.dataSets as! [LineChartDataSet] { + for case let set as LineChartDataSet in data { set.mode = (set.mode == .stepped) ? .linear : .stepped } chartView.setNeedsDisplay() case .toggleHorizontalCubic: - for set in chartView.data!.dataSets as! [LineChartDataSet] { + for case let set as LineChartDataSet in data { set.mode = (set.mode == .cubicBezier) ? .horizontalBezier : .cubicBezier } chartView.setNeedsDisplay() diff --git a/ChartsDemo-iOS/Swift/Demos/MultipleBarChartViewController.swift b/ChartsDemo-iOS/Swift/Demos/MultipleBarChartViewController.swift index ca7f54a353..871e2ebe7b 100644 --- a/ChartsDemo-iOS/Swift/Demos/MultipleBarChartViewController.swift +++ b/ChartsDemo-iOS/Swift/Demos/MultipleBarChartViewController.swift @@ -38,7 +38,7 @@ class MultipleBarChartViewController: DemoBaseViewController { chartView.delegate = self - chartView.chartDescription?.enabled = false + chartView.chartDescription.enabled = false chartView.pinchZoomEnabled = false chartView.drawBarShadowEnabled = false @@ -121,7 +121,7 @@ class MultipleBarChartViewController: DemoBaseViewController { let set4 = BarChartDataSet(entries: yVals4, label: "Company D") set4.setColor(UIColor(red: 255/255, green: 102/255, blue: 0/255, alpha: 1)) - let data = BarChartData(dataSets: [set1, set2, set3, set4]) + let data: BarChartData = [set1, set2, set3, set4] data.setValueFont(.systemFont(ofSize: 10, weight: .light)) data.setValueFormatter(LargeValueFormatter()) diff --git a/ChartsDemo-iOS/Swift/Demos/MultipleLinesChartViewController.swift b/ChartsDemo-iOS/Swift/Demos/MultipleLinesChartViewController.swift index 29c8efbb5e..098bf07b27 100644 --- a/ChartsDemo-iOS/Swift/Demos/MultipleLinesChartViewController.swift +++ b/ChartsDemo-iOS/Swift/Demos/MultipleLinesChartViewController.swift @@ -40,7 +40,7 @@ class MultipleLinesChartViewController: DemoBaseViewController { chartView.delegate = self - chartView.chartDescription?.enabled = false + chartView.chartDescription.enabled = false chartView.leftAxis.enabled = false chartView.rightAxis.drawAxisLineEnabled = false @@ -101,27 +101,29 @@ class MultipleLinesChartViewController: DemoBaseViewController { } override func optionTapped(_ option: Option) { + guard let data = chartView.data else { return } + switch option { case .toggleFilled: - for set in chartView.data!.dataSets as! [LineChartDataSet] { + for case let set as LineChartDataSet in data { set.drawFilledEnabled = !set.drawFilledEnabled } chartView.setNeedsDisplay() case .toggleCircles: - for set in chartView.data!.dataSets as! [LineChartDataSet] { + for case let set as LineChartDataSet in data { set.drawCirclesEnabled = !set.drawCirclesEnabled } chartView.setNeedsDisplay() case .toggleCubic: - for set in chartView.data!.dataSets as! [LineChartDataSet] { + for case let set as LineChartDataSet in data { set.mode = (set.mode == .cubicBezier) ? .linear : .cubicBezier } chartView.setNeedsDisplay() case .toggleStepped: - for set in chartView.data!.dataSets as! [LineChartDataSet] { + for case let set as LineChartDataSet in data { set.mode = (set.mode == .stepped) ? .linear : .stepped } chartView.setNeedsDisplay() diff --git a/ChartsDemo-iOS/Swift/Demos/NegativeStackedBarChartViewController.swift b/ChartsDemo-iOS/Swift/Demos/NegativeStackedBarChartViewController.swift index 6585aad950..01a656f94b 100644 --- a/ChartsDemo-iOS/Swift/Demos/NegativeStackedBarChartViewController.swift +++ b/ChartsDemo-iOS/Swift/Demos/NegativeStackedBarChartViewController.swift @@ -45,7 +45,7 @@ class NegativeStackedBarChartViewController: DemoBaseViewController { chartView.delegate = self - chartView.chartDescription?.enabled = false + chartView.chartDescription.enabled = false chartView.drawBarShadowEnabled = false chartView.drawValueAboveBarEnabled = true @@ -127,7 +127,7 @@ class NegativeStackedBarChartViewController: DemoBaseViewController { } } -extension NegativeStackedBarChartViewController: IAxisValueFormatter { +extension NegativeStackedBarChartViewController: AxisValueFormatter { func stringForValue(_ value: Double, axis: AxisBase?) -> String { return String(format: "%03.0f-%03.0f", value, value + 10) } diff --git a/ChartsDemo-iOS/Swift/Demos/PieChartViewController.swift b/ChartsDemo-iOS/Swift/Demos/PieChartViewController.swift index 4f8cb3180b..dc8523d08b 100644 --- a/ChartsDemo-iOS/Swift/Demos/PieChartViewController.swift +++ b/ChartsDemo-iOS/Swift/Demos/PieChartViewController.swift @@ -30,6 +30,7 @@ class PieChartViewController: DemoBaseViewController { .togglePercent, .toggleHole, .toggleIcons, + .toggleLabelsMinimumAngle, .animateX, .animateY, .animateXY, @@ -101,7 +102,7 @@ class PieChartViewController: DemoBaseViewController { data.setValueFormatter(DefaultValueFormatter(formatter: pFormatter)) data.setValueFont(.systemFont(ofSize: 11, weight: .light)) - data.setValueTextColor(.white) + data.setValueTextColor(.black) chartView.data = data chartView.highlightValues(nil) @@ -121,6 +122,10 @@ class PieChartViewController: DemoBaseViewController { chartView.drawHoleEnabled = !chartView.drawHoleEnabled chartView.setNeedsDisplay() + case .toggleLabelsMinimumAngle: + chartView.sliceTextDrawingThreshold = chartView.sliceTextDrawingThreshold == 0.0 ? 20.0 : 0.0 + chartView.setNeedsDisplay() + case .drawCenter: chartView.drawCenterTextEnabled = !chartView.drawCenterTextEnabled chartView.setNeedsDisplay() diff --git a/ChartsDemo-iOS/Swift/Demos/PiePolylineChartViewController.swift b/ChartsDemo-iOS/Swift/Demos/PiePolylineChartViewController.swift index a25000739b..42021249ce 100644 --- a/ChartsDemo-iOS/Swift/Demos/PiePolylineChartViewController.swift +++ b/ChartsDemo-iOS/Swift/Demos/PiePolylineChartViewController.swift @@ -27,6 +27,7 @@ class PiePolylineChartViewController: DemoBaseViewController { .toggleXValues, .togglePercent, .toggleHole, + .toggleLabelsMinimumAngle, .animateX, .animateY, .animateXY, @@ -111,6 +112,10 @@ class PiePolylineChartViewController: DemoBaseViewController { chartView.drawHoleEnabled = !chartView.drawHoleEnabled chartView.setNeedsDisplay() + case .toggleLabelsMinimumAngle: + chartView.sliceTextDrawingThreshold = chartView.sliceTextDrawingThreshold == 0.0 ? 20.0 : 0.0 + chartView.setNeedsDisplay() + case .drawCenter: chartView.drawCenterTextEnabled = !chartView.drawCenterTextEnabled chartView.setNeedsDisplay() diff --git a/ChartsDemo-iOS/Swift/Demos/PositiveNegativeBarChartViewController.swift b/ChartsDemo-iOS/Swift/Demos/PositiveNegativeBarChartViewController.swift index 36771b97c0..2f1a65e65c 100644 --- a/ChartsDemo-iOS/Swift/Demos/PositiveNegativeBarChartViewController.swift +++ b/ChartsDemo-iOS/Swift/Demos/PositiveNegativeBarChartViewController.swift @@ -46,7 +46,7 @@ class PositiveNegativeBarChartViewController: DemoBaseViewController { chartView.drawBarShadowEnabled = false chartView.drawValueAboveBarEnabled = true - chartView.chartDescription?.enabled = false + chartView.chartDescription.enabled = false chartView.rightAxis.enabled = false @@ -115,7 +115,7 @@ class PositiveNegativeBarChartViewController: DemoBaseViewController { } } -extension PositiveNegativeBarChartViewController: IAxisValueFormatter { +extension PositiveNegativeBarChartViewController: AxisValueFormatter { func stringForValue(_ value: Double, axis: AxisBase?) -> String { return dataLabels[min(max(Int(value), 0), dataLabels.count - 1)] } diff --git a/ChartsDemo-iOS/Swift/Demos/RadarChartViewController.swift b/ChartsDemo-iOS/Swift/Demos/RadarChartViewController.swift index 79f308d66a..a9842f89ef 100644 --- a/ChartsDemo-iOS/Swift/Demos/RadarChartViewController.swift +++ b/ChartsDemo-iOS/Swift/Demos/RadarChartViewController.swift @@ -41,7 +41,7 @@ class RadarChartViewController: DemoBaseViewController { chartView.delegate = self - chartView.chartDescription?.enabled = false + chartView.chartDescription.enabled = false chartView.webLineWidth = 1 chartView.innerWebLineWidth = 1 chartView.webColor = .lightGray @@ -144,7 +144,7 @@ class RadarChartViewController: DemoBaseViewController { set2.drawHighlightCircleEnabled = true set2.setDrawHighlightIndicators(false) - let data = RadarChartData(dataSets: [set1, set2]) + let data: RadarChartData = [set1, set2] data.setValueFont(.systemFont(ofSize: 8, weight: .light)) data.setDrawValues(false) data.setValueTextColor(.white) @@ -153,6 +153,8 @@ class RadarChartViewController: DemoBaseViewController { } override func optionTapped(_ option: Option) { + guard let data = chartView.data else { return } + switch option { case .toggleXLabels: chartView.xAxis.drawLabelsEnabled = !chartView.xAxis.drawLabelsEnabled @@ -168,14 +170,14 @@ class RadarChartViewController: DemoBaseViewController { chartView.rotationEnabled = !chartView.rotationEnabled case .toggleFilled: - for set in chartView.data!.dataSets as! [RadarChartDataSet] { + for case let set as RadarChartDataSet in data { set.drawFilledEnabled = !set.drawFilledEnabled } chartView.setNeedsDisplay() case .toggleHighlightCircle: - for set in chartView.data!.dataSets as! [RadarChartDataSet] { + for case let set as RadarChartDataSet in data { set.drawHighlightCircleEnabled = !set.drawHighlightCircleEnabled } chartView.setNeedsDisplay() @@ -198,7 +200,7 @@ class RadarChartViewController: DemoBaseViewController { } } -extension RadarChartViewController: IAxisValueFormatter { +extension RadarChartViewController: AxisValueFormatter { func stringForValue(_ value: Double, axis: AxisBase?) -> String { return activities[Int(value) % activities.count] } diff --git a/ChartsDemo-iOS/Swift/Demos/ScatterChartViewController.swift b/ChartsDemo-iOS/Swift/Demos/ScatterChartViewController.swift index b3d6907da7..bcc691c906 100644 --- a/ChartsDemo-iOS/Swift/Demos/ScatterChartViewController.swift +++ b/ChartsDemo-iOS/Swift/Demos/ScatterChartViewController.swift @@ -35,8 +35,8 @@ class ScatterChartViewController: DemoBaseViewController { .toggleData] chartView.delegate = self - - chartView.chartDescription?.enabled = false + + chartView.chartDescription.enabled = false chartView.dragEnabled = true chartView.setScaleEnabled(true) @@ -107,7 +107,7 @@ class ScatterChartViewController: DemoBaseViewController { set3.setColor(ChartColorTemplates.colorful()[2]) set3.scatterShapeSize = 8 - let data = ScatterChartData(dataSets: [set1, set2, set3]) + let data: ScatterChartData = [set1, set2, set3] data.setValueFont(.systemFont(ofSize: 7, weight: .light)) chartView.data = data diff --git a/ChartsDemo-iOS/Swift/Demos/SinusBarChartViewController.swift b/ChartsDemo-iOS/Swift/Demos/SinusBarChartViewController.swift index 918aef215a..0a966c4cce 100644 --- a/ChartsDemo-iOS/Swift/Demos/SinusBarChartViewController.swift +++ b/ChartsDemo-iOS/Swift/Demos/SinusBarChartViewController.swift @@ -34,7 +34,7 @@ class SinusBarChartViewController: DemoBaseViewController { chartView.delegate = self - chartView.chartDescription?.enabled = false + chartView.chartDescription.enabled = false chartView.drawBarShadowEnabled = false chartView.drawValueAboveBarEnabled = false diff --git a/ChartsDemo-iOS/Swift/Demos/StackedBarChartViewController.swift b/ChartsDemo-iOS/Swift/Demos/StackedBarChartViewController.swift index 87f3d64461..e48d882433 100644 --- a/ChartsDemo-iOS/Swift/Demos/StackedBarChartViewController.swift +++ b/ChartsDemo-iOS/Swift/Demos/StackedBarChartViewController.swift @@ -48,7 +48,7 @@ class StackedBarChartViewController: DemoBaseViewController { chartView.delegate = self - chartView.chartDescription?.enabled = false + chartView.chartDescription.enabled = false chartView.maxVisibleCount = 40 chartView.drawBarShadowEnabled = false diff --git a/ChartsDemo-iOS/Swift/Formatters/DateValueFormatter.swift b/ChartsDemo-iOS/Swift/Formatters/DateValueFormatter.swift index 2962a6852a..aa39e3d444 100644 --- a/ChartsDemo-iOS/Swift/Formatters/DateValueFormatter.swift +++ b/ChartsDemo-iOS/Swift/Formatters/DateValueFormatter.swift @@ -9,7 +9,7 @@ import Foundation import Charts -public class DateValueFormatter: NSObject, IAxisValueFormatter { +public class DateValueFormatter: NSObject, AxisValueFormatter { private let dateFormatter = DateFormatter() override init() { diff --git a/ChartsDemo-iOS/Swift/Formatters/DayAxisValueFormatter.swift b/ChartsDemo-iOS/Swift/Formatters/DayAxisValueFormatter.swift index 245a25c83e..f403daa06a 100644 --- a/ChartsDemo-iOS/Swift/Formatters/DayAxisValueFormatter.swift +++ b/ChartsDemo-iOS/Swift/Formatters/DayAxisValueFormatter.swift @@ -9,7 +9,7 @@ import Foundation import Charts -public class DayAxisValueFormatter: NSObject, IAxisValueFormatter { +public class DayAxisValueFormatter: NSObject, AxisValueFormatter { weak var chart: BarLineChartViewBase? let months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", diff --git a/ChartsDemo-iOS/Swift/Formatters/IntAxisValueFormatter.swift b/ChartsDemo-iOS/Swift/Formatters/IntAxisValueFormatter.swift index bd3062a190..00157055ec 100644 --- a/ChartsDemo-iOS/Swift/Formatters/IntAxisValueFormatter.swift +++ b/ChartsDemo-iOS/Swift/Formatters/IntAxisValueFormatter.swift @@ -9,7 +9,7 @@ import Foundation import Charts -public class IntAxisValueFormatter: NSObject, IAxisValueFormatter { +public class IntAxisValueFormatter: NSObject, AxisValueFormatter { public func stringForValue(_ value: Double, axis: AxisBase?) -> String { return "\(Int(value))" } diff --git a/ChartsDemo-iOS/Swift/Formatters/LargeValueFormatter.swift b/ChartsDemo-iOS/Swift/Formatters/LargeValueFormatter.swift index c95ca034a6..8cf679d2b5 100644 --- a/ChartsDemo-iOS/Swift/Formatters/LargeValueFormatter.swift +++ b/ChartsDemo-iOS/Swift/Formatters/LargeValueFormatter.swift @@ -11,7 +11,7 @@ private let MAX_LENGTH = 5 @objc protocol Testing123 { } -public class LargeValueFormatter: NSObject, IValueFormatter, IAxisValueFormatter { +public class LargeValueFormatter: NSObject, ValueFormatter, AxisValueFormatter { /// Suffix to be appended after the values. /// diff --git a/ChartsDemo-macOS/ChartsDemo-macOS/Demos/BarDemoViewController.swift b/ChartsDemo-macOS/ChartsDemo-macOS/Demos/BarDemoViewController.swift index bf0d91c76c..13102156d6 100644 --- a/ChartsDemo-macOS/ChartsDemo-macOS/Demos/BarDemoViewController.swift +++ b/ChartsDemo-macOS/ChartsDemo-macOS/Demos/BarDemoViewController.swift @@ -31,11 +31,11 @@ open class BarDemoViewController: NSViewController let data = BarChartData() let ds1 = BarChartDataSet(entries: yse1, label: "Hello") ds1.colors = [NSUIColor.red] - data.addDataSet(ds1) + data.append(ds1) let ds2 = BarChartDataSet(entries: yse2, label: "World") ds2.colors = [NSUIColor.blue] - data.addDataSet(ds2) + data.append(ds2) let barWidth = 0.4 let barSpace = 0.05 @@ -51,7 +51,7 @@ open class BarDemoViewController: NSViewController self.barChartView.gridBackgroundColor = NSUIColor.white - self.barChartView.chartDescription?.text = "Barchart Demo" + self.barChartView.chartDescription.text = "Barchart Demo" } @IBAction func save(_ sender: Any) diff --git a/ChartsDemo-macOS/ChartsDemo-macOS/Demos/LineDemoViewController.swift b/ChartsDemo-macOS/ChartsDemo-macOS/Demos/LineDemoViewController.swift index 5f555649d3..51ba836f63 100644 --- a/ChartsDemo-macOS/ChartsDemo-macOS/Demos/LineDemoViewController.swift +++ b/ChartsDemo-macOS/ChartsDemo-macOS/Demos/LineDemoViewController.swift @@ -30,16 +30,16 @@ open class LineDemoViewController: NSViewController let data = LineChartData() let ds1 = LineChartDataSet(entries: yse1, label: "Hello") ds1.colors = [NSUIColor.red] - data.addDataSet(ds1) + data.append(ds1) let ds2 = LineChartDataSet(entries: yse2, label: "World") ds2.colors = [NSUIColor.blue] - data.addDataSet(ds2) + data.append(ds2) self.lineChartView.data = data self.lineChartView.gridBackgroundColor = NSUIColor.white - self.lineChartView.chartDescription?.text = "Linechart Demo" + self.lineChartView.chartDescription.text = "Linechart Demo" } override open func viewWillAppear() diff --git a/ChartsDemo-macOS/ChartsDemo-macOS/Demos/PieDemoViewController.swift b/ChartsDemo-macOS/ChartsDemo-macOS/Demos/PieDemoViewController.swift index 5a566f58a8..5143051632 100644 --- a/ChartsDemo-macOS/ChartsDemo-macOS/Demos/PieDemoViewController.swift +++ b/ChartsDemo-macOS/ChartsDemo-macOS/Demos/PieDemoViewController.swift @@ -30,7 +30,7 @@ open class PieDemoViewController: NSViewController ds1.colors = ChartColorTemplates.vordiplom() - data.addDataSet(ds1) + data.append(ds1) let paragraphStyle: NSMutableParagraphStyle = NSParagraphStyle.default.mutableCopy() as! NSMutableParagraphStyle paragraphStyle.lineBreakMode = .byTruncatingTail @@ -44,7 +44,7 @@ open class PieDemoViewController: NSViewController self.pieChartView.data = data - self.pieChartView.chartDescription?.text = "Piechart Demo" + self.pieChartView.chartDescription.text = "Piechart Demo" } override open func viewWillAppear() diff --git a/ChartsDemo-macOS/ChartsDemo-macOS/Demos/RadarDemoViewController.swift b/ChartsDemo-macOS/ChartsDemo-macOS/Demos/RadarDemoViewController.swift index e147a2688c..3eecf73224 100644 --- a/ChartsDemo-macOS/ChartsDemo-macOS/Demos/RadarDemoViewController.swift +++ b/ChartsDemo-macOS/ChartsDemo-macOS/Demos/RadarDemoViewController.swift @@ -30,13 +30,13 @@ open class RadarDemoViewController: NSViewController let data = RadarChartData() let ds1 = RadarChartDataSet(entries: yse1, label: "Hello") ds1.colors = [NSUIColor.red] - data.addDataSet(ds1) + data.append(ds1) let ds2 = RadarChartDataSet(entries: yse2, label: "World") ds2.colors = [NSUIColor.blue] - data.addDataSet(ds2) + data.append(ds2) self.radarChartView.data = data - self.radarChartView.chartDescription?.text = "Radarchart Demo" + self.radarChartView.chartDescription.text = "Radarchart Demo" } diff --git a/ChartsDemo-macOS/PlaygroundChart.playground/Contents.o b/ChartsDemo-macOS/PlaygroundChart.playground/Contents.o deleted file mode 100644 index e7a031a9a8..0000000000 Binary files a/ChartsDemo-macOS/PlaygroundChart.playground/Contents.o and /dev/null differ diff --git a/Gemfile b/Gemfile deleted file mode 100644 index 89b2efafcf..0000000000 --- a/Gemfile +++ /dev/null @@ -1,6 +0,0 @@ -source 'https://rubygems.org' - -gem 'cocoapods', '>= 1.8.3' -gem 'github_changelog_generator' -gem 'rake' -gem 'xcpretty' diff --git a/Gemfile.lock b/Gemfile.lock deleted file mode 100644 index ccd0d7298e..0000000000 --- a/Gemfile.lock +++ /dev/null @@ -1,122 +0,0 @@ -GEM - remote: https://rubygems.org/ - specs: - CFPropertyList (3.0.2) - activesupport (4.2.11.1) - i18n (~> 0.7) - minitest (~> 5.1) - thread_safe (~> 0.3, >= 0.3.4) - tzinfo (~> 1.1) - addressable (2.7.0) - public_suffix (>= 2.0.2, < 5.0) - algoliasearch (1.27.1) - httpclient (~> 2.8, >= 2.8.3) - json (>= 1.5.1) - atomos (0.1.3) - claide (1.0.3) - cocoapods (1.9.1) - activesupport (>= 4.0.2, < 5) - claide (>= 1.0.2, < 2.0) - cocoapods-core (= 1.9.1) - cocoapods-deintegrate (>= 1.0.3, < 2.0) - cocoapods-downloader (>= 1.2.2, < 2.0) - cocoapods-plugins (>= 1.0.0, < 2.0) - cocoapods-search (>= 1.0.0, < 2.0) - cocoapods-stats (>= 1.0.0, < 2.0) - cocoapods-trunk (>= 1.4.0, < 2.0) - cocoapods-try (>= 1.1.0, < 2.0) - colored2 (~> 3.1) - escape (~> 0.0.4) - fourflusher (>= 2.3.0, < 3.0) - gh_inspector (~> 1.0) - molinillo (~> 0.6.6) - nap (~> 1.0) - ruby-macho (~> 1.4) - xcodeproj (>= 1.14.0, < 2.0) - cocoapods-core (1.9.1) - activesupport (>= 4.0.2, < 6) - algoliasearch (~> 1.0) - concurrent-ruby (~> 1.1) - fuzzy_match (~> 2.0.4) - nap (~> 1.0) - netrc (~> 0.11) - typhoeus (~> 1.0) - cocoapods-deintegrate (1.0.4) - cocoapods-downloader (1.3.0) - cocoapods-plugins (1.0.0) - nap - cocoapods-search (1.0.0) - cocoapods-stats (1.1.0) - cocoapods-trunk (1.4.1) - nap (>= 0.8, < 2.0) - netrc (~> 0.11) - cocoapods-try (1.1.0) - colored2 (3.1.2) - concurrent-ruby (1.1.6) - escape (0.0.4) - ethon (0.12.0) - ffi (>= 1.3.0) - faraday (1.0.1) - multipart-post (>= 1.2, < 3) - faraday-http-cache (2.2.0) - faraday (>= 0.8) - ffi (1.12.2) - fourflusher (2.3.1) - fuzzy_match (2.0.4) - gh_inspector (1.1.3) - github_changelog_generator (1.15.2) - activesupport - faraday-http-cache - multi_json - octokit (~> 4.6) - rainbow (>= 2.2.1) - rake (>= 10.0) - retriable (~> 3.0) - httpclient (2.8.3) - i18n (0.9.5) - concurrent-ruby (~> 1.0) - json (2.3.0) - minitest (5.14.0) - molinillo (0.6.6) - multi_json (1.14.1) - multipart-post (2.1.1) - nanaimo (0.2.6) - nap (1.1.0) - netrc (0.11.0) - octokit (4.18.0) - faraday (>= 0.9) - sawyer (~> 0.8.0, >= 0.5.3) - public_suffix (4.0.4) - rainbow (3.0.0) - rake (13.0.1) - retriable (3.1.2) - rouge (2.0.7) - ruby-macho (1.4.0) - sawyer (0.8.2) - addressable (>= 2.3.5) - faraday (> 0.8, < 2.0) - thread_safe (0.3.6) - typhoeus (1.3.1) - ethon (>= 0.9.0) - tzinfo (1.2.7) - thread_safe (~> 0.1) - xcodeproj (1.16.0) - CFPropertyList (>= 2.3.3, < 4.0) - atomos (~> 0.1.3) - claide (>= 1.0.2, < 2.0) - colored2 (~> 3.1) - nanaimo (~> 0.2.6) - xcpretty (0.3.0) - rouge (~> 2.0.7) - -PLATFORMS - ruby - -DEPENDENCIES - cocoapods (>= 1.8.3) - github_changelog_generator - rake - xcpretty - -BUNDLED WITH - 1.17.2 diff --git a/Package.resolved b/Package.resolved new file mode 100644 index 0000000000..27daaabac3 --- /dev/null +++ b/Package.resolved @@ -0,0 +1,25 @@ +{ + "object": { + "pins": [ + { + "package": "swift-algorithms", + "repositoryURL": "https://github.com/apple/swift-algorithms", + "state": { + "branch": null, + "revision": "bb3bafeca0e164ece3403a9de646b7d38c07dd49", + "version": "0.0.2" + } + }, + { + "package": "swift-numerics", + "repositoryURL": "https://github.com/apple/swift-numerics", + "state": { + "branch": null, + "revision": "6b24333510e9044cf4716a07bed65eeed6bc6393", + "version": "0.0.8" + } + } + ] + }, + "version": 1 +} diff --git a/Package.swift b/Package.swift index 922c8df92c..8b266f9287 100644 --- a/Package.swift +++ b/Package.swift @@ -13,9 +13,19 @@ let package = Package( .library( name: "Charts", targets: ["Charts"]), + .library( + name: "ChartsDynamic", + type: .dynamic, + targets: ["Charts"]) + ], + dependencies: [ + .package(url: "https://github.com/apple/swift-algorithms", from: "0.0.1") ], targets: [ - .target(name: "Charts") + .target( + name: "Charts", + dependencies: [.product(name: "Algorithms", package: "swift-algorithms")] + ) ], swiftLanguageVersions: [.v5] ) diff --git a/README.md b/README.md index a469fbd5ba..b18d78021e 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -**Version 3.5.0**, synced to [MPAndroidChart #f6a398b](https://github.com/PhilJay/MPAndroidChart/commit/f6a398b) +**Version 4.0.0**, synced to [MPAndroidChart #f6a398b](https://github.com/PhilJay/MPAndroidChart/commit/f6a398b) ![alt tag](https://raw.github.com/danielgindi/Charts/master/Assets/feature_graphic.png) ![Supported Platforms](https://img.shields.io/cocoapods/p/Charts.svg) [![Releases](https://img.shields.io/github/release/danielgindi/Charts.svg)](https://github.com/danielgindi/Charts/releases) [![Latest pod release](https://img.shields.io/cocoapods/v/Charts.svg)](http://cocoapods.org/pods/charts) [![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) [![Build Status](https://travis-ci.org/danielgindi/Charts.svg?branch=master)](https://travis-ci.org/danielgindi/Charts) [![codecov](https://codecov.io/gh/danielgindi/Charts/branch/master/graph/badge.svg)](https://codecov.io/gh/danielgindi/Charts) @@ -50,6 +50,7 @@ In order to correctly compile: #### Video tutorials * [Chart in Swift - Setting Up a Basic Line Chart Using iOS Charts(Alex Nagy)](https://www.youtube.com/watch?v=mWhwe_tLNE8&list=PL_csAAO9PQ8bjzg-wxEff1Fr0Y5W1hrum&index=5) +* [Charts Framework in SwiftUI - Bar Chart (Stewart Lynch)](https://youtu.be/csd7pyfEXgw) #### Blog posts * [Using Realm and Charts with Swift 3 in iOS 10 (Sami Korpela)](https://medium.com/@skoli/using-realm-and-charts-with-swift-3-in-ios-10-40c42e3838c0#.2gyymwfh8) @@ -86,12 +87,22 @@ For [Realm](https://realm.io/) support, please add `pod 'ChartsRealm'` too. Charts now include Carthage prebuilt binaries. ```carthage -github "danielgindi/Charts" == 3.5.0 -github "danielgindi/Charts" ~> 3.5.0 +github "danielgindi/Charts" == 4.0.0 +github "danielgindi/Charts" ~> 4.0.0 ``` In order to build the binaries for a new release, use `carthage build --no-skip-current && carthage archive Charts`. +## Swift Package Manager Install + +Swift Package Manager + +```swift +dependencies: [ + .package(url: "https://github.com/danielgindi/Charts.git", .upToNextMajor(from: "4.0.0")) +] +``` + ## 3rd party bindings Xamarin (by @Flash3001): *iOS* - [GitHub](https://github.com/Flash3001/iOSCharts.Xamarin)/[NuGet](https://www.nuget.org/packages/iOSCharts/). *Android* - [GitHub](https://github.com/Flash3001/MPAndroidChart.Xamarin)/[NuGet](https://www.nuget.org/packages/MPAndroidChart/). diff --git a/Rakefile b/Rakefile deleted file mode 100644 index c951ce57c2..0000000000 --- a/Rakefile +++ /dev/null @@ -1,182 +0,0 @@ -def type - :project # set `:project` for xcodeproj and `:workspace` for xcworkspace -end - -def project_name - 'ChartsDemo-iOS/ChartsDemo-iOS.xcodeproj' -end - -def macos_project_name - 'ChartsDemo-macOS/ChartsDemo-macOS.xcodeproj' -end - -def configuration - 'Debug' -end - -def test_platforms - %i[ - iOS - tvOS - ] -end - -def build_platforms - [ - :macOS - ] -end - -def build_schemes - %w[ - Charts - ] -end - -def build_demo_schemes - %i[ - ChartsDemo-iOS - ChartsDemo-iOS-Swift - ] -end - -def build_macos_demo_schemes - [ - 'ChartsDemo-macOS' - ] -end - -def test_schemes - [ - 'ChartsTests' - ] -end - -def devices - { - iOS: { - sdk: 'iphonesimulator', - device: "name='iPhone 8'", - name: 'iPhone 8' - }, - macOS: { - sdk: 'macosx', - device: "arch='x86_64'", - uuid: nil - }, - tvOS: { - sdk: 'appletvsimulator', - device: "name='Apple TV'", - name: 'Apple TV' - } - } -end - -def open_simulator_and_sleep(uuid) - return if uuid.nil? # Don't need a sleep on macOS because it runs first. - sh "xcrun instruments -w '#{uuid}' || sleep 15" -end - -def xcodebuild(type, name, scheme, configuration, sdk, destination, tasks, xcprety_args) - # set either workspace or project flag for xcodebuild - case type - when :project - project_type = '-project' - when :workspace - project_type = '-workspace' - else - abort 'Invalid project type, use `:project` for xcodeproj and `:workspace` for xcworkspace.' - end - - sh "set -o pipefail && xcodebuild #{project_type} '#{name}' -scheme '#{scheme}' -configuration '#{configuration}' -sdk #{sdk} -destination #{destination} #{tasks} | bundle exec xcpretty -c #{xcprety_args}" -end - -def run_xcodebuild(tasks, destination, is_build_demo, xcprety_args) - sdk = destination[:sdk] - device = destination[:device] - uuid = destination[:uuid] - - is_test = tasks.include?('test') - is_macos = sdk == 'macosx' - - project = is_macos ? macos_project_name : project_name - - schemes_to_execute = [] - if is_test - schemes_to_execute = test_schemes - elsif is_build_demo - schemes_to_execute = is_macos ? build_macos_demo_schemes : build_demo_schemes - else - schemes_to_execute = build_schemes - end - - open_simulator_and_sleep uuid if is_test - - schemes_to_execute.each do |scheme| - xcodebuild type, project, scheme, configuration, sdk, device, tasks, xcprety_args - end -end - -def execute(tasks, platform, is_build_demo = false, xcprety_args: '') - # platform specific settings - destination = devices[platform] - - # check if xcodebuild needs to be run on multiple devices - if destination.is_a?(Array) - destination.each do |destination| - run_xcodebuild tasks, destination, is_build_demo, xcprety_args - end - else - run_xcodebuild tasks, destination, is_build_demo, xcprety_args - end -end - -def arg_to_key(string_key) - case string_key.downcase - when 'ios' - :iOS - when 'tvos' - :tvOS - when 'macos' - :macOS - when 'watchos' - :watchOS - else - abort 'Invalid platform, use `iOS`, `tvOS`, `macOS` or `watchOS`' - end -end - -desc 'Run CI tasks. Build and test or build depending on the platform.' -task :ci, [:platform] do |_task, args| - platform = arg_to_key(args[:platform]) if args.key?(:platform) - is_build_demo = test_platforms.include?(platform) || build_platforms.include?(platform) - - if test_platforms.include?(platform) # iOS and tvOS - if platform == :iOS - execute 'clean', platform, is_build_demo - execute 'build', platform, is_build_demo - execute 'test', platform # not use demo specifically - else - execute 'clean test', platform - end - elsif build_platforms.include?(platform) # macOS - execute 'clean build', platform, is_build_demo - else - test_platforms.each do |platform| - execute 'clean test', platform - end - build_platforms.each do |platform| - execute 'clean build', platform - end - end -end - -desc 'updated the podspec on cocoapods' -task :update_pod do - sh 'bundle exec pod trunk push Charts.podspec --allow-warnings' -end - -desc 'generate changelog' -task :generate_changelog do - sh 'github_changelog_generator' -end diff --git a/Source/Charts/Charts/BarChartView.swift b/Source/Charts/Charts/BarChartView.swift index 4f9aaa0bc9..92332774d7 100644 --- a/Source/Charts/Charts/BarChartView.swift +++ b/Source/Charts/Charts/BarChartView.swift @@ -25,7 +25,7 @@ open class BarChartView: BarLineChartViewBase, BarChartDataProvider { super.initialize() - renderer = BarChartRenderer(dataProvider: self, animator: _animator, viewPortHandler: _viewPortHandler) + renderer = BarChartRenderer(dataProvider: self, animator: chartAnimator, viewPortHandler: viewPortHandler) self.highlighter = BarHighlighter(chart: self) @@ -40,13 +40,13 @@ open class BarChartView: BarLineChartViewBase, BarChartDataProvider if fitBars { - _xAxis.calculate( + xAxis.calculate( min: data.xMin - data.barWidth / 2.0, max: data.xMax + data.barWidth / 2.0) } else { - _xAxis.calculate(min: data.xMin, max: data.xMax) + xAxis.calculate(min: data.xMin, max: data.xMax) } // calculate axis range (min / max) according to provided data @@ -61,7 +61,7 @@ open class BarChartView: BarLineChartViewBase, BarChartDataProvider /// - Returns: The Highlight object (contains x-index and DataSet index) of the selected value at the given touch point inside the BarChart. open override func getHighlightByTouchPoint(_ pt: CGPoint) -> Highlight? { - if _data === nil + if data === nil { Swift.print("Can't select by touch. No data set.") return nil @@ -86,9 +86,9 @@ open class BarChartView: BarLineChartViewBase, BarChartDataProvider @objc open func getBarBounds(entry e: BarChartDataEntry) -> CGRect { guard let - data = _data as? BarChartData, - let set = data.getDataSetForEntry(e) as? IBarChartDataSet - else { return CGRect.null } + data = data as? BarChartData, + let set = data.getDataSetForEntry(e) as? BarChartDataSetProtocol + else { return .null } let y = e.y let x = e.x @@ -176,7 +176,7 @@ open class BarChartView: BarLineChartViewBase, BarChartDataProvider // MARK: - BarChartDataProvider - open var barData: BarChartData? { return _data as? BarChartData } + open var barData: BarChartData? { return data as? BarChartData } /// `true` if drawing values above bars is enabled, `false` ifnot open var isDrawValueAboveBarEnabled: Bool { return drawValueAboveBarEnabled } diff --git a/Source/Charts/Charts/BarLineChartViewBase.swift b/Source/Charts/Charts/BarLineChartViewBase.swift index 1f8fdf81d5..631ccd07d9 100644 --- a/Source/Charts/Charts/BarLineChartViewBase.swift +++ b/Source/Charts/Charts/BarLineChartViewBase.swift @@ -9,15 +9,13 @@ // https://github.com/danielgindi/Charts // -import Foundation import CoreGraphics +import Foundation #if canImport(UIKit) - import UIKit -#endif - -#if canImport(Cocoa) -import Cocoa +import UIKit +#elseif canImport(AppKit) +import AppKit #endif /// Base-class of LineChart, BarChart, ScatterChart and CandleStickChart. @@ -76,19 +74,19 @@ open class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChartD /// The left Y axis renderer. This is a read-write property so you can set your own custom renderer here. /// **default**: An instance of YAxisRenderer - @objc open lazy var leftYAxisRenderer = YAxisRenderer(viewPortHandler: _viewPortHandler, yAxis: leftAxis, transformer: _leftAxisTransformer) + @objc open lazy var leftYAxisRenderer = YAxisRenderer(viewPortHandler: viewPortHandler, axis: leftAxis, transformer: _leftAxisTransformer) /// The right Y axis renderer. This is a read-write property so you can set your own custom renderer here. /// **default**: An instance of YAxisRenderer - @objc open lazy var rightYAxisRenderer = YAxisRenderer(viewPortHandler: _viewPortHandler, yAxis: rightAxis, transformer: _rightAxisTransformer) - + @objc open lazy var rightYAxisRenderer = YAxisRenderer(viewPortHandler: viewPortHandler, axis: rightAxis, transformer: _rightAxisTransformer) + internal var _leftAxisTransformer: Transformer! internal var _rightAxisTransformer: Transformer! /// The X axis renderer. This is a read-write property so you can set your own custom renderer here. /// **default**: An instance of XAxisRenderer - @objc open lazy var xAxisRenderer = XAxisRenderer(viewPortHandler: _viewPortHandler, xAxis: _xAxis, transformer: _leftAxisTransformer) - + @objc open lazy var xAxisRenderer = XAxisRenderer(viewPortHandler: viewPortHandler, axis: xAxis, transformer: _leftAxisTransformer) + internal var _tapGestureRecognizer: NSUITapGestureRecognizer! internal var _doubleTapGestureRecognizer: NSUITapGestureRecognizer! #if !os(tvOS) @@ -118,9 +116,9 @@ open class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChartD { super.initialize() - _leftAxisTransformer = Transformer(viewPortHandler: _viewPortHandler) - _rightAxisTransformer = Transformer(viewPortHandler: _viewPortHandler) - + _leftAxisTransformer = Transformer(viewPortHandler: viewPortHandler) + _rightAxisTransformer = Transformer(viewPortHandler: viewPortHandler) + self.highlighter = ChartHighlighter(chart: self) _tapGestureRecognizer = NSUITapGestureRecognizer(target: self, action: #selector(tapGestureRecognized(_:))) @@ -138,10 +136,10 @@ open class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChartD _panGestureRecognizer.isEnabled = _dragXEnabled || _dragYEnabled #if !os(tvOS) - _pinchGestureRecognizer = NSUIPinchGestureRecognizer(target: self, action: #selector(BarLineChartViewBase.pinchGestureRecognized(_:))) - _pinchGestureRecognizer.delegate = self - self.addGestureRecognizer(_pinchGestureRecognizer) - _pinchGestureRecognizer.isEnabled = _pinchZoomEnabled || _scaleXEnabled || _scaleYEnabled + _pinchGestureRecognizer = NSUIPinchGestureRecognizer(target: self, action: #selector(BarLineChartViewBase.pinchGestureRecognized(_:))) + _pinchGestureRecognizer.delegate = self + self.addGestureRecognizer(_pinchGestureRecognizer) + _pinchGestureRecognizer.isEnabled = _pinchZoomEnabled || _scaleXEnabled || _scaleYEnabled #endif } @@ -198,9 +196,9 @@ open class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChartD rightYAxisRenderer.computeAxis(min: rightAxis._axisMinimum, max: rightAxis._axisMaximum, inverted: rightAxis.isInverted) } - if _xAxis.isEnabled + if xAxis.isEnabled { - xAxisRenderer.computeAxis(min: _xAxis._axisMinimum, max: _xAxis._axisMaximum, inverted: false) + xAxisRenderer.computeAxis(min: xAxis._axisMinimum, max: xAxis._axisMaximum, inverted: false) } xAxisRenderer.renderAxisLine(context: context) @@ -215,7 +213,7 @@ open class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChartD rightYAxisRenderer.renderGridLines(context: context) } - if _xAxis.isEnabled && _xAxis.isDrawLimitLinesBehindDataEnabled + if xAxis.isEnabled && xAxis.isDrawLimitLinesBehindDataEnabled { xAxisRenderer.renderLimitLines(context: context) } @@ -231,10 +229,12 @@ open class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChartD } context.saveGState() + // make sure the data cannot be drawn outside the content-rect if clipDataToContentEnabled { - context.clip(to: _viewPortHandler.contentRect) + context.clip(to: viewPortHandler.contentRect) } + renderer.drawData(context: context) // The renderers are responsible for clipping, to account for line-width center etc. @@ -248,14 +248,14 @@ open class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChartD // if highlighting is enabled if (valuesToHighlight()) { - renderer.drawHighlighted(context: context, indices: _indicesToHighlight) + renderer.drawHighlighted(context: context, indices: highlighted) } context.restoreGState() renderer.drawExtras(context: context) - if _xAxis.isEnabled && !_xAxis.isDrawLimitLinesBehindDataEnabled + if xAxis.isEnabled && !xAxis.isDrawLimitLinesBehindDataEnabled { xAxisRenderer.renderLimitLines(context: context) } @@ -277,7 +277,7 @@ open class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChartD if clipValuesToContentEnabled { context.saveGState() - context.clip(to: _viewPortHandler.contentRect) + context.clip(to: viewPortHandler.contentRect) renderer.drawValues(context: context) @@ -288,9 +288,9 @@ open class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChartD renderer.drawValues(context: context) } - _legendRenderer.renderLegend(context: context) + legendRenderer.renderLegend(context: context) - drawDescription(context: context) + drawDescription(in: context) drawMarkers(context: context) } @@ -301,12 +301,12 @@ open class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChartD /// Performs auto scaling of the axis by recalculating the minimum and maximum y-values based on the entries currently in view. internal func autoScale() { - guard let data = _data + guard let data = data else { return } data.calcMinMaxY(fromX: self.lowestVisibleX, toX: self.highestVisibleX) - _xAxis.calculate(min: data.xMin, max: data.xMax) + xAxis.calculate(min: data.xMin, max: data.xMax) // calculate axis range (min / max) according to provided data @@ -325,7 +325,7 @@ open class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChartD internal func prepareValuePxMatrix() { - _rightAxisTransformer.prepareMatrixValuePx(chartXMin: _xAxis._axisMinimum, deltaX: CGFloat(xAxis.axisRange), deltaY: CGFloat(rightAxis.axisRange), chartYMin: rightAxis._axisMinimum) + _rightAxisTransformer.prepareMatrixValuePx(chartXMin: xAxis._axisMinimum, deltaX: CGFloat(xAxis.axisRange), deltaY: CGFloat(rightAxis.axisRange), chartYMin: rightAxis._axisMinimum) _leftAxisTransformer.prepareMatrixValuePx(chartXMin: xAxis._axisMinimum, deltaX: CGFloat(xAxis.axisRange), deltaY: CGFloat(leftAxis.axisRange), chartYMin: leftAxis._axisMinimum) } @@ -344,17 +344,14 @@ open class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChartD leftYAxisRenderer.computeAxis(min: leftAxis._axisMinimum, max: leftAxis._axisMaximum, inverted: leftAxis.isInverted) rightYAxisRenderer.computeAxis(min: rightAxis._axisMinimum, max: rightAxis._axisMaximum, inverted: rightAxis.isInverted) - if let data = _data + if let data = data { xAxisRenderer.computeAxis( - min: _xAxis._axisMinimum, - max: _xAxis._axisMaximum, + min: xAxis._axisMinimum, + max: xAxis._axisMaximum, inverted: false) - if _legend !== nil - { - legendRenderer?.computeLegend(data: data) - } + legendRenderer.computeLegend(data: data) } calculateOffsets() @@ -365,39 +362,39 @@ open class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChartD internal override func calcMinMax() { // calculate / set x-axis range - _xAxis.calculate(min: _data?.xMin ?? 0.0, max: _data?.xMax ?? 0.0) + xAxis.calculate(min: data?.xMin ?? 0.0, max: data?.xMax ?? 0.0) // calculate axis range (min / max) according to provided data - leftAxis.calculate(min: _data?.getYMin(axis: .left) ?? 0.0, max: _data?.getYMax(axis: .left) ?? 0.0) - rightAxis.calculate(min: _data?.getYMin(axis: .right) ?? 0.0, max: _data?.getYMax(axis: .right) ?? 0.0) + leftAxis.calculate(min: data?.getYMin(axis: .left) ?? 0.0, max: data?.getYMax(axis: .left) ?? 0.0) + rightAxis.calculate(min: data?.getYMin(axis: .right) ?? 0.0, max: data?.getYMax(axis: .right) ?? 0.0) } internal func calculateLegendOffsets(offsetLeft: inout CGFloat, offsetTop: inout CGFloat, offsetRight: inout CGFloat, offsetBottom: inout CGFloat) { // setup offsets for legend - if _legend !== nil && _legend.isEnabled && !_legend.drawInside + if legend.isEnabled, !legend.drawInside { - switch _legend.orientation + switch legend.orientation { case .vertical: - switch _legend.horizontalAlignment + switch legend.horizontalAlignment { case .left: - offsetLeft += min(_legend.neededWidth, _viewPortHandler.chartWidth * _legend.maxSizePercent) + _legend.xOffset + offsetLeft += min(legend.neededWidth, viewPortHandler.chartWidth * legend.maxSizePercent) + legend.xOffset case .right: - offsetRight += min(_legend.neededWidth, _viewPortHandler.chartWidth * _legend.maxSizePercent) + _legend.xOffset + offsetRight += min(legend.neededWidth, viewPortHandler.chartWidth * legend.maxSizePercent) + legend.xOffset case .center: - switch _legend.verticalAlignment + switch legend.verticalAlignment { case .top: - offsetTop += min(_legend.neededHeight, _viewPortHandler.chartHeight * _legend.maxSizePercent) + _legend.yOffset + offsetTop += min(legend.neededHeight, viewPortHandler.chartHeight * legend.maxSizePercent) + legend.yOffset case .bottom: - offsetBottom += min(_legend.neededHeight, _viewPortHandler.chartHeight * _legend.maxSizePercent) + _legend.yOffset + offsetBottom += min(legend.neededHeight, viewPortHandler.chartHeight * legend.maxSizePercent) + legend.yOffset default: break @@ -406,13 +403,13 @@ open class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChartD case .horizontal: - switch _legend.verticalAlignment + switch legend.verticalAlignment { case .top: - offsetTop += min(_legend.neededHeight, _viewPortHandler.chartHeight * _legend.maxSizePercent) + _legend.yOffset + offsetTop += min(legend.neededHeight, viewPortHandler.chartHeight * legend.maxSizePercent) + legend.yOffset case .bottom: - offsetBottom += min(_legend.neededHeight, _viewPortHandler.chartHeight * _legend.maxSizePercent) + _legend.yOffset + offsetBottom += min(legend.neededHeight, viewPortHandler.chartHeight * legend.maxSizePercent) + legend.yOffset default: break @@ -471,7 +468,7 @@ open class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChartD offsetBottom += self.extraBottomOffset offsetLeft += self.extraLeftOffset - _viewPortHandler.restrainViewPort( + viewPortHandler.restrainViewPort( offsetLeft: max(self.minOffset, offsetLeft), offsetTop: max(self.minOffset, offsetTop), offsetRight: max(self.minOffset, offsetRight), @@ -494,14 +491,14 @@ open class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChartD { // draw the grid background context.setFillColor(gridBackgroundColor.cgColor) - context.fill(_viewPortHandler.contentRect) + context.fill(viewPortHandler.contentRect) } if drawBordersEnabled { context.setLineWidth(borderLineWidth) context.setStrokeColor(borderColor.cgColor) - context.stroke(_viewPortHandler.contentRect) + context.stroke(viewPortHandler.contentRect) } if drawGridBackgroundEnabled || drawBordersEnabled @@ -522,7 +519,7 @@ open class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChartD private var _isDragging = false private var _isScaling = false private var _gestureScaleAxis = GestureScaleAxis.both - private var _closestDataSetToTouch: IChartDataSet! + private var _closestDataSetToTouch: ChartDataSetProtocol! private var _panGestureReachedEdge: Bool = false private weak var _outerScrollView: NSUIScrollView? @@ -534,7 +531,7 @@ open class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChartD @objc private func tapGestureRecognized(_ recognizer: NSUITapGestureRecognizer) { - if _data === nil + if data === nil { return } @@ -560,31 +557,28 @@ open class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChartD @objc private func doubleTapGestureRecognized(_ recognizer: NSUITapGestureRecognizer) { - if _data === nil + if data === nil { return } if recognizer.state == NSUIGestureRecognizerState.ended { - if _data !== nil && _doubleTapToZoomEnabled && (data?.entryCount ?? 0) > 0 + if data !== nil && _doubleTapToZoomEnabled && (data?.entryCount ?? 0) > 0 { var location = recognizer.location(in: self) - location.x = location.x - _viewPortHandler.offsetLeft + location.x = location.x - viewPortHandler.offsetLeft if isTouchInverted() { - location.y = -(location.y - _viewPortHandler.offsetTop) + location.y = -(location.y - viewPortHandler.offsetTop) } else { - location.y = -(self.bounds.size.height - location.y - _viewPortHandler.offsetBottom) + location.y = -(self.bounds.size.height - location.y - viewPortHandler.offsetBottom) } - - let scaleX: CGFloat = isScaleXEnabled ? 1.4 : 1.0 - let scaleY: CGFloat = isScaleYEnabled ? 1.4 : 1.0 - - self.zoom(scaleX: scaleX, scaleY: scaleY, x: location.x, y: location.y) + + self.zoom(scaleX: isScaleXEnabled ? 1.4 : 1.0, scaleY: isScaleYEnabled ? 1.4 : 1.0, x: location.x, y: location.y) delegate?.chartScaled?(self, scaleX: scaleX, scaleY: scaleY) } } @@ -597,7 +591,7 @@ open class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChartD { stopDeceleration() - if _data !== nil && + if data !== nil && (_pinchZoomEnabled || _scaleXEnabled || _scaleYEnabled) { _isScaling = true @@ -637,8 +631,8 @@ open class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChartD else if recognizer.state == NSUIGestureRecognizerState.changed { let isZoomingOut = (recognizer.nsuiScale < 1) - var canZoomMoreX = isZoomingOut ? _viewPortHandler.canZoomOutMoreX : _viewPortHandler.canZoomInMoreX - var canZoomMoreY = isZoomingOut ? _viewPortHandler.canZoomOutMoreY : _viewPortHandler.canZoomInMoreY + var canZoomMoreX = isZoomingOut ? viewPortHandler.canZoomOutMoreX : viewPortHandler.canZoomInMoreX + var canZoomMoreY = isZoomingOut ? viewPortHandler.canZoomOutMoreY : viewPortHandler.canZoomInMoreY if _isScaling { @@ -647,15 +641,15 @@ open class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChartD if canZoomMoreX || canZoomMoreY { var location = recognizer.location(in: self) - location.x = location.x - _viewPortHandler.offsetLeft + location.x = location.x - viewPortHandler.offsetLeft if isTouchInverted() { - location.y = -(location.y - _viewPortHandler.offsetTop) + location.y = -(location.y - viewPortHandler.offsetTop) } else { - location.y = -(_viewPortHandler.chartHeight - location.y - _viewPortHandler.offsetBottom) + location.y = -(viewPortHandler.chartHeight - location.y - viewPortHandler.offsetBottom) } let scaleX = canZoomMoreX ? recognizer.nsuiScale : 1.0 @@ -665,10 +659,10 @@ open class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChartD matrix = matrix.scaledBy(x: scaleX, y: scaleY) matrix = matrix.translatedBy(x: -location.x, y: -location.y) - matrix = _viewPortHandler.touchMatrix.concatenating(matrix) - - _viewPortHandler.refresh(newMatrix: matrix, chart: self, invalidate: true) + matrix = viewPortHandler.touchMatrix.concatenating(matrix) + viewPortHandler.refresh(newMatrix: matrix, chart: self, invalidate: true) + if delegate !== nil { delegate?.chartScaled?(self, scaleX: scaleX, scaleY: scaleY) @@ -687,7 +681,7 @@ open class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChartD { stopDeceleration() - if _data === nil || !self.isDragEnabled + if data === nil || !self.isDragEnabled { // If we have no data, we have nothing to pan and no data to highlight return } @@ -818,12 +812,12 @@ open class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChartD } } - let originalMatrix = _viewPortHandler.touchMatrix + let originalMatrix = viewPortHandler.touchMatrix var matrix = CGAffineTransform(translationX: translation.x, y: translation.y) matrix = originalMatrix.concatenating(matrix) - matrix = _viewPortHandler.refresh(newMatrix: matrix, chart: self, invalidate: true) + matrix = viewPortHandler.refresh(newMatrix: matrix, chart: self, invalidate: true) if matrix != originalMatrix { @@ -888,7 +882,7 @@ open class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChartD if gestureRecognizer == _panGestureRecognizer { let velocity = _panGestureRecognizer.velocity(in: self) - if _data === nil || !isDragEnabled || + if data === nil || !isDragEnabled || (self.hasNoDragOffset && self.isFullyZoomedOut && !self.isHighlightPerDragEnabled) || (!_dragYEnabled && abs(velocity.y) > abs(velocity.x)) || (!_dragXEnabled && abs(velocity.y) < abs(velocity.x)) @@ -899,13 +893,13 @@ open class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChartD else { #if !os(tvOS) - if gestureRecognizer == _pinchGestureRecognizer - { - if _data === nil || (!_pinchZoomEnabled && !_scaleXEnabled && !_scaleYEnabled) + if gestureRecognizer == _pinchGestureRecognizer { - return false + if data === nil || (!_pinchZoomEnabled && !_scaleXEnabled && !_scaleYEnabled) + { + return false + } } - } #endif } @@ -913,7 +907,7 @@ open class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChartD } #if !os(OSX) - open override func gestureRecognizerShouldBegin(_ gestureRecognizer: UIGestureRecognizer) -> Bool + open override func gestureRecognizerShouldBegin(_ gestureRecognizer: NSUIGestureRecognizer) -> Bool { if !super.gestureRecognizerShouldBegin(gestureRecognizer) { @@ -925,7 +919,7 @@ open class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChartD #endif #if os(OSX) - public func gestureRecognizerShouldBegin(gestureRecognizer: NSGestureRecognizer) -> Bool + public func gestureRecognizerShouldBegin(gestureRecognizer: NSUIGestureRecognizer) -> Bool { return nsuiGestureRecognizerShouldBegin(gestureRecognizer) } @@ -934,11 +928,11 @@ open class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChartD open func gestureRecognizer(_ gestureRecognizer: NSUIGestureRecognizer, shouldRecognizeSimultaneouslyWith otherGestureRecognizer: NSUIGestureRecognizer) -> Bool { #if !os(tvOS) - if ((gestureRecognizer is NSUIPinchGestureRecognizer && otherGestureRecognizer is NSUIPanGestureRecognizer) || - (gestureRecognizer is NSUIPanGestureRecognizer && otherGestureRecognizer is NSUIPinchGestureRecognizer)) - { - return true - } + if ((gestureRecognizer is NSUIPinchGestureRecognizer && otherGestureRecognizer is NSUIPanGestureRecognizer) || + (gestureRecognizer is NSUIPanGestureRecognizer && otherGestureRecognizer is NSUIPinchGestureRecognizer)) + { + return true + } #endif if gestureRecognizer is NSUIPanGestureRecognizer, @@ -986,10 +980,10 @@ open class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChartD /// Zooms in by 1.4, into the charts center. @objc open func zoomIn() { - let center = _viewPortHandler.contentCenter + let center = viewPortHandler.contentCenter - let matrix = _viewPortHandler.zoomIn(x: center.x, y: -center.y) - _viewPortHandler.refresh(newMatrix: matrix, chart: self, invalidate: false) + let matrix = viewPortHandler.zoomIn(x: center.x, y: -center.y) + viewPortHandler.refresh(newMatrix: matrix, chart: self, invalidate: false) // Range might have changed, which means that Y-axis labels could have changed in size, affecting Y-axis size. So we need to recalculate offsets. calculateOffsets() @@ -999,10 +993,10 @@ open class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChartD /// Zooms out by 0.7, from the charts center. @objc open func zoomOut() { - let center = _viewPortHandler.contentCenter + let center = viewPortHandler.contentCenter - let matrix = _viewPortHandler.zoomOut(x: center.x, y: -center.y) - _viewPortHandler.refresh(newMatrix: matrix, chart: self, invalidate: false) + let matrix = viewPortHandler.zoomOut(x: center.x, y: -center.y) + viewPortHandler.refresh(newMatrix: matrix, chart: self, invalidate: false) // Range might have changed, which means that Y-axis labels could have changed in size, affecting Y-axis size. So we need to recalculate offsets. calculateOffsets() @@ -1012,9 +1006,9 @@ open class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChartD /// Zooms out to original size. @objc open func resetZoom() { - let matrix = _viewPortHandler.resetZoom() - _viewPortHandler.refresh(newMatrix: matrix, chart: self, invalidate: false) - + let matrix = viewPortHandler.resetZoom() + viewPortHandler.refresh(newMatrix: matrix, chart: self, invalidate: false) + // Range might have changed, which means that Y-axis labels could have changed in size, affecting Y-axis size. So we need to recalculate offsets. calculateOffsets() setNeedsDisplay() @@ -1034,9 +1028,9 @@ open class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChartD x: CGFloat, y: CGFloat) { - let matrix = _viewPortHandler.zoom(scaleX: scaleX, scaleY: scaleY, x: x, y: -y) - _viewPortHandler.refresh(newMatrix: matrix, chart: self, invalidate: false) - + let matrix = viewPortHandler.zoom(scaleX: scaleX, scaleY: scaleY, x: x, y: -y) + viewPortHandler.refresh(newMatrix: matrix, chart: self, invalidate: false) + // Range might have changed, which means that Y-axis labels could have changed in size, affecting Y-axis size. So we need to recalculate offsets. calculateOffsets() setNeedsDisplay() @@ -1119,7 +1113,7 @@ open class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChartD transformer: getTransformer(forAxis: axis), view: self, yAxis: getAxis(axis), - xAxisRange: _xAxis.axisRange, + xAxisRange: xAxis.axisRange, scaleX: scaleX, scaleY: scaleY, xOrigin: viewPortHandler.scaleX, @@ -1180,8 +1174,8 @@ open class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChartD /// Resets all zooming and dragging and makes the chart fit exactly it's bounds. @objc open func fitScreen() { - let matrix = _viewPortHandler.fitScreen() - _viewPortHandler.refresh(newMatrix: matrix, chart: self, invalidate: false) + let matrix = viewPortHandler.fitScreen() + viewPortHandler.refresh(newMatrix: matrix, chart: self, invalidate: false) calculateOffsets() setNeedsDisplay() @@ -1190,8 +1184,8 @@ open class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChartD /// Sets the minimum scale value to which can be zoomed out. 1 = fitScreen @objc open func setScaleMinima(_ scaleX: CGFloat, scaleY: CGFloat) { - _viewPortHandler.setMinimumScaleX(scaleX) - _viewPortHandler.setMinimumScaleY(scaleY) + viewPortHandler.setMinimumScaleX(scaleX) + viewPortHandler.setMinimumScaleY(scaleY) } @objc open var visibleXRange: Double @@ -1206,8 +1200,8 @@ open class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChartD /// If you call this method, chart must have data or it has no effect. @objc open func setVisibleXRangeMaximum(_ maxXRange: Double) { - let xScale = _xAxis.axisRange / maxXRange - _viewPortHandler.setMinimumScaleX(CGFloat(xScale)) + let xScale = xAxis.axisRange / maxXRange + viewPortHandler.setMinimumScaleX(CGFloat(xScale)) } /// Sets the size of the area (range on the x-axis) that should be minimum visible at once (no further zooming in allowed). @@ -1217,8 +1211,8 @@ open class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChartD /// If you call this method, chart must have data or it has no effect. @objc open func setVisibleXRangeMinimum(_ minXRange: Double) { - let xScale = _xAxis.axisRange / minXRange - _viewPortHandler.setMaximumScaleX(CGFloat(xScale)) + let xScale = xAxis.axisRange / minXRange + viewPortHandler.setMaximumScaleX(CGFloat(xScale)) } /// Limits the maximum and minimum value count that can be visible by pinching and zooming. @@ -1229,9 +1223,9 @@ open class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChartD /// If you call this method, chart must have data or it has no effect. @objc open func setVisibleXRange(minXRange: Double, maxXRange: Double) { - let minScale = _xAxis.axisRange / maxXRange - let maxScale = _xAxis.axisRange / minXRange - _viewPortHandler.setMinMaxScaleX( + let minScale = xAxis.axisRange / maxXRange + let maxScale = xAxis.axisRange / minXRange + viewPortHandler.setMinMaxScaleX( minScaleX: CGFloat(minScale), maxScaleX: CGFloat(maxScale)) } @@ -1244,7 +1238,7 @@ open class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChartD @objc open func setVisibleYRangeMaximum(_ maxYRange: Double, axis: YAxis.AxisDependency) { let yScale = getAxisRange(axis: axis) / maxYRange - _viewPortHandler.setMinimumScaleY(CGFloat(yScale)) + viewPortHandler.setMinimumScaleY(CGFloat(yScale)) } /// Sets the size of the area (range on the y-axis) that should be minimum visible at once, no further zooming in possible. @@ -1255,7 +1249,7 @@ open class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChartD @objc open func setVisibleYRangeMinimum(_ minYRange: Double, axis: YAxis.AxisDependency) { let yScale = getAxisRange(axis: axis) / minYRange - _viewPortHandler.setMaximumScaleY(CGFloat(yScale)) + viewPortHandler.setMaximumScaleY(CGFloat(yScale)) } /// Limits the maximum and minimum y range that can be visible by pinching and zooming. @@ -1268,7 +1262,7 @@ open class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChartD { let minScale = getAxisRange(axis: axis) / minYRange let maxScale = getAxisRange(axis: axis) / maxYRange - _viewPortHandler.setMinMaxScaleY(minScaleY: CGFloat(minScale), maxScaleY: CGFloat(maxScale)) + viewPortHandler.setMinMaxScaleY(minScaleY: CGFloat(minScale), maxScaleY: CGFloat(maxScale)) } /// Moves the left side of the current viewport to the specified x-value. @@ -1293,7 +1287,7 @@ open class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChartD /// - axis: - which axis should be used as a reference for the y-axis @objc open func moveViewToY(_ yValue: Double, axis: YAxis.AxisDependency) { - let yInView = getAxisRange(axis: axis) / Double(_viewPortHandler.scaleY) + let yInView = getAxisRange(axis: axis) / Double(viewPortHandler.scaleY) let job = MoveViewJob( viewPortHandler: viewPortHandler, @@ -1314,7 +1308,7 @@ open class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChartD /// - axis: - which axis should be used as a reference for the y-axis @objc open func moveViewTo(xValue: Double, yValue: Double, axis: YAxis.AxisDependency) { - let yInView = getAxisRange(axis: axis) / Double(_viewPortHandler.scaleY) + let yInView = getAxisRange(axis: axis) / Double(viewPortHandler.scaleY) let job = MoveViewJob( viewPortHandler: viewPortHandler, @@ -1346,7 +1340,7 @@ open class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChartD point: CGPoint(x: viewPortHandler.contentLeft, y: viewPortHandler.contentTop), axis: axis) - let yInView = getAxisRange(axis: axis) / Double(_viewPortHandler.scaleY) + let yInView = getAxisRange(axis: axis) / Double(viewPortHandler.scaleY) let job = AnimatedMoveViewJob( viewPortHandler: viewPortHandler, @@ -1411,8 +1405,8 @@ open class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChartD yValue: Double, axis: YAxis.AxisDependency) { - let yInView = getAxisRange(axis: axis) / Double(_viewPortHandler.scaleY) - let xInView = xAxis.axisRange / Double(_viewPortHandler.scaleX) + let yInView = getAxisRange(axis: axis) / Double(viewPortHandler.scaleY) + let xInView = xAxis.axisRange / Double(viewPortHandler.scaleX) let job = MoveViewJob( viewPortHandler: viewPortHandler, @@ -1443,8 +1437,8 @@ open class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChartD point: CGPoint(x: viewPortHandler.contentLeft, y: viewPortHandler.contentTop), axis: axis) - let yInView = getAxisRange(axis: axis) / Double(_viewPortHandler.scaleY) - let xInView = xAxis.axisRange / Double(_viewPortHandler.scaleX) + let yInView = getAxisRange(axis: axis) / Double(viewPortHandler.scaleY) + let xInView = xAxis.axisRange / Double(viewPortHandler.scaleX) let job = AnimatedMoveViewJob( viewPortHandler: viewPortHandler, @@ -1503,7 +1497,7 @@ open class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChartD if Thread.isMainThread { - self._viewPortHandler.restrainViewPort(offsetLeft: left, offsetTop: top, offsetRight: right, offsetBottom: bottom) + self.viewPortHandler.restrainViewPort(offsetLeft: left, offsetTop: top, offsetRight: right, offsetBottom: bottom) prepareOffsetMatrix() prepareValuePxMatrix() } @@ -1601,7 +1595,7 @@ open class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChartD _scaleXEnabled = enabled _scaleYEnabled = enabled #if !os(tvOS) - _pinchGestureRecognizer.isEnabled = _pinchZoomEnabled || _scaleXEnabled || _scaleYEnabled + _pinchGestureRecognizer.isEnabled = _pinchZoomEnabled || _scaleXEnabled || _scaleYEnabled #endif } } @@ -1618,7 +1612,7 @@ open class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChartD { _scaleXEnabled = newValue #if !os(tvOS) - _pinchGestureRecognizer.isEnabled = _pinchZoomEnabled || _scaleXEnabled || _scaleYEnabled + _pinchGestureRecognizer.isEnabled = _pinchZoomEnabled || _scaleXEnabled || _scaleYEnabled #endif } } @@ -1636,7 +1630,7 @@ open class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChartD { _scaleYEnabled = newValue #if !os(tvOS) - _pinchGestureRecognizer.isEnabled = _pinchZoomEnabled || _scaleXEnabled || _scaleYEnabled + _pinchGestureRecognizer.isEnabled = _pinchZoomEnabled || _scaleXEnabled || _scaleYEnabled #endif } } @@ -1716,44 +1710,35 @@ open class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChartD { if let h = getHighlightByTouchPoint(pt) { - return _data!.entryForHighlight(h) + return data!.entry(for: h) } return nil } /// - Returns: The DataSet object displayed at the touched position of the chart - @objc open func getDataSetByTouchPoint(point pt: CGPoint) -> IBarLineScatterCandleBubbleChartDataSet? + @objc open func getDataSetByTouchPoint(point pt: CGPoint) -> BarLineScatterCandleBubbleChartDataSetProtocol? { - let h = getHighlightByTouchPoint(pt) - if h !== nil - { - return _data?.getDataSetByIndex(h!.dataSetIndex) as? IBarLineScatterCandleBubbleChartDataSet + guard let h = getHighlightByTouchPoint(pt) else { + return nil } - return nil + + return data?[h.dataSetIndex] as? BarLineScatterCandleBubbleChartDataSetProtocol } /// The current x-scale factor @objc open var scaleX: CGFloat { - if _viewPortHandler === nil - { - return 1.0 - } - return _viewPortHandler.scaleX + return viewPortHandler.scaleX } /// The current y-scale factor @objc open var scaleY: CGFloat { - if _viewPortHandler === nil - { - return 1.0 - } - return _viewPortHandler.scaleY + return viewPortHandler.scaleY } /// if the chart is fully zoomed out, return true - @objc open var isFullyZoomedOut: Bool { return _viewPortHandler.isFullyZoomedOut } + @objc open var isFullyZoomedOut: Bool { return viewPortHandler.isFullyZoomedOut } /// - Returns: The y-axis object to the corresponding AxisDependency. In the /// horizontal bar-chart, LEFT == top, RIGHT == BOTTOM @@ -1782,7 +1767,7 @@ open class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChartD { _pinchZoomEnabled = newValue #if !os(tvOS) - _pinchGestureRecognizer.isEnabled = _pinchZoomEnabled || _scaleXEnabled || _scaleYEnabled + _pinchGestureRecognizer.isEnabled = _pinchZoomEnabled || _scaleXEnabled || _scaleYEnabled #endif } } @@ -1796,18 +1781,18 @@ open class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChartD /// bounds on the x-axis. @objc open func setDragOffsetX(_ offset: CGFloat) { - _viewPortHandler.setDragOffsetX(offset) + viewPortHandler.setDragOffsetX(offset) } /// Set an offset in dp that allows the user to drag the chart over it's /// bounds on the y-axis. @objc open func setDragOffsetY(_ offset: CGFloat) { - _viewPortHandler.setDragOffsetY(offset) + viewPortHandler.setDragOffsetY(offset) } /// `true` if both drag offsets (x and y) are zero or smaller. - @objc open var hasNoDragOffset: Bool { return _viewPortHandler.hasNoDragOffset } + @objc open var hasNoDragOffset: Bool { return viewPortHandler.hasNoDragOffset } open override var chartYMax: Double { diff --git a/Source/Charts/Charts/BubbleChartView.swift b/Source/Charts/Charts/BubbleChartView.swift index 1b13677564..14e8b462aa 100644 --- a/Source/Charts/Charts/BubbleChartView.swift +++ b/Source/Charts/Charts/BubbleChartView.swift @@ -18,10 +18,10 @@ open class BubbleChartView: BarLineChartViewBase, BubbleChartDataProvider { super.initialize() - renderer = BubbleChartRenderer(dataProvider: self, animator: _animator, viewPortHandler: _viewPortHandler) + renderer = BubbleChartRenderer(dataProvider: self, animator: chartAnimator, viewPortHandler: viewPortHandler) } // MARK: - BubbleChartDataProvider - open var bubbleData: BubbleChartData? { return _data as? BubbleChartData } + open var bubbleData: BubbleChartData? { return data as? BubbleChartData } } diff --git a/Source/Charts/Charts/CandleStickChartView.swift b/Source/Charts/Charts/CandleStickChartView.swift index 0366e8b873..33c2174ae5 100644 --- a/Source/Charts/Charts/CandleStickChartView.swift +++ b/Source/Charts/Charts/CandleStickChartView.swift @@ -19,7 +19,7 @@ open class CandleStickChartView: BarLineChartViewBase, CandleChartDataProvider { super.initialize() - renderer = CandleStickChartRenderer(dataProvider: self, animator: _animator, viewPortHandler: _viewPortHandler) + renderer = CandleStickChartRenderer(dataProvider: self, animator: chartAnimator, viewPortHandler: viewPortHandler) self.xAxis.spaceMin = 0.5 self.xAxis.spaceMax = 0.5 @@ -29,6 +29,6 @@ open class CandleStickChartView: BarLineChartViewBase, CandleChartDataProvider open var candleData: CandleChartData? { - return _data as? CandleChartData + return data as? CandleChartData } } diff --git a/Source/Charts/Charts/ChartViewBase.swift b/Source/Charts/Charts/ChartViewBase.swift index 0fccebc4d2..2810facf5b 100644 --- a/Source/Charts/Charts/ChartViewBase.swift +++ b/Source/Charts/Charts/ChartViewBase.swift @@ -13,14 +13,10 @@ import Foundation import CoreGraphics -#if canImport(UIKit) +#if !os(OSX) import UIKit #endif -#if canImport(Cocoa) -import Cocoa -#endif - @objc public protocol ChartViewDelegate { @@ -51,43 +47,43 @@ open class ChartViewBase: NSUIView, ChartDataProvider, AnimatorDelegate { // MARK: - Properties - /// - Returns: The object representing all x-labels, this method can be used to - /// acquire the XAxis object and modify it (e.g. change the position of the - /// labels) - @objc open var xAxis: XAxis - { - return _xAxis - } - /// The default IValueFormatter that has been determined by the chart considering the provided minimum and maximum values. - internal var _defaultValueFormatter: IValueFormatter? = DefaultValueFormatter(decimals: 0) - + internal lazy var defaultValueFormatter: ValueFormatter = DefaultValueFormatter(decimals: 0) + /// object that holds all data that was originally set for the chart, before it was modified or any filtering algorithms had been applied - internal var _data: ChartData? - - /// Flag that indicates if highlighting per tap (touch) is enabled - private var _highlightPerTapEnabled = true - + @objc open var data: ChartData? + { + didSet + { + offsetsCalculated = false + + guard let data = data else { return } + + // calculate how many digits are needed + setupDefaultFormatter(min: data.yMin, max: data.yMax) + + for set in data where set.valueFormatter is DefaultValueFormatter + { + set.valueFormatter = defaultValueFormatter + } + + // let the chart know there is new data + notifyDataSetChanged() + } + } + /// If set to true, chart continues to scroll after touch up @objc open var dragDecelerationEnabled = true - - /// Deceleration friction coefficient in [0 ; 1] interval, higher values indicate that speed will decrease slowly, for example if it set to 0, it will stop immediately. - /// 1 is an invalid value, and will be converted to 0.999 automatically. - private var _dragDecelerationFrictionCoef: CGFloat = 0.9 - - /// if true, units are drawn next to the values in the chart - internal var _drawUnitInChart = false - + /// The object representing the labels on the x-axis - internal var _xAxis: XAxis! + @objc open internal(set) lazy var xAxis = XAxis() /// The `Description` object of the chart. - /// This should have been called just "description", but - @objc open var chartDescription: Description? - + @objc open lazy var chartDescription = Description() + /// The legend object containing all data associated with the legend - internal var _legend: Legend! - + @objc open internal(set) lazy var legend = Legend() + /// delegate to receive chart events @objc open weak var delegate: ChartViewDelegate? @@ -101,26 +97,32 @@ open class ChartViewBase: NSUIView, ChartDataProvider, AnimatorDelegate @objc open var noDataTextColor: NSUIColor = .labelOrBlack /// alignment of the no data text - @objc open var noDataTextAlignment: NSTextAlignment = .left + @objc open var noDataTextAlignment: TextAlignment = .left + + /// The renderer object responsible for rendering / drawing the Legend. + @objc open lazy var legendRenderer = LegendRenderer(viewPortHandler: viewPortHandler, legend: legend) - internal var _legendRenderer: LegendRenderer! - /// object responsible for rendering the data @objc open var renderer: DataRenderer? - @objc open var highlighter: IHighlighter? - - /// object that manages the bounds and drawing constraints of the chart - internal var _viewPortHandler: ViewPortHandler! - - /// object responsible for animations - internal var _animator: Animator! - + @objc open var highlighter: Highlighter? + + /// The ViewPortHandler of the chart that is responsible for the + /// content area of the chart and its offsets and dimensions. + @objc open internal(set) lazy var viewPortHandler = ViewPortHandler(width: bounds.size.width, height: bounds.size.height) + + /// The animator responsible for animating chart values. + @objc open internal(set) lazy var chartAnimator: Animator = { + let animator = Animator() + animator.delegate = self + return animator + }() + /// flag that indicates if offsets calculation has already been done or not - private var _offsetsCalculated = false - - /// array of Highlight objects that reference the highlighted slices in the chart - internal var _indicesToHighlight = [Highlight]() + private var offsetsCalculated = false + + /// The array of currently highlighted values. This might an empty if nothing is highlighted. + @objc open internal(set) var highlighted = [Highlight]() /// `true` if drawing the marker is enabled when tapping on values /// (use the `marker` property to specify a marker) @@ -131,10 +133,8 @@ open class ChartViewBase: NSUIView, ChartDataProvider, AnimatorDelegate @objc open var isDrawMarkersEnabled: Bool { return drawMarkers } /// The marker that is displayed when a value is clicked on the chart - @objc open var marker: IMarker? - - private var _interceptTouchEvents = false - + @objc open var marker: Marker? + /// An extra offset to be appended to the viewport's top @objc open var extraTopOffset: CGFloat = 0.0 @@ -146,7 +146,7 @@ open class ChartViewBase: NSUIView, ChartDataProvider, AnimatorDelegate /// An extra offset to be appended to the viewport's left @objc open var extraLeftOffset: CGFloat = 0.0 - + @objc open func setExtraOffsets(left: CGFloat, top: CGFloat, right: CGFloat, bottom: CGFloat) { extraLeftOffset = left @@ -171,74 +171,28 @@ open class ChartViewBase: NSUIView, ChartDataProvider, AnimatorDelegate deinit { - self.removeObserver(self, forKeyPath: "bounds") - self.removeObserver(self, forKeyPath: "frame") + removeObserver(self, forKeyPath: "bounds") + removeObserver(self, forKeyPath: "frame") } internal func initialize() { #if os(iOS) - self.backgroundColor = NSUIColor.clear + self.backgroundColor = .clear #endif - _animator = Animator() - _animator.delegate = self - - _viewPortHandler = ViewPortHandler(width: bounds.size.width, height: bounds.size.height) - - chartDescription = Description() - - _legend = Legend() - _legendRenderer = LegendRenderer(viewPortHandler: _viewPortHandler, legend: _legend) - - _xAxis = XAxis() - - self.addObserver(self, forKeyPath: "bounds", options: .new, context: nil) - self.addObserver(self, forKeyPath: "frame", options: .new, context: nil) + addObserver(self, forKeyPath: "bounds", options: .new, context: nil) + addObserver(self, forKeyPath: "frame", options: .new, context: nil) } // MARK: - ChartViewBase - /// The data for the chart - open var data: ChartData? - { - get - { - return _data - } - set - { - _data = newValue - _offsetsCalculated = false - - guard let _data = _data else - { - setNeedsDisplay() - return - } - - // calculate how many digits are needed - setupDefaultFormatter(min: _data.getYMin(), max: _data.getYMax()) - - for set in _data.dataSets - { - if set.needsFormatter || set.valueFormatter === _defaultValueFormatter - { - set.valueFormatter = _defaultValueFormatter - } - } - - // let the chart know there is new data - notifyDataSetChanged() - } - } - /// Clears the chart from all data (sets it to null) and refreshes it (by calling setNeedsDisplay()). @objc open func clear() { - _data = nil - _offsetsCalculated = false - _indicesToHighlight.removeAll() + data = nil + offsetsCalculated = false + highlighted.removeAll() lastHighlighted = nil setNeedsDisplay() @@ -247,23 +201,14 @@ open class ChartViewBase: NSUIView, ChartDataProvider, AnimatorDelegate /// Removes all DataSets (and thereby Entries) from the chart. Does not set the data object to nil. Also refreshes the chart by calling setNeedsDisplay(). @objc open func clearValues() { - _data?.clearValues() + data?.clearValues() setNeedsDisplay() } /// - Returns: `true` if the chart is empty (meaning it's data object is either null or contains no entries). @objc open func isEmpty() -> Bool { - guard let data = _data else { return true } - - if data.entryCount <= 0 - { - return true - } - else - { - return false - } + return data?.isEmpty ?? true } /// Lets the chart know its underlying data has changed and should perform all necessary recalculations. @@ -289,94 +234,83 @@ open class ChartViewBase: NSUIView, ChartDataProvider, AnimatorDelegate internal func setupDefaultFormatter(min: Double, max: Double) { // check if a custom formatter is set or not - var reference = Double(0.0) + var reference = 0.0 - if let data = _data , data.entryCount >= 2 + if let data = data , data.entryCount >= 2 { - reference = fabs(max - min) + reference = abs(max - min) } else { - let absMin = fabs(min) - let absMax = fabs(max) - reference = absMin > absMax ? absMin : absMax + reference = Swift.max(abs(min), abs(max)) } - if _defaultValueFormatter is DefaultValueFormatter + if let formatter = defaultValueFormatter as? DefaultValueFormatter { // setup the formatter with a new number of digits let digits = reference.decimalPlaces - - (_defaultValueFormatter as? DefaultValueFormatter)?.decimals - = digits + formatter.decimals = digits } } open override func draw(_ rect: CGRect) { - let optionalContext = NSUIGraphicsGetCurrentContext() - guard let context = optionalContext else { return } - - let frame = self.bounds + guard let context = NSUIGraphicsGetCurrentContext() else { return } - if _data === nil && noDataText.count > 0 + if data === nil && !noDataText.isEmpty { context.saveGState() defer { context.restoreGState() } - let paragraphStyle = NSMutableParagraphStyle.default.mutableCopy() as! NSMutableParagraphStyle + let paragraphStyle = MutableParagraphStyle.default.mutableCopy() as! MutableParagraphStyle paragraphStyle.minimumLineHeight = noDataFont.lineHeight paragraphStyle.lineBreakMode = .byWordWrapping paragraphStyle.alignment = noDataTextAlignment - ChartUtils.drawMultilineText( - context: context, - text: noDataText, - point: CGPoint(x: frame.width / 2.0, y: frame.height / 2.0), - attributes: - [.font: noDataFont, - .foregroundColor: noDataTextColor, - .paragraphStyle: paragraphStyle], - constrainedToSize: self.bounds.size, - anchor: CGPoint(x: 0.5, y: 0.5), - angleRadians: 0.0) - + context.drawMultilineText(noDataText, + at: CGPoint(x: bounds.width / 2.0, y: bounds.height / 2.0), + constrainedTo: bounds.size, + anchor: CGPoint(x: 0.5, y: 0.5), + angleRadians: 0.0, + attributes: [.font: noDataFont, + .foregroundColor: noDataTextColor, + .paragraphStyle: paragraphStyle]) + return } - if !_offsetsCalculated + if !offsetsCalculated { calculateOffsets() - _offsetsCalculated = true + offsetsCalculated = true } } /// Draws the description text in the bottom right corner of the chart (per default) - internal func drawDescription(context: CGContext) + internal func drawDescription(in context: CGContext) { + let description = chartDescription + // check if description should be drawn guard - let description = chartDescription, description.isEnabled, let descriptionText = description.text, - descriptionText.count > 0 + !descriptionText.isEmpty else { return } - let position = description.position ?? CGPoint(x: bounds.width - _viewPortHandler.offsetRight - description.xOffset, - y: bounds.height - _viewPortHandler.offsetBottom - description.yOffset - description.font.lineHeight) - - var attrs = [NSAttributedString.Key : Any]() - - attrs[NSAttributedString.Key.font] = description.font - attrs[NSAttributedString.Key.foregroundColor] = description.textColor + let position = description.position ?? CGPoint(x: bounds.width - viewPortHandler.offsetRight - description.xOffset, + y: bounds.height - viewPortHandler.offsetBottom - description.yOffset - description.font.lineHeight) + + let attrs: [NSAttributedString.Key : Any] = [ + .font: description.font, + .foregroundColor: description.textColor + ] - ChartUtils.drawText( - context: context, - text: descriptionText, - point: position, - align: description.textAlign, - attributes: attrs) + context.drawText(descriptionText, + at: position, + align: description.textAlign, + attributes: attrs) } // MARK: - Accessibility @@ -386,22 +320,12 @@ open class ChartViewBase: NSUIView, ChartDataProvider, AnimatorDelegate } // MARK: - Highlighting - - /// The array of currently highlighted values. This might an empty if nothing is highlighted. - @objc open var highlighted: [Highlight] - { - return _indicesToHighlight - } - + /// Set this to false to prevent values from being highlighted by tap gesture. /// Values can still be highlighted via drag or programmatically. /// **default**: true - @objc open var highlightPerTapEnabled: Bool - { - get { return _highlightPerTapEnabled } - set { _highlightPerTapEnabled = newValue } - } - + @objc open var highlightPerTapEnabled: Bool = true + /// `true` if values can be highlighted via tap gesture, `false` ifnot. @objc open var isHighLightPerTapEnabled: Bool { @@ -413,7 +337,7 @@ open class ChartViewBase: NSUIView, ChartDataProvider, AnimatorDelegate /// - Returns: `true` if there are values to highlight, `false` ifthere are no values to highlight. @objc open func valuesToHighlight() -> Bool { - return !_indicesToHighlight.isEmpty + return !highlighted.isEmpty } /// Highlights the values at the given indices in the given DataSets. Provide @@ -423,16 +347,9 @@ open class ChartViewBase: NSUIView, ChartDataProvider, AnimatorDelegate @objc open func highlightValues(_ highs: [Highlight]?) { // set the indices to highlight - _indicesToHighlight = highs ?? [Highlight]() - - if _indicesToHighlight.isEmpty - { - self.lastHighlighted = nil - } - else - { - self.lastHighlighted = _indicesToHighlight[0] - } + highlighted = highs ?? [] + + lastHighlighted = highlighted.first // redraw the chart setNeedsDisplay() @@ -489,19 +406,19 @@ open class ChartViewBase: NSUIView, ChartDataProvider, AnimatorDelegate /// - callDelegate: Should the delegate be called for this change @objc open func highlightValue(x: Double, y: Double, dataSetIndex: Int, dataIndex: Int = -1, callDelegate: Bool) { - guard let data = _data else + guard let data = data else { Swift.print("Value not highlighted because data is nil") return } - - if dataSetIndex < 0 || dataSetIndex >= data.dataSetCount + + if data.indices.contains(dataSetIndex) { - highlightValue(nil, callDelegate: callDelegate) + highlightValue(Highlight(x: x, y: y, dataSetIndex: dataSetIndex, dataIndex: dataIndex), callDelegate: callDelegate) } else { - highlightValue(Highlight(x: x, y: y, dataSetIndex: dataSetIndex, dataIndex: dataIndex), callDelegate: callDelegate) + highlightValue(nil, callDelegate: callDelegate) } } @@ -518,42 +435,30 @@ open class ChartViewBase: NSUIView, ChartDataProvider, AnimatorDelegate /// Highlights the value selected by touch gesture. @objc open func highlightValue(_ highlight: Highlight?, callDelegate: Bool) { - var entry: ChartDataEntry? - var h = highlight - - if h == nil - { - self.lastHighlighted = nil - _indicesToHighlight.removeAll(keepingCapacity: false) - } - else - { - // set the indices to highlight - entry = _data?.entryForHighlight(h!) - if entry == nil - { - h = nil - _indicesToHighlight.removeAll(keepingCapacity: false) - } + var high = highlight + guard + let h = high, + let entry = data?.entry(for: h) else - { - _indicesToHighlight = [h!] - } + { + high = nil + highlighted.removeAll(keepingCapacity: false) + if callDelegate + { + delegate?.chartValueNothingSelected?(self) + } + return } - - if callDelegate, let delegate = delegate + + // set the indices to highlight + highlighted = [h] + + if callDelegate { - if let h = h - { - // notify the listener - delegate.chartValueSelected?(self, entry: entry!, highlight: h) - } - else - { - delegate.chartValueNothingSelected?(self) - } + // notify the listener + delegate?.chartValueSelected?(self, entry: entry, highlight: h) } - + // redraw the chart setNeedsDisplay() } @@ -563,7 +468,7 @@ open class ChartViewBase: NSUIView, ChartDataProvider, AnimatorDelegate /// CandleStick-Chart. @objc open func getHighlightByTouchPoint(_ pt: CGPoint) -> Highlight? { - if _data === nil + guard data != nil else { Swift.print("Can't select by touch. No data set.") return nil @@ -582,33 +487,25 @@ open class ChartViewBase: NSUIView, ChartDataProvider, AnimatorDelegate { // if there is no marker view or drawing marker is disabled guard - let marker = marker - , isDrawMarkersEnabled && - valuesToHighlight() + let marker = marker, + isDrawMarkersEnabled, + valuesToHighlight() else { return } - for i in 0 ..< _indicesToHighlight.count + for highlight in highlighted { - let highlight = _indicesToHighlight[i] - - guard let - set = data?.getDataSetByIndex(highlight.dataSetIndex), - let e = _data?.entryForHighlight(highlight) + guard + let set = data?[highlight.dataSetIndex], + let e = data?.entry(for: highlight) else { continue } let entryIndex = set.entryIndex(entry: e) - if entryIndex > Int(Double(set.entryCount) * _animator.phaseX) - { - continue - } + guard entryIndex <= Int(Double(set.entryCount) * chartAnimator.phaseX) else { continue } let pos = getMarkerPosition(highlight: highlight) // check bounds - if !_viewPortHandler.isInBounds(x: pos.x, y: pos.y) - { - continue - } + guard viewPortHandler.isInBounds(x: pos.x, y: pos.y) else { continue } // callbacks to update the content marker.refreshContent(entry: e, highlight: highlight) @@ -625,13 +522,7 @@ open class ChartViewBase: NSUIView, ChartDataProvider, AnimatorDelegate } // MARK: - Animation - - /// The animator responsible for animating chart values. - @objc open var chartAnimator: Animator! - { - return _animator - } - + /// Animates the drawing / rendering of the chart on both x- and y-axis with the specified animation time. /// If `animate(...)` is called, no further calling of `invalidate()` is necessary to refresh the chart. /// @@ -642,7 +533,7 @@ open class ChartViewBase: NSUIView, ChartDataProvider, AnimatorDelegate /// - easingY: an easing function for the animation on the y axis @objc open func animate(xAxisDuration: TimeInterval, yAxisDuration: TimeInterval, easingX: ChartEasingFunctionBlock?, easingY: ChartEasingFunctionBlock?) { - _animator.animate(xAxisDuration: xAxisDuration, yAxisDuration: yAxisDuration, easingX: easingX, easingY: easingY) + chartAnimator.animate(xAxisDuration: xAxisDuration, yAxisDuration: yAxisDuration, easingX: easingX, easingY: easingY) } /// Animates the drawing / rendering of the chart on both x- and y-axis with the specified animation time. @@ -655,7 +546,7 @@ open class ChartViewBase: NSUIView, ChartDataProvider, AnimatorDelegate /// - easingOptionY: the easing function for the animation on the y axis @objc open func animate(xAxisDuration: TimeInterval, yAxisDuration: TimeInterval, easingOptionX: ChartEasingOption, easingOptionY: ChartEasingOption) { - _animator.animate(xAxisDuration: xAxisDuration, yAxisDuration: yAxisDuration, easingOptionX: easingOptionX, easingOptionY: easingOptionY) + chartAnimator.animate(xAxisDuration: xAxisDuration, yAxisDuration: yAxisDuration, easingOptionX: easingOptionX, easingOptionY: easingOptionY) } /// Animates the drawing / rendering of the chart on both x- and y-axis with the specified animation time. @@ -667,7 +558,7 @@ open class ChartViewBase: NSUIView, ChartDataProvider, AnimatorDelegate /// - easing: an easing function for the animation @objc open func animate(xAxisDuration: TimeInterval, yAxisDuration: TimeInterval, easing: ChartEasingFunctionBlock?) { - _animator.animate(xAxisDuration: xAxisDuration, yAxisDuration: yAxisDuration, easing: easing) + chartAnimator.animate(xAxisDuration: xAxisDuration, yAxisDuration: yAxisDuration, easing: easing) } /// Animates the drawing / rendering of the chart on both x- and y-axis with the specified animation time. @@ -679,7 +570,7 @@ open class ChartViewBase: NSUIView, ChartDataProvider, AnimatorDelegate /// - easingOption: the easing function for the animation @objc open func animate(xAxisDuration: TimeInterval, yAxisDuration: TimeInterval, easingOption: ChartEasingOption) { - _animator.animate(xAxisDuration: xAxisDuration, yAxisDuration: yAxisDuration, easingOption: easingOption) + chartAnimator.animate(xAxisDuration: xAxisDuration, yAxisDuration: yAxisDuration, easingOption: easingOption) } /// Animates the drawing / rendering of the chart on both x- and y-axis with the specified animation time. @@ -690,7 +581,7 @@ open class ChartViewBase: NSUIView, ChartDataProvider, AnimatorDelegate /// - yAxisDuration: duration for animating the y axis @objc open func animate(xAxisDuration: TimeInterval, yAxisDuration: TimeInterval) { - _animator.animate(xAxisDuration: xAxisDuration, yAxisDuration: yAxisDuration) + chartAnimator.animate(xAxisDuration: xAxisDuration, yAxisDuration: yAxisDuration) } /// Animates the drawing / rendering of the chart the x-axis with the specified animation time. @@ -701,7 +592,7 @@ open class ChartViewBase: NSUIView, ChartDataProvider, AnimatorDelegate /// - easing: an easing function for the animation @objc open func animate(xAxisDuration: TimeInterval, easing: ChartEasingFunctionBlock?) { - _animator.animate(xAxisDuration: xAxisDuration, easing: easing) + chartAnimator.animate(xAxisDuration: xAxisDuration, easing: easing) } /// Animates the drawing / rendering of the chart the x-axis with the specified animation time. @@ -712,7 +603,7 @@ open class ChartViewBase: NSUIView, ChartDataProvider, AnimatorDelegate /// - easingOption: the easing function for the animation @objc open func animate(xAxisDuration: TimeInterval, easingOption: ChartEasingOption) { - _animator.animate(xAxisDuration: xAxisDuration, easingOption: easingOption) + chartAnimator.animate(xAxisDuration: xAxisDuration, easingOption: easingOption) } /// Animates the drawing / rendering of the chart the x-axis with the specified animation time. @@ -722,7 +613,7 @@ open class ChartViewBase: NSUIView, ChartDataProvider, AnimatorDelegate /// - xAxisDuration: duration for animating the x axis @objc open func animate(xAxisDuration: TimeInterval) { - _animator.animate(xAxisDuration: xAxisDuration) + chartAnimator.animate(xAxisDuration: xAxisDuration) } /// Animates the drawing / rendering of the chart the y-axis with the specified animation time. @@ -733,7 +624,7 @@ open class ChartViewBase: NSUIView, ChartDataProvider, AnimatorDelegate /// - easing: an easing function for the animation @objc open func animate(yAxisDuration: TimeInterval, easing: ChartEasingFunctionBlock?) { - _animator.animate(yAxisDuration: yAxisDuration, easing: easing) + chartAnimator.animate(yAxisDuration: yAxisDuration, easing: easing) } /// Animates the drawing / rendering of the chart the y-axis with the specified animation time. @@ -744,7 +635,7 @@ open class ChartViewBase: NSUIView, ChartDataProvider, AnimatorDelegate /// - easingOption: the easing function for the animation @objc open func animate(yAxisDuration: TimeInterval, easingOption: ChartEasingOption) { - _animator.animate(yAxisDuration: yAxisDuration, easingOption: easingOption) + chartAnimator.animate(yAxisDuration: yAxisDuration, easingOption: easingOption) } /// Animates the drawing / rendering of the chart the y-axis with the specified animation time. @@ -754,7 +645,7 @@ open class ChartViewBase: NSUIView, ChartDataProvider, AnimatorDelegate /// - yAxisDuration: duration for animating the y axis @objc open func animate(yAxisDuration: TimeInterval) { - _animator.animate(yAxisDuration: yAxisDuration) + chartAnimator.animate(yAxisDuration: yAxisDuration) } // MARK: - Accessors @@ -762,78 +653,58 @@ open class ChartViewBase: NSUIView, ChartDataProvider, AnimatorDelegate /// The current y-max value across all DataSets open var chartYMax: Double { - return _data?.yMax ?? 0.0 + return data?.yMax ?? 0.0 } /// The current y-min value across all DataSets open var chartYMin: Double { - return _data?.yMin ?? 0.0 + return data?.yMin ?? 0.0 } open var chartXMax: Double { - return _xAxis._axisMaximum + return xAxis._axisMaximum } open var chartXMin: Double { - return _xAxis._axisMinimum + return xAxis._axisMinimum } open var xRange: Double { - return _xAxis.axisRange + return xAxis.axisRange } /// - Note: (Equivalent of getCenter() in MPAndroidChart, as center is already a standard in iOS that returns the center point relative to superview, and MPAndroidChart returns relative to self)* /// The center point of the chart (the whole View) in pixels. @objc open var midPoint: CGPoint { - let bounds = self.bounds return CGPoint(x: bounds.origin.x + bounds.size.width / 2.0, y: bounds.origin.y + bounds.size.height / 2.0) } /// The center of the chart taking offsets under consideration. (returns the center of the content rectangle) open var centerOffsets: CGPoint { - return _viewPortHandler.contentCenter - } - - /// The Legend object of the chart. This method can be used to get an instance of the legend in order to customize the automatically generated Legend. - @objc open var legend: Legend - { - return _legend - } - - /// The renderer object responsible for rendering / drawing the Legend. - @objc open var legendRenderer: LegendRenderer! - { - return _legendRenderer + return viewPortHandler.contentCenter } - + /// The rectangle that defines the borders of the chart-value surface (into which the actual values are drawn). @objc open var contentRect: CGRect { - return _viewPortHandler.contentRect - } - - /// - Returns: The ViewPortHandler of the chart that is responsible for the - /// content area of the chart and its offsets and dimensions. - @objc open var viewPortHandler: ViewPortHandler! - { - return _viewPortHandler + return viewPortHandler.contentRect } - + /// - Returns: The bitmap that represents the chart. @objc open func getChartImage(transparent: Bool) -> NSUIImage? { - NSUIGraphicsBeginImageContextWithOptions(bounds.size, isOpaque || !transparent, NSUIScreen.nsuiMain?.nsuiScale ?? 1.0) + NSUIGraphicsBeginImageContextWithOptions(bounds.size, isOpaque || !transparent, NSUIMainScreen()?.nsuiScale ?? 1.0) guard let context = NSUIGraphicsGetCurrentContext() else { return nil } - let rect = CGRect(origin: CGPoint(x: 0, y: 0), size: bounds.size) + let rect = CGRect(origin: .zero, size: bounds.size) if isOpaque || !transparent { @@ -906,11 +777,10 @@ open class ChartViewBase: NSUIView, ChartDataProvider, AnimatorDelegate { let bounds = self.bounds - if (_viewPortHandler !== nil && - (bounds.size.width != _viewPortHandler.chartWidth || - bounds.size.height != _viewPortHandler.chartHeight)) + if ((bounds.size.width != viewPortHandler.chartWidth || + bounds.size.height != viewPortHandler.chartHeight)) { - _viewPortHandler.setChartDimens(width: bounds.size.width, height: bounds.size.height) + viewPortHandler.setChartDimens(width: bounds.size.width, height: bounds.size.height) // This may cause the chart view to mutate properties affecting the view port -- lets do this // before we try to run any pending jobs on the view port itself @@ -941,7 +811,7 @@ open class ChartViewBase: NSUIView, ChartDataProvider, AnimatorDelegate @objc open func addViewportJob(_ job: ViewPortJob) { - if _viewPortHandler.hasChartDimens + if viewPortHandler.hasChartDimens { job.doJob() } @@ -960,8 +830,6 @@ open class ChartViewBase: NSUIView, ChartDataProvider, AnimatorDelegate /// Deceleration friction coefficient in [0 ; 1] interval, higher values indicate that speed will decrease slowly, for example if it set to 0, it will stop immediately. /// 1 is an invalid value, and will be converted to 0.999 automatically. - /// - /// **default**: true @objc open var dragDecelerationFrictionCoef: CGFloat { get @@ -970,19 +838,10 @@ open class ChartViewBase: NSUIView, ChartDataProvider, AnimatorDelegate } set { - var val = newValue - if val < 0.0 - { - val = 0.0 - } - if val >= 1.0 - { - val = 0.999 - } - - _dragDecelerationFrictionCoef = val + _dragDecelerationFrictionCoef = max(0, min(newValue, 0.999)) } } + private var _dragDecelerationFrictionCoef: CGFloat = 0.9 /// The maximum distance in screen pixels away from an entry causing it to highlight. /// **default**: 500.0 @@ -991,7 +850,7 @@ open class ChartViewBase: NSUIView, ChartDataProvider, AnimatorDelegate /// the number of maximum visible drawn values on the chart only active when `drawValuesEnabled` is enabled open var maxVisibleCount: Int { - return Int(INT_MAX) + return .max } // MARK: - AnimatorDelegate @@ -1010,33 +869,21 @@ open class ChartViewBase: NSUIView, ChartDataProvider, AnimatorDelegate open override func nsuiTouchesBegan(_ touches: Set, withEvent event: NSUIEvent?) { - if !_interceptTouchEvents - { - super.nsuiTouchesBegan(touches, withEvent: event) - } + super.nsuiTouchesBegan(touches, withEvent: event) } open override func nsuiTouchesMoved(_ touches: Set, withEvent event: NSUIEvent?) { - if !_interceptTouchEvents - { - super.nsuiTouchesMoved(touches, withEvent: event) - } + super.nsuiTouchesMoved(touches, withEvent: event) } open override func nsuiTouchesEnded(_ touches: Set, withEvent event: NSUIEvent?) { - if !_interceptTouchEvents - { - super.nsuiTouchesEnded(touches, withEvent: event) - } + super.nsuiTouchesEnded(touches, withEvent: event) } open override func nsuiTouchesCancelled(_ touches: Set?, withEvent event: NSUIEvent?) { - if !_interceptTouchEvents - { - super.nsuiTouchesCancelled(touches, withEvent: event) - } + super.nsuiTouchesCancelled(touches, withEvent: event) } } diff --git a/Source/Charts/Charts/CombinedChartView.swift b/Source/Charts/Charts/CombinedChartView.swift index 47eebd6c78..6b2ecbf107 100644 --- a/Source/Charts/Charts/CombinedChartView.swift +++ b/Source/Charts/Charts/CombinedChartView.swift @@ -16,7 +16,7 @@ import CoreGraphics open class CombinedChartView: BarLineChartViewBase, CombinedChartDataProvider { /// the fill-formatter used for determining the position of the fill-line - internal var _fillFormatter: IFillFormatter! + internal var _fillFormatter: FillFormatter! /// enum that allows to specify the order in which the different data objects for the combined-chart are drawn @objc(CombinedChartDrawOrder) @@ -40,7 +40,7 @@ open class CombinedChartView: BarLineChartViewBase, CombinedChartDataProvider _fillFormatter = DefaultFillFormatter() - renderer = CombinedChartRenderer(chart: self, animator: _animator, viewPortHandler: _viewPortHandler) + renderer = CombinedChartRenderer(chart: self, animator: chartAnimator, viewPortHandler: viewPortHandler) } open override var data: ChartData? @@ -60,7 +60,7 @@ open class CombinedChartView: BarLineChartViewBase, CombinedChartDataProvider } } - @objc open var fillFormatter: IFillFormatter + @objc open var fillFormatter: FillFormatter { get { @@ -79,7 +79,7 @@ open class CombinedChartView: BarLineChartViewBase, CombinedChartDataProvider /// - Returns: The Highlight object (contains x-index and DataSet index) of the selected value at the given touch point inside the CombinedChart. open override func getHighlightByTouchPoint(_ pt: CGPoint) -> Highlight? { - if _data === nil + if data === nil { Swift.print("Can't select by touch. No data set.") return nil @@ -106,7 +106,7 @@ open class CombinedChartView: BarLineChartViewBase, CombinedChartDataProvider { get { - return _data as? CombinedChartData + return data as? CombinedChartData } } @@ -213,17 +213,17 @@ open class CombinedChartView: BarLineChartViewBase, CombinedChartDataProvider isDrawMarkersEnabled && valuesToHighlight() else { return } - for i in 0 ..< _indicesToHighlight.count + for i in highlighted.indices { - let highlight = _indicesToHighlight[i] + let highlight = highlighted[i] guard let set = combinedData?.getDataSetByHighlight(highlight), - let e = _data?.entryForHighlight(highlight) + let e = data?.entry(for: highlight) else { continue } let entryIndex = set.entryIndex(entry: e) - if entryIndex > Int(Double(set.entryCount) * _animator.phaseX) + if entryIndex > Int(Double(set.entryCount) * chartAnimator.phaseX) { continue } @@ -231,7 +231,7 @@ open class CombinedChartView: BarLineChartViewBase, CombinedChartDataProvider let pos = getMarkerPosition(highlight: highlight) // check bounds - if !_viewPortHandler.isInBounds(x: pos.x, y: pos.y) + if !viewPortHandler.isInBounds(x: pos.x, y: pos.y) { continue } diff --git a/Source/Charts/Charts/HorizontalBarChartView.swift b/Source/Charts/Charts/HorizontalBarChartView.swift index 7b6163c8c9..2da795212c 100644 --- a/Source/Charts/Charts/HorizontalBarChartView.swift +++ b/Source/Charts/Charts/HorizontalBarChartView.swift @@ -19,21 +19,20 @@ open class HorizontalBarChartView: BarChartView { super.initialize() - _leftAxisTransformer = TransformerHorizontalBarChart(viewPortHandler: _viewPortHandler) - _rightAxisTransformer = TransformerHorizontalBarChart(viewPortHandler: _viewPortHandler) - - renderer = HorizontalBarChartRenderer(dataProvider: self, animator: _animator, viewPortHandler: _viewPortHandler) - leftYAxisRenderer = YAxisRendererHorizontalBarChart(viewPortHandler: _viewPortHandler, yAxis: leftAxis, transformer: _leftAxisTransformer) - rightYAxisRenderer = YAxisRendererHorizontalBarChart(viewPortHandler: _viewPortHandler, yAxis: rightAxis, transformer: _rightAxisTransformer) - xAxisRenderer = XAxisRendererHorizontalBarChart(viewPortHandler: _viewPortHandler, xAxis: _xAxis, transformer: _leftAxisTransformer, chart: self) - + _leftAxisTransformer = TransformerHorizontalBarChart(viewPortHandler: viewPortHandler) + _rightAxisTransformer = TransformerHorizontalBarChart(viewPortHandler: viewPortHandler) + + renderer = HorizontalBarChartRenderer(dataProvider: self, animator: chartAnimator, viewPortHandler: viewPortHandler) + leftYAxisRenderer = YAxisRendererHorizontalBarChart(viewPortHandler: viewPortHandler, axis: leftAxis, transformer: _leftAxisTransformer) + rightYAxisRenderer = YAxisRendererHorizontalBarChart(viewPortHandler: viewPortHandler, axis: rightAxis, transformer: _rightAxisTransformer) + xAxisRenderer = XAxisRendererHorizontalBarChart(viewPortHandler: viewPortHandler, axis: xAxis, transformer: _leftAxisTransformer, chart: self) + self.highlighter = HorizontalBarHighlighter(chart: self) } internal override func calculateLegendOffsets(offsetLeft: inout CGFloat, offsetTop: inout CGFloat, offsetRight: inout CGFloat, offsetBottom: inout CGFloat) { guard - let legend = _legend, legend.isEnabled, !legend.drawInside else { return } @@ -45,20 +44,20 @@ open class HorizontalBarChartView: BarChartView switch legend.horizontalAlignment { case .left: - offsetLeft += min(legend.neededWidth, _viewPortHandler.chartWidth * legend.maxSizePercent) + legend.xOffset + offsetLeft += min(legend.neededWidth, viewPortHandler.chartWidth * legend.maxSizePercent) + legend.xOffset case .right: - offsetRight += min(legend.neededWidth, _viewPortHandler.chartWidth * legend.maxSizePercent) + legend.xOffset + offsetRight += min(legend.neededWidth, viewPortHandler.chartWidth * legend.maxSizePercent) + legend.xOffset case .center: switch legend.verticalAlignment { case .top: - offsetTop += min(legend.neededHeight, _viewPortHandler.chartHeight * legend.maxSizePercent) + legend.yOffset + offsetTop += min(legend.neededHeight, viewPortHandler.chartHeight * legend.maxSizePercent) + legend.yOffset case .bottom: - offsetBottom += min(legend.neededHeight, _viewPortHandler.chartHeight * legend.maxSizePercent) + legend.yOffset + offsetBottom += min(legend.neededHeight, viewPortHandler.chartHeight * legend.maxSizePercent) + legend.yOffset default: break @@ -69,7 +68,7 @@ open class HorizontalBarChartView: BarChartView switch legend.verticalAlignment { case .top: - offsetTop += min(legend.neededHeight, _viewPortHandler.chartHeight * legend.maxSizePercent) + legend.yOffset + offsetTop += min(legend.neededHeight, viewPortHandler.chartHeight * legend.maxSizePercent) + legend.yOffset // left axis equals the top x-axis in a horizontal chart if leftAxis.isEnabled && leftAxis.isDrawLabelsEnabled @@ -78,7 +77,7 @@ open class HorizontalBarChartView: BarChartView } case .bottom: - offsetBottom += min(legend.neededHeight, _viewPortHandler.chartHeight * legend.maxSizePercent) + legend.yOffset + offsetBottom += min(legend.neededHeight, viewPortHandler.chartHeight * legend.maxSizePercent) + legend.yOffset // right axis equals the bottom x-axis in a horizontal chart if rightAxis.isEnabled && rightAxis.isDrawLabelsEnabled @@ -114,20 +113,20 @@ open class HorizontalBarChartView: BarChartView offsetBottom += rightAxis.getRequiredHeightSpace() } - let xlabelwidth = _xAxis.labelRotatedWidth + let xlabelwidth = xAxis.labelRotatedWidth - if _xAxis.isEnabled + if xAxis.isEnabled { // offsets for x-labels - if _xAxis.labelPosition == .bottom + if xAxis.labelPosition == .bottom { offsetLeft += xlabelwidth } - else if _xAxis.labelPosition == .top + else if xAxis.labelPosition == .top { offsetRight += xlabelwidth } - else if _xAxis.labelPosition == .bothSided + else if xAxis.labelPosition == .bothSided { offsetLeft += xlabelwidth offsetRight += xlabelwidth @@ -139,7 +138,7 @@ open class HorizontalBarChartView: BarChartView offsetBottom += self.extraBottomOffset offsetLeft += self.extraLeftOffset - _viewPortHandler.restrainViewPort( + viewPortHandler.restrainViewPort( offsetLeft: max(self.minOffset, offsetLeft), offsetTop: max(self.minOffset, offsetTop), offsetRight: max(self.minOffset, offsetRight), @@ -151,8 +150,8 @@ open class HorizontalBarChartView: BarChartView internal override func prepareValuePxMatrix() { - _rightAxisTransformer.prepareMatrixValuePx(chartXMin: rightAxis._axisMinimum, deltaX: CGFloat(rightAxis.axisRange), deltaY: CGFloat(_xAxis.axisRange), chartYMin: _xAxis._axisMinimum) - _leftAxisTransformer.prepareMatrixValuePx(chartXMin: leftAxis._axisMinimum, deltaX: CGFloat(leftAxis.axisRange), deltaY: CGFloat(_xAxis.axisRange), chartYMin: _xAxis._axisMinimum) + _rightAxisTransformer.prepareMatrixValuePx(chartXMin: rightAxis._axisMinimum, deltaX: CGFloat(rightAxis.axisRange), deltaY: CGFloat(xAxis.axisRange), chartYMin: xAxis._axisMinimum) + _leftAxisTransformer.prepareMatrixValuePx(chartXMin: leftAxis._axisMinimum, deltaX: CGFloat(leftAxis.axisRange), deltaY: CGFloat(xAxis.axisRange), chartYMin: xAxis._axisMinimum) } open override func getMarkerPosition(highlight: Highlight) -> CGPoint @@ -163,9 +162,9 @@ open class HorizontalBarChartView: BarChartView open override func getBarBounds(entry e: BarChartDataEntry) -> CGRect { guard - let data = _data as? BarChartData, - let set = data.getDataSetForEntry(e) as? IBarChartDataSet - else { return CGRect.null } + let data = data as? BarChartData, + let set = data.getDataSetForEntry(e) as? BarChartDataSetProtocol + else { return .null } let y = e.y let x = e.x @@ -195,7 +194,7 @@ open class HorizontalBarChartView: BarChartView open override func getHighlightByTouchPoint(_ pt: CGPoint) -> Highlight? { - if _data === nil + if data === nil { Swift.print("Can't select by touch. No data set.", terminator: "\n") return nil diff --git a/Source/Charts/Charts/LineChartView.swift b/Source/Charts/Charts/LineChartView.swift index c5fbecfacf..e7918266b2 100644 --- a/Source/Charts/Charts/LineChartView.swift +++ b/Source/Charts/Charts/LineChartView.swift @@ -19,10 +19,10 @@ open class LineChartView: BarLineChartViewBase, LineChartDataProvider { super.initialize() - renderer = LineChartRenderer(dataProvider: self, animator: _animator, viewPortHandler: _viewPortHandler) + renderer = LineChartRenderer(dataProvider: self, animator: chartAnimator, viewPortHandler: viewPortHandler) } // MARK: - LineChartDataProvider - open var lineData: LineChartData? { return _data as? LineChartData } + open var lineData: LineChartData? { return data as? LineChartData } } diff --git a/Source/Charts/Charts/PieChartView.swift b/Source/Charts/Charts/PieChartView.swift index 7a036c01b6..704c066bdf 100644 --- a/Source/Charts/Charts/PieChartView.swift +++ b/Source/Charts/Charts/PieChartView.swift @@ -12,14 +12,10 @@ import Foundation import CoreGraphics -#if canImport(UIKit) +#if !os(OSX) import UIKit #endif -#if canImport(Cocoa) -import Cocoa -#endif - /// View that represents a pie chart. Draws cake like slices. open class PieChartView: PieRadarChartViewBase { @@ -90,9 +86,8 @@ open class PieChartView: PieRadarChartViewBase { super.initialize() - renderer = PieChartRenderer(chart: self, animator: _animator, viewPortHandler: _viewPortHandler) - _xAxis = nil - + renderer = PieChartRenderer(chart: self, animator: chartAnimator, viewPortHandler: viewPortHandler) + self.highlighter = PieHighlighter(chart: self) } @@ -100,7 +95,7 @@ open class PieChartView: PieRadarChartViewBase { super.draw(rect) - if _data === nil + if data === nil { return } @@ -115,7 +110,7 @@ open class PieChartView: PieRadarChartViewBase if (valuesToHighlight()) { - renderer.drawHighlighted(context: context, indices: _indicesToHighlight) + renderer.drawHighlighted(context: context, indices: highlighted) } renderer.drawExtras(context: context) @@ -124,7 +119,7 @@ open class PieChartView: PieRadarChartViewBase legendRenderer.renderLegend(context: context) - drawDescription(context: context) + drawDescription(in: context) drawMarkers(context: context) } @@ -132,7 +127,7 @@ open class PieChartView: PieRadarChartViewBase /// if width is larger than height private var widthLarger: Bool { - return _viewPortHandler.contentRect.orientation == .landscape + return viewPortHandler.contentRect.orientation == .landscape } /// adjusted radius. Use diameter when it's half pie and width is larger @@ -154,7 +149,7 @@ open class PieChartView: PieRadarChartViewBase super.calculateOffsets() // prevent nullpointer when no data set - if _data === nil + if data === nil { return } @@ -210,29 +205,10 @@ open class PieChartView: PieRadarChartViewBase @objc open override func distanceToCenter(x: CGFloat, y: CGFloat) -> CGFloat { let c = adjustedCenterOffsets() - var dist = CGFloat(0.0) - var xDist = CGFloat(0.0) - var yDist = CGFloat(0.0) - - if x > c.x - { - xDist = x - c.x - } - else - { - xDist = c.x - x - } - - if y > c.y - { - yDist = y - c.y - } - else - { - yDist = c.y - y - } + let xDist = x > c.x ? x - c.x : c.x - x + let yDist = y > c.y ? y - c.y : c.y - y // pythagoras dist = sqrt(pow(xDist, 2.0) + pow(yDist, 2.0)) @@ -262,9 +238,9 @@ open class PieChartView: PieRadarChartViewBase let offset = drawAngles[entryIndex] / 2.0 // calculate the text position - let x: CGFloat = (r * cos(((rotationAngle + absoluteAngles[entryIndex] - offset) * CGFloat(_animator.phaseY)).DEG2RAD) + center.x) - let y: CGFloat = (r * sin(((rotationAngle + absoluteAngles[entryIndex] - offset) * CGFloat(_animator.phaseY)).DEG2RAD) + center.y) - + let x = (r * cos(((rotationAngle + absoluteAngles[entryIndex] - offset) * CGFloat(chartAnimator.phaseY)).DEG2RAD) + center.x) + let y = (r * sin(((rotationAngle + absoluteAngles[entryIndex] - offset) * CGFloat(chartAnimator.phaseY)).DEG2RAD) + center.y) + return CGPoint(x: x, y: y) } @@ -274,18 +250,18 @@ open class PieChartView: PieRadarChartViewBase _drawAngles = [CGFloat]() _absoluteAngles = [CGFloat]() - guard let data = _data else { return } + guard let data = data else { return } let entryCount = data.entryCount _drawAngles.reserveCapacity(entryCount) _absoluteAngles.reserveCapacity(entryCount) - let yValueSum = (_data as! PieChartData).yValueSum + let yValueSum = (data as! PieChartData).yValueSum var cnt = 0 - for set in data.dataSets + for set in data { for j in 0 ..< set.entryCount { @@ -310,13 +286,13 @@ open class PieChartView: PieRadarChartViewBase /// Checks if the given index is set to be highlighted. @objc open func needsHighlight(index: Int) -> Bool { - return _indicesToHighlight.contains { Int($0.x) == index } + return highlighted.contains { Int($0.x) == index } } /// calculates the needed angle for a given value private func calcAngle(_ value: Double) -> CGFloat { - return calcAngle(value: value, yValueSum: (_data as! PieChartData).yValueSum) + return calcAngle(value: value, yValueSum: (data as! PieChartData).yValueSum) } /// calculates the needed angle for a given value @@ -328,7 +304,8 @@ open class PieChartView: PieRadarChartViewBase /// This will throw an exception, PieChart has no XAxis object. open override var xAxis: XAxis { - fatalError("PieChart has no XAxis") + get { fatalError("PieChart has no XAxis") } + set { fatalError("PieChart has no XAxis") } } open override func indexForAngle(_ angle: CGFloat) -> Int @@ -343,7 +320,7 @@ open class PieChartView: PieRadarChartViewBase @objc open func dataSetIndexForIndex(_ xValue: Double) -> Int { // TODO: Return nil instead of -1 - return _data?.dataSets.firstIndex { + return data?.firstIndex { $0.entryForXValue(xValue, closestToY: .nan) != nil } ?? -1 } @@ -440,7 +417,7 @@ open class PieChartView: PieRadarChartViewBase } else { - let paragraphStyle = NSParagraphStyle.default.mutableCopy() as! NSMutableParagraphStyle + let paragraphStyle = ParagraphStyle.default.mutableCopy() as! MutableParagraphStyle paragraphStyle.lineBreakMode = .byTruncatingTail paragraphStyle.alignment = .center @@ -508,7 +485,7 @@ open class PieChartView: PieRadarChartViewBase internal override var requiredLegendOffset: CGFloat { - return _legend.font.pointSize * 2.0 + return legend.font.pointSize * 2.0 } internal override var requiredBaseOffset: CGFloat @@ -687,4 +664,12 @@ open class PieChartView: PieRadarChartViewBase } } } + + /// smallest pie slice angle that will have a label drawn in degrees, 0 by default + @objc open var sliceTextDrawingThreshold: CGFloat = 0.0 + { + didSet { + setNeedsDisplay() + } + } } diff --git a/Source/Charts/Charts/PieRadarChartViewBase.swift b/Source/Charts/Charts/PieRadarChartViewBase.swift index 86edcd84ba..45b8e0f1db 100644 --- a/Source/Charts/Charts/PieRadarChartViewBase.swift +++ b/Source/Charts/Charts/PieRadarChartViewBase.swift @@ -73,7 +73,7 @@ open class PieRadarChartViewBase: ChartViewBase internal override func calcMinMax() { - /*_xAxis.axisRange = Double((_data?.xVals.count ?? 0) - 1)*/ + /*_xAxis.axisRange = Double((data?.xVals.count ?? 0) - 1)*/ } open override var maxVisibleCount: Int @@ -88,7 +88,7 @@ open class PieRadarChartViewBase: ChartViewBase { calcMinMax() - if let data = _data , _legend !== nil + if let data = data { legendRenderer.computeLegend(data: data) } @@ -105,20 +105,20 @@ open class PieRadarChartViewBase: ChartViewBase var legendBottom = CGFloat(0.0) var legendTop = CGFloat(0.0) - if _legend != nil && _legend.enabled && !_legend.drawInside + if legend.enabled && !legend.drawInside { - let fullLegendWidth = min(_legend.neededWidth, _viewPortHandler.chartWidth * _legend.maxSizePercent) + let fullLegendWidth = min(legend.neededWidth, viewPortHandler.chartWidth * legend.maxSizePercent) - switch _legend.orientation + switch legend.orientation { case .vertical: var xLegendOffset: CGFloat = 0.0 - if _legend.horizontalAlignment == .left - || _legend.horizontalAlignment == .right + if legend.horizontalAlignment == .left + || legend.horizontalAlignment == .right { - if _legend.verticalAlignment == .center + if legend.verticalAlignment == .center { // this is the space between the legend and the chart let spacing = CGFloat(13.0) @@ -131,11 +131,11 @@ open class PieRadarChartViewBase: ChartViewBase let spacing = CGFloat(8.0) let legendWidth = fullLegendWidth + spacing - let legendHeight = _legend.neededHeight + _legend.textHeightMax + let legendHeight = legend.neededHeight + legend.textHeightMax let c = self.midPoint - let bottomX = _legend.horizontalAlignment == .right + let bottomX = legend.horizontalAlignment == .right ? self.bounds.width - legendWidth + 15.0 : legendWidth - 15.0 let bottomY = legendHeight + 15 @@ -160,7 +160,7 @@ open class PieRadarChartViewBase: ChartViewBase } } - switch _legend.horizontalAlignment + switch legend.horizontalAlignment { case .left: legendLeft = xLegendOffset @@ -170,13 +170,13 @@ open class PieRadarChartViewBase: ChartViewBase case .center: - switch _legend.verticalAlignment + switch legend.verticalAlignment { case .top: - legendTop = min(_legend.neededHeight, _viewPortHandler.chartHeight * _legend.maxSizePercent) + legendTop = min(legend.neededHeight, viewPortHandler.chartHeight * legend.maxSizePercent) case .bottom: - legendBottom = min(_legend.neededHeight, _viewPortHandler.chartHeight * _legend.maxSizePercent) + legendBottom = min(legend.neededHeight, viewPortHandler.chartHeight * legend.maxSizePercent) default: break @@ -187,8 +187,8 @@ open class PieRadarChartViewBase: ChartViewBase var yLegendOffset: CGFloat = 0.0 - if _legend.verticalAlignment == .top - || _legend.verticalAlignment == .bottom + if legend.verticalAlignment == .top + || legend.verticalAlignment == .bottom { // It's possible that we do not need this offset anymore as it // is available through the extraOffsets, but changing it can mean @@ -196,11 +196,11 @@ open class PieRadarChartViewBase: ChartViewBase let yOffset = self.requiredLegendOffset yLegendOffset = min( - _legend.neededHeight + yOffset, - _viewPortHandler.chartHeight * _legend.maxSizePercent) + legend.neededHeight + yOffset, + viewPortHandler.chartHeight * legend.maxSizePercent) } - switch _legend.verticalAlignment + switch legend.verticalAlignment { case .top: @@ -243,7 +243,7 @@ open class PieRadarChartViewBase: ChartViewBase let offsetRight = max(minOffset, legendRight) let offsetBottom = max(minOffset, max(self.requiredBaseOffset, legendBottom)) - _viewPortHandler.restrainViewPort(offsetLeft: offsetLeft, offsetTop: offsetTop, offsetRight: offsetRight, offsetBottom: offsetBottom) + viewPortHandler.restrainViewPort(offsetLeft: offsetLeft, offsetTop: offsetTop, offsetRight: offsetRight, offsetBottom: offsetBottom) } /// - Returns: The angle relative to the chart center for the given point on the chart in degrees. @@ -353,7 +353,7 @@ open class PieRadarChartViewBase: ChartViewBase /// The diameter of the pie- or radar-chart @objc open var diameter: CGFloat { - var content = _viewPortHandler.contentRect + var content = viewPortHandler.contentRect content.origin.x += extraLeftOffset content.origin.y += extraTopOffset content.size.width -= extraLeftOffset + extraRightOffset @@ -678,7 +678,6 @@ open class PieRadarChartViewBase: ChartViewBase // Remove samples older than our sample time - 1 seconds // while keeping at least one sample - var i = 0, count = velocitySamples.count while (i < count - 2) { diff --git a/Source/Charts/Charts/RadarChartView.swift b/Source/Charts/Charts/RadarChartView.swift index 6bcad33613..3b21cedd34 100644 --- a/Source/Charts/Charts/RadarChartView.swift +++ b/Source/Charts/Charts/RadarChartView.swift @@ -61,11 +61,11 @@ open class RadarChartView: PieRadarChartViewBase _yAxis = YAxis(position: .left) _yAxis.labelXOffset = 10.0 - renderer = RadarChartRenderer(chart: self, animator: _animator, viewPortHandler: _viewPortHandler) - - _yAxisRenderer = YAxisRendererRadarChart(viewPortHandler: _viewPortHandler, yAxis: _yAxis, chart: self) - _xAxisRenderer = XAxisRendererRadarChart(viewPortHandler: _viewPortHandler, xAxis: _xAxis, chart: self) + renderer = RadarChartRenderer(chart: self, animator: chartAnimator, viewPortHandler: viewPortHandler) + _yAxisRenderer = YAxisRendererRadarChart(viewPortHandler: viewPortHandler, axis: _yAxis, chart: self) + _xAxisRenderer = XAxisRendererRadarChart(viewPortHandler: viewPortHandler, axis: xAxis, chart: self) + self.highlighter = RadarHighlighter(chart: self) } @@ -73,10 +73,10 @@ open class RadarChartView: PieRadarChartViewBase { super.calcMinMax() - guard let data = _data else { return } + guard let data = data else { return } _yAxis.calculate(min: data.getYMin(axis: .left), max: data.getYMax(axis: .left)) - _xAxis.calculate(min: 0.0, max: Double(data.maxEntryCountSet?.entryCount ?? 0)) + xAxis.calculate(min: 0.0, max: Double(data.maxEntryCountSet?.entryCount ?? 0)) } open override func notifyDataSetChanged() @@ -84,13 +84,12 @@ open class RadarChartView: PieRadarChartViewBase calcMinMax() _yAxisRenderer?.computeAxis(min: _yAxis._axisMinimum, max: _yAxis._axisMaximum, inverted: _yAxis.isInverted) - _xAxisRenderer?.computeAxis(min: _xAxis._axisMinimum, max: _xAxis._axisMaximum, inverted: false) + _xAxisRenderer?.computeAxis(min: xAxis._axisMinimum, max: xAxis._axisMaximum, inverted: false) - if let data = _data, - let legend = _legend, + if let data = data, !legend.isLegendCustom { - legendRenderer?.computeLegend(data: data) + legendRenderer.computeLegend(data: data) } calculateOffsets() @@ -107,9 +106,9 @@ open class RadarChartView: PieRadarChartViewBase let optionalContext = NSUIGraphicsGetCurrentContext() guard let context = optionalContext else { return } - if _xAxis.isEnabled + if xAxis.isEnabled { - _xAxisRenderer.computeAxis(min: _xAxis._axisMinimum, max: _xAxis._axisMaximum, inverted: false) + _xAxisRenderer.computeAxis(min: xAxis._axisMinimum, max: xAxis._axisMaximum, inverted: false) } _xAxisRenderer?.renderAxisLabels(context: context) @@ -128,7 +127,7 @@ open class RadarChartView: PieRadarChartViewBase if valuesToHighlight() { - renderer.drawHighlighted(context: context, indices: _indicesToHighlight) + renderer.drawHighlighted(context: context, indices: highlighted) } if _yAxis.isEnabled && !_yAxis.isDrawLimitLinesBehindDataEnabled @@ -142,7 +141,7 @@ open class RadarChartView: PieRadarChartViewBase legendRenderer.renderLegend(context: context) - drawDescription(context: context) + drawDescription(in: context) drawMarkers(context: context) } @@ -150,7 +149,7 @@ open class RadarChartView: PieRadarChartViewBase /// The factor that is needed to transform values into pixels. @objc open var factor: CGFloat { - let content = _viewPortHandler.contentRect + let content = viewPortHandler.contentRect return min(content.width / 2.0, content.height / 2.0) / CGFloat(_yAxis.axisRange) } @@ -158,7 +157,7 @@ open class RadarChartView: PieRadarChartViewBase /// The angle that each slice in the radar chart occupies. @objc open var sliceAngle: CGFloat { - return 360.0 / CGFloat(_data?.maxEntryCountSet?.entryCount ?? 0) + return 360.0 / CGFloat(data?.maxEntryCountSet?.entryCount ?? 0) } open override func indexForAngle(_ angle: CGFloat) -> Int @@ -168,10 +167,10 @@ open class RadarChartView: PieRadarChartViewBase let sliceAngle = self.sliceAngle - let max = _data?.maxEntryCountSet?.entryCount ?? 0 + let max = data?.maxEntryCountSet?.entryCount ?? 0 return (0.. a - } ?? max + } ?? 0 } /// The object that represents all y-labels of the RadarChart. @@ -196,17 +195,17 @@ open class RadarChartView: PieRadarChartViewBase internal override var requiredLegendOffset: CGFloat { - return _legend.font.pointSize * 4.0 + return legend.font.pointSize * 4.0 } internal override var requiredBaseOffset: CGFloat { - return _xAxis.isEnabled && _xAxis.isDrawLabelsEnabled ? _xAxis.labelRotatedWidth : 10.0 + return xAxis.isEnabled && xAxis.isDrawLabelsEnabled ? xAxis.labelRotatedWidth : 10.0 } open override var radius: CGFloat { - let content = _viewPortHandler.contentRect + let content = viewPortHandler.contentRect return min(content.width / 2.0, content.height / 2.0) } diff --git a/Source/Charts/Charts/ScatterChartView.swift b/Source/Charts/Charts/ScatterChartView.swift index 22c710ad83..070acc68e0 100644 --- a/Source/Charts/Charts/ScatterChartView.swift +++ b/Source/Charts/Charts/ScatterChartView.swift @@ -19,7 +19,7 @@ open class ScatterChartView: BarLineChartViewBase, ScatterChartDataProvider { super.initialize() - renderer = ScatterChartRenderer(dataProvider: self, animator: _animator, viewPortHandler: _viewPortHandler) + renderer = ScatterChartRenderer(dataProvider: self, animator: chartAnimator, viewPortHandler: viewPortHandler) xAxis.spaceMin = 0.5 xAxis.spaceMax = 0.5 @@ -27,5 +27,5 @@ open class ScatterChartView: BarLineChartViewBase, ScatterChartDataProvider // MARK: - ScatterChartDataProvider - open var scatterData: ScatterChartData? { return _data as? ScatterChartData } + open var scatterData: ScatterChartData? { return data as? ScatterChartData } } diff --git a/Source/Charts/Components/AxisBase.swift b/Source/Charts/Components/AxisBase.swift index 0b59628d4f..83db26b62c 100644 --- a/Source/Charts/Components/AxisBase.swift +++ b/Source/Charts/Components/AxisBase.swift @@ -22,7 +22,7 @@ open class AxisBase: ComponentBase } /// Custom formatter that is used instead of the auto-formatter if set - private var _axisValueFormatter: IAxisValueFormatter? + private lazy var _axisValueFormatter: AxisValueFormatter = DefaultAxisValueFormatter(decimals: decimals) @objc open var labelFont = NSUIFont.systemFont(ofSize: 10.0) @objc open var labelTextColor = NSUIColor.labelOrBlack @@ -133,28 +133,18 @@ open class AxisBase: ComponentBase @objc open func getLongestLabel() -> String { - var longest = "" - - for i in 0 ..< entries.count - { - let text = getFormattedLabel(i) - - if longest.count < text.count - { - longest = text - } - } - - return longest + let longest = entries.indices + .lazy + .map(getFormattedLabel(_:)) + .max(by: \.count) + + return longest ?? "" } /// - Returns: The formatted label at the specified index. This will either use the auto-formatter or the custom formatter (if one is set). @objc open func getFormattedLabel(_ index: Int) -> String { - if index < 0 || index >= entries.count - { - return "" - } + guard entries.indices.contains(index) else { return "" } return valueFormatter?.stringForValue(entries[index], axis: self) ?? "" } @@ -162,15 +152,11 @@ open class AxisBase: ComponentBase /// Sets the formatter to be used for formatting the axis labels. /// If no formatter is set, the chart will automatically determine a reasonable formatting (concerning decimals) for all the values that are drawn inside the chart. /// Use `nil` to use the formatter calculated by the chart. - @objc open var valueFormatter: IAxisValueFormatter? + @objc open var valueFormatter: AxisValueFormatter? { get { - if _axisValueFormatter == nil - { - _axisValueFormatter = DefaultAxisValueFormatter(decimals: decimals) - } - else if _axisValueFormatter is DefaultAxisValueFormatter && + if _axisValueFormatter is DefaultAxisValueFormatter && (_axisValueFormatter as! DefaultAxisValueFormatter).hasAutoDecimals && (_axisValueFormatter as! DefaultAxisValueFormatter).decimals != decimals { diff --git a/Source/Charts/Components/ChartLimitLine.swift b/Source/Charts/Components/ChartLimitLine.swift index 407c7cd4cc..fc876b4d80 100644 --- a/Source/Charts/Components/ChartLimitLine.swift +++ b/Source/Charts/Components/ChartLimitLine.swift @@ -20,10 +20,10 @@ open class ChartLimitLine: ComponentBase @objc(ChartLimitLabelPosition) public enum LabelPosition: Int { - case topLeft - case topRight - case bottomLeft - case bottomRight + case leftTop + case leftBottom + case rightTop + case rightBottom } /// limit / maximum (the y-value or xIndex) @@ -39,7 +39,7 @@ open class ChartLimitLine: ComponentBase @objc open var drawLabelEnabled = true @objc open var label = "" - @objc open var labelPosition = LabelPosition.topRight + @objc open var labelPosition = LabelPosition.rightTop public override init() { diff --git a/Source/Charts/Components/Description.swift b/Source/Charts/Components/Description.swift index 0288931c04..ba455dc051 100644 --- a/Source/Charts/Components/Description.swift +++ b/Source/Charts/Components/Description.swift @@ -44,7 +44,7 @@ open class Description: ComponentBase open var position: CGPoint? = nil /// The text alignment of the description text. Default RIGHT. - @objc open var textAlign: NSTextAlignment = NSTextAlignment.right + @objc open var textAlign: TextAlignment = TextAlignment.right /// Font object used for drawing the description text. @objc open var font: NSUIFont diff --git a/Source/Charts/Components/Legend.swift b/Source/Charts/Components/Legend.swift index 2a92f4ebaa..e86d59ca53 100644 --- a/Source/Charts/Components/Legend.swift +++ b/Source/Charts/Components/Legend.swift @@ -229,13 +229,12 @@ open class Legend: ComponentBase var wasStacked = false - for i in 0 ..< entryCount + for i in entries.indices { let e = entries[i] let drawingForm = e.form != .none let formSize = e.formSize.isNaN ? defaultFormSize : e.formSize - let label = e.label - + if !wasStacked { width = 0.0 @@ -250,10 +249,10 @@ open class Legend: ComponentBase width += formSize } - if label != nil + if let label = e.label { - let size = (label! as NSString).size(withAttributes: [.font: labelFont]) - + let size = (label as NSString).size(withAttributes: [.font: labelFont]) + if drawingForm && !wasStacked { width += formToTextSpace @@ -307,13 +306,12 @@ open class Legend: ComponentBase // Start calculating layout - let labelAttrs = [NSAttributedString.Key.font: labelFont] var maxLineWidth: CGFloat = 0.0 var currentLineWidth: CGFloat = 0.0 var requiredWidth: CGFloat = 0.0 var stackedStartIndex: Int = -1 - for i in 0 ..< entryCount + for i in entries.indices { let e = entries[i] let drawingForm = e.form != .none @@ -333,9 +331,9 @@ open class Legend: ComponentBase } // grouped forms have null labels - if label != nil + if let label = label { - calculatedLabelSizes[i] = (label! as NSString).size(withAttributes: labelAttrs) + calculatedLabelSizes[i] = (label as NSString).size(withAttributes: [.font: labelFont]) requiredWidth += drawingForm ? formToTextSpace + formSize : 0.0 requiredWidth += calculatedLabelSizes[i].width } @@ -386,7 +384,7 @@ open class Legend: ComponentBase neededWidth = maxLineWidth neededHeight = labelLineHeight * CGFloat(calculatedLineSizes.count) + - yEntrySpace * CGFloat(calculatedLineSizes.count == 0 ? 0 : (calculatedLineSizes.count - 1)) + yEntrySpace * CGFloat(calculatedLineSizes.isEmpty ? 0 : (calculatedLineSizes.count - 1)) } neededWidth += xOffset diff --git a/Source/Charts/Components/LegendEntry.swift b/Source/Charts/Components/LegendEntry.swift index 5868137ef9..9d2ae5eaf0 100644 --- a/Source/Charts/Components/LegendEntry.swift +++ b/Source/Charts/Components/LegendEntry.swift @@ -23,33 +23,18 @@ open class LegendEntry: NSObject /// - Parameters: /// - label: The legend entry text. /// A `nil` label will start a group. - /// - form: The form to draw for this entry. - /// - formSize: Set to NaN to use the legend's default. - /// - formLineWidth: Set to NaN to use the legend's default. - /// - formLineDashPhase: Line dash configuration. - /// - formLineDashLengths: Line dash configurationas NaN to use the legend's default. - /// - formColor: The color for drawing the form. - @objc public init(label: String?, - form: Legend.Form, - formSize: CGFloat, - formLineWidth: CGFloat, - formLineDashPhase: CGFloat, - formLineDashLengths: [CGFloat]?, - formColor: NSUIColor?) + @objc public init(label: String?) { self.label = label - self.form = form - self.formSize = formSize - self.formLineWidth = formLineWidth - self.formLineDashPhase = formLineDashPhase - self.formLineDashLengths = formLineDashLengths - self.formColor = formColor } - + /// The legend entry text. /// A `nil` label will start a group. @objc open var label: String? - + + /// The color for drawing the label + @objc open var labelColor: NSUIColor? + /// The form to draw for this entry. /// /// `None` will avoid drawing a form, and any related space. diff --git a/Source/Charts/Components/IMarker.swift b/Source/Charts/Components/Marker.swift similarity index 84% rename from Source/Charts/Components/IMarker.swift rename to Source/Charts/Components/Marker.swift index a4b7526098..c643517a10 100644 --- a/Source/Charts/Components/IMarker.swift +++ b/Source/Charts/Components/Marker.swift @@ -12,8 +12,8 @@ import Foundation import CoreGraphics -@objc(IChartMarker) -public protocol IMarker: class +@objc(ChartMarker) +public protocol Marker: class { /// - Returns: The desired (general) offset you wish the IMarker to have on the x-axis. /// By returning x: -(width / 2) you will center the IMarker horizontally. @@ -27,13 +27,13 @@ public protocol IMarker: class /// If you have no adjustments to make, return self.offset(). func offsetForDrawing(atPoint: CGPoint) -> CGPoint - /// This method enables a custom IMarker to update it's content every time the IMarker is redrawn according to the data entry it points to. + /// This method enables a custom Marker to update it's content every time the Marker is redrawn according to the data entry it points to. /// /// - Parameters: /// - entry: The Entry the IMarker belongs to. This can also be any subclass of Entry, like BarEntry or CandleEntry, simply cast it at runtime. /// - highlight: The highlight object contains information about the highlighted value such as it's dataset-index, the selected range or stack-index (only stacked bar entries). func refreshContent(entry: ChartDataEntry, highlight: Highlight) - /// Draws the IMarker on the given position on the given context + /// Draws the Marker on the given position on the given context func draw(context: CGContext, point: CGPoint) } diff --git a/Source/Charts/Components/MarkerImage.swift b/Source/Charts/Components/MarkerImage.swift index 341b1186c0..eed33422e7 100644 --- a/Source/Charts/Components/MarkerImage.swift +++ b/Source/Charts/Components/MarkerImage.swift @@ -13,7 +13,7 @@ import Foundation import CoreGraphics @objc(ChartMarkerImage) -open class MarkerImage: NSObject, IMarker +open class MarkerImage: NSObject, Marker { /// The marker image to render @objc open var image: NSUIImage? diff --git a/Source/Charts/Components/MarkerView.swift b/Source/Charts/Components/MarkerView.swift index bf65e67cf1..d80ad535b3 100644 --- a/Source/Charts/Components/MarkerView.swift +++ b/Source/Charts/Components/MarkerView.swift @@ -17,7 +17,7 @@ import AppKit #endif @objc(ChartMarkerView) -open class MarkerView: NSUIView, IMarker +open class MarkerView: NSUIView, Marker { open var offset: CGPoint = CGPoint() @@ -82,15 +82,14 @@ open class MarkerView: NSUIView, IMarker options: nil)?[0] as? MarkerView #else - var loadedObjects = NSArray() - let loadedObjectsPointer = AutoreleasingUnsafeMutablePointer(&loadedObjects) + var loadedObjects: NSArray? = NSArray() if bundle.loadNibNamed( NSNib.Name(String(describing: self)), owner: nil, - topLevelObjects: loadedObjectsPointer) + topLevelObjects: &loadedObjects) { - return loadedObjects[0] as? MarkerView + return loadedObjects?[0] as? MarkerView } return nil diff --git a/Source/Charts/Components/YAxis.swift b/Source/Charts/Components/YAxis.swift index 8f528615a4..bf0beef6d1 100644 --- a/Source/Charts/Components/YAxis.swift +++ b/Source/Charts/Components/YAxis.swift @@ -78,7 +78,7 @@ open class YAxis: AxisBase @objc open var labelPosition = LabelPosition.outsideChart /// the alignment of the text in the y-label - @objc open var labelAlignment: NSTextAlignment = .left + @objc open var labelAlignment: TextAlignment = .left /// the horizontal offset of the y-label @objc open var labelXOffset: CGFloat = 0.0 @@ -121,7 +121,7 @@ open class YAxis: AxisBase @objc open func requiredSize() -> CGSize { let label = getLongestLabel() as NSString - var size = label.size(withAttributes: [NSAttributedString.Key.font: labelFont]) + var size = label.size(withAttributes: [.font: labelFont]) size.width += xOffset * 2.0 size.height += yOffset * 2.0 size.width = max(minWidth, min(size.width, maxWidth > 0.0 ? maxWidth : size.width)) diff --git a/Source/Charts/Data/Implementations/ChartBaseDataSet.swift b/Source/Charts/Data/Implementations/ChartBaseDataSet.swift index b416a422fa..ccb82de6b4 100644 --- a/Source/Charts/Data/Implementations/ChartBaseDataSet.swift +++ b/Source/Charts/Data/Implementations/ChartBaseDataSet.swift @@ -13,7 +13,7 @@ import Foundation import CoreGraphics -open class ChartBaseDataSet: NSObject, IChartDataSet, NSCopying +open class ChartBaseDataSet: NSObject, ChartDataSetProtocol, NSCopying { public required override init() { @@ -24,7 +24,7 @@ open class ChartBaseDataSet: NSObject, IChartDataSet, NSCopying valueColors.append(.labelOrBlack) } - @objc public init(label: String?) + @objc public init(label: String) { super.init() @@ -271,35 +271,10 @@ open class ChartBaseDataSet: NSObject, IChartDataSet, NSCopying /// `true` if value highlighting is enabled for this dataset open var isHighlightEnabled: Bool { return highlightEnabled } - - /// Custom formatter that is used instead of the auto-formatter if set - internal var _valueFormatter: IValueFormatter? - + /// Custom formatter that is used instead of the auto-formatter if set - open var valueFormatter: IValueFormatter? - { - get - { - if needsFormatter - { - return ChartUtils.defaultValueFormatter() - } - - return _valueFormatter - } - set - { - if newValue == nil { return } - - _valueFormatter = newValue - } - } - - open var needsFormatter: Bool - { - return _valueFormatter == nil - } - + open lazy var valueFormatter: ValueFormatter = DefaultValueFormatter() + /// Sets/get a single color for value text. /// Setting the color clears the colors array and adds a single color. /// Getting will return the first color in the array. @@ -330,6 +305,9 @@ open class ChartBaseDataSet: NSObject, IChartDataSet, NSCopying /// the font for the value-text labels open var valueFont: NSUIFont = NSUIFont.systemFont(ofSize: 7.0) + /// The rotation angle (in degrees) for value-text labels + open var valueLabelAngle: CGFloat = CGFloat(0.0) + /// The form to draw for this dataset in the legend. open var form = Legend.Form.default @@ -418,7 +396,7 @@ open class ChartBaseDataSet: NSObject, IChartDataSet, NSCopying copy.label = label copy.axisDependency = axisDependency copy.highlightEnabled = highlightEnabled - copy._valueFormatter = _valueFormatter + copy.valueFormatter = valueFormatter copy.valueFont = valueFont copy.form = form copy.formSize = formSize @@ -426,7 +404,7 @@ open class ChartBaseDataSet: NSObject, IChartDataSet, NSCopying copy.formLineDashPhase = formLineDashPhase copy.formLineDashLengths = formLineDashLengths copy.drawValuesEnabled = drawValuesEnabled - copy.drawValuesEnabled = drawValuesEnabled + copy.drawIconsEnabled = drawIconsEnabled copy.iconsOffset = iconsOffset copy.visible = visible diff --git a/Source/Charts/Data/Implementations/Standard/BarChartData.swift b/Source/Charts/Data/Implementations/Standard/BarChartData.swift index 6697c32cf2..0403c76b71 100644 --- a/Source/Charts/Data/Implementations/Standard/BarChartData.swift +++ b/Source/Charts/Data/Implementations/Standard/BarChartData.swift @@ -14,16 +14,21 @@ import CoreGraphics open class BarChartData: BarLineScatterCandleBubbleChartData { - public override init() + public required init() { super.init() } - public override init(dataSets: [IChartDataSet]?) + public override init(dataSets: [ChartDataSetProtocol]) { super.init(dataSets: dataSets) } - + + public required init(arrayLiteral elements: ChartDataSetProtocol...) + { + super.init(dataSets: elements) + } + /// The width of the bars on the x-axis, in values (not pixels) /// /// **default**: 0.85 @@ -39,13 +44,11 @@ open class BarChartData: BarLineScatterCandleBubbleChartData /// - barSpace: The space between individual bars in values (not pixels) e.g. 0.1f for bar width 1f @objc open func groupBars(fromX: Double, groupSpace: Double, barSpace: Double) { - let setCount = _dataSets.count - if setCount <= 1 - { + guard !isEmpty else { print("BarData needs to hold at least 2 BarDataSets to allow grouping.", terminator: "\n") return } - + let max = maxEntryCountSet let maxEntryCount = max?.entryCount ?? 0 @@ -57,12 +60,12 @@ open class BarChartData: BarLineScatterCandleBubbleChartData let interval = groupWidth(groupSpace: groupSpace, barSpace: barSpace) - for i in stride(from: 0, to: maxEntryCount, by: 1) + for i in 0.. Double { - return Double(_dataSets.count) * (self.barWidth + barSpace) + groupSpace + return Double(count) * (self.barWidth + barSpace) + groupSpace } - } diff --git a/Source/Charts/Data/Implementations/Standard/BarChartDataEntry.swift b/Source/Charts/Data/Implementations/Standard/BarChartDataEntry.swift index 31c51b0f86..86a8fa2645 100644 --- a/Source/Charts/Data/Implementations/Standard/BarChartDataEntry.swift +++ b/Source/Charts/Data/Implementations/Standard/BarChartDataEntry.swift @@ -89,22 +89,14 @@ open class BarChartDataEntry: ChartDataEntry self.data = data } - @objc open func sumBelow(stackIndex :Int) -> Double + @objc open func sumBelow(stackIndex: Int) -> Double { - guard let yVals = _yVals else + guard let yVals = _yVals, yVals.indices.contains(stackIndex) else { return 0 } - - var remainder: Double = 0.0 - var index = yVals.count - 1 - - while (index > stackIndex && index >= 0) - { - remainder += yVals[index] - index -= 1 - } - + + let remainder = yVals[stackIndex...].reduce(into: 0.0) { $0 += $1 } return remainder } @@ -120,6 +112,8 @@ open class BarChartDataEntry: ChartDataEntry return _positiveSum } + var stackSize: Int { yValues?.count ?? 1} + @objc open func calcPosNegSum() { (_negativeSum, _positiveSum) = _yVals?.reduce(into: (0,0)) { (result, y) in @@ -183,7 +177,7 @@ open class BarChartDataEntry: ChartDataEntry get { return self._yVals } set { - self.y = BarChartDataEntry.calcSum(values: newValue) + self.y = BarChartDataEntry.calcSum(values: newValue ?? []) self._yVals = newValue calcPosNegSum() calcRanges() @@ -213,18 +207,8 @@ open class BarChartDataEntry: ChartDataEntry /// - Parameters: /// - vals: /// - Returns: - private static func calcSum(values: [Double]?) -> Double + private static func calcSum(values: [Double]) -> Double { - guard let values = values - else { return 0.0 } - - var sum = 0.0 - - for f in values - { - sum += f - } - - return sum + values.reduce(into: 0, +=) } } diff --git a/Source/Charts/Data/Implementations/Standard/BarChartDataSet.swift b/Source/Charts/Data/Implementations/Standard/BarChartDataSet.swift index 2478aeccf8..aae7ae30ae 100644 --- a/Source/Charts/Data/Implementations/Standard/BarChartDataSet.swift +++ b/Source/Charts/Data/Implementations/Standard/BarChartDataSet.swift @@ -13,7 +13,7 @@ import Foundation import CoreGraphics -open class BarChartDataSet: BarLineScatterCandleBubbleChartDataSet, IBarChartDataSet +open class BarChartDataSet: BarLineScatterCandleBubbleChartDataSet, BarChartDataSetProtocol { private func initialize() { @@ -29,7 +29,7 @@ open class BarChartDataSet: BarLineScatterCandleBubbleChartDataSet, IBarChartDat initialize() } - public override init(entries: [ChartDataEntry]?, label: String?) + public override init(entries: [ChartDataEntry], label: String) { super.init(entries: entries, label: label) initialize() @@ -48,70 +48,37 @@ open class BarChartDataSet: BarLineScatterCandleBubbleChartDataSet, IBarChartDat /// stacks. All values belonging to a stack are calculated separately. private func calcEntryCountIncludingStacks(entries: [BarChartDataEntry]) { - _entryCountStacks = 0 - - for i in 0 ..< entries.count - { - if let vals = entries[i].yValues - { - _entryCountStacks += vals.count - } - else - { - _entryCountStacks += 1 - } - } + _entryCountStacks = entries.lazy + .map(\.stackSize) + .reduce(into: 0, +=) } /// calculates the maximum stacksize that occurs in the Entries array of this DataSet private func calcStackSize(entries: [BarChartDataEntry]) { - for i in 0 ..< entries.count - { - if let vals = entries[i].yValues - { - if vals.count > _stackSize - { - _stackSize = vals.count - } - } - } + _stackSize = entries.lazy + .map(\.stackSize) + .max() ?? 1 } open override func calcMinMax(entry e: ChartDataEntry) { - guard let e = e as? BarChartDataEntry + guard let e = e as? BarChartDataEntry, + !e.y.isNaN else { return } - if !e.y.isNaN + if e.yValues == nil + { + _yMin = Swift.min(e.y, _yMin) + _yMax = Swift.max(e.y, _yMax) + } + else { - if e.yValues == nil - { - if e.y < _yMin - { - _yMin = e.y - } - - if e.y > _yMax - { - _yMax = e.y - } - } - else - { - if -e.negativeSum < _yMin - { - _yMin = -e.negativeSum - } - - if e.positiveSum > _yMax - { - _yMax = e.positiveSum - } - } - - calcMinMaxX(entry: e) + _yMin = Swift.min(-e.negativeSum, _yMin) + _yMax = Swift.max(e.positiveSum, _yMax) } + + calcMinMaxX(entry: e) } /// The maximum number of bars that can be stacked upon another in this DataSet. @@ -123,7 +90,7 @@ open class BarChartDataSet: BarLineScatterCandleBubbleChartDataSet, IBarChartDat /// `true` if this DataSet is stacked (stacksize > 1) or not. open var isStacked: Bool { - return _stackSize > 1 ? true : false + return _stackSize > 1 } /// The overall entry count, including counting each stack-value individually diff --git a/Source/Charts/Data/Implementations/Standard/BarLineScatterCandleBubbleChartData.swift b/Source/Charts/Data/Implementations/Standard/BarLineScatterCandleBubbleChartData.swift index c98bb1d075..75eb8a278e 100644 --- a/Source/Charts/Data/Implementations/Standard/BarLineScatterCandleBubbleChartData.swift +++ b/Source/Charts/Data/Implementations/Standard/BarLineScatterCandleBubbleChartData.swift @@ -13,13 +13,18 @@ import Foundation open class BarLineScatterCandleBubbleChartData: ChartData { - public override init() + public required init() { super.init() } - public override init(dataSets: [IChartDataSet]?) + public override init(dataSets: [ChartDataSetProtocol]) { super.init(dataSets: dataSets) } + + public required init(arrayLiteral elements: ChartDataSetProtocol...) + { + super.init(dataSets: elements) + } } diff --git a/Source/Charts/Data/Implementations/Standard/BarLineScatterCandleBubbleChartDataSet.swift b/Source/Charts/Data/Implementations/Standard/BarLineScatterCandleBubbleChartDataSet.swift index 91382515a8..6d233db514 100644 --- a/Source/Charts/Data/Implementations/Standard/BarLineScatterCandleBubbleChartDataSet.swift +++ b/Source/Charts/Data/Implementations/Standard/BarLineScatterCandleBubbleChartDataSet.swift @@ -13,7 +13,7 @@ import Foundation import CoreGraphics -open class BarLineScatterCandleBubbleChartDataSet: ChartDataSet, IBarLineScatterCandleBubbleChartDataSet +open class BarLineScatterCandleBubbleChartDataSet: ChartDataSet, BarLineScatterCandleBubbleChartDataSetProtocol { // MARK: - Data functions and accessors diff --git a/Source/Charts/Data/Implementations/Standard/BubbleChartData.swift b/Source/Charts/Data/Implementations/Standard/BubbleChartData.swift index 433f384f75..5a0a85563d 100644 --- a/Source/Charts/Data/Implementations/Standard/BubbleChartData.swift +++ b/Source/Charts/Data/Implementations/Standard/BubbleChartData.swift @@ -14,19 +14,24 @@ import CoreGraphics open class BubbleChartData: BarLineScatterCandleBubbleChartData { - public override init() + public required init() { super.init() } - public override init(dataSets: [IChartDataSet]?) + public override init(dataSets: [ChartDataSetProtocol]) { super.init(dataSets: dataSets) } - + + public required init(arrayLiteral elements: ChartDataSetProtocol...) + { + super.init(dataSets: elements) + } + /// Sets the width of the circle that surrounds the bubble when highlighted for all DataSet objects this data object contains @objc open func setHighlightCircleWidth(_ width: CGFloat) { - (_dataSets as? [IBubbleChartDataSet])?.forEach { $0.highlightCircleWidth = width } + (_dataSets as? [BubbleChartDataSetProtocol])?.forEach { $0.highlightCircleWidth = width } } } diff --git a/Source/Charts/Data/Implementations/Standard/BubbleChartDataSet.swift b/Source/Charts/Data/Implementations/Standard/BubbleChartDataSet.swift index 775fafb8bd..02bdc399d0 100644 --- a/Source/Charts/Data/Implementations/Standard/BubbleChartDataSet.swift +++ b/Source/Charts/Data/Implementations/Standard/BubbleChartDataSet.swift @@ -13,7 +13,7 @@ import Foundation import CoreGraphics -open class BubbleChartDataSet: BarLineScatterCandleBubbleChartDataSet, IBubbleChartDataSet +open class BubbleChartDataSet: BarLineScatterCandleBubbleChartDataSet, BubbleChartDataSetProtocol { // MARK: - Data functions and accessors @@ -30,12 +30,7 @@ open class BubbleChartDataSet: BarLineScatterCandleBubbleChartDataSet, IBubbleCh super.calcMinMax(entry: e) - let size = e.size - - if size > _maxSize - { - _maxSize = size - } + _maxSize = Swift.max(e.size, maxSize) } // MARK: - Styling functions and accessors diff --git a/Source/Charts/Data/Implementations/Standard/CandleChartData.swift b/Source/Charts/Data/Implementations/Standard/CandleChartData.swift index 5158668ad9..3cfe5bac35 100644 --- a/Source/Charts/Data/Implementations/Standard/CandleChartData.swift +++ b/Source/Charts/Data/Implementations/Standard/CandleChartData.swift @@ -13,13 +13,18 @@ import Foundation open class CandleChartData: BarLineScatterCandleBubbleChartData { - public override init() + public required init() { super.init() } - public override init(dataSets: [IChartDataSet]?) + public override init(dataSets: [ChartDataSetProtocol]) { super.init(dataSets: dataSets) } + + public required init(arrayLiteral elements: ChartDataSetProtocol...) + { + super.init(dataSets: elements) + } } diff --git a/Source/Charts/Data/Implementations/Standard/CandleChartDataSet.swift b/Source/Charts/Data/Implementations/Standard/CandleChartDataSet.swift index 1c51da7d26..a860a3b91f 100644 --- a/Source/Charts/Data/Implementations/Standard/CandleChartDataSet.swift +++ b/Source/Charts/Data/Implementations/Standard/CandleChartDataSet.swift @@ -13,7 +13,7 @@ import Foundation import CoreGraphics -open class CandleChartDataSet: LineScatterCandleRadarChartDataSet, ICandleChartDataSet +open class CandleChartDataSet: LineScatterCandleRadarChartDataSet, CandleChartDataSetProtocol { public required init() @@ -21,7 +21,7 @@ open class CandleChartDataSet: LineScatterCandleRadarChartDataSet, ICandleChartD super.init() } - public override init(entries: [ChartDataEntry]?, label: String?) + public override init(entries: [ChartDataEntry], label: String) { super.init(entries: entries, label: label) } @@ -32,17 +32,10 @@ open class CandleChartDataSet: LineScatterCandleRadarChartDataSet, ICandleChartD { guard let e = e as? CandleChartDataEntry else { return } - - if e.low < _yMin - { - _yMin = e.low - } - - if e.high > _yMax - { - _yMax = e.high - } - + + _yMin = Swift.min(e.low, _yMin) + _yMax = Swift.max(e.high, _yMax) + calcMinMaxX(entry: e) } @@ -50,24 +43,12 @@ open class CandleChartDataSet: LineScatterCandleRadarChartDataSet, ICandleChartD { guard let e = e as? CandleChartDataEntry else { return } - - if e.high < _yMin - { - _yMin = e.high - } - if e.high > _yMax - { - _yMax = e.high - } - - if e.low < _yMin - { - _yMin = e.low - } - if e.low > _yMax - { - _yMax = e.low - } + + _yMin = Swift.min(e.low, _yMin) + _yMax = Swift.max(e.high, _yMin) + + _yMin = Swift.min(e.low, _yMax) + _yMax = Swift.max(e.high, _yMax) } // MARK: - Styling functions and accessors @@ -75,8 +56,8 @@ open class CandleChartDataSet: LineScatterCandleRadarChartDataSet, ICandleChartD /// the space between the candle entries /// /// **default**: 0.1 (10%) - private var _barSpace = CGFloat(0.1) - + private var _barSpace: CGFloat = 0.1 + /// the space that is left out on the left and right side of each candle, /// **default**: 0.1 (10%), max 0.45, min 0.0 open var barSpace: CGFloat diff --git a/Source/Charts/Data/Implementations/Standard/ChartData.swift b/Source/Charts/Data/Implementations/Standard/ChartData.swift index f4699ef702..e5e22d0ac2 100644 --- a/Source/Charts/Data/Implementations/Standard/ChartData.swift +++ b/Source/Charts/Data/Implementations/Standard/ChartData.swift @@ -11,45 +11,58 @@ import Foundation -open class ChartData: NSObject +open class ChartData: NSObject, ExpressibleByArrayLiteral { - internal var _yMax: Double = -Double.greatestFiniteMagnitude - internal var _yMin: Double = Double.greatestFiniteMagnitude - internal var _xMax: Double = -Double.greatestFiniteMagnitude - internal var _xMin: Double = Double.greatestFiniteMagnitude - internal var _leftAxisMax: Double = -Double.greatestFiniteMagnitude - internal var _leftAxisMin: Double = Double.greatestFiniteMagnitude - internal var _rightAxisMax: Double = -Double.greatestFiniteMagnitude - internal var _rightAxisMin: Double = Double.greatestFiniteMagnitude + + @objc public internal(set) var xMax = -Double.greatestFiniteMagnitude + @objc public internal(set) var xMin = Double.greatestFiniteMagnitude + @objc public internal(set) var yMax = -Double.greatestFiniteMagnitude + @objc public internal(set) var yMin = Double.greatestFiniteMagnitude + var leftAxisMax = -Double.greatestFiniteMagnitude + var leftAxisMin = Double.greatestFiniteMagnitude + var rightAxisMax = -Double.greatestFiniteMagnitude + var rightAxisMin = Double.greatestFiniteMagnitude + + // MARK: - Accessibility + + /// When the data entry labels are generated identifiers, set this property to prepend a string before each identifier + /// + /// For example, if a label is "#3", settings this property to "Item" allows it to be spoken as "Item #3" + @objc open var accessibilityEntryLabelPrefix: String? + + /// When the data entry value requires a unit, use this property to append the string representation of the unit to the value + /// + /// For example, if a value is "44.1", setting this property to "m" allows it to be spoken as "44.1 m" + @objc open var accessibilityEntryLabelSuffix: String? - internal var _dataSets = [IChartDataSet]() + /// If the data entry value is a count, set this to true to allow plurals and other grammatical changes + /// **default**: false + @objc open var accessibilityEntryLabelSuffixIsCount: Bool = false - public override init() + var _dataSets = [Element]() + + public override required init() { super.init() - - _dataSets = [IChartDataSet]() } - - @objc public init(dataSets: [IChartDataSet]?) + + public required init(arrayLiteral elements: Element...) { super.init() - - _dataSets = dataSets ?? [IChartDataSet]() - - self.initialize(dataSets: _dataSets) + self.dataSets = elements } - - @objc public convenience init(dataSet: IChartDataSet?) + + @objc public init(dataSets: [Element]) { - self.init(dataSets: dataSet === nil ? nil : [dataSet!]) + super.init() + self.dataSets = dataSets } - internal func initialize(dataSets: [IChartDataSet]) + @objc public convenience init(dataSet: Element) { - notifyDataChanged() + self.init(dataSets: [dataSet]) } - + /// Call this method to let the ChartData know that the underlying data has changed. /// Calling this performs all necessary recalculations needed when the contained data has changed. @objc open func notifyDataChanged() @@ -59,7 +72,8 @@ open class ChartData: NSObject @objc open func calcMinMaxY(fromX: Double, toX: Double) { - _dataSets.forEach { $0.calcMinMaxY(fromX: fromX, toX: toX) } + forEach { $0.calcMinMaxY(fromX: fromX, toX: toX) } + // apply the new data calcMinMax() } @@ -67,39 +81,35 @@ open class ChartData: NSObject /// calc minimum and maximum y value over all datasets @objc open func calcMinMax() { - _yMax = -Double.greatestFiniteMagnitude - _yMin = Double.greatestFiniteMagnitude - _xMax = -Double.greatestFiniteMagnitude - _xMin = Double.greatestFiniteMagnitude - - _dataSets.forEach { calcMinMax(dataSet: $0) } - - _leftAxisMax = -Double.greatestFiniteMagnitude - _leftAxisMin = Double.greatestFiniteMagnitude - _rightAxisMax = -Double.greatestFiniteMagnitude - _rightAxisMin = Double.greatestFiniteMagnitude - + leftAxisMax = -.greatestFiniteMagnitude + leftAxisMin = .greatestFiniteMagnitude + rightAxisMax = -.greatestFiniteMagnitude + rightAxisMin = .greatestFiniteMagnitude + yMax = -.greatestFiniteMagnitude + yMin = .greatestFiniteMagnitude + xMax = -.greatestFiniteMagnitude + xMin = .greatestFiniteMagnitude + + forEach { calcMinMax(dataSet: $0) } + // left axis let firstLeft = getFirstLeft(dataSets: dataSets) if firstLeft !== nil { - _leftAxisMax = firstLeft!.yMax - _leftAxisMin = firstLeft!.yMin - - for dataSet in _dataSets + leftAxisMax = firstLeft!.yMax + leftAxisMin = firstLeft!.yMin + + for dataSet in _dataSets where dataSet.axisDependency == .left { - if dataSet.axisDependency == .left + if dataSet.yMin < leftAxisMin { - if dataSet.yMin < _leftAxisMin - { - _leftAxisMin = dataSet.yMin - } - - if dataSet.yMax > _leftAxisMax - { - _leftAxisMax = dataSet.yMax - } + leftAxisMin = dataSet.yMin + } + + if dataSet.yMax > leftAxisMax + { + leftAxisMax = dataSet.yMax } } } @@ -109,220 +119,126 @@ open class ChartData: NSObject if firstRight !== nil { - _rightAxisMax = firstRight!.yMax - _rightAxisMin = firstRight!.yMin + rightAxisMax = firstRight!.yMax + rightAxisMin = firstRight!.yMin - for dataSet in _dataSets + for dataSet in _dataSets where dataSet.axisDependency == .right { - if dataSet.axisDependency == .right + if dataSet.yMin < rightAxisMin { - if dataSet.yMin < _rightAxisMin - { - _rightAxisMin = dataSet.yMin - } - - if dataSet.yMax > _rightAxisMax - { - _rightAxisMax = dataSet.yMax - } + rightAxisMin = dataSet.yMin + } + + if dataSet.yMax > rightAxisMax + { + rightAxisMax = dataSet.yMax } } } } - + /// Adjusts the current minimum and maximum values based on the provided Entry object. @objc open func calcMinMax(entry e: ChartDataEntry, axis: YAxis.AxisDependency) { - if _yMax < e.y - { - _yMax = e.y - } - - if _yMin > e.y - { - _yMin = e.y - } - - if _xMax < e.x - { - _xMax = e.x - } - - if _xMin > e.x - { - _xMin = e.x - } - - if axis == .left - { - if _leftAxisMax < e.y - { - _leftAxisMax = e.y - } - - if _leftAxisMin > e.y - { - _leftAxisMin = e.y - } - } - else + xMax = Swift.max(xMax, e.x) + xMin = Swift.min(xMin, e.x) + yMax = Swift.max(yMax, e.y) + yMin = Swift.min(yMin, e.y) + + switch axis { - if _rightAxisMax < e.y - { - _rightAxisMax = e.y - } - - if _rightAxisMin > e.y - { - _rightAxisMin = e.y - } + case .left: + leftAxisMax = Swift.max(leftAxisMax, e.y) + leftAxisMin = Swift.min(leftAxisMin, e.y) + + case .right: + rightAxisMax = Swift.max(rightAxisMax, e.y) + rightAxisMin = Swift.min(rightAxisMin, e.y) } } /// Adjusts the minimum and maximum values based on the given DataSet. - @objc open func calcMinMax(dataSet d: IChartDataSet) + @objc open func calcMinMax(dataSet d: Element) { - if _yMax < d.yMax - { - _yMax = d.yMax - } - - if _yMin > d.yMin - { - _yMin = d.yMin - } - - if _xMax < d.xMax - { - _xMax = d.xMax - } - - if _xMin > d.xMin - { - _xMin = d.xMin - } - - if d.axisDependency == .left - { - if _leftAxisMax < d.yMax - { - _leftAxisMax = d.yMax - } - - if _leftAxisMin > d.yMin - { - _leftAxisMin = d.yMin - } - } - else + xMax = Swift.max(xMax, d.xMax) + xMin = Swift.min(xMin, d.xMin) + yMax = Swift.max(yMax, d.yMax) + yMin = Swift.min(yMin, d.yMin) + + switch d.axisDependency { - if _rightAxisMax < d.yMax - { - _rightAxisMax = d.yMax - } - - if _rightAxisMin > d.yMin - { - _rightAxisMin = d.yMin - } + case .left: + leftAxisMax = Swift.max(leftAxisMax, d.yMax) + leftAxisMin = Swift.min(leftAxisMin, d.yMin) + + case .right: + rightAxisMax = Swift.max(rightAxisMax, d.yMax) + rightAxisMin = Swift.min(rightAxisMin, d.yMin) } } /// The number of LineDataSets this object contains + // exists only for objc compatibility @objc open var dataSetCount: Int { - return _dataSets.count - } - - /// The smallest y-value the data object contains. - @objc open var yMin: Double - { - return _yMin - } - - @nonobjc - open func getYMin() -> Double - { - return _yMin + return dataSets.count } - + @objc open func getYMin(axis: YAxis.AxisDependency) -> Double { - if axis == .left + // TODO: Why does it make sense to return the other axisMin if there is none for the one requested? + switch axis { - if _leftAxisMin == Double.greatestFiniteMagnitude + case .left: + if leftAxisMin == .greatestFiniteMagnitude { - return _rightAxisMin + return rightAxisMin } else { - return _leftAxisMin + return leftAxisMin } - } - else - { - if _rightAxisMin == Double.greatestFiniteMagnitude + + case .right: + if rightAxisMin == .greatestFiniteMagnitude { - return _leftAxisMin + return leftAxisMin } else { - return _rightAxisMin + return rightAxisMin } } } - /// The greatest y-value the data object contains. - @objc open var yMax: Double - { - return _yMax - } - - @nonobjc - open func getYMax() -> Double - { - return _yMax - } - @objc open func getYMax(axis: YAxis.AxisDependency) -> Double { if axis == .left { - if _leftAxisMax == -Double.greatestFiniteMagnitude + if leftAxisMax == -.greatestFiniteMagnitude { - return _rightAxisMax + return rightAxisMax } else { - return _leftAxisMax + return leftAxisMax } } else { - if _rightAxisMax == -Double.greatestFiniteMagnitude + if rightAxisMax == -.greatestFiniteMagnitude { - return _leftAxisMax + return leftAxisMax } else { - return _rightAxisMax + return rightAxisMax } } } - /// The minimum x-value the data object contains. - @objc open var xMin: Double - { - return _xMin - } - /// The maximum x-value the data object contains. - @objc open var xMax: Double - { - return _xMax - } - /// All DataSet objects this ChartData object holds. - @objc open var dataSets: [IChartDataSet] + @objc open var dataSets: [Element] { get { @@ -334,46 +250,16 @@ open class ChartData: NSObject notifyDataChanged() } } - - /// Retrieve the index of a ChartDataSet with a specific label from the ChartData. Search can be case sensitive or not. - /// - /// **IMPORTANT: This method does calculations at runtime, do not over-use in performance critical situations.** - /// - /// - Parameters: - /// - dataSets: the DataSet array to search - /// - type: - /// - ignorecase: if true, the search is not case-sensitive - /// - Returns: The index of the DataSet Object with the given label. Sensitive or not. - internal func getDataSetIndexByLabel(_ label: String, ignorecase: Bool) -> Int - { - // TODO: Return nil instead of -1 - if ignorecase - { - return dataSets.firstIndex { $0.label?.caseInsensitiveCompare(label) == .orderedSame } - ?? -1 - } - else - { - return dataSets.firstIndex { $0.label == label } - ?? -1 - } - } /// Get the Entry for a corresponding highlight object /// /// - Parameters: /// - highlight: /// - Returns: The entry that is highlighted - @objc open func entryForHighlight(_ highlight: Highlight) -> ChartDataEntry? + @objc open func entry(for highlight: Highlight) -> ChartDataEntry? { - if highlight.dataSetIndex >= dataSets.count - { - return nil - } - else - { - return dataSets[highlight.dataSetIndex].entryForXValue(highlight.x, closestToY: highlight.y) - } + guard highlight.dataSetIndex < dataSets.endIndex else { return nil } + return self[highlight.dataSetIndex].entryForXValue(highlight.x, closestToY: highlight.y) } /// **IMPORTANT: This method does calculations at runtime. Use with care in performance critical situations.** @@ -382,93 +268,49 @@ open class ChartData: NSObject /// - label: /// - ignorecase: /// - Returns: The DataSet Object with the given label. Sensitive or not. - @objc open func getDataSetByLabel(_ label: String, ignorecase: Bool) -> IChartDataSet? - { - let index = getDataSetIndexByLabel(label, ignorecase: ignorecase) - - if index < 0 || index >= _dataSets.count - { - return nil - } - else - { - return _dataSets[index] - } - } - - @objc open func getDataSetByIndex(_ index: Int) -> IChartDataSet! + @objc open func dataSet(forLabel label: String, ignorecase: Bool) -> Element? { - if index < 0 || index >= _dataSets.count - { - return nil - } - - return _dataSets[index] + guard let index = index(forLabel: label, ignoreCase: ignorecase) else { return nil } + return self[index] } - @objc open func addDataSet(_ dataSet: IChartDataSet!) + @objc(dataSetAtIndex:) + open func dataSet(at index: Index) -> Element? { - calcMinMax(dataSet: dataSet) - - _dataSets.append(dataSet) + guard dataSets.indices.contains(index) else { return nil } + return self[index] } - + /// Removes the given DataSet from this data object. /// Also recalculates all minimum and maximum values. /// /// - Returns: `true` if a DataSet was removed, `false` ifno DataSet could be removed. - @objc @discardableResult open func removeDataSet(_ dataSet: IChartDataSet) -> Bool + @objc @discardableResult open func removeDataSet(_ dataSet: Element) -> Element? { - guard let i = _dataSets.firstIndex(where: { $0 === dataSet }) else { return false } - return removeDataSetByIndex(i) + guard let index = firstIndex(where: { $0 === dataSet }) else { return nil } + return remove(at: index) } - - /// Removes the DataSet at the given index in the DataSet array from the data object. - /// Also recalculates all minimum and maximum values. - /// - /// - Returns: `true` if a DataSet was removed, `false` ifno DataSet could be removed. - @objc @discardableResult open func removeDataSetByIndex(_ index: Int) -> Bool - { - if index >= _dataSets.count || index < 0 - { - return false - } - - _dataSets.remove(at: index) - - calcMinMax() - - return true - } - + /// Adds an Entry to the DataSet at the specified index. Entries are added to the end of the list. - @objc open func addEntry(_ e: ChartDataEntry, dataSetIndex: Int) + @objc(addEntry:dataSetIndex:) + open func appendEntry(_ e: ChartDataEntry, toDataSet dataSetIndex: Index) { - if _dataSets.count > dataSetIndex && dataSetIndex >= 0 - { - let set = _dataSets[dataSetIndex] - - if !set.addEntry(e) { return } - - calcMinMax(entry: e, axis: set.axisDependency) - } - else - { - print("ChartData.addEntry() - Cannot add Entry because dataSetIndex too high or too low.", terminator: "\n") + guard dataSets.indices.contains(dataSetIndex) else { + return print("ChartData.addEntry() - Cannot add Entry because dataSetIndex too high or too low.", terminator: "\n") } + + let set = self[dataSetIndex] + if !set.addEntry(e) { return } + calcMinMax(entry: e, axis: set.axisDependency) } - + /// Removes the given Entry object from the DataSet at the specified index. - @objc @discardableResult open func removeEntry(_ entry: ChartDataEntry, dataSetIndex: Int) -> Bool + @objc @discardableResult open func removeEntry(_ entry: ChartDataEntry, dataSetIndex: Index) -> Bool { - // entry outofbounds - if dataSetIndex >= _dataSets.count - { - return false - } - + guard dataSets.indices.contains(dataSetIndex) else { return false } + // remove the entry from the dataset - let removed = _dataSets[dataSetIndex].removeEntry(entry) + let removed = self[dataSetIndex].removeEntry(entry) if removed { @@ -482,129 +324,251 @@ open class ChartData: NSObject /// specified index. /// /// - Returns: `true` if an entry was removed, `false` ifno Entry was found that meets the specified requirements. - @objc @discardableResult open func removeEntry(xValue: Double, dataSetIndex: Int) -> Bool + @objc @discardableResult open func removeEntry(xValue: Double, dataSetIndex: Index) -> Bool { - if dataSetIndex >= _dataSets.count - { - return false - } - - if let entry = _dataSets[dataSetIndex].entryForXValue(xValue, closestToY: Double.nan) - { - return removeEntry(entry, dataSetIndex: dataSetIndex) - } - - return false + guard + dataSets.indices.contains(dataSetIndex), + let entry = self[dataSetIndex].entryForXValue(xValue, closestToY: .nan) + else { return false } + + return removeEntry(entry, dataSetIndex: dataSetIndex) } /// - Returns: The DataSet that contains the provided Entry, or null, if no DataSet contains this entry. - @objc open func getDataSetForEntry(_ e: ChartDataEntry) -> IChartDataSet? + @objc open func getDataSetForEntry(_ e: ChartDataEntry) -> Element? { - return _dataSets.first { $0.entryForXValue(e.x, closestToY: e.y) === e } + return first { $0.entryForXValue(e.x, closestToY: e.y) === e } } /// - Returns: The index of the provided DataSet in the DataSet array of this data object, or -1 if it does not exist. - @objc open func indexOfDataSet(_ dataSet: IChartDataSet) -> Int + @objc open func index(of dataSet: Element) -> Index { // TODO: Return nil instead of -1 - return _dataSets.firstIndex { $0 === dataSet } ?? -1 + return firstIndex(where: { $0 === dataSet }) ?? -1 } /// - Returns: The first DataSet from the datasets-array that has it's dependency on the left axis. Returns null if no DataSet with left dependency could be found. - @objc open func getFirstLeft(dataSets: [IChartDataSet]) -> IChartDataSet? + @objc open func getFirstLeft(dataSets: [Element]) -> Element? { - return dataSets.first { $0.axisDependency == .left } + return first { $0.axisDependency == .left } } /// - Returns: The first DataSet from the datasets-array that has it's dependency on the right axis. Returns null if no DataSet with right dependency could be found. - @objc open func getFirstRight(dataSets: [IChartDataSet]) -> IChartDataSet? + @objc open func getFirstRight(dataSets: [Element]) -> Element? { - return dataSets.first { $0.axisDependency == .right } + return first { $0.axisDependency == .right } } /// - Returns: All colors used across all DataSet objects this object represents. - @objc open func getColors() -> [NSUIColor]? + @objc open var colors: [NSUIColor] { // TODO: Don't return nil - return _dataSets.flatMap { $0.colors } + return reduce(into: []) { $0 += $1.colors } } - /// Sets a custom IValueFormatter for all DataSets this data object contains. - @objc open func setValueFormatter(_ formatter: IValueFormatter) + /// Sets a custom ValueFormatter for all DataSets this data object contains. + @objc open func setValueFormatter(_ formatter: ValueFormatter) { - dataSets.forEach { $0.valueFormatter = formatter } + forEach { $0.valueFormatter = formatter } } /// Sets the color of the value-text (color in which the value-labels are drawn) for all DataSets this data object contains. @objc open func setValueTextColor(_ color: NSUIColor) { - dataSets.forEach { $0.valueTextColor = color } + forEach { $0.valueTextColor = color } } /// Sets the font for all value-labels for all DataSets this data object contains. @objc open func setValueFont(_ font: NSUIFont) { - dataSets.forEach { $0.valueFont = font } + forEach { $0.valueFont = font } } /// Enables / disables drawing values (value-text) for all DataSets this data object contains. @objc open func setDrawValues(_ enabled: Bool) { - dataSets.forEach { $0.drawValuesEnabled = enabled } + forEach { $0.drawValuesEnabled = enabled } } /// Enables / disables highlighting values for all DataSets this data object contains. /// If set to true, this means that values can be highlighted programmatically or by touch gesture. - @objc open var highlightEnabled: Bool + @objc open var isHighlightEnabled: Bool { - get { return dataSets.allSatisfy { $0.highlightEnabled } } - set { dataSets.forEach { $0.highlightEnabled = newValue } } + get { return allSatisfy { $0.isHighlightEnabled } } + set { forEach { $0.highlightEnabled = newValue } } } - - /// if true, value highlightning is enabled - @objc open var isHighlightEnabled: Bool { return highlightEnabled } - + /// Clears this data object from all DataSets and removes all Entries. /// Don't forget to invalidate the chart after this. @objc open func clearValues() { - dataSets.removeAll(keepingCapacity: false) - notifyDataChanged() + removeAll(keepingCapacity: false) } /// Checks if this data object contains the specified DataSet. /// /// - Returns: `true` if so, `false` ifnot. - @objc open func contains(dataSet: IChartDataSet) -> Bool + @objc open func contains(dataSet: Element) -> Bool { - return dataSets.contains { $0 === dataSet } + return contains { $0 === dataSet } } /// The total entry count across all DataSet objects this data object contains. @objc open var entryCount: Int { - return _dataSets.reduce(0) { $0 + $1.entryCount } + return reduce(0) { return $0 + $1.entryCount } } /// The DataSet object with the maximum number of entries or null if there are no DataSets. - @objc open var maxEntryCountSet: IChartDataSet? + @objc open var maxEntryCountSet: Element? { - return dataSets.max { $0.entryCount < $1.entryCount } + return self.max { $0.entryCount > $1.entryCount } } +} - // MARK: - Accessibility +// MARK: MutableCollection +extension ChartData: MutableCollection +{ + public typealias Index = Int + public typealias Element = ChartDataSetProtocol - /// When the data entry labels are generated identifiers, set this property to prepend a string before each identifier - /// - /// For example, if a label is "#3", settings this property to "Item" allows it to be spoken as "Item #3" - @objc open var accessibilityEntryLabelPrefix: String? + public var startIndex: Index + { + return dataSets.startIndex + } - /// When the data entry value requires a unit, use this property to append the string representation of the unit to the value + public var endIndex: Index + { + return dataSets.endIndex + } + + public func index(after: Index) -> Index + { + return dataSets.index(after: after) + } + + public subscript(position: Index) -> Element + { + get { return dataSets[position] } + set { self._dataSets[position] = newValue } + } +} + +// MARK: RandomAccessCollection +extension ChartData: RandomAccessCollection +{ + public func index(before: Index) -> Index + { + return dataSets.index(before: before) + } +} + +// TODO: Conform when dropping Objective-C support +// MARK: RangeReplaceableCollection +extension ChartData//: RangeReplaceableCollection +{ + @objc(addDataSet:) + public func append(_ newElement: Element) + { + _dataSets.append(newElement) + calcMinMax(dataSet: newElement) + } + + @objc(removeDataSetByIndex:) + public func remove(at position: Index) -> Element + { + let element = _dataSets.remove(at: position) + calcMinMax() + return element + } + + public func removeFirst() -> Element + { + assert(!(self is CombinedChartData), "\(#function) not supported for CombinedData") + + let element = _dataSets.removeFirst() + notifyDataChanged() + return element + } + + public func removeFirst(_ n: Int) + { + assert(!(self is CombinedChartData), "\(#function) not supported for CombinedData") + + _dataSets.removeFirst(n) + notifyDataChanged() + } + + public func removeLast() -> Element + { + assert(!(self is CombinedChartData), "\(#function) not supported for CombinedData") + + let element = _dataSets.removeLast() + notifyDataChanged() + return element + } + + public func removeLast(_ n: Int) + { + assert(!(self is CombinedChartData), "\(#function) not supported for CombinedData") + + _dataSets.removeLast(n) + notifyDataChanged() + } + + public func removeSubrange(_ bounds: R) where R : RangeExpression, Index == R.Bound + { + assert(!(self is CombinedChartData), "\(#function) not supported for CombinedData") + + _dataSets.removeSubrange(bounds) + notifyDataChanged() + } + + public func removeAll(keepingCapacity keepCapacity: Bool) + { + assert(!(self is CombinedChartData), "\(#function) not supported for CombinedData") + + _dataSets.removeAll(keepingCapacity: keepCapacity) + notifyDataChanged() + } + + public func replaceSubrange(_ subrange: Swift.Range, with newElements: C) where C : Collection, Element == C.Element + { + assert(!(self is CombinedChartData), "\(#function) not supported for CombinedData") + + _dataSets.replaceSubrange(subrange, with: newElements) + newElements.forEach { self.calcMinMax(dataSet: $0) } + } +} + +// MARK: Swift Accessors +extension ChartData +{ + /// Retrieve the index of a ChartDataSet with a specific label from the ChartData. Search can be case sensitive or not. + /// **IMPORTANT: This method does calculations at runtime, do not over-use in performance critical situations.** /// - /// For example, if a value is "44.1", setting this property to "m" allows it to be spoken as "44.1 m" - @objc open var accessibilityEntryLabelSuffix: String? + /// - Parameters: + /// - label: The label to search for + /// - ignoreCase: if true, the search is not case-sensitive + /// - Returns: The index of the DataSet Object with the given label. `nil` if not found + public func index(forLabel label: String, ignoreCase: Bool) -> Index? + { + return ignoreCase + ? firstIndex { $0.label?.caseInsensitiveCompare(label) == .orderedSame } + : firstIndex { $0.label == label } + } - /// If the data entry value is a count, set this to true to allow plurals and other grammatical changes - /// **default**: false - @objc open var accessibilityEntryLabelSuffixIsCount: Bool = false + public subscript(label label: String, ignoreCase ignoreCase: Bool) -> Element? + { + guard let index = index(forLabel: label, ignoreCase: ignoreCase) else { return nil } + return self[index] + } + + public subscript(entry entry: ChartDataEntry) -> Element? + { + assert(!(self is CombinedChartData), "\(#function) not supported for CombinedData") + + guard let index = firstIndex(where: { $0.entryForXValue(entry.x, closestToY: entry.y) === entry }) else { return nil } + return self[index] + } } diff --git a/Source/Charts/Data/Implementations/Standard/ChartDataSet.swift b/Source/Charts/Data/Implementations/Standard/ChartDataSet.swift index 9922878da8..703c0abe72 100644 --- a/Source/Charts/Data/Implementations/Standard/ChartDataSet.swift +++ b/Source/Charts/Data/Implementations/Standard/ChartDataSet.swift @@ -9,6 +9,7 @@ // https://github.com/danielgindi/Charts // +import Algorithms import Foundation /// Determines how to round DataSet index values for `ChartDataSet.entryIndex(x, rounding)` when an exact x-value is not found. @@ -27,25 +28,25 @@ open class ChartDataSet: ChartBaseDataSet public required init() { entries = [] - + super.init() } - public override convenience init(label: String?) + public override convenience init(label: String) { - self.init(entries: nil, label: label) + self.init(entries: [], label: label) } - @objc public init(entries: [ChartDataEntry]?, label: String?) + @objc public init(entries: [ChartDataEntry], label: String) { - self.entries = entries ?? [] + self.entries = entries super.init(label: label) self.calcMinMax() } - @objc public convenience init(entries: [ChartDataEntry]?) + @objc public convenience init(entries: [ChartDataEntry]) { self.init(entries: entries, label: "DataSet") } @@ -55,10 +56,6 @@ open class ChartDataSet: ChartBaseDataSet /// - Note: Calls `notifyDataSetChanged()` after setting a new value. /// - Returns: The array of y-values that this DataSet represents. /// the entries that this dataset represents / holds together - @available(*, unavailable, renamed: "entries") - @objc - open var values: [ChartDataEntry] { return entries } - @objc open private(set) var entries: [ChartDataEntry] @@ -104,36 +101,24 @@ open class ChartDataSet: ChartBaseDataSet guard !isEmpty else { return } - let indexFrom = entryIndex(x: fromX, closestToY: Double.nan, rounding: .down) - let indexTo = entryIndex(x: toX, closestToY: Double.nan, rounding: .up) + let indexFrom = entryIndex(x: fromX, closestToY: .nan, rounding: .down) + let indexTo = entryIndex(x: toX, closestToY: .nan, rounding: .up) - guard !(indexTo < indexFrom) else { return } + guard indexTo >= indexFrom else { return } // only recalculate y self[indexFrom...indexTo].forEach(calcMinMaxY) } @objc open func calcMinMaxX(entry e: ChartDataEntry) { - if e.x < _xMin - { - _xMin = e.x - } - if e.x > _xMax - { - _xMax = e.x - } + _xMin = Swift.min(e.x, _xMin) + _xMax = Swift.max(e.x, _xMax) } @objc open func calcMinMaxY(entry e: ChartDataEntry) { - if e.y < _yMin - { - _yMin = e.y - } - if e.y > _yMax - { - _yMax = e.y - } + _yMin = Swift.min(e.y, _yMin) + _yMax = Swift.max(e.y, _yMax) } /// Updates the min and max x and y value of this DataSet based on the given Entry. @@ -147,16 +132,16 @@ open class ChartDataSet: ChartBaseDataSet } /// The minimum y-value this DataSet holds - open override var yMin: Double { return _yMin } + @objc open override var yMin: Double { return _yMin } /// The maximum y-value this DataSet holds - open override var yMax: Double { return _yMax } + @objc open override var yMax: Double { return _yMax } /// The minimum x-value this DataSet holds - open override var xMin: Double { return _xMin } + @objc open override var xMin: Double { return _xMin } /// The maximum x-value this DataSet holds - open override var xMax: Double { return _xMax } + @objc open override var xMax: Double { return _xMax } /// The number of y-values this DataSet represents @available(*, deprecated, message: "Use `count` instead") @@ -168,7 +153,7 @@ open class ChartDataSet: ChartBaseDataSet @available(*, deprecated, message: "Use `subscript(index:)` instead.") open override func entryForIndex(_ i: Int) -> ChartDataEntry? { - guard i >= startIndex, i < endIndex else { + guard indices.contains(i) else { return nil } return self[i] @@ -211,58 +196,10 @@ open class ChartDataSet: ChartBaseDataSet /// An empty array if no Entry object at that index. open override func entriesForXValue(_ xValue: Double) -> [ChartDataEntry] { - var entries = [ChartDataEntry]() - - var low = startIndex - var high = endIndex - 1 - - while low <= high - { - var m = (high + low) / 2 - var entry = self[m] - - // if we have a match - if xValue == entry.x - { - while m > 0 && self[m - 1].x == xValue - { - m -= 1 - } - - high = endIndex - - // loop over all "equal" entries - while m < high - { - entry = self[m] - if entry.x == xValue - { - entries.append(entry) - } - else - { - break - } - - m += 1 - } - - break - } - else - { - if xValue > entry.x - { - low = m + 1 - } - else - { - high = m - 1 - } - } - } - - return entries + let match: (ChartDataEntry) -> Bool = { $0.x == xValue } + let i = partitioningIndex(where: match) + guard i < endIndex else { return [] } + return self[i...].prefix(while: match) } /// - Parameters: @@ -276,98 +213,55 @@ open class ChartDataSet: ChartBaseDataSet closestToY yValue: Double, rounding: ChartDataSetRounding) -> Int { - var low = startIndex - var high = endIndex - 1 - var closest = high - - while low < high - { - let m = (low + high) / 2 - - let d1 = self[m].x - xValue - let d2 = self[m + 1].x - xValue - let ad1 = abs(d1), ad2 = abs(d2) - - if ad2 < ad1 + var closest = partitioningIndex { $0.x >= xValue } + guard closest < endIndex else { return -1 } + + let closestXValue = self[closest].x + + switch rounding { + case .up: + // If rounding up, and found x-value is lower than specified x, and we can go upper... + if closestXValue < xValue && closest < index(before: endIndex) { - // [m + 1] is closer to xValue - // Search in an higher place - low = m + 1 + formIndex(after: &closest) } - else if ad1 < ad2 + + case .down: + // If rounding down, and found x-value is upper than specified x, and we can go lower... + if closestXValue > xValue && closest > startIndex { - // [m] is closer to xValue - // Search in a lower place - high = m + formIndex(before: &closest) } - else - { - // We have multiple sequential x-value with same distance - - if d1 >= 0.0 - { - // Search in a lower place - high = m - } - else if d1 < 0.0 - { - // Search in an higher place - low = m + 1 - } - } - - closest = high + + case .closest: + break } - - if closest != -1 + + // Search by closest to y-value + if !yValue.isNaN { - let closestXValue = self[closest].x - - if rounding == .up - { - // If rounding up, and found x-value is lower than specified x, and we can go upper... - if closestXValue < xValue && closest < endIndex - 1 - { - closest += 1 - } - } - else if rounding == .down + while closest > startIndex && self[index(before: closest)].x == closestXValue { - // If rounding down, and found x-value is upper than specified x, and we can go lower... - if closestXValue > xValue && closest > 0 - { - closest -= 1 - } + formIndex(before: &closest) } - - // Search by closest to y-value - if !yValue.isNaN + + var closestYValue = self[closest].y + var closestYIndex = closest + + while closest < index(before: endIndex) { - while closest > 0 && self[closest - 1].x == closestXValue - { - closest -= 1 - } - - var closestYValue = self[closest].y - var closestYIndex = closest - - while true + formIndex(after: &closest) + let value = self[closest] + + if value.x != closestXValue { break } + if abs(value.y - yValue) <= abs(closestYValue - yValue) { - closest += 1 - if closest >= endIndex { break } - - let value = self[closest] - - if value.x != closestXValue { break } - if abs(value.y - yValue) <= abs(closestYValue - yValue) - { - closestYValue = yValue - closestYIndex = closest - } + closestYValue = yValue + closestYIndex = closest } - - closest = closestYIndex } + + closest = closestYIndex } return closest @@ -376,6 +270,7 @@ open class ChartDataSet: ChartBaseDataSet /// - Parameters: /// - e: the entry to search for /// - Returns: The array-index of the specified entry + // TODO: Should be returning `nil` to follow Swift convention @available(*, deprecated, message: "Use `firstIndex(of:)` or `lastIndex(of:)`") open override func entryIndex(entry e: ChartDataEntry) -> Int { @@ -389,7 +284,8 @@ open class ChartDataSet: ChartBaseDataSet /// - Parameters: /// - e: the entry to add /// - Returns: True - @available(*, deprecated, message: "Use `append(_:)` instead") + // TODO: This should return `Void` to follow Swift convention + @available(*, deprecated, message: "Use `append(_:)` instead", renamed: "append(_:)") open override func addEntry(_ e: ChartDataEntry) -> Bool { append(e) @@ -403,17 +299,15 @@ open class ChartDataSet: ChartBaseDataSet /// - Parameters: /// - e: the entry to add /// - Returns: True + // TODO: This should return `Void` to follow Swift convention open override func addEntryOrdered(_ e: ChartDataEntry) -> Bool { - calcMinMax(entry: e) - if let last = last, last.x > e.x { - var closestIndex = entryIndex(x: e.x, closestToY: e.y, rounding: .up) - while self[closestIndex].x < e.x - { - closestIndex += 1 - } + let startIndex = entryIndex(x: e.x, closestToY: e.y, rounding: .up) + let closestIndex = self[startIndex...].lastIndex { $0.x < e.x } + ?? startIndex + calcMinMax(entry: e) entries.insert(e, at: closestIndex) } else @@ -427,7 +321,7 @@ open class ChartDataSet: ChartBaseDataSet @available(*, renamed: "remove(_:)") open override func removeEntry(_ entry: ChartDataEntry) -> Bool { - return remove(entry) + remove(entry) } /// Removes an Entry from the DataSet dynamically. @@ -446,6 +340,7 @@ open class ChartDataSet: ChartBaseDataSet /// Removes the first Entry (at index 0) of this DataSet from the entries array. /// /// - Returns: `true` if successful, `false` if not. + // TODO: This should return the removed entry to follow Swift convention. @available(*, deprecated, message: "Use `func removeFirst() -> ChartDataEntry` instead.") open override func removeFirst() -> Bool { @@ -456,6 +351,7 @@ open class ChartDataSet: ChartBaseDataSet /// Removes the last Entry (at index size-1) of this DataSet from the entries array. /// /// - Returns: `true` if successful, `false` if not. + // TODO: This should return the removed entry to follow Swift convention. @available(*, deprecated, message: "Use `func removeLast() -> ChartDataEntry` instead.") open override func removeLast() -> Bool { @@ -471,7 +367,7 @@ open class ChartDataSet: ChartBaseDataSet } // MARK: - Data functions and accessors - + // MARK: - NSCopying open override func copy(with zone: NSZone? = nil) -> Any diff --git a/Source/Charts/Data/Implementations/Standard/CombinedChartData.swift b/Source/Charts/Data/Implementations/Standard/CombinedChartData.swift index e883c8b7f3..9659055a41 100644 --- a/Source/Charts/Data/Implementations/Standard/CombinedChartData.swift +++ b/Source/Charts/Data/Implementations/Standard/CombinedChartData.swift @@ -19,15 +19,20 @@ open class CombinedChartData: BarLineScatterCandleBubbleChartData private var _candleData: CandleChartData! private var _bubbleData: BubbleChartData! - public override init() + public required init() { super.init() } - public override init(dataSets: [IChartDataSet]?) + public override init(dataSets: [ChartDataSetProtocol]) { super.init(dataSets: dataSets) } + + public required init(arrayLiteral elements: ChartDataSetProtocol...) + { + super.init(dataSets: elements) + } @objc open var lineData: LineChartData! { @@ -98,15 +103,15 @@ open class CombinedChartData: BarLineScatterCandleBubbleChartData { _dataSets.removeAll() - _yMax = -Double.greatestFiniteMagnitude - _yMin = Double.greatestFiniteMagnitude - _xMax = -Double.greatestFiniteMagnitude - _xMin = Double.greatestFiniteMagnitude + yMax = -Double.greatestFiniteMagnitude + yMin = Double.greatestFiniteMagnitude + xMax = -Double.greatestFiniteMagnitude + xMin = Double.greatestFiniteMagnitude - _leftAxisMax = -Double.greatestFiniteMagnitude - _leftAxisMin = Double.greatestFiniteMagnitude - _rightAxisMax = -Double.greatestFiniteMagnitude - _rightAxisMin = Double.greatestFiniteMagnitude + leftAxisMax = -Double.greatestFiniteMagnitude + leftAxisMin = Double.greatestFiniteMagnitude + rightAxisMax = -Double.greatestFiniteMagnitude + rightAxisMin = Double.greatestFiniteMagnitude let allData = self.allData @@ -114,51 +119,50 @@ open class CombinedChartData: BarLineScatterCandleBubbleChartData { data.calcMinMax() - let sets = data.dataSets - _dataSets.append(contentsOf: sets) + _dataSets.append(contentsOf: data) - if data.yMax > _yMax + if data.yMax > yMax { - _yMax = data.yMax + yMax = data.yMax } - if data.yMin < _yMin + if data.yMin < yMin { - _yMin = data.yMin + yMin = data.yMin } - if data.xMax > _xMax + if data.xMax > xMax { - _xMax = data.xMax + xMax = data.xMax } - if data.xMin < _xMin + if data.xMin < xMin { - _xMin = data.xMin + xMin = data.xMin } - for dataset in sets + for set in data { - if dataset.axisDependency == .left + if set.axisDependency == .left { - if dataset.yMax > _leftAxisMax + if set.yMax > leftAxisMax { - _leftAxisMax = dataset.yMax + leftAxisMax = set.yMax } - if dataset.yMin < _leftAxisMin + if set.yMin < leftAxisMin { - _leftAxisMin = dataset.yMin + leftAxisMin = set.yMin } } else { - if dataset.yMax > _rightAxisMax + if set.yMax > rightAxisMax { - _rightAxisMax = dataset.yMax + rightAxisMax = set.yMax } - if dataset.yMin < _rightAxisMin + if set.yMin < rightAxisMin { - _rightAxisMin = dataset.yMin + rightAxisMin = set.yMin } } } @@ -204,17 +208,19 @@ open class CombinedChartData: BarLineScatterCandleBubbleChartData return allData.firstIndex(of: data) } - open override func removeDataSet(_ dataSet: IChartDataSet) -> Bool + open override func removeDataSet(_ dataSet: ChartDataSetProtocol) -> Element? { - return allData.contains { $0.removeDataSet(dataSet) } - } - - open override func removeDataSetByIndex(_ index: Int) -> Bool - { - print("removeDataSet(index) not supported for CombinedData", terminator: "\n") - return false + for data in allData + { + if let e = data.removeDataSet(dataSet) + { + return e + } + } + + return nil } - + open override func removeEntry(_ entry: ChartDataEntry, dataSetIndex: Int) -> Bool { print("removeEntry(entry, dataSetIndex) not supported for CombinedData", terminator: "\n") @@ -229,27 +235,12 @@ open class CombinedChartData: BarLineScatterCandleBubbleChartData open override func notifyDataChanged() { - if _lineData !== nil - { - _lineData.notifyDataChanged() - } - if _barData !== nil - { - _barData.notifyDataChanged() - } - if _scatterData !== nil - { - _scatterData.notifyDataChanged() - } - if _candleData !== nil - { - _candleData.notifyDataChanged() - } - if _bubbleData !== nil - { - _bubbleData.notifyDataChanged() - } - + _lineData?.notifyDataChanged() + _barData?.notifyDataChanged() + _scatterData?.notifyDataChanged() + _candleData?.notifyDataChanged() + _bubbleData?.notifyDataChanged() + super.notifyDataChanged() // recalculate everything } @@ -258,23 +249,12 @@ open class CombinedChartData: BarLineScatterCandleBubbleChartData /// - Parameters: /// - highlight: /// - Returns: The entry that is highlighted - open override func entryForHighlight(_ highlight: Highlight) -> ChartDataEntry? + @objc override open func entry(for highlight: Highlight) -> ChartDataEntry? { - if highlight.dataIndex >= allData.count - { - return nil - } - - let data = dataByIndex(highlight.dataIndex) - - if highlight.dataSetIndex >= data.dataSetCount - { - return nil - } - // The value of the highlighted entry could be NaN - if we are not interested in highlighting a specific value. - let entries = data.getDataSetByIndex(highlight.dataSetIndex).entriesForXValue(highlight.x) - return entries.first { $0.y == highlight.y || highlight.y.isNaN } + getDataSetByHighlight(highlight)? + .entriesForXValue(highlight.x) + .first { $0.y == highlight.y || highlight.y.isNaN } } /// Get dataset for highlight @@ -282,20 +262,31 @@ open class CombinedChartData: BarLineScatterCandleBubbleChartData /// - Parameters: /// - highlight: current highlight /// - Returns: dataset related to highlight - @objc open func getDataSetByHighlight(_ highlight: Highlight) -> IChartDataSet! - { - if highlight.dataIndex >= allData.count + @objc open func getDataSetByHighlight(_ highlight: Highlight) -> ChartDataSetProtocol! + { + guard allData.indices.contains(highlight.dataIndex) else { return nil } - + let data = dataByIndex(highlight.dataIndex) - - if highlight.dataSetIndex >= data.dataSetCount + + guard data.indices.contains(highlight.dataSetIndex) else { return nil } - - return data.dataSets[highlight.dataSetIndex] + + // The value of the highlighted entry could be NaN - if we are not interested in highlighting a specific value. + return data[highlight.dataSetIndex] + } + + // MARK: Unsupported Collection Methods + + public override func append(_ newElement: ChartData.Element) { + fatalError("append(_:) not supported for CombinedData") + } + + public override func remove(at i: Int) -> ChartDataSetProtocol { + fatalError("remove(at:) not supported for CombinedData") } } diff --git a/Source/Charts/Data/Implementations/Standard/LineChartData.swift b/Source/Charts/Data/Implementations/Standard/LineChartData.swift index 2ebd6b42a9..fe3eb92862 100644 --- a/Source/Charts/Data/Implementations/Standard/LineChartData.swift +++ b/Source/Charts/Data/Implementations/Standard/LineChartData.swift @@ -14,13 +14,18 @@ import Foundation /// Data object that encapsulates all data associated with a LineChart. open class LineChartData: ChartData { - public override init() + public required init() { super.init() } - public override init(dataSets: [IChartDataSet]?) + public override init(dataSets: [ChartDataSetProtocol]) { super.init(dataSets: dataSets) } + + public required init(arrayLiteral elements: ChartDataSetProtocol...) + { + super.init(dataSets: elements) + } } diff --git a/Source/Charts/Data/Implementations/Standard/LineChartDataSet.swift b/Source/Charts/Data/Implementations/Standard/LineChartDataSet.swift index d47623fbaf..fdfb856c3a 100644 --- a/Source/Charts/Data/Implementations/Standard/LineChartDataSet.swift +++ b/Source/Charts/Data/Implementations/Standard/LineChartDataSet.swift @@ -13,7 +13,7 @@ import Foundation import CoreGraphics -open class LineChartDataSet: LineRadarChartDataSet, ILineChartDataSet +open class LineChartDataSet: LineRadarChartDataSet, LineChartDataSetProtocol { @objc(LineChartMode) public enum Mode: Int @@ -36,7 +36,7 @@ open class LineChartDataSet: LineRadarChartDataSet, ILineChartDataSet initialize() } - public override init(entries: [ChartDataEntry]?, label: String?) + public override init(entries: [ChartDataEntry], label: String) { super.init(entries: entries, label: label) initialize() @@ -67,7 +67,11 @@ open class LineChartDataSet: LineRadarChartDataSet, ILineChartDataSet _cubicIntensity = newValue.clamped(to: 0.05...1) } } - + + open var isDrawLineWithGradientEnabled = false + + open var gradientPositions: [CGFloat]? + /// The radius of the drawn circles. open var circleRadius = CGFloat(8.0) @@ -155,10 +159,10 @@ open class LineChartDataSet: LineRadarChartDataSet, ILineChartDataSet open var lineCapType = CGLineCap.butt /// formatter for customizing the position of the fill-line - private var _fillFormatter: IFillFormatter = DefaultFillFormatter() + private var _fillFormatter: FillFormatter = DefaultFillFormatter() - /// Sets a custom IFillFormatter to the chart that handles the position of the filled-line for each DataSet. Set this to null to use the default logic. - open var fillFormatter: IFillFormatter? + /// Sets a custom FillFormatterProtocol to the chart that handles the position of the filled-line for each DataSet. Set this to null to use the default logic. + open var fillFormatter: FillFormatter? { get { diff --git a/Source/Charts/Data/Implementations/Standard/LineRadarChartDataSet.swift b/Source/Charts/Data/Implementations/Standard/LineRadarChartDataSet.swift index 54a3af6929..91ad13e4ba 100644 --- a/Source/Charts/Data/Implementations/Standard/LineRadarChartDataSet.swift +++ b/Source/Charts/Data/Implementations/Standard/LineRadarChartDataSet.swift @@ -13,7 +13,7 @@ import Foundation import CoreGraphics -open class LineRadarChartDataSet: LineScatterCandleRadarChartDataSet, ILineRadarChartDataSet +open class LineRadarChartDataSet: LineScatterCandleRadarChartDataSet, LineRadarChartDataSetProtocol { // MARK: - Data functions and accessors diff --git a/Source/Charts/Data/Implementations/Standard/LineScatterCandleRadarChartDataSet.swift b/Source/Charts/Data/Implementations/Standard/LineScatterCandleRadarChartDataSet.swift index 1c68983bbc..1392cd2465 100644 --- a/Source/Charts/Data/Implementations/Standard/LineScatterCandleRadarChartDataSet.swift +++ b/Source/Charts/Data/Implementations/Standard/LineScatterCandleRadarChartDataSet.swift @@ -12,7 +12,7 @@ import Foundation -open class LineScatterCandleRadarChartDataSet: BarLineScatterCandleBubbleChartDataSet, ILineScatterCandleRadarChartDataSet +open class LineScatterCandleRadarChartDataSet: BarLineScatterCandleBubbleChartDataSet, LineScatterCandleRadarChartDataSetProtocol { // MARK: - Data functions and accessors diff --git a/Source/Charts/Data/Implementations/Standard/PieChartData.swift b/Source/Charts/Data/Implementations/Standard/PieChartData.swift index 7f34383517..accda2ed89 100644 --- a/Source/Charts/Data/Implementations/Standard/PieChartData.swift +++ b/Source/Charts/Data/Implementations/Standard/PieChartData.swift @@ -13,41 +13,32 @@ import Foundation open class PieChartData: ChartData { - public override init() + public required init() { super.init() } - public override init(dataSets: [IChartDataSet]?) + public override init(dataSets: [ChartDataSetProtocol]) { super.init(dataSets: dataSets) } - /// All DataSet objects this ChartData object holds. - @objc open override var dataSets: [IChartDataSet] + public required init(arrayLiteral elements: ChartDataSetProtocol...) { - get - { - assert(super.dataSets.count <= 1, "Found multiple data sets while pie chart only allows one") - return super.dataSets - } - set - { - super.dataSets = newValue - } + super.init(dataSets: elements) } - @objc var dataSet: IPieChartDataSet? + @objc public var dataSet: PieChartDataSetProtocol? { get { - return dataSets.count > 0 ? dataSets[0] as? IPieChartDataSet : nil + return dataSets.first as? PieChartDataSetProtocol } set { - if let newValue = newValue + if let set = newValue { - dataSets = [newValue] + dataSets = [set] } else { @@ -55,19 +46,30 @@ open class PieChartData: ChartData } } } - - open override func getDataSetByIndex(_ index: Int) -> IChartDataSet? + + /// - returns: All up to one dataSet object this ChartData object holds. + @objc open override var dataSets: [ChartDataSetProtocol] { - if index != 0 + get { - return nil + assert(super.dataSets.count <= 1, "Found multiple data sets while pie chart only allows one") + return super.dataSets + } + set + { + super.dataSets = newValue } - return super.getDataSetByIndex(index) } - open override func getDataSetByLabel(_ label: String, ignorecase: Bool) -> IChartDataSet? + open override func dataSet(at index: ChartData.Index) -> ChartData.Element? { - if dataSets.count == 0 || dataSets[0].label == nil + guard index == 0 else { return nil } + return self[index] + } + + open override func dataSet(forLabel label: String, ignorecase: Bool) -> ChartDataSetProtocol? + { + if dataSets.first?.label == nil { return nil } @@ -89,30 +91,11 @@ open class PieChartData: ChartData return nil } - open override func entryForHighlight(_ highlight: Highlight) -> ChartDataEntry? + @objc override open func entry(for highlight: Highlight) -> ChartDataEntry? { return dataSet?.entryForIndex(Int(highlight.x)) } - open override func addDataSet(_ d: IChartDataSet!) - { - super.addDataSet(d) - } - - /// Removes the DataSet at the given index in the DataSet array from the data object. - /// Also recalculates all minimum and maximum values. - /// - /// - Returns: `true` if a DataSet was removed, `false` ifno DataSet could be removed. - open override func removeDataSetByIndex(_ index: Int) -> Bool - { - if index >= _dataSets.count || index < 0 - { - return false - } - - return false - } - /// The total y-value sum across all DataSet objects the this object represents. @objc open var yValueSum: Double { diff --git a/Source/Charts/Data/Implementations/Standard/PieChartDataSet.swift b/Source/Charts/Data/Implementations/Standard/PieChartDataSet.swift index ac0e63489a..07287ad06f 100644 --- a/Source/Charts/Data/Implementations/Standard/PieChartDataSet.swift +++ b/Source/Charts/Data/Implementations/Standard/PieChartDataSet.swift @@ -12,7 +12,7 @@ import Foundation import CoreGraphics -open class PieChartDataSet: ChartDataSet, IPieChartDataSet +open class PieChartDataSet: ChartDataSet, PieChartDataSetProtocol { @objc(PieChartValuePosition) public enum ValuePosition: Int @@ -33,7 +33,7 @@ open class PieChartDataSet: ChartDataSet, IPieChartDataSet initialize() } - public override init(entries: [ChartDataEntry]?, label: String?) + public override init(entries: [ChartDataEntry], label: String) { super.init(entries: entries, label: label) initialize() @@ -59,16 +59,11 @@ open class PieChartDataSet: ChartDataSet, IPieChartDataSet } set { - var space = newValue - if space > 20.0 - { - space = 20.0 + switch newValue { + case ..<0.0: _sliceSpace = 0.0 + case 20.0...: _sliceSpace = 20.0 + default: _sliceSpace = newValue } - if space < 0.0 - { - space = 0.0 - } - _sliceSpace = space } } diff --git a/Source/Charts/Data/Implementations/Standard/RadarChartData.swift b/Source/Charts/Data/Implementations/Standard/RadarChartData.swift index 31fd7d2ba0..2f8a2db7ae 100644 --- a/Source/Charts/Data/Implementations/Standard/RadarChartData.swift +++ b/Source/Charts/Data/Implementations/Standard/RadarChartData.swift @@ -29,18 +29,23 @@ open class RadarChartData: ChartData self.labels = labels } - public override init() + public required init() { super.init() } - public override init(dataSets: [IChartDataSet]?) + public override init(dataSets: [ChartDataSetProtocol]) { super.init(dataSets: dataSets) } - - open override func entryForHighlight(_ highlight: Highlight) -> ChartDataEntry? + + public required init(arrayLiteral elements: ChartDataSetProtocol...) + { + super.init(dataSets: elements) + } + + @objc open override func entry(for highlight: Highlight) -> ChartDataEntry? { - return getDataSetByIndex(highlight.dataSetIndex)?.entryForIndex(Int(highlight.x)) + return self[highlight.dataSetIndex].entryForIndex(Int(highlight.x)) } } diff --git a/Source/Charts/Data/Implementations/Standard/RadarChartDataSet.swift b/Source/Charts/Data/Implementations/Standard/RadarChartDataSet.swift index 030269d6a2..9b859d144f 100644 --- a/Source/Charts/Data/Implementations/Standard/RadarChartDataSet.swift +++ b/Source/Charts/Data/Implementations/Standard/RadarChartDataSet.swift @@ -13,7 +13,7 @@ import Foundation import CoreGraphics -open class RadarChartDataSet: LineRadarChartDataSet, IRadarChartDataSet +open class RadarChartDataSet: LineRadarChartDataSet, RadarChartDataSetProtocol { private func initialize() { @@ -26,7 +26,7 @@ open class RadarChartDataSet: LineRadarChartDataSet, IRadarChartDataSet initialize() } - public required override init(entries: [ChartDataEntry]?, label: String?) + public required override init(entries: [ChartDataEntry], label: String) { super.init(entries: entries, label: label) initialize() diff --git a/Source/Charts/Data/Implementations/Standard/ScatterChartData.swift b/Source/Charts/Data/Implementations/Standard/ScatterChartData.swift index e06a60325d..49b1e89bbe 100644 --- a/Source/Charts/Data/Implementations/Standard/ScatterChartData.swift +++ b/Source/Charts/Data/Implementations/Standard/ScatterChartData.swift @@ -14,20 +14,25 @@ import CoreGraphics open class ScatterChartData: BarLineScatterCandleBubbleChartData { - public override init() + public required init() { super.init() } - public override init(dataSets: [IChartDataSet]?) + public override init(dataSets: [ChartDataSetProtocol]) { super.init(dataSets: dataSets) } + + public required init(arrayLiteral elements: ChartDataSetProtocol...) + { + super.init(dataSets: elements) + } /// - Returns: The maximum shape-size across all DataSets. @objc open func getGreatestShapeSize() -> CGFloat { - return (_dataSets as? [IScatterChartDataSet])? + return (_dataSets as? [ScatterChartDataSetProtocol])? .max { $0.scatterShapeSize < $1.scatterShapeSize }? .scatterShapeSize ?? 0 } diff --git a/Source/Charts/Data/Implementations/Standard/ScatterChartDataSet.swift b/Source/Charts/Data/Implementations/Standard/ScatterChartDataSet.swift index bc9767a06c..161deb2f93 100644 --- a/Source/Charts/Data/Implementations/Standard/ScatterChartDataSet.swift +++ b/Source/Charts/Data/Implementations/Standard/ScatterChartDataSet.swift @@ -12,7 +12,7 @@ import Foundation import CoreGraphics -open class ScatterChartDataSet: LineScatterCandleRadarChartDataSet, IScatterChartDataSet +open class ScatterChartDataSet: LineScatterCandleRadarChartDataSet, ScatterChartDataSetProtocol { @objc(ScatterShape) @@ -39,7 +39,7 @@ open class ScatterChartDataSet: LineScatterCandleRadarChartDataSet, IScatterChar open var scatterShapeHoleColor: NSUIColor? = nil /// Sets the ScatterShape this DataSet should be drawn with. - /// This will search for an available IShapeRenderer and set this renderer for the DataSet + /// This will search for an available ShapeRenderer and set this renderer for the DataSet @objc open func setScatterShape(_ shape: Shape) { self.shapeRenderer = ScatterChartDataSet.renderer(forShape: shape) @@ -48,9 +48,9 @@ open class ScatterChartDataSet: LineScatterCandleRadarChartDataSet, IScatterChar /// The IShapeRenderer responsible for rendering this DataSet. /// This can also be used to set a custom IShapeRenderer aside from the default ones. /// **default**: `SquareShapeRenderer` - open var shapeRenderer: IShapeRenderer? = SquareShapeRenderer() + open var shapeRenderer: ShapeRenderer? = SquareShapeRenderer() - @objc open class func renderer(forShape shape: Shape) -> IShapeRenderer + @objc open class func renderer(forShape shape: Shape) -> ShapeRenderer { switch shape { diff --git a/Source/Charts/Data/Interfaces/IBarChartDataSet.swift b/Source/Charts/Data/Interfaces/BarChartDataSetProtocol.swift similarity index 91% rename from Source/Charts/Data/Interfaces/IBarChartDataSet.swift rename to Source/Charts/Data/Interfaces/BarChartDataSetProtocol.swift index b90b4dc0c2..3ea0903cce 100644 --- a/Source/Charts/Data/Interfaces/IBarChartDataSet.swift +++ b/Source/Charts/Data/Interfaces/BarChartDataSetProtocol.swift @@ -1,5 +1,5 @@ // -// IBarChartDataSet.swift +// BarChartDataSetProtocol.swift // Charts // // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda @@ -13,7 +13,7 @@ import Foundation import CoreGraphics @objc -public protocol IBarChartDataSet: IBarLineScatterCandleBubbleChartDataSet +public protocol BarChartDataSetProtocol: BarLineScatterCandleBubbleChartDataSetProtocol { // MARK: - Data functions and accessors diff --git a/Source/Charts/Data/Interfaces/IBarLineScatterCandleBubbleChartDataSet.swift b/Source/Charts/Data/Interfaces/BarLineScatterCandleBubbleChartDataSetProtocol.swift similarity index 79% rename from Source/Charts/Data/Interfaces/IBarLineScatterCandleBubbleChartDataSet.swift rename to Source/Charts/Data/Interfaces/BarLineScatterCandleBubbleChartDataSetProtocol.swift index 8af47ff4a7..cbc90147f0 100644 --- a/Source/Charts/Data/Interfaces/IBarLineScatterCandleBubbleChartDataSet.swift +++ b/Source/Charts/Data/Interfaces/BarLineScatterCandleBubbleChartDataSetProtocol.swift @@ -1,5 +1,5 @@ // -// IBarLineScatterCandleBubbleChartDataSet.swift +// BarLineScatterCandleBubbleChartDataSetProtocol.swift // Charts // // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda @@ -13,7 +13,7 @@ import Foundation import CoreGraphics @objc -public protocol IBarLineScatterCandleBubbleChartDataSet: IChartDataSet +public protocol BarLineScatterCandleBubbleChartDataSetProtocol: ChartDataSetProtocol { // MARK: - Data functions and accessors diff --git a/Source/Charts/Data/Interfaces/IBubbleChartDataSet.swift b/Source/Charts/Data/Interfaces/BubbleChartDataSetProtocol.swift similarity index 81% rename from Source/Charts/Data/Interfaces/IBubbleChartDataSet.swift rename to Source/Charts/Data/Interfaces/BubbleChartDataSetProtocol.swift index 10c5d9eecb..5cc9457951 100644 --- a/Source/Charts/Data/Interfaces/IBubbleChartDataSet.swift +++ b/Source/Charts/Data/Interfaces/BubbleChartDataSetProtocol.swift @@ -1,5 +1,5 @@ // -// IBubbleChartDataSet.swift +// BubbleChartDataSetProtocol.swift // Charts // // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda @@ -13,7 +13,7 @@ import Foundation import CoreGraphics @objc -public protocol IBubbleChartDataSet: IBarLineScatterCandleBubbleChartDataSet +public protocol BubbleChartDataSetProtocol: BarLineScatterCandleBubbleChartDataSetProtocol { // MARK: - Data functions and accessors diff --git a/Source/Charts/Data/Interfaces/ICandleChartDataSet.swift b/Source/Charts/Data/Interfaces/CandleChartDataSetProtocol.swift similarity index 93% rename from Source/Charts/Data/Interfaces/ICandleChartDataSet.swift rename to Source/Charts/Data/Interfaces/CandleChartDataSetProtocol.swift index fac88d3b2e..d47b5a8c9f 100644 --- a/Source/Charts/Data/Interfaces/ICandleChartDataSet.swift +++ b/Source/Charts/Data/Interfaces/CandleChartDataSetProtocol.swift @@ -1,5 +1,5 @@ // -// ICandleChartDataSet.swift +// CandleChartDataSetProtocol.swift // Charts // // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda @@ -13,7 +13,7 @@ import Foundation import CoreGraphics @objc -public protocol ICandleChartDataSet: ILineScatterCandleRadarChartDataSet +public protocol CandleChartDataSetProtocol: LineScatterCandleRadarChartDataSetProtocol { // MARK: - Data functions and accessors diff --git a/Source/Charts/Data/Interfaces/IChartDataSet.swift b/Source/Charts/Data/Interfaces/ChartDataSetProtocol.swift similarity index 97% rename from Source/Charts/Data/Interfaces/IChartDataSet.swift rename to Source/Charts/Data/Interfaces/ChartDataSetProtocol.swift index 849da103b7..9cf80d3368 100644 --- a/Source/Charts/Data/Interfaces/IChartDataSet.swift +++ b/Source/Charts/Data/Interfaces/ChartDataSetProtocol.swift @@ -1,5 +1,5 @@ // -// IChartDataSet.swift +// ChartDataSetProtocol.swift // Charts // // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda @@ -13,14 +13,14 @@ import Foundation import CoreGraphics @objc -public protocol IChartDataSet +public protocol ChartDataSetProtocol { // MARK: - Data functions and accessors /// Use this method to tell the data set that the underlying data has changed func notifyDataSetChanged() - /// Calculates the minimum and maximum x and y values (_xMin, _xMax, _yMin, _yMax). + /// Calculates the minimum and maximum x and y values (xMin, xMax, yMin, yMax). func calcMinMax() /// Calculates the min and max y-values from the Entry closest to the given fromX to the Entry closest to the given toX value. @@ -196,10 +196,7 @@ public protocol IChartDataSet var isHighlightEnabled: Bool { get } /// Custom formatter that is used instead of the auto-formatter if set - var valueFormatter: IValueFormatter? { get set } - - /// `true` if the valueFormatter object of this DataSet is null. - var needsFormatter: Bool { get } + var valueFormatter: ValueFormatter { get set } /// Sets/get a single color for value text. /// Setting the color clears the colors array and adds a single color. @@ -212,6 +209,9 @@ public protocol IChartDataSet /// the font for the value-text labels var valueFont: NSUIFont { get set } + /// The rotation angle (in degrees) for value-text labels + var valueLabelAngle: CGFloat { get set } + /// The form to draw for this dataset in the legend. /// /// Return `.Default` to use the default legend form. diff --git a/Source/Charts/Data/Interfaces/ILineChartDataSet.swift b/Source/Charts/Data/Interfaces/LineChartDataSetProtocol.swift similarity index 82% rename from Source/Charts/Data/Interfaces/ILineChartDataSet.swift rename to Source/Charts/Data/Interfaces/LineChartDataSetProtocol.swift index a67c586156..d238d9a07c 100644 --- a/Source/Charts/Data/Interfaces/ILineChartDataSet.swift +++ b/Source/Charts/Data/Interfaces/LineChartDataSetProtocol.swift @@ -1,5 +1,5 @@ // -// ILineChartDataSet.swift +// LineChartDataSetProtocol.swift // Charts // // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda @@ -14,7 +14,7 @@ import CoreGraphics @objc -public protocol ILineChartDataSet: ILineRadarChartDataSet +public protocol LineChartDataSetProtocol: LineRadarChartDataSetProtocol { // MARK: - Data functions and accessors @@ -29,7 +29,13 @@ public protocol ILineChartDataSet: ILineRadarChartDataSet /// /// **default**: 0.2 var cubicIntensity: CGFloat { get set } - + + /// If true, gradient lines are drawn instead of solid + var isDrawLineWithGradientEnabled: Bool { get set } + + /// The points where gradient should change color + var gradientPositions: [CGFloat]? { get set } + /// The radius of the drawn circles. var circleRadius: CGFloat { get set } @@ -81,6 +87,6 @@ public protocol ILineChartDataSet: ILineRadarChartDataSet /// Line cap type, default is CGLineCap.Butt var lineCapType: CGLineCap { get set } - /// Sets a custom IFillFormatter to the chart that handles the position of the filled-line for each DataSet. Set this to null to use the default logic. - var fillFormatter: IFillFormatter? { get set } + /// Sets a custom FillFormatterProtocol to the chart that handles the position of the filled-line for each DataSet. Set this to null to use the default logic. + var fillFormatter: FillFormatter? { get set } } diff --git a/Source/Charts/Data/Interfaces/ILineRadarChartDataSet.swift b/Source/Charts/Data/Interfaces/LineRadarChartDataSetProtocol.swift similarity index 90% rename from Source/Charts/Data/Interfaces/ILineRadarChartDataSet.swift rename to Source/Charts/Data/Interfaces/LineRadarChartDataSetProtocol.swift index d9f8980b47..aadcb28b9b 100644 --- a/Source/Charts/Data/Interfaces/ILineRadarChartDataSet.swift +++ b/Source/Charts/Data/Interfaces/LineRadarChartDataSetProtocol.swift @@ -1,5 +1,5 @@ // -// ILineRadarChartDataSet.swift +// LineRadarChartDataSetProtocol.swift // Charts // // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda @@ -13,7 +13,7 @@ import Foundation import CoreGraphics @objc -public protocol ILineRadarChartDataSet: ILineScatterCandleRadarChartDataSet +public protocol LineRadarChartDataSetProtocol: LineScatterCandleRadarChartDataSetProtocol { // MARK: - Data functions and accessors diff --git a/Source/Charts/Data/Interfaces/ILineScatterCandleRadarChartDataSet.swift b/Source/Charts/Data/Interfaces/LineScatterCandleRadarChartDataSetProtocol.swift similarity index 87% rename from Source/Charts/Data/Interfaces/ILineScatterCandleRadarChartDataSet.swift rename to Source/Charts/Data/Interfaces/LineScatterCandleRadarChartDataSetProtocol.swift index 27c2bca944..25325e0366 100644 --- a/Source/Charts/Data/Interfaces/ILineScatterCandleRadarChartDataSet.swift +++ b/Source/Charts/Data/Interfaces/LineScatterCandleRadarChartDataSetProtocol.swift @@ -1,5 +1,5 @@ // -// ILineScatterCandleRadarChartDataSet.swift +// LineScatterCandleRadarChartDataSetProtocol.swift // Charts // // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda @@ -12,7 +12,7 @@ import Foundation @objc -public protocol ILineScatterCandleRadarChartDataSet: IBarLineScatterCandleBubbleChartDataSet +public protocol LineScatterCandleRadarChartDataSetProtocol: BarLineScatterCandleBubbleChartDataSetProtocol { // MARK: - Data functions and accessors diff --git a/Source/Charts/Data/Interfaces/IPieChartDataSet.swift b/Source/Charts/Data/Interfaces/PieChartDataSetProtocol.swift similarity index 95% rename from Source/Charts/Data/Interfaces/IPieChartDataSet.swift rename to Source/Charts/Data/Interfaces/PieChartDataSetProtocol.swift index 433c08f262..1b8ea87850 100644 --- a/Source/Charts/Data/Interfaces/IPieChartDataSet.swift +++ b/Source/Charts/Data/Interfaces/PieChartDataSetProtocol.swift @@ -1,5 +1,5 @@ // -// IPieChartDataSet.swift +// PieChartDataSetProtocol.swift // Charts // // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda @@ -13,7 +13,7 @@ import Foundation import CoreGraphics @objc -public protocol IPieChartDataSet: IChartDataSet +public protocol PieChartDataSetProtocol: ChartDataSetProtocol { // MARK: - Styling functions and accessors diff --git a/Source/Charts/Data/Interfaces/IRadarChartDataSet.swift b/Source/Charts/Data/Interfaces/RadarChartDataSetProtocol.swift similarity index 90% rename from Source/Charts/Data/Interfaces/IRadarChartDataSet.swift rename to Source/Charts/Data/Interfaces/RadarChartDataSetProtocol.swift index 2e37b4ffd5..98c12d77c3 100644 --- a/Source/Charts/Data/Interfaces/IRadarChartDataSet.swift +++ b/Source/Charts/Data/Interfaces/RadarChartDataSetProtocol.swift @@ -1,5 +1,5 @@ // -// IRadarChartDataSet.swift +// RadarChartDataSetProtocol.swift // Charts // // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda @@ -13,7 +13,7 @@ import Foundation import CoreGraphics @objc -public protocol IRadarChartDataSet: ILineRadarChartDataSet +public protocol RadarChartDataSetProtocol: LineRadarChartDataSetProtocol { // MARK: - Data functions and accessors diff --git a/Source/Charts/Data/Interfaces/IScatterChartDataSet.swift b/Source/Charts/Data/Interfaces/ScatterChartDataSetProtocol.swift similarity index 72% rename from Source/Charts/Data/Interfaces/IScatterChartDataSet.swift rename to Source/Charts/Data/Interfaces/ScatterChartDataSetProtocol.swift index 0565146725..4d160fcd0c 100644 --- a/Source/Charts/Data/Interfaces/IScatterChartDataSet.swift +++ b/Source/Charts/Data/Interfaces/ScatterChartDataSetProtocol.swift @@ -1,5 +1,5 @@ // -// IScatterChartDataSet.swift +// ScatterChartDataSetProtocol.swift // Charts // // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda @@ -13,13 +13,13 @@ import Foundation import CoreGraphics @objc -public protocol IScatterChartDataSet: ILineScatterCandleRadarChartDataSet +public protocol ScatterChartDataSetProtocol: LineScatterCandleRadarChartDataSetProtocol { // MARK: - Data functions and accessors // MARK: - Styling functions and accessors - /// The size the scatter shape will have + /// - Returns: The size the scatter shape will have var scatterShapeSize: CGFloat { get } /// - Returns: The radius of the hole in the shape (applies to Square, Circle and Triangle) @@ -31,6 +31,6 @@ public protocol IScatterChartDataSet: ILineScatterCandleRadarChartDataSet /// **default**: nil var scatterShapeHoleColor: NSUIColor? { get } - /// The IShapeRenderer responsible for rendering this DataSet. - var shapeRenderer: IShapeRenderer? { get } + /// - Returns: The ShapeRenderer responsible for rendering this DataSet. + var shapeRenderer: ShapeRenderer? { get } } diff --git a/Source/Charts/Filters/DataApproximator+N.swift b/Source/Charts/Filters/DataApproximator+N.swift index b194955003..e291d84a71 100644 --- a/Source/Charts/Filters/DataApproximator+N.swift +++ b/Source/Charts/Filters/DataApproximator+N.swift @@ -78,12 +78,12 @@ extension DataApproximator { var keep = [Bool](repeating: false, count: points.count) // first and last always stay - keep[0] = true - keep[points.count - 1] = true + keep[points.startIndex] = true + keep[points.endIndex - 1] = true var currentStoredPoints = 2 var queue = [LineAlt]() - let line = LineAlt(start: 0, end: points.count - 1, points: points) + let line = LineAlt(start: points.startIndex, end: points.endIndex - 1, points: points) queue.append(line) repeat { diff --git a/Source/Charts/Filters/DataApproximator.swift b/Source/Charts/Filters/DataApproximator.swift index 234a7d11e2..db665abfad 100644 --- a/Source/Charts/Filters/DataApproximator.swift +++ b/Source/Charts/Filters/DataApproximator.swift @@ -27,14 +27,14 @@ open class DataApproximator: NSObject var keep = [Bool](repeating: false, count: points.count) // first and last always stay - keep[0] = true - keep[points.count - 1] = true + keep[points.startIndex] = true + keep[points.endIndex - 1] = true // first and last entry are entry point to recursion reduceWithDouglasPeuker(points: points, tolerance: tolerance, - start: 0, - end: points.count - 1, + start: points.startIndex, + end: points.endIndex - 1, keep: &keep) // create a new array with series, only take the kept ones diff --git a/Source/Charts/Formatters/IAxisValueFormatter.swift b/Source/Charts/Formatters/AxisValueFormatter.swift similarity index 88% rename from Source/Charts/Formatters/IAxisValueFormatter.swift rename to Source/Charts/Formatters/AxisValueFormatter.swift index 302eee18f8..57d4cbbb3e 100644 --- a/Source/Charts/Formatters/IAxisValueFormatter.swift +++ b/Source/Charts/Formatters/AxisValueFormatter.swift @@ -1,5 +1,5 @@ // -// IAxisValueFormatter.swift +// AxisValueFormatter.swift // Charts // // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda @@ -12,8 +12,8 @@ import Foundation /// An interface for providing custom axis Strings. -@objc(IChartAxisValueFormatter) -public protocol IAxisValueFormatter: class +@objc(ChartAxisValueFormatter) +public protocol AxisValueFormatter: class { /// Called when a value from an axis is formatted before being drawn. diff --git a/Source/Charts/Formatters/DefaultAxisValueFormatter.swift b/Source/Charts/Formatters/DefaultAxisValueFormatter.swift index 85193d0c46..b698c5a319 100644 --- a/Source/Charts/Formatters/DefaultAxisValueFormatter.swift +++ b/Source/Charts/Formatters/DefaultAxisValueFormatter.swift @@ -12,7 +12,7 @@ import Foundation @objc(ChartDefaultAxisValueFormatter) -open class DefaultAxisValueFormatter: NSObject, IAxisValueFormatter +open class DefaultAxisValueFormatter: NSObject, AxisValueFormatter { public typealias Block = ( _ value: Double, diff --git a/Source/Charts/Formatters/DefaultFillFormatter.swift b/Source/Charts/Formatters/DefaultFillFormatter.swift index 3afadf35fa..07a6c34446 100644 --- a/Source/Charts/Formatters/DefaultFillFormatter.swift +++ b/Source/Charts/Formatters/DefaultFillFormatter.swift @@ -14,10 +14,10 @@ import CoreGraphics /// Default formatter that calculates the position of the filled line. @objc(ChartDefaultFillFormatter) -open class DefaultFillFormatter: NSObject, IFillFormatter +open class DefaultFillFormatter: NSObject, FillFormatter { public typealias Block = ( - _ dataSet: ILineChartDataSet, + _ dataSet: LineChartDataSetProtocol, _ dataProvider: LineChartDataProvider) -> CGFloat @objc open var block: Block? @@ -35,7 +35,7 @@ open class DefaultFillFormatter: NSObject, IFillFormatter } open func getFillLinePosition( - dataSet: ILineChartDataSet, + dataSet: LineChartDataSetProtocol, dataProvider: LineChartDataProvider) -> CGFloat { guard block == nil else { return block!(dataSet, dataProvider) } diff --git a/Source/Charts/Formatters/DefaultValueFormatter.swift b/Source/Charts/Formatters/DefaultValueFormatter.swift index b3fff70ac9..ee86dc79a2 100644 --- a/Source/Charts/Formatters/DefaultValueFormatter.swift +++ b/Source/Charts/Formatters/DefaultValueFormatter.swift @@ -11,8 +11,9 @@ import Foundation +/// The default value formatter used for all chart components that needs a default @objc(ChartDefaultValueFormatter) -open class DefaultValueFormatter: NSObject, IValueFormatter +open class DefaultValueFormatter: NSObject, ValueFormatter { public typealias Block = ( _ value: Double, @@ -22,69 +23,76 @@ open class DefaultValueFormatter: NSObject, IValueFormatter @objc open var block: Block? - @objc open var hasAutoDecimals: Bool = false + @objc open var hasAutoDecimals: Bool - private var _formatter: NumberFormatter? @objc open var formatter: NumberFormatter? { - get { return _formatter } - set + willSet { hasAutoDecimals = false - _formatter = newValue } } - private var _decimals: Int? open var decimals: Int? { - get { return _decimals } - set + didSet { - _decimals = newValue - - if let digits = newValue - { - self.formatter?.minimumFractionDigits = digits - self.formatter?.maximumFractionDigits = digits - self.formatter?.usesGroupingSeparator = true - } + setupDecimals(decimals: decimals) + } + } + + private func setupDecimals(decimals: Int?) + { + if let digits = decimals + { + formatter?.minimumFractionDigits = digits + formatter?.maximumFractionDigits = digits + formatter?.usesGroupingSeparator = true } } public override init() { - super.init() - - self.formatter = NumberFormatter() + formatter = NumberFormatter() + formatter?.usesGroupingSeparator = true + decimals = 1 hasAutoDecimals = true + + super.init() + setupDecimals(decimals: decimals) } @objc public init(formatter: NumberFormatter) { - super.init() - self.formatter = formatter + hasAutoDecimals = false + + super.init() } @objc public init(decimals: Int) { - super.init() - - self.formatter = NumberFormatter() - self.formatter?.usesGroupingSeparator = true + formatter = NumberFormatter() + formatter?.usesGroupingSeparator = true self.decimals = decimals hasAutoDecimals = true + + super.init() + setupDecimals(decimals: decimals) } @objc public init(block: @escaping Block) { - super.init() - self.block = block + hasAutoDecimals = false + + super.init() } - - @objc public static func with(block: @escaping Block) -> DefaultValueFormatter? + + /// This function is deprecated - Use `init(block:)` instead. + // DEC 11, 2017 + @available(*, deprecated, message: "Use `init(block:)` instead.") + @objc public static func with(block: @escaping Block) -> DefaultValueFormatter { return DefaultValueFormatter(block: block) } diff --git a/Source/Charts/Formatters/IFillFormatter.swift b/Source/Charts/Formatters/FillFormatter.swift similarity index 72% rename from Source/Charts/Formatters/IFillFormatter.swift rename to Source/Charts/Formatters/FillFormatter.swift index 7b684fd84e..bd0598110e 100644 --- a/Source/Charts/Formatters/IFillFormatter.swift +++ b/Source/Charts/Formatters/FillFormatter.swift @@ -1,5 +1,5 @@ // -// IFillFormatter.swift +// FillFormatter.swift // Charts // // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda @@ -13,9 +13,9 @@ import Foundation import CoreGraphics /// Protocol for providing a custom logic to where the filling line of a LineDataSet should end. This of course only works if setFillEnabled(...) is set to true. -@objc(IChartFillFormatter) -public protocol IFillFormatter +@objc(ChartFillFormatter) +public protocol FillFormatter { /// - Returns: The vertical (y-axis) position where the filled-line of the LineDataSet should end. - func getFillLinePosition(dataSet: ILineChartDataSet, dataProvider: LineChartDataProvider) -> CGFloat + func getFillLinePosition(dataSet: LineChartDataSetProtocol, dataProvider: LineChartDataProvider) -> CGFloat } diff --git a/Source/Charts/Formatters/IndexAxisValueFormatter.swift b/Source/Charts/Formatters/IndexAxisValueFormatter.swift index ae86509d05..6f339eb36e 100644 --- a/Source/Charts/Formatters/IndexAxisValueFormatter.swift +++ b/Source/Charts/Formatters/IndexAxisValueFormatter.swift @@ -13,24 +13,10 @@ import Foundation /// This formatter is used for passing an array of x-axis labels, on whole x steps. @objc(ChartIndexAxisValueFormatter) -open class IndexAxisValueFormatter: NSObject, IAxisValueFormatter +open class IndexAxisValueFormatter: NSObject, AxisValueFormatter { - private var _values: [String] = [String]() - private var _valueCount: Int = 0 - - @objc public var values: [String] - { - get - { - return _values - } - set - { - _values = newValue - _valueCount = _values.count - } - } - + @objc public var values: [String] = [String]() + public override init() { super.init() @@ -54,6 +40,6 @@ open class IndexAxisValueFormatter: NSObject, IAxisValueFormatter { let index = Int(value.rounded()) guard values.indices.contains(index), index == Int(value) else { return "" } - return _values[index] + return values[index] } } diff --git a/Source/Charts/Formatters/IValueFormatter.swift b/Source/Charts/Formatters/ValueFormatter.swift similarity index 93% rename from Source/Charts/Formatters/IValueFormatter.swift rename to Source/Charts/Formatters/ValueFormatter.swift index 53ca7a40c2..61fb23f593 100644 --- a/Source/Charts/Formatters/IValueFormatter.swift +++ b/Source/Charts/Formatters/ValueFormatter.swift @@ -1,5 +1,5 @@ // -// IValueFormatter.swift +// ValueFormatter.swift // Charts // // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda @@ -16,8 +16,8 @@ import Foundation /// Simply create your own formatting class and let it implement ValueFormatter. Then override the stringForValue() /// method and return whatever you want. -@objc(IChartValueFormatter) -public protocol IValueFormatter: class +@objc(ChartValueFormatter) +public protocol ValueFormatter: class { /// Called when a value (from labels inside the chart) is formatted before being drawn. diff --git a/Source/Charts/Highlight/BarHighlighter.swift b/Source/Charts/Highlight/BarHighlighter.swift index da9e6da733..904302cf14 100644 --- a/Source/Charts/Highlight/BarHighlighter.swift +++ b/Source/Charts/Highlight/BarHighlighter.swift @@ -24,7 +24,7 @@ open class BarHighlighter: ChartHighlighter let pos = getValsForTouch(x: x, y: y) - if let set = barData.getDataSetByIndex(high.dataSetIndex) as? IBarChartDataSet, + if let set = barData[high.dataSetIndex] as? BarChartDataSetProtocol, set.isStacked { return getStackedHighlight(high: high, @@ -57,7 +57,7 @@ open class BarHighlighter: ChartHighlighter /// - yValue: /// - Returns: @objc open func getStackedHighlight(high: Highlight, - set: IBarChartDataSet, + set: BarChartDataSetProtocol, xValue: Double, yValue: Double) -> Highlight? { @@ -74,7 +74,7 @@ open class BarHighlighter: ChartHighlighter guard let ranges = entry.ranges, - ranges.count > 0 + !ranges.isEmpty else { return nil } let stackIndex = getClosestStackIndex(ranges: ranges, value: yValue) @@ -98,10 +98,11 @@ open class BarHighlighter: ChartHighlighter @objc open func getClosestStackIndex(ranges: [Range]?, value: Double) -> Int { guard let ranges = ranges else { return 0 } + if let stackIndex = ranges.firstIndex(where: { $0.contains(value) }) { return stackIndex } else { - let length = max(ranges.count - 1, 0) + let length = max(ranges.endIndex - 1, 0) return (value > ranges[length].to) ? length : 0 } } diff --git a/Source/Charts/Highlight/ChartHighlighter.swift b/Source/Charts/Highlight/ChartHighlighter.swift index 417ba0d0af..f1f1873386 100644 --- a/Source/Charts/Highlight/ChartHighlighter.swift +++ b/Source/Charts/Highlight/ChartHighlighter.swift @@ -9,10 +9,11 @@ // https://github.com/danielgindi/Charts // +import Algorithms import Foundation import CoreGraphics -open class ChartHighlighter : NSObject, IHighlighter +open class ChartHighlighter : NSObject, Highlighter { /// instance of the data-provider @objc open weak var chart: ChartDataProvider? @@ -73,17 +74,11 @@ open class ChartHighlighter : NSObject, IHighlighter guard let data = self.data else { return vals } - for i in 0 ..< data.dataSetCount + for (i, set) in data.indexed() where set.isHighlightEnabled { - guard - let dataSet = data.getDataSetByIndex(i), - dataSet.isHighlightEnabled // don't include datasets that cannot be highlighted - else { continue } - - // extract all y-values from all DataSets at the given x-value. // some datasets (i.e bubble charts) make sense to have multiple values for an x-value. We'll have to find a way to handle that later on. It's more complicated now when x-indices are floating point. - vals.append(contentsOf: buildHighlights(dataSet: dataSet, dataSetIndex: i, xValue: xValue, rounding: .closest)) + vals.append(contentsOf: buildHighlights(dataSet: set, dataSetIndex: i, xValue: xValue, rounding: .closest)) } return vals @@ -91,7 +86,7 @@ open class ChartHighlighter : NSObject, IHighlighter /// - Returns: An array of `Highlight` objects corresponding to the selected xValue and dataSetIndex. internal func buildHighlights( - dataSet set: IChartDataSet, + dataSet set: ChartDataSetProtocol, dataSetIndex: Int, xValue: Double, rounding: ChartDataSetRounding) -> [Highlight] @@ -99,7 +94,7 @@ open class ChartHighlighter : NSObject, IHighlighter guard let chart = self.chart as? BarLineScatterCandleBubbleChartDataProvider else { return [] } var entries = set.entriesForXValue(xValue) - if entries.count == 0, let closest = set.entryForXValue(xValue, closestToY: .nan, rounding: rounding) + if entries.isEmpty, let closest = set.entryForXValue(xValue, closestToY: .nan, rounding: rounding) { // Try to find closest x-value and take all entries for that x-value entries = set.entriesForXValue(closest.x) diff --git a/Source/Charts/Highlight/CombinedHighlighter.swift b/Source/Charts/Highlight/CombinedHighlighter.swift index 7053df09d3..0a03db2301 100644 --- a/Source/Charts/Highlight/CombinedHighlighter.swift +++ b/Source/Charts/Highlight/CombinedHighlighter.swift @@ -9,6 +9,7 @@ // https://github.com/danielgindi/Charts // +import Algorithms import Foundation import CoreGraphics @@ -35,10 +36,8 @@ open class CombinedHighlighter: ChartHighlighter let dataObjects = chart.combinedData?.allData else { return vals } - for i in 0.. [Highlight] @@ -43,7 +43,7 @@ open class HorizontalBarHighlighter: BarHighlighter guard let chart = self.chart as? BarLineScatterCandleBubbleChartDataProvider else { return [] } var entries = set.entriesForXValue(xValue) - if entries.count == 0, let closest = set.entryForXValue(xValue, closestToY: .nan, rounding: rounding) + if entries.isEmpty, let closest = set.entryForXValue(xValue, closestToY: .nan, rounding: rounding) { // Try to find closest x-value and take all entries for that x-value entries = set.entriesForXValue(closest.x) diff --git a/Source/Charts/Highlight/PieHighlighter.swift b/Source/Charts/Highlight/PieHighlighter.swift index 54bb3d7b83..42b30a2b83 100644 --- a/Source/Charts/Highlight/PieHighlighter.swift +++ b/Source/Charts/Highlight/PieHighlighter.swift @@ -18,7 +18,7 @@ open class PieHighlighter: PieRadarHighlighter open override func closestHighlight(index: Int, x: CGFloat, y: CGFloat) -> Highlight? { guard - let set = chart?.data?.dataSets[0], + let set = chart?.data?[0], let entry = set.entryForIndex(index) else { return nil } diff --git a/Source/Charts/Highlight/RadarHighlighter.swift b/Source/Charts/Highlight/RadarHighlighter.swift index cfaf57aec9..d01cb4fd6f 100644 --- a/Source/Charts/Highlight/RadarHighlighter.swift +++ b/Source/Charts/Highlight/RadarHighlighter.swift @@ -22,20 +22,12 @@ open class RadarHighlighter: PieRadarHighlighter let highlights = getHighlights(forIndex: index) let distanceToCenter = Double(chart.distanceToCenter(x: x, y: y) / chart.factor) - - var closest: Highlight? - var distance = Double.greatestFiniteMagnitude - - for high in highlights - { - let cdistance = abs(high.y - distanceToCenter) - if cdistance < distance - { - closest = high - distance = cdistance - } + + func closestToCenter(lhs: Highlight, rhs: Highlight) -> Bool { + abs(lhs.y - distanceToCenter) < abs(rhs.y - distanceToCenter) } - + + let closest = highlights.min(by: closestToCenter(lhs:rhs:)) return closest } @@ -57,12 +49,9 @@ open class RadarHighlighter: PieRadarHighlighter let sliceangle = chart.sliceAngle let factor = chart.factor - for i in chartData.dataSets.indices + for (i, dataSet) in chartData.indexed() { - guard - let dataSet = chartData.getDataSetByIndex(i), - let entry = dataSet.entryForIndex(index) - else { continue } + guard let entry = dataSet.entryForIndex(index) else { continue } let y = (entry.y - chart.chartYMin) diff --git a/Source/Charts/Jobs/AnimatedMoveViewJob.swift b/Source/Charts/Jobs/AnimatedMoveViewJob.swift index 7a75822161..408883a92c 100644 --- a/Source/Charts/Jobs/AnimatedMoveViewJob.swift +++ b/Source/Charts/Jobs/AnimatedMoveViewJob.swift @@ -16,12 +16,6 @@ open class AnimatedMoveViewJob: AnimatedViewPortJob { internal override func animationUpdate() { - guard - let viewPortHandler = viewPortHandler, - let transformer = transformer, - let view = view - else { return } - var pt = CGPoint( x: xOrigin + (CGFloat(xValue) - xOrigin) * phase, y: yOrigin + (CGFloat(yValue) - yOrigin) * phase diff --git a/Source/Charts/Jobs/AnimatedViewPortJob.swift b/Source/Charts/Jobs/AnimatedViewPortJob.swift index 1bdfedf5bd..363bb0085d 100644 --- a/Source/Charts/Jobs/AnimatedViewPortJob.swift +++ b/Source/Charts/Jobs/AnimatedViewPortJob.swift @@ -37,16 +37,16 @@ open class AnimatedViewPortJob: ViewPortJob duration: TimeInterval, easing: ChartEasingFunctionBlock?) { + self.xOrigin = xOrigin + self.yOrigin = yOrigin + self._duration = duration + self._easing = easing + super.init(viewPortHandler: viewPortHandler, xValue: xValue, yValue: yValue, transformer: transformer, view: view) - - self.xOrigin = xOrigin - self.yOrigin = yOrigin - self._duration = duration - self._easing = easing } deinit diff --git a/Source/Charts/Jobs/AnimatedZoomViewJob.swift b/Source/Charts/Jobs/AnimatedZoomViewJob.swift index 4e9d5fd981..4f23911283 100644 --- a/Source/Charts/Jobs/AnimatedZoomViewJob.swift +++ b/Source/Charts/Jobs/AnimatedZoomViewJob.swift @@ -14,7 +14,7 @@ import CoreGraphics open class AnimatedZoomViewJob: AnimatedViewPortJob { - internal var yAxis: YAxis? + internal var yAxis: YAxis internal var xAxisRange: Double = 0.0 internal var scaleX: CGFloat = 0.0 internal var scaleY: CGFloat = 0.0 @@ -40,6 +40,15 @@ open class AnimatedZoomViewJob: AnimatedViewPortJob duration: TimeInterval, easing: ChartEasingFunctionBlock?) { + self.yAxis = yAxis + self.xAxisRange = xAxisRange + self.scaleX = scaleX + self.scaleY = scaleY + self.zoomCenterX = zoomCenterX + self.zoomCenterY = zoomCenterY + self.zoomOriginX = zoomOriginX + self.zoomOriginY = zoomOriginY + super.init(viewPortHandler: viewPortHandler, xValue: 0.0, yValue: 0.0, @@ -49,32 +58,17 @@ open class AnimatedZoomViewJob: AnimatedViewPortJob yOrigin: yOrigin, duration: duration, easing: easing) - - self.yAxis = yAxis - self.xAxisRange = xAxisRange - self.scaleX = scaleX - self.scaleY = scaleY - self.zoomCenterX = zoomCenterX - self.zoomCenterY = zoomCenterY - self.zoomOriginX = zoomOriginX - self.zoomOriginY = zoomOriginY } internal override func animationUpdate() { - guard - let viewPortHandler = viewPortHandler, - let transformer = transformer, - let view = view - else { return } - let scaleX = xOrigin + (self.scaleX - xOrigin) * phase let scaleY = yOrigin + (self.scaleY - yOrigin) * phase var matrix = viewPortHandler.setZoom(scaleX: scaleX, scaleY: scaleY) viewPortHandler.refresh(newMatrix: matrix, chart: view, invalidate: false) - let valsInView = CGFloat(yAxis?.axisRange ?? 0.0) / viewPortHandler.scaleY + let valsInView = CGFloat(yAxis.axisRange) / viewPortHandler.scaleY let xsInView = CGFloat(xAxisRange) / viewPortHandler.scaleX var pt = CGPoint( @@ -91,6 +85,6 @@ open class AnimatedZoomViewJob: AnimatedViewPortJob internal override func animationEnd() { (view as? BarLineChartViewBase)?.calculateOffsets() - view?.setNeedsDisplay() + view.setNeedsDisplay() } } diff --git a/Source/Charts/Jobs/MoveViewJob.swift b/Source/Charts/Jobs/MoveViewJob.swift index 0b6ca320e5..a9a64feabe 100644 --- a/Source/Charts/Jobs/MoveViewJob.swift +++ b/Source/Charts/Jobs/MoveViewJob.swift @@ -14,15 +14,9 @@ import CoreGraphics @objc(MoveChartViewJob) open class MoveViewJob: ViewPortJob -{ +{ open override func doJob() { - guard - let viewPortHandler = viewPortHandler, - let transformer = transformer, - let view = view - else { return } - var pt = CGPoint( x: xValue, y: yValue diff --git a/Source/Charts/Jobs/ViewPortJob.swift b/Source/Charts/Jobs/ViewPortJob.swift index c52562ed53..c3adcca5c8 100644 --- a/Source/Charts/Jobs/ViewPortJob.swift +++ b/Source/Charts/Jobs/ViewPortJob.swift @@ -16,13 +16,13 @@ import CoreGraphics @objc(ChartViewPortJob) open class ViewPortJob: NSObject { - internal var point: CGPoint = CGPoint() - internal weak var viewPortHandler: ViewPortHandler? - internal var xValue: Double = 0.0 - internal var yValue: Double = 0.0 - internal weak var transformer: Transformer? - internal weak var view: ChartViewBase? - + internal var point: CGPoint = .zero + internal unowned var viewPortHandler: ViewPortHandler + internal var xValue = 0.0 + internal var yValue = 0.0 + internal unowned var transformer: Transformer + internal unowned var view: ChartViewBase + @objc public init( viewPortHandler: ViewPortHandler, xValue: Double, @@ -30,13 +30,13 @@ open class ViewPortJob: NSObject transformer: Transformer, view: ChartViewBase) { - super.init() - self.viewPortHandler = viewPortHandler self.xValue = xValue self.yValue = yValue self.transformer = transformer self.view = view + + super.init() } @objc open func doJob() diff --git a/Source/Charts/Jobs/ZoomViewJob.swift b/Source/Charts/Jobs/ZoomViewJob.swift index a6a79394da..79ce41c76e 100644 --- a/Source/Charts/Jobs/ZoomViewJob.swift +++ b/Source/Charts/Jobs/ZoomViewJob.swift @@ -18,7 +18,7 @@ open class ZoomViewJob: ViewPortJob internal var scaleX: CGFloat = 0.0 internal var scaleY: CGFloat = 0.0 internal var axisDependency: YAxis.AxisDependency = .left - + @objc public init( viewPortHandler: ViewPortHandler, scaleX: CGFloat, @@ -29,26 +29,21 @@ open class ZoomViewJob: ViewPortJob axis: YAxis.AxisDependency, view: ChartViewBase) { + self.scaleX = scaleX + self.scaleY = scaleY + self.axisDependency = axis + super.init( viewPortHandler: viewPortHandler, xValue: xValue, yValue: yValue, transformer: transformer, view: view) - - self.scaleX = scaleX - self.scaleY = scaleY - self.axisDependency = axis + } open override func doJob() { - guard - let viewPortHandler = viewPortHandler, - let transformer = transformer, - let view = view - else { return } - var matrix = viewPortHandler.setZoom(scaleX: scaleX, scaleY: scaleY) viewPortHandler.refresh(newMatrix: matrix, chart: view, invalidate: false) diff --git a/Source/Charts/Renderers/AxisRenderer.swift b/Source/Charts/Renderers/AxisRenderer.swift new file mode 100644 index 0000000000..35b1ddf72d --- /dev/null +++ b/Source/Charts/Renderers/AxisRenderer.swift @@ -0,0 +1,45 @@ +// +// AxisRenderer.swift +// Charts +// +// Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda +// A port of MPAndroidChart for iOS +// Licensed under Apache License 2.0 +// +// https://github.com/danielgindi/Charts +// + +import Foundation +import CoreGraphics + + +public protocol AxisRenderer: Renderer { + + associatedtype Axis: AxisBase + + /// base axis this axis renderer works with + var axis: Axis { get } + + /// transformer to transform values to screen pixels and return + var transformer: Transformer? { get } + + /// Draws the axis labels on the specified context + func renderAxisLabels(context: CGContext) + + /// Draws the grid lines belonging to the axis. + func renderGridLines(context: CGContext) + + /// Draws the line that goes alongside the axis. + func renderAxisLine(context: CGContext) + + /// Draws the LimitLines associated with this axis to the screen. + func renderLimitLines(context: CGContext) + + /// Computes the axis values. + /// - parameter min: the minimum value in the data object for this axis + /// - parameter max: the maximum value in the data object for this axis + func computeAxis(min: Double, max: Double, inverted: Bool) + + /// Sets up the axis values. Computes the desired number of labels between the two given extremes. + func computeAxisValues(min: Double, max: Double) +} diff --git a/Source/Charts/Renderers/AxisRendererBase.swift b/Source/Charts/Renderers/AxisRendererBase.swift deleted file mode 100644 index 302bdf5312..0000000000 --- a/Source/Charts/Renderers/AxisRendererBase.swift +++ /dev/null @@ -1,218 +0,0 @@ -// -// AxisRendererBase.swift -// Charts -// -// Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda -// A port of MPAndroidChart for iOS -// Licensed under Apache License 2.0 -// -// https://github.com/danielgindi/Charts -// - -import Foundation -import CoreGraphics - -@objc(ChartAxisRendererBase) -open class AxisRendererBase: Renderer -{ - /// base axis this axis renderer works with - @objc open var axis: AxisBase? - - /// transformer to transform values to screen pixels and return - @objc open var transformer: Transformer? - - @objc public init(viewPortHandler: ViewPortHandler, transformer: Transformer?, axis: AxisBase?) - { - super.init(viewPortHandler: viewPortHandler) - - self.transformer = transformer - self.axis = axis - } - - /// Draws the axis labels on the specified context - @objc open func renderAxisLabels(context: CGContext) - { - fatalError("renderAxisLabels() cannot be called on AxisRendererBase") - } - - /// Draws the grid lines belonging to the axis. - @objc open func renderGridLines(context: CGContext) - { - fatalError("renderGridLines() cannot be called on AxisRendererBase") - } - - /// Draws the line that goes alongside the axis. - @objc open func renderAxisLine(context: CGContext) - { - fatalError("renderAxisLine() cannot be called on AxisRendererBase") - } - - /// Draws the LimitLines associated with this axis to the screen. - @objc open func renderLimitLines(context: CGContext) - { - fatalError("renderLimitLines() cannot be called on AxisRendererBase") - } - - /// Computes the axis values. - /// - /// - Parameters: - /// - min: the minimum value in the data object for this axis - /// - max: the maximum value in the data object for this axis - @objc open func computeAxis(min: Double, max: Double, inverted: Bool) - { - var min = min, max = max - - if let transformer = self.transformer - { - // calculate the starting and entry point of the y-labels (depending on zoom / contentrect bounds) - if viewPortHandler.contentWidth > 10.0 && !viewPortHandler.isFullyZoomedOutY - { - let p1 = transformer.valueForTouchPoint(CGPoint(x: viewPortHandler.contentLeft, y: viewPortHandler.contentTop)) - let p2 = transformer.valueForTouchPoint(CGPoint(x: viewPortHandler.contentLeft, y: viewPortHandler.contentBottom)) - - if !inverted - { - min = Double(p2.y) - max = Double(p1.y) - } - else - { - min = Double(p1.y) - max = Double(p2.y) - } - } - } - - computeAxisValues(min: min, max: max) - } - - /// Sets up the axis values. Computes the desired number of labels between the two given extremes. - @objc open func computeAxisValues(min: Double, max: Double) - { - guard let axis = self.axis else { return } - - let yMin = min - let yMax = max - - let labelCount = axis.labelCount - let range = abs(yMax - yMin) - - if labelCount == 0 || range <= 0 || range.isInfinite - { - axis.entries = [Double]() - axis.centeredEntries = [Double]() - return - } - - // Find out how much spacing (in y value space) between axis values - let rawInterval = range / Double(labelCount) - var interval = rawInterval.roundedToNextSignficant() - - // If granularity is enabled, then do not allow the interval to go below specified granularity. - // This is used to avoid repeated values when rounding values for display. - if axis.granularityEnabled - { - interval = interval < axis.granularity ? axis.granularity : interval - } - - // Normalize interval - let intervalMagnitude = pow(10.0, Double(Int(log10(interval)))).roundedToNextSignficant() - let intervalSigDigit = Int(interval / intervalMagnitude) - if intervalSigDigit > 5 - { - // Use one order of magnitude higher, to avoid intervals like 0.9 or 90 - // if it's 0.0 after floor(), we use the old value - interval = floor(10.0 * intervalMagnitude) == 0.0 ? interval : floor(10.0 * intervalMagnitude) - } - - var n = axis.centerAxisLabelsEnabled ? 1 : 0 - - // force label count - if axis.isForceLabelsEnabled - { - interval = Double(range) / Double(labelCount - 1) - - // Ensure stops contains at least n elements. - axis.entries.removeAll(keepingCapacity: true) - axis.entries.reserveCapacity(labelCount) - - var v = yMin - - for _ in 0 ..< labelCount - { - axis.entries.append(v) - v += interval - } - - n = labelCount - } - else - { - // no forced count - - var first = interval == 0.0 ? 0.0 : ceil(yMin / interval) * interval - - if axis.centerAxisLabelsEnabled - { - first -= interval - } - - let last = interval == 0.0 ? 0.0 : (floor(yMax / interval) * interval).nextUp - - if interval != 0.0 && last != first - { - for _ in stride(from: first, through: last, by: interval) - { - n += 1 - } - } - else if last == first && n == 0 - { - n = 1 - } - - // Ensure stops contains at least n elements. - axis.entries.removeAll(keepingCapacity: true) - axis.entries.reserveCapacity(labelCount) - - var f = first - var i = 0 - while i < n - { - if f == 0.0 - { - // Fix for IEEE negative zero case (Where value == -0.0, and 0.0 == -0.0) - f = 0.0 - } - - axis.entries.append(Double(f)) - - f += interval - i += 1 - } - } - - // set decimals - if interval < 1 - { - axis.decimals = Int(ceil(-log10(interval))) - } - else - { - axis.decimals = 0 - } - - if axis.centerAxisLabelsEnabled - { - axis.centeredEntries.reserveCapacity(n) - axis.centeredEntries.removeAll() - - let offset: Double = interval / 2.0 - - for i in 0 ..< n - { - axis.centeredEntries.append(axis.entries[i] + offset) - } - } - } -} diff --git a/Source/Charts/Renderers/BarChartRenderer.swift b/Source/Charts/Renderers/BarChartRenderer.swift index c2ff0b108b..2aa69a828f 100644 --- a/Source/Charts/Renderers/BarChartRenderer.swift +++ b/Source/Charts/Renderers/BarChartRenderer.swift @@ -12,14 +12,10 @@ import Foundation import CoreGraphics -#if canImport(UIKit) +#if !os(OSX) import UIKit #endif -#if canImport(Cocoa) -import Cocoa -#endif - open class BarChartRenderer: BarLineScatterCandleBubbleRenderer { /// A nested array of elements ordered logically (i.e not in visual/drawing order) for use with VoiceOver @@ -44,10 +40,7 @@ open class BarChartRenderer: BarLineScatterCandleBubbleRenderer /// The ````internal```` specifier is to allow subclasses (HorizontalBar) to populate the same array internal lazy var accessibilityOrderedElements: [[NSUIAccessibilityElement]] = accessibilityCreateEmptyOrderedElements() - private class Buffer - { - var rects = [CGRect]() - } + private typealias Buffer = [CGRect] @objc open weak var dataProvider: BarChartDataProvider? @@ -63,70 +56,103 @@ open class BarChartRenderer: BarLineScatterCandleBubbleRenderer open override func initBuffers() { - if let barData = dataProvider?.barData + guard let barData = dataProvider?.barData else { return _buffers.removeAll() } + + // Match buffers count to dataset count + if _buffers.count != barData.count { - // Matche buffers count to dataset count - if _buffers.count != barData.dataSetCount + while _buffers.count < barData.count { - while _buffers.count < barData.dataSetCount - { - _buffers.append(Buffer()) - } - while _buffers.count > barData.dataSetCount - { - _buffers.removeLast() - } + _buffers.append(Buffer()) } - - for i in stride(from: 0, to: barData.dataSetCount, by: 1) + while _buffers.count > barData.count { - let set = barData.dataSets[i] as! IBarChartDataSet - let size = set.entryCount * (set.isStacked ? set.stackSize : 1) - if _buffers[i].rects.count != size - { - _buffers[i].rects = [CGRect](repeating: CGRect(), count: size) - } + _buffers.removeLast() } } - else - { - _buffers.removeAll() + + _buffers = zip(_buffers, barData).map { buffer, set -> Buffer in + let set = set as! BarChartDataSetProtocol + let size = set.entryCount * (set.isStacked ? set.stackSize : 1) + return buffer.count == size + ? buffer + : Buffer(repeating: .zero, count: size) } } - private func prepareBuffer(dataSet: IBarChartDataSet, index: Int) + private func prepareBuffer(dataSet: BarChartDataSetProtocol, index: Int) { guard let dataProvider = dataProvider, let barData = dataProvider.barData else { return } - let barWidthHalf = barData.barWidth / 2.0 + let barWidthHalf = CGFloat(barData.barWidth / 2.0) - let buffer = _buffers[index] var bufferIndex = 0 let containsStacks = dataSet.isStacked let isInverted = dataProvider.isInverted(axis: dataSet.axisDependency) - let phaseY = animator.phaseY - var barRect = CGRect() - var x: Double - var y: Double + let phaseY = CGFloat(animator.phaseY) - - for i in stride(from: 0, to: min(Int(ceil(Double(dataSet.entryCount) * animator.phaseX)), dataSet.entryCount), by: 1) + for i in (0..= 0.0 + { + y = posY + yStart = posY + value + posY = yStart + } + else + { + y = negY + yStart = negY + abs(value) + negY += abs(value) + } + + var top = isInverted + ? (y <= yStart ? CGFloat(y) : CGFloat(yStart)) + : (y >= yStart ? CGFloat(y) : CGFloat(yStart)) + var bottom = isInverted + ? (y >= yStart ? CGFloat(y) : CGFloat(yStart)) + : (y <= yStart ? CGFloat(y) : CGFloat(yStart)) + + // multiply the height of the rect with the phase + top *= phaseY + bottom *= phaseY - if !containsStacks || vals == nil + let barRect = CGRect(x: left, y: top, + width: right - left, + height: bottom - top) + _buffers[index][bufferIndex] = barRect + bufferIndex += 1 + } + } + else { - let left = CGFloat(x - barWidthHalf) - let right = CGFloat(x + barWidthHalf) var top = isInverted ? (y <= 0.0 ? CGFloat(y) : 0) : (y >= 0.0 ? CGFloat(y) : 0) @@ -212,72 +238,19 @@ open class BarChartRenderer: BarLineScatterCandleBubbleRenderer // explicitly add 0 + topOffset to indicate this is changed after adding accessibility support (#3650, #3520) if top > 0 + topOffset { - top *= CGFloat(phaseY) + top *= phaseY } else { - bottom *= CGFloat(phaseY) + bottom *= phaseY } - barRect.origin.x = left - barRect.origin.y = top - barRect.size.width = right - left - barRect.size.height = bottom - top - buffer.rects[bufferIndex] = barRect + let barRect = CGRect(x: left, y: top, + width: right - left, + height: bottom - top) + _buffers[index][bufferIndex] = barRect bufferIndex += 1 } - else - { - var posY = 0.0 - var negY = -e.negativeSum - var yStart = 0.0 - - // fill the stack - for k in 0 ..< vals!.count - { - let value = vals![k] - - if value == 0.0 && (posY == 0.0 || negY == 0.0) - { - // Take care of the situation of a 0.0 value, which overlaps a non-zero bar - y = value - yStart = y - } - else if value >= 0.0 - { - y = posY - yStart = posY + value - posY = yStart - } - else - { - y = negY - yStart = negY + abs(value) - negY += abs(value) - } - - let left = CGFloat(x - barWidthHalf) - let right = CGFloat(x + barWidthHalf) - var top = isInverted - ? (y <= yStart ? CGFloat(y) : CGFloat(yStart)) - : (y >= yStart ? CGFloat(y) : CGFloat(yStart)) - var bottom = isInverted - ? (y >= yStart ? CGFloat(y) : CGFloat(yStart)) - : (y <= yStart ? CGFloat(y) : CGFloat(yStart)) - - // multiply the height of the rect with the phase - top *= CGFloat(phaseY) - bottom *= CGFloat(phaseY) - - barRect.origin.x = left - barRect.size.width = right - left - barRect.origin.y = top - barRect.size.height = bottom - top - - buffer.rects[bufferIndex] = barRect - bufferIndex += 1 - } - } } } @@ -301,19 +274,15 @@ open class BarChartRenderer: BarLineScatterCandleBubbleRenderer } // Populate logically ordered nested elements into accessibilityOrderedElements in drawDataSet() - for i in 0 ..< barData.dataSetCount + for i in barData.indices { - guard let set = barData.getDataSetByIndex(i) else { continue } - - if set.isVisible - { - if !(set is IBarChartDataSet) - { - fatalError("Datasets for BarChartRenderer must conform to IBarChartDataset") - } - - drawDataSet(context: context, dataSet: set as! IBarChartDataSet, index: i) + guard let set = barData[i] as? BarChartDataSetProtocol else { + fatalError("Datasets for BarChartRenderer must conform to IBarChartDataset") } + + guard set.isVisible else { continue } + + drawDataSet(context: context, dataSet: set, index: i) } // Merge nested ordered arrays into the single accessibleChartElements. @@ -322,21 +291,22 @@ open class BarChartRenderer: BarLineScatterCandleBubbleRenderer } private var _barShadowRectBuffer: CGRect = CGRect() - - @objc open func drawDataSet(context: CGContext, dataSet: IBarChartDataSet, index: Int) + + @objc open func drawDataSet(context: CGContext, dataSet: BarChartDataSetProtocol, index: Int) { guard let dataProvider = dataProvider else { return } let trans = dataProvider.getTransformer(forAxis: dataSet.axisDependency) prepareBuffer(dataSet: dataSet, index: index) - trans.rectValuesToPixel(&_buffers[index].rects) - + trans.rectValuesToPixel(&_buffers[index]) + let borderWidth = dataSet.barBorderWidth let borderColor = dataSet.barBorderColor let drawBorder = borderWidth > 0.0 context.saveGState() + defer { context.restoreGState() } // draw the bar shadow before the values if dataProvider.isDrawBarShadowEnabled @@ -346,8 +316,9 @@ open class BarChartRenderer: BarLineScatterCandleBubbleRenderer let barWidth = barData.barWidth let barWidthHalf = barWidth / 2.0 var x: Double = 0.0 - - for i in stride(from: 0, to: min(Int(ceil(Double(dataSet.entryCount) * animator.phaseX)), dataSet.entryCount), by: 1) + + let range = (0..= 0 ? posOffset : negOffset), - font: valueFont, - align: .center, - color: dataSet.valueTextColorAt(index)) - } - - if let icon = e.icon, dataSet.isDrawIconsEnabled - { - var px = x - var py = rect.origin.y + - (e.y >= 0 ? posOffset : negOffset) - - px += iconsOffset.x - py += iconsOffset.y - - ChartUtils.drawImage( - context: context, - image: icon, - x: px, - y: py, - size: icon.size) - } - } - else + if let values = vals { // draw stack values - - let vals = vals! var transformed = [CGPoint]() - + var posY = 0.0 var negY = -e.negativeSum - - for k in 0 ..< vals.count + + for value in values { - let value = vals[k] - var y: Double + let y: Double if value == 0.0 && (posY == 0.0 || negY == 0.0) { @@ -683,34 +577,28 @@ open class BarChartRenderer: BarLineScatterCandleBubbleRenderer y = negY negY -= value } - + transformed.append(CGPoint(x: 0.0, y: CGFloat(y * phaseY))) } - + trans.pointValuesToPixel(&transformed) - - for k in 0 ..< transformed.count + + for (value, transformed) in zip(values, transformed) { - let val = vals[k] - let drawBelow = (val == 0.0 && negY == 0.0 && posY > 0.0) || val < 0.0 - let y = transformed[k].y + (drawBelow ? negOffset : posOffset) - - if !viewPortHandler.isInBoundsRight(x) - { - break - } - - if !viewPortHandler.isInBoundsY(y) || !viewPortHandler.isInBoundsLeft(x) - { - continue - } - + let drawBelow = (value == 0.0 && negY == 0.0 && posY > 0.0) || value < 0.0 + let y = transformed.y + (drawBelow ? negOffset : posOffset) + + guard viewPortHandler.isInBoundsRight(x) else { break } + guard viewPortHandler.isInBoundsY(y), + viewPortHandler.isInBoundsLeft(x) + else { continue } + if dataSet.isDrawValuesEnabled { drawValue( context: context, value: formatter.stringForValue( - vals[k], + value, entry: e, dataSetIndex: dataSetIndex, viewPortHandler: viewPortHandler), @@ -718,22 +606,61 @@ open class BarChartRenderer: BarLineScatterCandleBubbleRenderer yPos: y, font: valueFont, align: .center, - color: dataSet.valueTextColorAt(index)) + color: dataSet.valueTextColorAt(index), + anchor: CGPoint(x: 0.5, y: 0.5), + angleRadians: angleRadians) } - + if let icon = e.icon, dataSet.isDrawIconsEnabled { - ChartUtils.drawImage( - context: context, - image: icon, - x: x + iconsOffset.x, - y: y + iconsOffset.y, - size: icon.size) + context.drawImage(icon, + atCenter: CGPoint(x: x + iconsOffset.x, + y: y + iconsOffset.y), + size: icon.size) } } } - - bufferIndex = vals == nil ? (bufferIndex + 1) : (bufferIndex + vals!.count) + else + { + guard viewPortHandler.isInBoundsRight(x) else { break } + guard viewPortHandler.isInBoundsY(rect.origin.y), + viewPortHandler.isInBoundsLeft(x) else { continue } + + if dataSet.isDrawValuesEnabled + { + drawValue( + context: context, + value: formatter.stringForValue( + e.y, + entry: e, + dataSetIndex: dataSetIndex, + viewPortHandler: viewPortHandler), + xPos: x, + yPos: rect.origin.y + + (e.y >= 0 ? posOffset : negOffset), + font: valueFont, + align: .center, + color: dataSet.valueTextColorAt(index), + anchor: CGPoint(x: 0.5, y: 0.5), + angleRadians: angleRadians) + } + + if let icon = e.icon, dataSet.isDrawIconsEnabled + { + var px = x + var py = rect.origin.y + + (e.y >= 0 ? posOffset : negOffset) + + px += iconsOffset.x + py += iconsOffset.y + + context.drawImage(icon, + atCenter: CGPoint(x: px, y: py), + size: icon.size) + } + } + + bufferIndex += vals?.count ?? 1 } } } @@ -741,10 +668,19 @@ open class BarChartRenderer: BarLineScatterCandleBubbleRenderer } /// Draws a value at the specified x and y position. - @objc open func drawValue(context: CGContext, value: String, xPos: CGFloat, yPos: CGFloat, font: NSUIFont, align: NSTextAlignment, color: NSUIColor) + @objc open func drawValue(context: CGContext, value: String, xPos: CGFloat, yPos: CGFloat, font: NSUIFont, align: TextAlignment, color: NSUIColor, anchor: CGPoint, angleRadians: CGFloat) { - ChartUtils.drawText(context: context, text: value, point: CGPoint(x: xPos, y: yPos), align: align, attributes: [NSAttributedString.Key.font: font, NSAttributedString.Key.foregroundColor: color]) + if (angleRadians == 0.0) + { + context.drawText(value, at: CGPoint(x: xPos, y: yPos), align: align, attributes: [.font: font, .foregroundColor: color]) + } + else + { + // align left to center text with rotation + context.drawText(value, at: CGPoint(x: xPos, y: yPos), align: align, anchor: anchor, angleRadians: angleRadians, attributes: [.font: font, .foregroundColor: color]) + } } + open override func drawExtras(context: CGContext) { @@ -759,22 +695,19 @@ open class BarChartRenderer: BarLineScatterCandleBubbleRenderer else { return } context.saveGState() - + defer { context.restoreGState() } var barRect = CGRect() for high in indices { guard - let set = barData.getDataSetByIndex(high.dataSetIndex) as? IBarChartDataSet, + let set = barData[high.dataSetIndex] as? BarChartDataSetProtocol, set.isHighlightEnabled else { continue } if let e = set.entryForXValue(high.x, closestToY: high.y) as? BarChartDataEntry { - if !isInBoundsX(entry: e, dataSet: set) - { - continue - } + guard isInBoundsX(entry: e, dataSet: set) else { continue } let trans = dataProvider.getTransformer(forAxis: set.axisDependency) @@ -814,8 +747,6 @@ open class BarChartRenderer: BarLineScatterCandleBubbleRenderer context.fill(barRect) } } - - context.restoreGState() } /// Sets the drawing position of the highlight object based on the given bar-rect. @@ -842,7 +773,7 @@ open class BarChartRenderer: BarLineScatterCandleBubbleRenderer /// Note that it is marked internal to support subclass modification in the HorizontalBarChart. internal func createAccessibleElement(withIndex idx: Int, container: BarChartView, - dataSet: IBarChartDataSet, + dataSet: BarChartDataSetProtocol, dataSetIndex: Int, stackSize: Int, modifier: (NSUIAccessibilityElement) -> ()) -> NSUIAccessibilityElement @@ -858,18 +789,18 @@ open class BarChartRenderer: BarLineScatterCandleBubbleRenderer // there is the possibility of some labels being rounded up. A floor() might fix this, but seems to be a brute force solution. let label = xAxis.valueFormatter?.stringForValue(e.x, axis: xAxis) ?? "\(e.x)" - var elementValueText = dataSet.valueFormatter?.stringForValue( + var elementValueText = dataSet.valueFormatter.stringForValue( e.y, entry: e, dataSetIndex: dataSetIndex, - viewPortHandler: viewPortHandler) ?? "\(e.y)" + viewPortHandler: viewPortHandler) if dataSet.isStacked, let vals = e.yValues { let labelCount = min(dataSet.colors.count, stackSize) let stackLabel: String? - if (dataSet.stackLabels.count > 0 && labelCount > 0) { + if (!dataSet.stackLabels.isEmpty && labelCount > 0) { let labelIndex = idx % labelCount stackLabel = dataSet.stackLabels.indices.contains(labelIndex) ? dataSet.stackLabels[labelIndex] : nil } else { @@ -878,12 +809,12 @@ open class BarChartRenderer: BarLineScatterCandleBubbleRenderer //Handles empty array of yValues let yValue = vals.isEmpty ? 0.0 : vals[idx % vals.count] - - elementValueText = dataSet.valueFormatter?.stringForValue( + + elementValueText = dataSet.valueFormatter.stringForValue( yValue, entry: e, dataSetIndex: dataSetIndex, - viewPortHandler: viewPortHandler) ?? "\(e.y)" + viewPortHandler: viewPortHandler) if let stackLabel = stackLabel { elementValueText = stackLabel + " \(elementValueText)" diff --git a/Source/Charts/Renderers/BarLineScatterCandleBubbleRenderer.swift b/Source/Charts/Renderers/BarLineScatterCandleBubbleRenderer.swift index 82e6df9c88..2f4751d1aa 100644 --- a/Source/Charts/Renderers/BarLineScatterCandleBubbleRenderer.swift +++ b/Source/Charts/Renderers/BarLineScatterCandleBubbleRenderer.swift @@ -13,17 +13,34 @@ import Foundation import CoreGraphics @objc(BarLineScatterCandleBubbleChartRenderer) -open class BarLineScatterCandleBubbleRenderer: DataRenderer +open class BarLineScatterCandleBubbleRenderer: NSObject, DataRenderer { + public let viewPortHandler: ViewPortHandler + + public final var accessibleChartElements: [NSUIAccessibilityElement] = [] + + public let animator: Animator + internal var _xBounds = XBounds() // Reusable XBounds object - public override init(animator: Animator, viewPortHandler: ViewPortHandler) + public init(animator: Animator, viewPortHandler: ViewPortHandler) { - super.init(animator: animator, viewPortHandler: viewPortHandler) + self.viewPortHandler = viewPortHandler + self.animator = animator + + super.init() } - + + open func drawData(context: CGContext) { } + + open func drawValues(context: CGContext) { } + + open func drawExtras(context: CGContext) { } + + open func drawHighlighted(context: CGContext, indices: [Highlight]) { } + /// Checks if the provided entry object is in bounds for drawing considering the current animation phase. - internal func isInBoundsX(entry e: ChartDataEntry, dataSet: IBarLineScatterCandleBubbleChartDataSet) -> Bool + internal func isInBoundsX(entry e: ChartDataEntry, dataSet: BarLineScatterCandleBubbleChartDataSetProtocol) -> Bool { let entryIndex = dataSet.entryIndex(entry: e) return Double(entryIndex) < Double(dataSet.entryCount) * animator.phaseX @@ -32,18 +49,26 @@ open class BarLineScatterCandleBubbleRenderer: DataRenderer /// Calculates and returns the x-bounds for the given DataSet in terms of index in their values array. /// This includes minimum and maximum visible x, as well as range. internal func xBounds(chart: BarLineScatterCandleBubbleChartDataProvider, - dataSet: IBarLineScatterCandleBubbleChartDataSet, + dataSet: BarLineScatterCandleBubbleChartDataSetProtocol, animator: Animator?) -> XBounds { return XBounds(chart: chart, dataSet: dataSet, animator: animator) } /// - Returns: `true` if the DataSet values should be drawn, `false` if not. - internal func shouldDrawValues(forDataSet set: IChartDataSet) -> Bool + internal func shouldDrawValues(forDataSet set: ChartDataSetProtocol) -> Bool { return set.isVisible && (set.isDrawValuesEnabled || set.isDrawIconsEnabled) } + open func initBuffers() { } + + open func isDrawingValuesAllowed(dataProvider: ChartDataProvider?) -> Bool + { + guard let data = dataProvider?.data else { return false } + return data.entryCount < Int(CGFloat(dataProvider?.maxVisibleCount ?? 0) * viewPortHandler.scaleX) + } + /// Class representing the bounds of the current viewport in terms of indices in the values array of a DataSet. open class XBounds { @@ -62,7 +87,7 @@ open class BarLineScatterCandleBubbleRenderer: DataRenderer } public init(chart: BarLineScatterCandleBubbleChartDataProvider, - dataSet: IBarLineScatterCandleBubbleChartDataSet, + dataSet: BarLineScatterCandleBubbleChartDataSetProtocol, animator: Animator?) { self.set(chart: chart, dataSet: dataSet, animator: animator) @@ -70,7 +95,7 @@ open class BarLineScatterCandleBubbleRenderer: DataRenderer /// Calculates the minimum and maximum x values as well as the range between them. open func set(chart: BarLineScatterCandleBubbleChartDataProvider, - dataSet: IBarLineScatterCandleBubbleChartDataSet, + dataSet: BarLineScatterCandleBubbleChartDataSetProtocol, animator: Animator?) { let phaseX = Swift.max(0.0, Swift.min(1.0, animator?.phaseX ?? 1.0)) @@ -86,6 +111,10 @@ open class BarLineScatterCandleBubbleRenderer: DataRenderer range = Int(Double(self.max - self.min) * phaseX) } } + + public func createAccessibleHeader(usingChart chart: ChartViewBase, andData data: ChartData, withDefaultDescription defaultDescription: String) -> NSUIAccessibilityElement { + return AccessibleHeader.create(usingChart: chart, andData: data, withDefaultDescription: defaultDescription) + } } extension BarLineScatterCandleBubbleRenderer.XBounds: RangeExpression { diff --git a/Source/Charts/Renderers/BubbleChartRenderer.swift b/Source/Charts/Renderers/BubbleChartRenderer.swift index 1a089e9f3e..fa96a6f91e 100644 --- a/Source/Charts/Renderers/BubbleChartRenderer.swift +++ b/Source/Charts/Renderers/BubbleChartRenderer.swift @@ -45,7 +45,8 @@ open class BubbleChartRenderer: BarLineScatterCandleBubbleRenderer accessibleChartElements.append(element) } - for (i, set) in (bubbleData.dataSets as! [IBubbleChartDataSet]).enumerated() where set.isVisible + let sets = bubbleData.dataSets as! [BubbleChartDataSet] + for case let (i, set) in zip(sets.indices, sets) where set.isVisible { drawDataSet(context: context, dataSet: set, dataSetIndex: i) } @@ -71,7 +72,7 @@ open class BubbleChartRenderer: BarLineScatterCandleBubbleRenderer private var _pointBuffer = CGPoint() private var _sizeBuffer = [CGPoint](repeating: CGPoint(), count: 2) - @objc open func drawDataSet(context: CGContext, dataSet: IBubbleChartDataSet, dataSetIndex: Int) + @objc open func drawDataSet(context: CGContext, dataSet: BubbleChartDataSetProtocol, dataSetIndex: Int) { guard let dataProvider = dataProvider else { return } @@ -153,8 +154,7 @@ open class BubbleChartRenderer: BarLineScatterCandleBubbleRenderer guard let dataProvider = dataProvider, let bubbleData = dataProvider.bubbleData, - isDrawingValuesAllowed(dataProvider: dataProvider), - let dataSets = bubbleData.dataSets as? [IBubbleChartDataSet] + isDrawingValuesAllowed(dataProvider: dataProvider) else { return } let phaseX = max(0.0, min(1.0, animator.phaseX)) @@ -162,15 +162,16 @@ open class BubbleChartRenderer: BarLineScatterCandleBubbleRenderer var pt = CGPoint() - for i in 0.. ()) -> NSUIAccessibilityElement @@ -342,10 +343,10 @@ open class BubbleChartRenderer: BarLineScatterCandleBubbleRenderer // there is the possibility of some labels being rounded up. A floor() might fix this, but seems to be a brute force solution. let label = xAxis.valueFormatter?.stringForValue(e.x, axis: xAxis) ?? "\(e.x)" - let elementValueText = dataSet.valueFormatter?.stringForValue(e.y, + let elementValueText = dataSet.valueFormatter.stringForValue(e.y, entry: e, dataSetIndex: dataSetIndex, - viewPortHandler: viewPortHandler) ?? "\(e.y)" + viewPortHandler: viewPortHandler) let dataSetCount = dataProvider.bubbleData?.dataSetCount ?? -1 let doesContainMultipleDataSets = dataSetCount > 1 diff --git a/Source/Charts/Renderers/CandleStickChartRenderer.swift b/Source/Charts/Renderers/CandleStickChartRenderer.swift index 2cdaadf5bb..5690fdb74a 100644 --- a/Source/Charts/Renderers/CandleStickChartRenderer.swift +++ b/Source/Charts/Renderers/CandleStickChartRenderer.swift @@ -38,7 +38,7 @@ open class CandleStickChartRenderer: LineScatterCandleRadarRenderer accessibleChartElements.append(element) } - for set in candleData.dataSets as! [ICandleChartDataSet] where set.isVisible + for case let set as CandleChartDataSetProtocol in candleData where set.isVisible { drawDataSet(context: context, dataSet: set) } @@ -51,7 +51,7 @@ open class CandleStickChartRenderer: LineScatterCandleRadarRenderer private var _bodyRect = CGRect() private var _lineSegments = [CGPoint](repeating: CGPoint(), count: 2) - @objc open func drawDataSet(context: CGContext, dataSet: ICandleChartDataSet) + @objc open func drawDataSet(context: CGContext, dataSet: CandleChartDataSetProtocol) { guard let dataProvider = dataProvider @@ -81,7 +81,7 @@ open class CandleStickChartRenderer: LineScatterCandleRadarRenderer let high = e.high let low = e.low - let doesContainMultipleDataSets = (dataProvider.candleData?.dataSets.count ?? 1) > 1 + let doesContainMultipleDataSets = (dataProvider.candleData?.count ?? 1) > 1 var accessibilityMovementDescription = "neutral" var accessibilityRect = CGRect(x: CGFloat(xPos) + 0.5 - barSpace, y: CGFloat(low * phaseY), @@ -275,28 +275,28 @@ open class CandleStickChartRenderer: LineScatterCandleRadarRenderer // if values are drawn if isDrawingValuesAllowed(dataProvider: dataProvider) { - let dataSets = candleData.dataSets - let phaseY = animator.phaseY var pt = CGPoint() - for i in 0 ..< dataSets.count + for i in candleData.indices { guard let - dataSet = dataSets[i] as? IBarLineScatterCandleBubbleChartDataSet, + dataSet = candleData[i] as? BarLineScatterCandleBubbleChartDataSetProtocol, shouldDrawValues(forDataSet: dataSet) else { continue } let valueFont = dataSet.valueFont - guard let formatter = dataSet.valueFormatter else { continue } + let formatter = dataSet.valueFormatter let trans = dataProvider.getTransformer(forAxis: dataSet.axisDependency) let valueToPixelMatrix = trans.valueToPixelMatrix let iconsOffset = dataSet.iconsOffset + let angleRadians = dataSet.valueLabelAngle.DEG2RAD + _xBounds.set(chart: dataProvider, dataSet: dataSet, animator: animator) let lineHeight = valueFont.lineHeight @@ -322,27 +322,24 @@ open class CandleStickChartRenderer: LineScatterCandleRadarRenderer if dataSet.isDrawValuesEnabled { - ChartUtils.drawText( - context: context, - text: formatter.stringForValue( - e.high, - entry: e, - dataSetIndex: i, - viewPortHandler: viewPortHandler), - point: CGPoint( - x: pt.x, - y: pt.y - yOffset), - align: .center, - attributes: [NSAttributedString.Key.font: valueFont, NSAttributedString.Key.foregroundColor: dataSet.valueTextColorAt(j)]) + context.drawText(formatter.stringForValue(e.high, + entry: e, + dataSetIndex: i, + viewPortHandler: viewPortHandler), + at: CGPoint(x: pt.x, + y: pt.y - yOffset), + align: .center, + angleRadians: angleRadians, + attributes: [.font: valueFont, + .foregroundColor: dataSet.valueTextColorAt(j)]) } if let icon = e.icon, dataSet.isDrawIconsEnabled { - ChartUtils.drawImage(context: context, - image: icon, - x: pt.x + iconsOffset.x, - y: pt.y + iconsOffset.y, - size: icon.size) + context.drawImage(icon, + atCenter: CGPoint(x: pt.x + iconsOffset.x, + y: pt.y + iconsOffset.y), + size: icon.size) } } } @@ -365,7 +362,7 @@ open class CandleStickChartRenderer: LineScatterCandleRadarRenderer for high in indices { guard - let set = candleData.getDataSetByIndex(high.dataSetIndex) as? ICandleChartDataSet, + let set = candleData[high.dataSetIndex] as? CandleChartDataSetProtocol, set.isHighlightEnabled else { continue } @@ -407,7 +404,7 @@ open class CandleStickChartRenderer: LineScatterCandleRadarRenderer private func createAccessibleElement(withIndex idx: Int, container: CandleChartDataProvider, - dataSet: ICandleChartDataSet, + dataSet: CandleChartDataSetProtocol, modifier: (NSUIAccessibilityElement) -> ()) -> NSUIAccessibilityElement { let element = NSUIAccessibilityElement(accessibilityContainer: container) diff --git a/Source/Charts/Renderers/ChartDataRendererBase.swift b/Source/Charts/Renderers/ChartDataRendererBase.swift deleted file mode 100644 index abbbcb0df1..0000000000 --- a/Source/Charts/Renderers/ChartDataRendererBase.swift +++ /dev/null @@ -1,102 +0,0 @@ -// -// DataRenderer.swift -// Charts -// -// Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda -// A port of MPAndroidChart for iOS -// Licensed under Apache License 2.0 -// -// https://github.com/danielgindi/Charts -// - -import Foundation -import CoreGraphics - -#if canImport(UIKit) - import UIKit -#endif - -#if canImport(Cocoa) -import Cocoa -#endif - -@objc(ChartDataRendererBase) -open class DataRenderer: Renderer -{ - /// An array of accessibility elements that are presented to the ChartViewBase accessibility methods. - /// - /// Note that the order of elements in this array determines the order in which they are presented and navigated by - /// Accessibility clients such as VoiceOver. - /// - /// Renderers should ensure that the order of elements makes sense to a client presenting an audio-only interface to a user. - /// Subclasses should populate this array in drawData() or drawDataSet() to make the chart accessible. - @objc final var accessibleChartElements: [NSUIAccessibilityElement] = [] - - @objc public let animator: Animator - - @objc public init(animator: Animator, viewPortHandler: ViewPortHandler) - { - self.animator = animator - - super.init(viewPortHandler: viewPortHandler) - } - - @objc open func drawData(context: CGContext) - { - fatalError("drawData() cannot be called on DataRenderer") - } - - @objc open func drawValues(context: CGContext) - { - fatalError("drawValues() cannot be called on DataRenderer") - } - - @objc open func drawExtras(context: CGContext) - { - fatalError("drawExtras() cannot be called on DataRenderer") - } - - /// Draws all highlight indicators for the values that are currently highlighted. - /// - /// - Parameters: - /// - indices: the highlighted values - @objc open func drawHighlighted(context: CGContext, indices: [Highlight]) - { - fatalError("drawHighlighted() cannot be called on DataRenderer") - } - - /// An opportunity for initializing internal buffers used for rendering with a new size. - /// Since this might do memory allocations, it should only be called if necessary. - @objc open func initBuffers() { } - - @objc open func isDrawingValuesAllowed(dataProvider: ChartDataProvider?) -> Bool - { - guard let data = dataProvider?.data else { return false } - return data.entryCount < Int(CGFloat(dataProvider?.maxVisibleCount ?? 0) * viewPortHandler.scaleX) - } - - /// Creates an ```NSUIAccessibilityElement``` that acts as the first and primary header describing a chart view. - /// - /// - Parameters: - /// - chart: The chartView object being described - /// - data: A non optional data source about the chart - /// - defaultDescription: A simple string describing the type/design of Chart. - /// - Returns: A header ```NSUIAccessibilityElement``` that can be added to accessibleChartElements. - @objc internal func createAccessibleHeader(usingChart chart: ChartViewBase, - andData data: ChartData, - withDefaultDescription defaultDescription: String = "Chart") -> NSUIAccessibilityElement - { - let chartDescriptionText = chart.chartDescription?.text ?? defaultDescription - let dataSetDescriptions = data.dataSets.map { $0.label ?? "" } - let dataSetDescriptionText = dataSetDescriptions.joined(separator: ", ") - let dataSetCount = data.dataSets.count - - let - element = NSUIAccessibilityElement(accessibilityContainer: chart) - element.accessibilityLabel = chartDescriptionText + ". \(dataSetCount) dataset\(dataSetCount == 1 ? "" : "s"). \(dataSetDescriptionText)" - element.accessibilityFrame = chart.bounds - element.isHeader = true - - return element - } -} diff --git a/Source/Charts/Renderers/CombinedChartRenderer.swift b/Source/Charts/Renderers/CombinedChartRenderer.swift index 8446c9b637..de6121df63 100644 --- a/Source/Charts/Renderers/CombinedChartRenderer.swift +++ b/Source/Charts/Renderers/CombinedChartRenderer.swift @@ -12,8 +12,14 @@ import Foundation import CoreGraphics -open class CombinedChartRenderer: DataRenderer +open class CombinedChartRenderer: NSObject, DataRenderer { + public let viewPortHandler: ViewPortHandler + + public final var accessibleChartElements: [NSUIAccessibilityElement] = [] + + public let animator: Animator + @objc open weak var chart: CombinedChartView? /// if set to true, all values are drawn above their bars, instead of below their top @@ -28,9 +34,11 @@ open class CombinedChartRenderer: DataRenderer @objc public init(chart: CombinedChartView, animator: Animator, viewPortHandler: ViewPortHandler) { - super.init(animator: animator, viewPortHandler: viewPortHandler) - self.chart = chart + self.viewPortHandler = viewPortHandler + self.animator = animator + + super.init() createRenderers() } @@ -51,46 +59,41 @@ open class CombinedChartRenderer: DataRenderer { _renderers.append(BarChartRenderer(dataProvider: chart, animator: animator, viewPortHandler: viewPortHandler)) } - break - + case .line: if chart.lineData !== nil { _renderers.append(LineChartRenderer(dataProvider: chart, animator: animator, viewPortHandler: viewPortHandler)) } - break - + case .candle: if chart.candleData !== nil { _renderers.append(CandleStickChartRenderer(dataProvider: chart, animator: animator, viewPortHandler: viewPortHandler)) } - break - + case .scatter: if chart.scatterData !== nil { _renderers.append(ScatterChartRenderer(dataProvider: chart, animator: animator, viewPortHandler: viewPortHandler)) } - break - + case .bubble: if chart.bubbleData !== nil { _renderers.append(BubbleChartRenderer(dataProvider: chart, animator: animator, viewPortHandler: viewPortHandler)) } - break } } } - open override func initBuffers() + open func initBuffers() { _renderers.forEach { $0.initBuffers() } } - open override func drawData(context: CGContext) + open func drawData(context: CGContext) { // If we redraw the data, remove and repopulate accessible elements to update label values and frames accessibleChartElements.removeAll() @@ -111,17 +114,17 @@ open class CombinedChartRenderer: DataRenderer _renderers.forEach { $0.drawData(context: context) } } - open override func drawValues(context: CGContext) + open func drawValues(context: CGContext) { _renderers.forEach { $0.drawValues(context: context) } } - open override func drawExtras(context: CGContext) + open func drawExtras(context: CGContext) { _renderers.forEach { $0.drawExtras(context: context) } } - open override func drawHighlighted(context: CGContext, indices: [Highlight]) + open func drawHighlighted(context: CGContext, indices: [Highlight]) { for renderer in _renderers { @@ -148,12 +151,7 @@ open class CombinedChartRenderer: DataRenderer data = (renderer as! BubbleChartRenderer).dataProvider?.bubbleData } - let dataIndex: Int? = { - guard let data = data else { return nil } - return (chart?.data as? CombinedChartData)? - .allData - .firstIndex(of: data) - }() + let dataIndex = data == nil ? nil : (chart?.data as? CombinedChartData)?.allData.firstIndex(of: data!) let dataIndices = indices.filter{ $0.dataIndex == dataIndex || $0.dataIndex == -1 } @@ -161,17 +159,10 @@ open class CombinedChartRenderer: DataRenderer } } - /// - Returns: The sub-renderer object at the specified index. - @objc open func getSubRenderer(index: Int) -> DataRenderer? + open func isDrawingValuesAllowed(dataProvider: ChartDataProvider?) -> Bool { - if index >= _renderers.count || index < 0 - { - return nil - } - else - { - return _renderers[index] - } + guard let data = dataProvider?.data else { return false } + return data.entryCount < Int(CGFloat(dataProvider?.maxVisibleCount ?? 0) * viewPortHandler.scaleX) } /// All sub-renderers. @@ -194,16 +185,17 @@ open class CombinedChartRenderer: DataRenderer /// e.g. if you provide [DrawOrder.Bar, DrawOrder.Line], the bars will be drawn behind the lines. open var drawOrder: [CombinedChartView.DrawOrder] { - get - { - return _drawOrder - } + get { _drawOrder } set { - if newValue.count > 0 + if !newValue.isEmpty { _drawOrder = newValue } } } + + public func createAccessibleHeader(usingChart chart: ChartViewBase, andData data: ChartData, withDefaultDescription defaultDescription: String) -> NSUIAccessibilityElement { + return AccessibleHeader.create(usingChart: chart, andData: data, withDefaultDescription: defaultDescription) + } } diff --git a/Source/Charts/Renderers/DataRenderer.swift b/Source/Charts/Renderers/DataRenderer.swift new file mode 100644 index 0000000000..e417b42808 --- /dev/null +++ b/Source/Charts/Renderers/DataRenderer.swift @@ -0,0 +1,75 @@ +// +// DataRenderer.swift +// Charts +// +// Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda +// A port of MPAndroidChart for iOS +// Licensed under Apache License 2.0 +// +// https://github.com/danielgindi/Charts +// + +import Foundation +import CoreGraphics + +@objc(ChartDataRenderer) +public protocol DataRenderer: Renderer +{ + /// An array of accessibility elements that are presented to the ChartViewBase accessibility methods. + /// + /// Note that the order of elements in this array determines the order in which they are presented and navigated by + /// Accessibility clients such as VoiceOver. + /// + /// Renderers should ensure that the order of elements makes sense to a client presenting an audio-only interface to a user. + /// Subclasses should populate this array in drawData() or drawDataSet() to make the chart accessible. + var accessibleChartElements: [NSUIAccessibilityElement] { get } + + var animator: Animator { get } + + func drawData(context: CGContext) + + func drawValues(context: CGContext) + + func drawExtras(context: CGContext) + + /// Draws all highlight indicators for the values that are currently highlighted. + /// + /// - Parameters: + /// - indices: the highlighted values + func drawHighlighted(context: CGContext, indices: [Highlight]) + + /// An opportunity for initializing internal buffers used for rendering with a new size. + /// Since this might do memory allocations, it should only be called if necessary. + func initBuffers() + + func isDrawingValuesAllowed(dataProvider: ChartDataProvider?) -> Bool + + /// Creates an ```NSUIAccessibilityElement``` that acts as the first and primary header describing a chart view. + /// + /// - Parameters: + /// - chart: The chartView object being described + /// - data: A non optional data source about the chart + /// - defaultDescription: A simple string describing the type/design of Chart. + /// - Returns: A header ```NSUIAccessibilityElement``` that can be added to accessibleChartElements. + func createAccessibleHeader(usingChart chart: ChartViewBase, + andData data: ChartData, + withDefaultDescription defaultDescription: String) -> NSUIAccessibilityElement +} + +internal struct AccessibleHeader { + static func create(usingChart chart: ChartViewBase, + andData data: ChartData, + withDefaultDescription defaultDescription: String = "Chart") -> NSUIAccessibilityElement + { + let chartDescriptionText = chart.chartDescription.text ?? defaultDescription + let dataSetDescriptions = data.map { $0.label ?? "" } + let dataSetDescriptionText = dataSetDescriptions.joined(separator: ", ") + + let element = NSUIAccessibilityElement(accessibilityContainer: chart) + element.accessibilityLabel = chartDescriptionText + ". \(data.count) dataset\(data.count == 1 ? "" : "s"). \(dataSetDescriptionText)" + element.accessibilityFrame = chart.bounds + element.isHeader = true + + return element + } +} diff --git a/Source/Charts/Renderers/HorizontalBarChartRenderer.swift b/Source/Charts/Renderers/HorizontalBarChartRenderer.swift index 36f4a6c846..d2fed814f3 100644 --- a/Source/Charts/Renderers/HorizontalBarChartRenderer.swift +++ b/Source/Charts/Renderers/HorizontalBarChartRenderer.swift @@ -12,13 +12,10 @@ import Foundation import CoreGraphics -#if canImport(UIKit) +#if !os(OSX) import UIKit #endif -#if canImport(Cocoa) -import Cocoa -#endif open class HorizontalBarChartRenderer: BarChartRenderer { @@ -40,21 +37,21 @@ open class HorizontalBarChartRenderer: BarChartRenderer if let barData = dataProvider?.barData { // Matche buffers count to dataset count - if _buffers.count != barData.dataSetCount + if _buffers.count != barData.count { - while _buffers.count < barData.dataSetCount + while _buffers.count < barData.count { _buffers.append(Buffer()) } - while _buffers.count > barData.dataSetCount + while _buffers.count > barData.count { _buffers.removeLast() } } - for i in stride(from: 0, to: barData.dataSetCount, by: 1) + for i in barData.indices { - let set = barData.dataSets[i] as! IBarChartDataSet + let set = barData[i] as! BarChartDataSetProtocol let size = set.entryCount * (set.isStacked ? set.stackSize : 1) if _buffers[i].rects.count != size { @@ -68,7 +65,7 @@ open class HorizontalBarChartRenderer: BarChartRenderer } } - private func prepareBuffer(dataSet: IBarChartDataSet, index: Int) + private func prepareBuffer(dataSet: BarChartDataSetProtocol, index: Int) { guard let dataProvider = dataProvider, @@ -132,7 +129,7 @@ open class HorizontalBarChartRenderer: BarChartRenderer var yStart = 0.0 // fill the stack - for k in 0 ..< vals!.count + for k in vals!.indices { let value = vals![k] @@ -182,7 +179,7 @@ open class HorizontalBarChartRenderer: BarChartRenderer private var _barShadowRectBuffer: CGRect = CGRect() - open override func drawDataSet(context: CGContext, dataSet: IBarChartDataSet, index: Int) + open override func drawDataSet(context: CGContext, dataSet: BarChartDataSetProtocol, index: Int) { guard let dataProvider = dataProvider else { return } @@ -248,7 +245,7 @@ open class HorizontalBarChartRenderer: BarChartRenderer let isStacked = dataSet.isStacked let stackSize = isStacked ? dataSet.stackSize : 1 - for j in stride(from: 0, to: buffer.rects.count, by: 1) + for j in buffer.rects.indices { let barRect = buffer.rects[j] @@ -326,29 +323,29 @@ open class HorizontalBarChartRenderer: BarChartRenderer let dataProvider = dataProvider, let barData = dataProvider.barData else { return } - - let dataSets = barData.dataSets - - let textAlign = NSTextAlignment.left + + let textAlign = TextAlignment.left let valueOffsetPlus: CGFloat = 5.0 var posOffset: CGFloat var negOffset: CGFloat let drawValueAboveBar = dataProvider.isDrawValueAboveBarEnabled - for dataSetIndex in 0 ..< barData.dataSetCount + for dataSetIndex in barData.indices { guard let - dataSet = dataSets[dataSetIndex] as? IBarChartDataSet, + dataSet = barData[dataSetIndex] as? BarChartDataSetProtocol, shouldDrawValues(forDataSet: dataSet) else { continue } + let angleRadians = dataSet.valueLabelAngle.DEG2RAD + let isInverted = dataProvider.isInverted(axis: dataSet.axisDependency) let valueFont = dataSet.valueFont let yOffset = -valueFont.lineHeight / 2.0 - guard let formatter = dataSet.valueFormatter else { continue } + let formatter = dataSet.valueFormatter let trans = dataProvider.getTransformer(forAxis: dataSet.axisDependency) @@ -392,7 +389,7 @@ open class HorizontalBarChartRenderer: BarChartRenderer viewPortHandler: viewPortHandler) // calculate the correct offset depending on the draw position of the value - let valueTextWidth = valueText.size(withAttributes: [NSAttributedString.Key.font: valueFont]).width + let valueTextWidth = valueText.size(withAttributes: [.font: valueFont]).width posOffset = (drawValueAboveBar ? valueOffsetPlus : -(valueTextWidth + valueOffsetPlus)) negOffset = (drawValueAboveBar ? -(valueTextWidth + valueOffsetPlus) : valueOffsetPlus) - rect.size.width @@ -412,7 +409,9 @@ open class HorizontalBarChartRenderer: BarChartRenderer yPos: y + yOffset, font: valueFont, align: textAlign, - color: dataSet.valueTextColorAt(j)) + color: dataSet.valueTextColorAt(j), + anchor: CGPoint.zero, + angleRadians: angleRadians) } if let icon = e.icon, dataSet.isDrawIconsEnabled @@ -424,12 +423,9 @@ open class HorizontalBarChartRenderer: BarChartRenderer px += iconsOffset.x py += iconsOffset.y - ChartUtils.drawImage( - context: context, - image: icon, - x: px, - y: py, - size: icon.size) + context.drawImage(icon, + atCenter: CGPoint(x: px, y: py), + size: icon.size) } } } @@ -493,7 +489,9 @@ open class HorizontalBarChartRenderer: BarChartRenderer yPos: rect.origin.y + yOffset, font: valueFont, align: textAlign, - color: dataSet.valueTextColorAt(index)) + color: dataSet.valueTextColorAt(index), + anchor: CGPoint.zero, + angleRadians: angleRadians) } if let icon = e.icon, dataSet.isDrawIconsEnabled @@ -505,12 +503,9 @@ open class HorizontalBarChartRenderer: BarChartRenderer px += iconsOffset.x py += iconsOffset.y - ChartUtils.drawImage( - context: context, - image: icon, - x: px, - y: py, - size: icon.size) + context.drawImage(icon, + atCenter: CGPoint(x: px, y: py), + size: icon.size) } } else @@ -521,7 +516,7 @@ open class HorizontalBarChartRenderer: BarChartRenderer var posY = 0.0 var negY = -e.negativeSum - for k in 0 ..< vals.count + for k in vals.indices { let value = vals[k] var y: Double @@ -547,7 +542,7 @@ open class HorizontalBarChartRenderer: BarChartRenderer trans.pointValuesToPixel(&transformed) - for k in 0 ..< transformed.count + for k in transformed.indices { let val = vals[k] let valueText = formatter.stringForValue( @@ -557,7 +552,7 @@ open class HorizontalBarChartRenderer: BarChartRenderer viewPortHandler: viewPortHandler) // calculate the correct offset depending on the draw position of the value - let valueTextWidth = valueText.size(withAttributes: [NSAttributedString.Key.font: valueFont]).width + let valueTextWidth = valueText.size(withAttributes: [.font: valueFont]).width posOffset = (drawValueAboveBar ? valueOffsetPlus : -(valueTextWidth + valueOffsetPlus)) negOffset = (drawValueAboveBar ? -(valueTextWidth + valueOffsetPlus) : valueOffsetPlus) @@ -590,27 +585,27 @@ open class HorizontalBarChartRenderer: BarChartRenderer if dataSet.isDrawValuesEnabled { drawValue(context: context, - value: valueText, - xPos: x, - yPos: y + yOffset, - font: valueFont, - align: textAlign, - color: dataSet.valueTextColorAt(index)) + value: valueText, + xPos: x, + yPos: y + yOffset, + font: valueFont, + align: textAlign, + color: dataSet.valueTextColorAt(index), + anchor: CGPoint.zero, + angleRadians: angleRadians) } if let icon = e.icon, dataSet.isDrawIconsEnabled { - ChartUtils.drawImage( - context: context, - image: icon, - x: x + iconsOffset.x, - y: y + iconsOffset.y, - size: icon.size) + context.drawImage(icon, + atCenter: CGPoint(x: x + iconsOffset.x, + y: y + iconsOffset.y), + size: icon.size) } } } - bufferIndex = vals == nil ? (bufferIndex + 1) : (bufferIndex + vals!.count) + bufferIndex += vals?.count ?? 1 } } } diff --git a/Source/Charts/Renderers/LegendRenderer.swift b/Source/Charts/Renderers/LegendRenderer.swift index b9514b4fcf..41fd499dbe 100755 --- a/Source/Charts/Renderers/LegendRenderer.swift +++ b/Source/Charts/Renderers/LegendRenderer.swift @@ -13,16 +13,19 @@ import Foundation import CoreGraphics @objc(ChartLegendRenderer) -open class LegendRenderer: Renderer +open class LegendRenderer: NSObject, Renderer { + @objc public let viewPortHandler: ViewPortHandler + /// the legend object this renderer renders @objc open var legend: Legend? @objc public init(viewPortHandler: ViewPortHandler, legend: Legend?) { - super.init(viewPortHandler: viewPortHandler) - + self.viewPortHandler = viewPortHandler self.legend = legend + + super.init() } /// Prepares the legend and calculates all needed forms, labels and colors. @@ -35,25 +38,23 @@ open class LegendRenderer: Renderer var entries: [LegendEntry] = [] // loop for building up the colors and labels used in the legend - for i in 0.. 0) + if !sLabels.isEmpty && minEntries > 0 { let labelIndex = j % minEntries label = sLabels.indices.contains(labelIndex) ? sLabels[labelIndex] : nil @@ -63,100 +64,76 @@ open class LegendRenderer: Renderer label = nil } - entries.append( - LegendEntry( - label: label, - form: dataSet.form, - formSize: dataSet.formSize, - formLineWidth: dataSet.formLineWidth, - formLineDashPhase: dataSet.formLineDashPhase, - formLineDashLengths: dataSet.formLineDashLengths, - formColor: clrs[j] - ) - ) + let entry = LegendEntry(label: label) + entry.form = dataSet.form + entry.formSize = dataSet.formSize + entry.formLineWidth = dataSet.formLineWidth + entry.formLineDashPhase = dataSet.formLineDashPhase + entry.formLineDashLengths = dataSet.formLineDashLengths + entry.formColor = clrs[j] + + entries.append(entry) } if dataSet.label != nil { // add the legend description label - - entries.append( - LegendEntry( - label: dataSet.label, - form: .none, - formSize: CGFloat.nan, - formLineWidth: CGFloat.nan, - formLineDashPhase: 0.0, - formLineDashLengths: nil, - formColor: nil - ) - ) + let entry = LegendEntry(label: dataSet.label) + entry.form = .none + + entries.append(entry) } } - else if dataSet is IPieChartDataSet + else if dataSet is PieChartDataSetProtocol { - let pds = dataSet as! IPieChartDataSet + let pds = dataSet as! PieChartDataSetProtocol for j in 0.. 0 + if formLineDashLengths != nil && !formLineDashLengths!.isEmpty { context.setLineDash(phase: formLineDashPhase, lengths: formLineDashLengths!) } @@ -573,6 +548,6 @@ open class LegendRenderer: Renderer /// Draws the provided label at the given position. @objc open func drawLabel(context: CGContext, x: CGFloat, y: CGFloat, label: String, font: NSUIFont, textColor: NSUIColor) { - ChartUtils.drawText(context: context, text: label, point: CGPoint(x: x, y: y), align: .left, attributes: [NSAttributedString.Key.font: font, NSAttributedString.Key.foregroundColor: textColor]) + context.drawText(label, at: CGPoint(x: x, y: y), align: .left, attributes: [.font: font, .foregroundColor: textColor]) } } diff --git a/Source/Charts/Renderers/LineScatterCandleRadarRenderer.swift b/Source/Charts/Renderers/LineScatterCandleRadarRenderer.swift index 05203caf9c..dd33ffe862 100644 --- a/Source/Charts/Renderers/LineScatterCandleRadarRenderer.swift +++ b/Source/Charts/Renderers/LineScatterCandleRadarRenderer.swift @@ -25,7 +25,7 @@ open class LineScatterCandleRadarRenderer: BarLineScatterCandleBubbleRenderer /// :param: points /// :param: horizontal /// :param: vertical - @objc open func drawHighlightLines(context: CGContext, point: CGPoint, set: ILineScatterCandleRadarChartDataSet) + @objc open func drawHighlightLines(context: CGContext, point: CGPoint, set: LineScatterCandleRadarChartDataSetProtocol) { // draw vertical highlight lines diff --git a/Source/Charts/Renderers/PieChartRenderer.swift b/Source/Charts/Renderers/PieChartRenderer.swift index 19ea0d4607..18f571bc79 100644 --- a/Source/Charts/Renderers/PieChartRenderer.swift +++ b/Source/Charts/Renderers/PieChartRenderer.swift @@ -12,41 +12,41 @@ import Foundation import CoreGraphics -#if canImport(UIKit) +#if !os(OSX) import UIKit #endif -#if canImport(Cocoa) -import Cocoa -#endif -open class PieChartRenderer: DataRenderer +open class PieChartRenderer: NSObject, DataRenderer { + public let viewPortHandler: ViewPortHandler + + public final var accessibleChartElements: [NSUIAccessibilityElement] = [] + + public let animator: Animator + @objc open weak var chart: PieChartView? @objc public init(chart: PieChartView, animator: Animator, viewPortHandler: ViewPortHandler) { - super.init(animator: animator, viewPortHandler: viewPortHandler) - + self.viewPortHandler = viewPortHandler + self.animator = animator self.chart = chart - } - open override func drawData(context: CGContext) + super.init() + } + + open func drawData(context: CGContext) { - guard let chart = chart else { return } + guard let chart = chart, let pieData = chart.data else { return } - let pieData = chart.data + // If we redraw the data, remove and repopulate accessible elements to update label values and frames + accessibleChartElements.removeAll() - if pieData != nil + for case let set as PieChartDataSetProtocol in pieData where + set.isVisible && set.entryCount > 0 { - // If we redraw the data, remove and repopulate accessible elements to update label values and frames - accessibleChartElements.removeAll() - - for set in pieData!.dataSets as! [IPieChartDataSet] - where set.isVisible && set.entryCount > 0 - { - drawDataSet(context: context, dataSet: set) - } + drawDataSet(context: context, dataSet: set) } } @@ -92,7 +92,7 @@ open class PieChartRenderer: DataRenderer } /// Calculates the sliceSpace to use based on visible values and their size compared to the set sliceSpace. - @objc open func getSliceSpace(dataSet: IPieChartDataSet) -> CGFloat + @objc open func getSliceSpace(dataSet: PieChartDataSetProtocol) -> CGFloat { guard dataSet.automaticallyDisableSliceSpacing, @@ -109,7 +109,7 @@ open class PieChartRenderer: DataRenderer return sliceSpace } - @objc open func drawDataSet(context: CGContext, dataSet: IPieChartDataSet) + @objc open func drawDataSet(context: CGContext, dataSet: PieChartDataSetProtocol) { guard let chart = chart else {return } @@ -148,7 +148,7 @@ open class PieChartRenderer: DataRenderer // i.e. We want to VO to say "3 Elements" even if the developer didn't specify an accessibility prefix // If prefix is unspecified it is safe to assume they did not want to use "Element 1", so that uses a default empty string let prefix: String = chart.data?.accessibilityEntryLabelPrefix ?? "Element" - let description = chart.chartDescription?.text ?? dataSet.label ?? chart.centerText ?? "Pie Chart" + let description = chart.chartDescription.text ?? dataSet.label ?? chart.centerText ?? "Pie Chart" let element = NSUIAccessibilityElement(accessibilityContainer: chart) @@ -293,8 +293,8 @@ open class PieChartRenderer: DataRenderer context.restoreGState() } - - open override func drawValues(context: CGContext) + + open func drawValues(context: CGContext) { guard let chart = chart, @@ -321,12 +321,11 @@ open class PieChartRenderer: DataRenderer let labelRadius = radius - labelRadiusOffset - let dataSets = data.dataSets - let yValueSum = (data as! PieChartData).yValueSum let drawEntryLabels = chart.isDrawEntryLabelsEnabled let usePercentValuesEnabled = chart.usePercentValuesEnabled + let sliceTextDrawingThreshold = chart.sliceTextDrawingThreshold var angle: CGFloat = 0.0 var xIndex = 0 @@ -334,10 +333,10 @@ open class PieChartRenderer: DataRenderer context.saveGState() defer { context.restoreGState() } - for i in 0 ..< dataSets.count + for i in data.indices { - guard let dataSet = dataSets[i] as? IPieChartDataSet else { continue } - + guard let dataSet = data[i] as? PieChartDataSetProtocol else { continue } + let drawValues = dataSet.isDrawValuesEnabled if !drawValues && !drawEntryLabels && !dataSet.isDrawIconsEnabled @@ -347,15 +346,17 @@ open class PieChartRenderer: DataRenderer let iconsOffset = dataSet.iconsOffset + let angleRadians = dataSet.valueLabelAngle.DEG2RAD + let xValuePosition = dataSet.xValuePosition let yValuePosition = dataSet.yValuePosition let valueFont = dataSet.valueFont - let entryLabelFont = dataSet.entryLabelFont ?? chart.entryLabelFont + let entryLabelFont = dataSet.entryLabelFont let lineHeight = valueFont.lineHeight - - guard let formatter = dataSet.valueFormatter else { continue } - + + let formatter = dataSet.valueFormatter + for j in 0 ..< dataSet.entryCount { guard let e = dataSet.entryForIndex(j) else { continue } @@ -390,14 +391,14 @@ open class PieChartRenderer: DataRenderer let sliceXBase = cos(transformedAngle.DEG2RAD) let sliceYBase = sin(transformedAngle.DEG2RAD) - - let drawXOutside = drawEntryLabels && xValuePosition == .outsideSlice - let drawYOutside = drawValues && yValuePosition == .outsideSlice - let drawXInside = drawEntryLabels && xValuePosition == .insideSlice - let drawYInside = drawValues && yValuePosition == .insideSlice - + + let drawXOutside = sliceAngle > sliceTextDrawingThreshold && drawEntryLabels && xValuePosition == .outsideSlice + let drawYOutside = sliceAngle > sliceTextDrawingThreshold && drawValues && yValuePosition == .outsideSlice + let drawXInside = sliceAngle > sliceTextDrawingThreshold && drawEntryLabels && xValuePosition == .insideSlice + let drawYInside = sliceAngle > sliceTextDrawingThreshold && drawValues && yValuePosition == .insideSlice + let valueTextColor = dataSet.valueTextColorAt(j) - let entryLabelColor = dataSet.entryLabelColor ?? chart.entryLabelColor + let entryLabelColor = dataSet.entryLabelColor if drawXOutside || drawYOutside { @@ -407,7 +408,7 @@ open class PieChartRenderer: DataRenderer var pt2: CGPoint var labelPoint: CGPoint - var align: NSTextAlignment + var align: TextAlignment var line1Radius: CGFloat @@ -470,51 +471,46 @@ open class PieChartRenderer: DataRenderer if drawXOutside && drawYOutside { - ChartUtils.drawText( - context: context, - text: valueText, - point: labelPoint, - align: align, - attributes: [NSAttributedString.Key.font: valueFont, NSAttributedString.Key.foregroundColor: valueTextColor] - ) - + context.drawText(valueText, + at: labelPoint, + align: align, + angleRadians: angleRadians, + attributes: [.font: valueFont, + .foregroundColor: valueTextColor]) + if j < data.entryCount && pe?.label != nil { - ChartUtils.drawText( - context: context, - text: pe!.label!, - point: CGPoint(x: labelPoint.x, y: labelPoint.y + lineHeight), - align: align, - attributes: [ - NSAttributedString.Key.font: entryLabelFont ?? valueFont, - NSAttributedString.Key.foregroundColor: entryLabelColor ?? valueTextColor] - ) + context.drawText(pe!.label!, + at: CGPoint(x: labelPoint.x, + y: labelPoint.y + lineHeight), + align: align, + angleRadians: angleRadians, + attributes: [.font: entryLabelFont ?? valueFont, + .foregroundColor: entryLabelColor ?? valueTextColor]) } } else if drawXOutside { if j < data.entryCount && pe?.label != nil { - ChartUtils.drawText( - context: context, - text: pe!.label!, - point: CGPoint(x: labelPoint.x, y: labelPoint.y + lineHeight / 2.0), - align: align, - attributes: [ - NSAttributedString.Key.font: entryLabelFont ?? valueFont, - NSAttributedString.Key.foregroundColor: entryLabelColor ?? valueTextColor] - ) + context.drawText(pe!.label!, + at: CGPoint(x: labelPoint.x, + y: labelPoint.y + lineHeight / 2.0), + align: align, + angleRadians: angleRadians, + attributes: [.font: entryLabelFont ?? valueFont, + .foregroundColor: entryLabelColor ?? valueTextColor]) } } else if drawYOutside { - ChartUtils.drawText( - context: context, - text: valueText, - point: CGPoint(x: labelPoint.x, y: labelPoint.y + lineHeight / 2.0), - align: align, - attributes: [NSAttributedString.Key.font: valueFont, NSAttributedString.Key.foregroundColor: valueTextColor] - ) + context.drawText(valueText, + at: CGPoint(x: labelPoint.x, + y: labelPoint.y + lineHeight / 2.0), + align: align, + angleRadians: angleRadians, + attributes: [.font: valueFont, + .foregroundColor: valueTextColor]) } } @@ -526,51 +522,41 @@ open class PieChartRenderer: DataRenderer if drawXInside && drawYInside { - ChartUtils.drawText( - context: context, - text: valueText, - point: CGPoint(x: x, y: y), - align: .center, - attributes: [NSAttributedString.Key.font: valueFont, NSAttributedString.Key.foregroundColor: valueTextColor] - ) - + context.drawText(valueText, + at: CGPoint(x: x, y: y), + align: .center, + angleRadians: angleRadians, + attributes: [.font: valueFont, .foregroundColor: valueTextColor]) + if j < data.entryCount && pe?.label != nil { - ChartUtils.drawText( - context: context, - text: pe!.label!, - point: CGPoint(x: x, y: y + lineHeight), - align: .center, - attributes: [ - NSAttributedString.Key.font: entryLabelFont ?? valueFont, - NSAttributedString.Key.foregroundColor: entryLabelColor ?? valueTextColor] - ) + context.drawText(pe!.label!, + at: CGPoint(x: x, y: y + lineHeight), + align: .center, + angleRadians: angleRadians, + attributes: [.font: entryLabelFont ?? valueFont, + .foregroundColor: entryLabelColor ?? valueTextColor]) } } else if drawXInside { if j < data.entryCount && pe?.label != nil { - ChartUtils.drawText( - context: context, - text: pe!.label!, - point: CGPoint(x: x, y: y + lineHeight / 2.0), - align: .center, - attributes: [ - NSAttributedString.Key.font: entryLabelFont ?? valueFont, - NSAttributedString.Key.foregroundColor: entryLabelColor ?? valueTextColor] - ) + context.drawText(pe!.label!, + at: CGPoint(x: x, y: y + lineHeight / 2.0), + align: .center, + angleRadians: angleRadians, + attributes: [.font: entryLabelFont ?? valueFont, + .foregroundColor: entryLabelColor ?? valueTextColor]) } } else if drawYInside { - ChartUtils.drawText( - context: context, - text: valueText, - point: CGPoint(x: x, y: y + lineHeight / 2.0), - align: .center, - attributes: [NSAttributedString.Key.font: valueFont, NSAttributedString.Key.foregroundColor: valueTextColor] - ) + context.drawText(valueText, + at: CGPoint(x: x, y: y + lineHeight / 2.0), + align: .center, + angleRadians: angleRadians, + attributes: [.font: valueFont, .foregroundColor: valueTextColor]) } } @@ -581,25 +567,31 @@ open class PieChartRenderer: DataRenderer let x = (labelRadius + iconsOffset.y) * sliceXBase + center.x var y = (labelRadius + iconsOffset.y) * sliceYBase + center.y y += iconsOffset.x - - ChartUtils.drawImage(context: context, - image: icon, - x: x, - y: y, - size: icon.size) + + context.drawImage(icon, + atCenter: CGPoint(x: x, y: y), + size: icon.size) } xIndex += 1 } } } - - open override func drawExtras(context: CGContext) + + open func drawExtras(context: CGContext) { drawHole(context: context) drawCenterText(context: context) } + open func initBuffers() { } + + open func isDrawingValuesAllowed(dataProvider: ChartDataProvider?) -> Bool + { + guard let data = dataProvider?.data else { return false } + return data.entryCount < Int(CGFloat(dataProvider?.maxVisibleCount ?? 0) * viewPortHandler.scaleX) + } + /// draws the hole in the center of the chart and the transparent circle / hole private func drawHole(context: CGContext) { @@ -704,8 +696,8 @@ open class PieChartRenderer: DataRenderer context.restoreGState() } } - - open override func drawHighlighted(context: CGContext, indices: [Highlight]) + + open func drawHighlighted(context: CGContext, indices highlights: [Highlight]) { guard let chart = chart, @@ -730,19 +722,18 @@ open class PieChartRenderer: DataRenderer // Append highlighted accessibility slices into this array, so we can prioritize them over unselected slices var highlightedAccessibleElements: [NSUIAccessibilityElement] = [] - for i in 0 ..< indices.count + for hightlight in highlights { // get the index to highlight - let index = Int(indices[i].x) - if index >= drawAngles.count + let index = Int(hightlight.x) + guard index < drawAngles.count, + let set = data[hightlight.dataSetIndex] as? PieChartDataSetProtocol, + set.isHighlightEnabled + else { continue } - guard let set = data.getDataSetByIndex(indices[i].dataSetIndex) as? IPieChartDataSet else { continue } - - if !set.isHighlightEnabled { continue } - let entryCount = set.entryCount var visibleAngleCount = 0 for j in 0 ..< entryCount @@ -901,15 +892,16 @@ open class PieChartRenderer: DataRenderer /// The element only has it's container and label set based on the chart and dataSet. Use the modifier to alter traits and frame. private func createAccessibleElement(withIndex idx: Int, container: PieChartView, - dataSet: IPieChartDataSet, + dataSet: PieChartDataSetProtocol, modifier: (NSUIAccessibilityElement) -> ()) -> NSUIAccessibilityElement { let element = NSUIAccessibilityElement(accessibilityContainer: container) guard let e = dataSet.entryForIndex(idx) else { return element } - guard let formatter = dataSet.valueFormatter else { return element } guard let data = container.data as? PieChartData else { return element } + let formatter = dataSet.valueFormatter + var elementValueText = formatter.stringForValue( e.y, entry: e, @@ -938,4 +930,8 @@ open class PieChartRenderer: DataRenderer return element } + + public func createAccessibleHeader(usingChart chart: ChartViewBase, andData data: ChartData, withDefaultDescription defaultDescription: String) -> NSUIAccessibilityElement { + return AccessibleHeader.create(usingChart: chart, andData: data, withDefaultDescription: defaultDescription) + } } diff --git a/Source/Charts/Renderers/RadarChartRenderer.swift b/Source/Charts/Renderers/RadarChartRenderer.swift index c2ab79fcc2..26da1e8560 100644 --- a/Source/Charts/Renderers/RadarChartRenderer.swift +++ b/Source/Charts/Renderers/RadarChartRenderer.swift @@ -35,29 +35,26 @@ open class RadarChartRenderer: LineRadarRenderer open override func drawData(context: CGContext) { - guard let chart = chart else { return } - - let radarData = chart.data - - if radarData != nil + guard let chart = chart, + let radarData = chart.data as? RadarChartData else { - let mostEntries = radarData?.maxEntryCountSet?.entryCount ?? 0 + return + } + + let mostEntries = radarData.maxEntryCountSet?.entryCount ?? 0 - // If we redraw the data, remove and repopulate accessible elements to update label values and frames - self.accessibleChartElements.removeAll() + // If we redraw the data, remove and repopulate accessible elements to update label values and frames + self.accessibleChartElements.removeAll() - // Make the chart header the first element in the accessible elements array - if let accessibilityHeaderData = radarData as? RadarChartData { - let element = createAccessibleHeader(usingChart: chart, - andData: accessibilityHeaderData, - withDefaultDescription: "Radar Chart") - self.accessibleChartElements.append(element) - } + // Make the chart header the first element in the accessible elements array + let element = createAccessibleHeader(usingChart: chart, + andData: radarData, + withDefaultDescription: "Radar Chart") + self.accessibleChartElements.append(element) - for set in radarData!.dataSets as! [IRadarChartDataSet] where set.isVisible - { - drawDataSet(context: context, dataSet: set, mostEntries: mostEntries) - } + for case let set as RadarChartDataSetProtocol in radarData where set.isVisible + { + drawDataSet(context: context, dataSet: set, mostEntries: mostEntries) } } @@ -67,7 +64,7 @@ open class RadarChartRenderer: LineRadarRenderer /// - context: /// - dataSet: /// - mostEntries: the entry count of the dataset with the most entries - internal func drawDataSet(context: CGContext, dataSet: IRadarChartDataSet, mostEntries: Int) + internal func drawDataSet(context: CGContext, dataSet: RadarChartDataSetProtocol, mostEntries: Int) { guard let chart = chart else { return } @@ -211,13 +208,15 @@ open class RadarChartRenderer: LineRadarRenderer let yoffset = CGFloat(5.0) - for i in 0 ..< data.dataSetCount + for i in data.indices { guard let - dataSet = data.getDataSetByIndex(i) as? IRadarChartDataSet, + dataSet = data[i] as? RadarChartDataSetProtocol, shouldDrawValues(forDataSet: dataSet) else { continue } + let angleRadians = dataSet.valueLabelAngle.DEG2RAD + let entryCount = dataSet.entryCount let iconsOffset = dataSet.iconsOffset @@ -231,22 +230,19 @@ open class RadarChartRenderer: LineRadarRenderer let valueFont = dataSet.valueFont - guard let formatter = dataSet.valueFormatter else { continue } + let formatter = dataSet.valueFormatter if dataSet.isDrawValuesEnabled { - ChartUtils.drawText( - context: context, - text: formatter.stringForValue( - e.y, - entry: e, - dataSetIndex: i, - viewPortHandler: viewPortHandler), - point: CGPoint(x: p.x, y: p.y - yoffset - valueFont.lineHeight), - align: .center, - attributes: [NSAttributedString.Key.font: valueFont, - NSAttributedString.Key.foregroundColor: dataSet.valueTextColorAt(j)] - ) + context.drawText(formatter.stringForValue(e.y, + entry: e, + dataSetIndex: i, + viewPortHandler: viewPortHandler), + at: CGPoint(x: p.x, y: p.y - yoffset - valueFont.lineHeight), + align: .center, + angleRadians: angleRadians, + attributes: [.font: valueFont, + .foregroundColor: dataSet.valueTextColorAt(j)]) } if let icon = e.icon, dataSet.isDrawIconsEnabled @@ -255,11 +251,9 @@ open class RadarChartRenderer: LineRadarRenderer atAngle: sliceangle * CGFloat(j) * CGFloat(phaseX) + chart.rotationAngle) pIcon.y += iconsOffset.x - ChartUtils.drawImage(context: context, - image: icon, - x: pIcon.x, - y: pIcon.y, - size: icon.size) + context.drawImage(icon, + atCenter: CGPoint(x: pIcon.x, y: pIcon.y), + size: icon.size) } } } @@ -360,7 +354,7 @@ open class RadarChartRenderer: LineRadarRenderer for high in indices { guard - let set = chart.data?.getDataSetByIndex(high.dataSetIndex) as? IRadarChartDataSet, + let set = chart.data?[high.dataSetIndex] as? RadarChartDataSetProtocol, set.isHighlightEnabled else { continue } @@ -461,7 +455,7 @@ open class RadarChartRenderer: LineRadarRenderer private func createAccessibleElement(withDescription description: String, container: RadarChartView, - dataSet: IRadarChartDataSet, + dataSet: RadarChartDataSetProtocol, modifier: (NSUIAccessibilityElement) -> ()) -> NSUIAccessibilityElement { let element = NSUIAccessibilityElement(accessibilityContainer: container) diff --git a/Source/Charts/Renderers/Renderer.swift b/Source/Charts/Renderers/Renderer.swift index e57a9b853f..dbdcb8ae3b 100644 --- a/Source/Charts/Renderers/Renderer.swift +++ b/Source/Charts/Renderers/Renderer.swift @@ -13,14 +13,8 @@ import Foundation import CoreGraphics @objc(ChartRenderer) -open class Renderer: NSObject -{ - /// the component that handles the drawing area of the chart and it's offsets - @objc public let viewPortHandler: ViewPortHandler +public protocol Renderer { - @objc public init(viewPortHandler: ViewPortHandler) - { - self.viewPortHandler = viewPortHandler - super.init() - } + /// the component that handles the drawing area of the chart and it's offsets + var viewPortHandler: ViewPortHandler { get } } diff --git a/Source/Charts/Renderers/Scatter/ChevronDownShapeRenderer.swift b/Source/Charts/Renderers/Scatter/ChevronDownShapeRenderer.swift index 2d035bf357..1dab1cc46b 100644 --- a/Source/Charts/Renderers/Scatter/ChevronDownShapeRenderer.swift +++ b/Source/Charts/Renderers/Scatter/ChevronDownShapeRenderer.swift @@ -11,11 +11,11 @@ import Foundation import CoreGraphics -open class ChevronDownShapeRenderer : NSObject, IShapeRenderer +open class ChevronDownShapeRenderer : NSObject, ShapeRenderer { open func renderShape( context: CGContext, - dataSet: IScatterChartDataSet, + dataSet: ScatterChartDataSetProtocol, viewPortHandler: ViewPortHandler, point: CGPoint, color: NSUIColor) diff --git a/Source/Charts/Renderers/Scatter/ChevronUpShapeRenderer.swift b/Source/Charts/Renderers/Scatter/ChevronUpShapeRenderer.swift index 725533e780..0d077707f7 100644 --- a/Source/Charts/Renderers/Scatter/ChevronUpShapeRenderer.swift +++ b/Source/Charts/Renderers/Scatter/ChevronUpShapeRenderer.swift @@ -11,11 +11,11 @@ import Foundation import CoreGraphics -open class ChevronUpShapeRenderer : NSObject, IShapeRenderer +open class ChevronUpShapeRenderer : NSObject, ShapeRenderer { open func renderShape( context: CGContext, - dataSet: IScatterChartDataSet, + dataSet: ScatterChartDataSetProtocol, viewPortHandler: ViewPortHandler, point: CGPoint, color: NSUIColor) diff --git a/Source/Charts/Renderers/Scatter/CircleShapeRenderer.swift b/Source/Charts/Renderers/Scatter/CircleShapeRenderer.swift index b94a51137a..fc0c4dfef1 100644 --- a/Source/Charts/Renderers/Scatter/CircleShapeRenderer.swift +++ b/Source/Charts/Renderers/Scatter/CircleShapeRenderer.swift @@ -11,11 +11,11 @@ import Foundation import CoreGraphics -open class CircleShapeRenderer : NSObject, IShapeRenderer +open class CircleShapeRenderer : NSObject, ShapeRenderer { open func renderShape( context: CGContext, - dataSet: IScatterChartDataSet, + dataSet: ScatterChartDataSetProtocol, viewPortHandler: ViewPortHandler, point: CGPoint, color: NSUIColor) diff --git a/Source/Charts/Renderers/Scatter/CrossShapeRenderer.swift b/Source/Charts/Renderers/Scatter/CrossShapeRenderer.swift index 18785d3dee..7961da25aa 100644 --- a/Source/Charts/Renderers/Scatter/CrossShapeRenderer.swift +++ b/Source/Charts/Renderers/Scatter/CrossShapeRenderer.swift @@ -11,11 +11,11 @@ import Foundation import CoreGraphics -open class CrossShapeRenderer : NSObject, IShapeRenderer +open class CrossShapeRenderer : NSObject, ShapeRenderer { open func renderShape( context: CGContext, - dataSet: IScatterChartDataSet, + dataSet: ScatterChartDataSetProtocol, viewPortHandler: ViewPortHandler, point: CGPoint, color: NSUIColor) diff --git a/Source/Charts/Renderers/Scatter/IShapeRenderer.swift b/Source/Charts/Renderers/Scatter/ShapeRenderer.swift similarity index 87% rename from Source/Charts/Renderers/Scatter/IShapeRenderer.swift rename to Source/Charts/Renderers/Scatter/ShapeRenderer.swift index ff12ee3fb2..c334a5b8a2 100644 --- a/Source/Charts/Renderers/Scatter/IShapeRenderer.swift +++ b/Source/Charts/Renderers/Scatter/ShapeRenderer.swift @@ -1,5 +1,5 @@ // -// IShapeRenderer.swift +// ShapeRenderer.swift // Charts // // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda @@ -13,7 +13,7 @@ import Foundation import CoreGraphics @objc -public protocol IShapeRenderer: class +public protocol ShapeRenderer: class { /// Renders the provided ScatterDataSet with a shape. /// @@ -25,7 +25,7 @@ public protocol IShapeRenderer: class /// - color: Color to draw the shape func renderShape( context: CGContext, - dataSet: IScatterChartDataSet, + dataSet: ScatterChartDataSetProtocol, viewPortHandler: ViewPortHandler, point: CGPoint, color: NSUIColor) diff --git a/Source/Charts/Renderers/Scatter/SquareShapeRenderer.swift b/Source/Charts/Renderers/Scatter/SquareShapeRenderer.swift index ea692e33fd..948c1ff2eb 100644 --- a/Source/Charts/Renderers/Scatter/SquareShapeRenderer.swift +++ b/Source/Charts/Renderers/Scatter/SquareShapeRenderer.swift @@ -11,11 +11,11 @@ import Foundation import CoreGraphics -open class SquareShapeRenderer : NSObject, IShapeRenderer +open class SquareShapeRenderer : NSObject, ShapeRenderer { open func renderShape( context: CGContext, - dataSet: IScatterChartDataSet, + dataSet: ScatterChartDataSetProtocol, viewPortHandler: ViewPortHandler, point: CGPoint, color: NSUIColor) diff --git a/Source/Charts/Renderers/Scatter/TriangleShapeRenderer.swift b/Source/Charts/Renderers/Scatter/TriangleShapeRenderer.swift index fa313b765b..1f4bdca0d7 100644 --- a/Source/Charts/Renderers/Scatter/TriangleShapeRenderer.swift +++ b/Source/Charts/Renderers/Scatter/TriangleShapeRenderer.swift @@ -11,11 +11,11 @@ import Foundation import CoreGraphics -open class TriangleShapeRenderer : NSObject, IShapeRenderer +open class TriangleShapeRenderer : NSObject, ShapeRenderer { open func renderShape( context: CGContext, - dataSet: IScatterChartDataSet, + dataSet: ScatterChartDataSetProtocol, viewPortHandler: ViewPortHandler, point: CGPoint, color: NSUIColor) diff --git a/Source/Charts/Renderers/Scatter/XShapeRenderer.swift b/Source/Charts/Renderers/Scatter/XShapeRenderer.swift index 8a546c5f0b..73e2efdd4b 100644 --- a/Source/Charts/Renderers/Scatter/XShapeRenderer.swift +++ b/Source/Charts/Renderers/Scatter/XShapeRenderer.swift @@ -11,11 +11,11 @@ import Foundation import CoreGraphics -open class XShapeRenderer : NSObject, IShapeRenderer +open class XShapeRenderer : NSObject, ShapeRenderer { open func renderShape( context: CGContext, - dataSet: IScatterChartDataSet, + dataSet: ScatterChartDataSetProtocol, viewPortHandler: ViewPortHandler, point: CGPoint, color: NSUIColor) diff --git a/Source/Charts/Renderers/ScatterChartRenderer.swift b/Source/Charts/Renderers/ScatterChartRenderer.swift index 57d348b28b..9fb1f560c7 100644 --- a/Source/Charts/Renderers/ScatterChartRenderer.swift +++ b/Source/Charts/Renderers/ScatterChartRenderer.swift @@ -41,25 +41,18 @@ open class ScatterChartRenderer: LineScatterCandleRadarRenderer // TODO: Due to the potential complexity of data presented in Scatter charts, a more usable way // for VO accessibility would be to use axis based traversal rather than by dataset. // Hence, accessibleChartElements is not populated below. (Individual renderers guard against dataSource being their respective views) - for i in 0 ..< scatterData.dataSetCount - { - guard let set = scatterData.getDataSetByIndex(i) else { continue } - - if set.isVisible - { - if !(set is IScatterChartDataSet) - { - fatalError("Datasets for ScatterChartRenderer must conform to IScatterChartDataSet") - } - - drawDataSet(context: context, dataSet: set as! IScatterChartDataSet) - } - } + let sets = scatterData.dataSets as? [ScatterChartDataSet] + assert(sets != nil, "Datasets for ScatterChartRenderer must conform to IScatterChartDataSet") + + let drawDataSet = { self.drawDataSet(context: context, dataSet: $0) } + sets!.lazy + .filter(\.isVisible) + .forEach(drawDataSet) } private var _lineSegments = [CGPoint](repeating: CGPoint(), count: 2) - @objc open func drawDataSet(context: CGContext, dataSet: IScatterChartDataSet) + @objc open func drawDataSet(context: CGContext, dataSet: ScatterChartDataSetProtocol) { guard let dataProvider = dataProvider else { return } @@ -103,7 +96,7 @@ open class ScatterChartRenderer: LineScatterCandleRadarRenderer } else { - print("There's no IShapeRenderer specified for ScatterDataSet", terminator: "\n") + print("There's no ShapeRenderer specified for ScatterDataSet", terminator: "\n") } } @@ -116,28 +109,28 @@ open class ScatterChartRenderer: LineScatterCandleRadarRenderer // if values are drawn if isDrawingValuesAllowed(dataProvider: dataProvider) - { - guard let dataSets = scatterData.dataSets as? [IScatterChartDataSet] else { return } - + { let phaseY = animator.phaseY var pt = CGPoint() - for i in 0 ..< scatterData.dataSetCount + for i in scatterData.indices { - let dataSet = dataSets[i] - guard let - formatter = dataSet.valueFormatter, - shouldDrawValues(forDataSet: dataSet) + guard let dataSet = scatterData[i] as? ScatterChartDataSetProtocol, + shouldDrawValues(forDataSet: dataSet) else { continue } let valueFont = dataSet.valueFont + let formatter = dataSet.valueFormatter + let trans = dataProvider.getTransformer(forAxis: dataSet.axisDependency) let valueToPixelMatrix = trans.valueToPixelMatrix let iconsOffset = dataSet.iconsOffset + let angleRadians = dataSet.valueLabelAngle.DEG2RAD + let shapeSize = dataSet.scatterShapeSize let lineHeight = valueFont.lineHeight @@ -171,24 +164,22 @@ open class ScatterChartRenderer: LineScatterCandleRadarRenderer if dataSet.isDrawValuesEnabled { - ChartUtils.drawText( - context: context, - text: text, - point: CGPoint( - x: pt.x, - y: pt.y - shapeSize - lineHeight), - align: .center, - attributes: [NSAttributedString.Key.font: valueFont, NSAttributedString.Key.foregroundColor: dataSet.valueTextColorAt(j)] + context.drawText(text, + at: CGPoint(x: pt.x, + y: pt.y - shapeSize - lineHeight), + align: .center, + angleRadians: angleRadians, + attributes: [.font: valueFont, + .foregroundColor: dataSet.valueTextColorAt(j)] ) } if let icon = e.icon, dataSet.isDrawIconsEnabled { - ChartUtils.drawImage(context: context, - image: icon, - x: pt.x + iconsOffset.x, - y: pt.y + iconsOffset.y, - size: icon.size) + context.drawImage(icon, + atCenter: CGPoint(x: pt.x + iconsOffset.x, + y: pt.y + iconsOffset.y), + size: icon.size) } } } @@ -212,7 +203,7 @@ open class ScatterChartRenderer: LineScatterCandleRadarRenderer for high in indices { guard - let set = scatterData.getDataSetByIndex(high.dataSetIndex) as? IScatterChartDataSet, + let set = scatterData[high.dataSetIndex] as? ScatterChartDataSetProtocol, set.isHighlightEnabled else { continue } diff --git a/Source/Charts/Renderers/XAxisRenderer.swift b/Source/Charts/Renderers/XAxisRenderer.swift index 2cb80bc2d9..a20be3818d 100644 --- a/Source/Charts/Renderers/XAxisRenderer.swift +++ b/Source/Charts/Renderers/XAxisRenderer.swift @@ -12,244 +12,303 @@ import Foundation import CoreGraphics -#if canImport(UIKit) - import UIKit -#endif - -#if canImport(Cocoa) -import Cocoa -#endif @objc(ChartXAxisRenderer) -open class XAxisRenderer: AxisRendererBase +open class XAxisRenderer: NSObject, AxisRenderer { - @objc public init(viewPortHandler: ViewPortHandler, xAxis: XAxis?, transformer: Transformer?) + public let viewPortHandler: ViewPortHandler + public let axis: XAxis + public let transformer: Transformer? + + @objc public init(viewPortHandler: ViewPortHandler, axis: XAxis, transformer: Transformer?) { - super.init(viewPortHandler: viewPortHandler, transformer: transformer, axis: xAxis) + self.viewPortHandler = viewPortHandler + self.axis = axis + self.transformer = transformer + + super.init() } - open override func computeAxis(min: Double, max: Double, inverted: Bool) + open func computeAxis(min: Double, max: Double, inverted: Bool) { var min = min, max = max - if let transformer = self.transformer + if let transformer = self.transformer, + viewPortHandler.contentWidth > 10, + !viewPortHandler.isFullyZoomedOutX { // calculate the starting and entry point of the y-labels (depending on // zoom / contentrect bounds) - if viewPortHandler.contentWidth > 10 && !viewPortHandler.isFullyZoomedOutX - { - let p1 = transformer.valueForTouchPoint(CGPoint(x: viewPortHandler.contentLeft, y: viewPortHandler.contentTop)) - let p2 = transformer.valueForTouchPoint(CGPoint(x: viewPortHandler.contentRight, y: viewPortHandler.contentTop)) - - if inverted - { - min = Double(p2.x) - max = Double(p1.x) - } - else - { - min = Double(p1.x) - max = Double(p2.x) - } - } + let p1 = transformer.valueForTouchPoint(CGPoint(x: viewPortHandler.contentLeft, y: viewPortHandler.contentTop)) + let p2 = transformer.valueForTouchPoint(CGPoint(x: viewPortHandler.contentRight, y: viewPortHandler.contentTop)) + + min = inverted ? Double(p2.x) : Double(p1.x) + max = inverted ? Double(p1.x) : Double(p2.x) } computeAxisValues(min: min, max: max) } - open override func computeAxisValues(min: Double, max: Double) + open func computeAxisValues(min: Double, max: Double) { - super.computeAxisValues(min: min, max: max) + let yMin = min + let yMax = max + + let labelCount = axis.labelCount + let range = abs(yMax - yMin) + + guard + labelCount != 0, + range > 0, + range.isFinite + else + { + axis.entries = [] + axis.centeredEntries = [] + return + } + + // Find out how much spacing (in y value space) between axis values + let rawInterval = range / Double(labelCount) + var interval = rawInterval.roundedToNextSignificant() + + // If granularity is enabled, then do not allow the interval to go below specified granularity. + // This is used to avoid repeated values when rounding values for display. + if axis.granularityEnabled + { + interval = Swift.max(interval, axis.granularity) + } + + // Normalize interval + let intervalMagnitude = pow(10.0, Double(Int(log10(interval)))).roundedToNextSignificant() + let intervalSigDigit = Int(interval / intervalMagnitude) + if intervalSigDigit > 5 + { + // Use one order of magnitude higher, to avoid intervals like 0.9 or 90 + interval = floor(10.0 * Double(intervalMagnitude)) + } + + var n = axis.centerAxisLabelsEnabled ? 1 : 0 + + // force label count + if axis.isForceLabelsEnabled + { + interval = range / Double(labelCount - 1) + + // Ensure stops contains at least n elements. + axis.entries.removeAll(keepingCapacity: true) + axis.entries.reserveCapacity(labelCount) + + let values = stride(from: yMin, to: Double(labelCount) * interval + yMin, by: interval) + axis.entries.append(contentsOf: values) + + n = labelCount + } + else + { + // no forced count + + var first = interval == 0.0 ? 0.0 : ceil(yMin / interval) * interval + + if axis.centerAxisLabelsEnabled + { + first -= interval + } + + let last = interval == 0.0 ? 0.0 : (floor(yMax / interval) * interval).nextUp + + if interval != 0.0, last != first + { + stride(from: first, through: last, by: interval).forEach { _ in n += 1 } + } + + // Ensure stops contains at least n elements. + axis.entries.removeAll(keepingCapacity: true) + axis.entries.reserveCapacity(labelCount) + + let start = first, end = first + Double(n) * interval + + // Fix for IEEE negative zero case (Where value == -0.0, and 0.0 == -0.0) + let values = stride(from: start, to: end, by: interval).map { $0 == 0.0 ? 0.0 : $0 } + axis.entries.append(contentsOf: values) + } + + // set decimals + if interval < 1 + { + axis.decimals = Int(ceil(-log10(interval))) + } + else + { + axis.decimals = 0 + } + + if axis.centerAxisLabelsEnabled + { + let offset: Double = interval / 2.0 + axis.centeredEntries = axis.entries[.. 1 { - // avoid clipping of the last - if i == xAxis.entryCount - 1 && xAxis.entryCount > 1 + let width = labelns.boundingRect(with: labelMaxSize, options: .usesLineFragmentOrigin, attributes: labelAttrs, context: nil).size.width + + if width > viewPortHandler.offsetRight * 2.0, + position.x + width > viewPortHandler.chartWidth { - let width = labelns.boundingRect(with: labelMaxSize, options: .usesLineFragmentOrigin, attributes: labelAttrs, context: nil).size.width - - if width > viewPortHandler.offsetRight * 2.0 - && position.x + width > viewPortHandler.chartWidth - { - position.x -= width / 2.0 - } - } - else if i == 0 - { // avoid clipping of the first - let width = labelns.boundingRect(with: labelMaxSize, options: .usesLineFragmentOrigin, attributes: labelAttrs, context: nil).size.width - position.x += width / 2.0 + position.x -= width / 2.0 } } - - drawLabel(context: context, - formattedLabel: label, - x: position.x, - y: pos, - attributes: labelAttrs, - constrainedToSize: labelMaxSize, - anchor: anchor, - angleRadians: labelRotationAngleRadians) + else if i == 0 + { // avoid clipping of the first + let width = labelns.boundingRect(with: labelMaxSize, options: .usesLineFragmentOrigin, attributes: labelAttrs, context: nil).size.width + position.x += width / 2.0 + } } + + drawLabel(context: context, + formattedLabel: label, + x: position.x, + y: pos, + attributes: labelAttrs, + constrainedTo: labelMaxSize, + anchor: anchor, + angleRadians: labelRotationAngleRadians) } } @@ -259,44 +318,39 @@ open class XAxisRenderer: AxisRendererBase x: CGFloat, y: CGFloat, attributes: [NSAttributedString.Key : Any], - constrainedToSize: CGSize, + constrainedTo size: CGSize, anchor: CGPoint, angleRadians: CGFloat) { - ChartUtils.drawMultilineText( - context: context, - text: formattedLabel, - point: CGPoint(x: x, y: y), - attributes: attributes, - constrainedToSize: constrainedToSize, - anchor: anchor, - angleRadians: angleRadians) + context.drawMultilineText(formattedLabel, + at: CGPoint(x: x, y: y), + constrainedTo: size, + anchor: anchor, + angleRadians: angleRadians, + attributes: attributes) } - open override func renderGridLines(context: CGContext) + open func renderGridLines(context: CGContext) { guard - let xAxis = self.axis as? XAxis, - let transformer = self.transformer + let transformer = self.transformer, + axis.isEnabled, + axis.isDrawGridLinesEnabled else { return } - if !xAxis.isDrawGridLinesEnabled || !xAxis.isEnabled - { - return - } - context.saveGState() defer { context.restoreGState() } + context.clip(to: self.gridClippingRect) - context.setShouldAntialias(xAxis.gridAntialiasEnabled) - context.setStrokeColor(xAxis.gridColor.cgColor) - context.setLineWidth(xAxis.gridLineWidth) - context.setLineCap(xAxis.gridLineCap) + context.setShouldAntialias(axis.gridAntialiasEnabled) + context.setStrokeColor(axis.gridColor.cgColor) + context.setLineWidth(axis.gridLineWidth) + context.setLineCap(axis.gridLineCap) - if xAxis.gridLineDashLengths != nil + if axis.gridLineDashLengths != nil { - context.setLineDash(phase: xAxis.gridLineDashPhase, lengths: xAxis.gridLineDashLengths) + context.setLineDash(phase: axis.gridLineDashPhase, lengths: axis.gridLineDashLengths) } else { @@ -305,14 +359,14 @@ open class XAxisRenderer: AxisRendererBase let valueToPixelMatrix = transformer.valueToPixelMatrix - var position = CGPoint(x: 0.0, y: 0.0) + var position = CGPoint.zero - let entries = xAxis.entries + let entries = axis.entries - for i in stride(from: 0, to: entries.count, by: 1) + for entry in entries { - position.x = CGFloat(entries[i]) - position.y = position.x + position.x = CGFloat(entry) + position.y = CGFloat(entry) position = position.applying(valueToPixelMatrix) drawGridLine(context: context, x: position.x, y: position.y) @@ -322,7 +376,7 @@ open class XAxisRenderer: AxisRendererBase @objc open var gridClippingRect: CGRect { var contentRect = viewPortHandler.contentRect - let dx = self.axis?.gridLineWidth ?? 0.0 + let dx = self.axis.gridLineWidth contentRect.origin.x -= dx / 2.0 contentRect.size.width += dx return contentRect @@ -330,29 +384,26 @@ open class XAxisRenderer: AxisRendererBase @objc open func drawGridLine(context: CGContext, x: CGFloat, y: CGFloat) { - if x >= viewPortHandler.offsetLeft - && x <= viewPortHandler.chartWidth - { - context.beginPath() - context.move(to: CGPoint(x: x, y: viewPortHandler.contentTop)) - context.addLine(to: CGPoint(x: x, y: viewPortHandler.contentBottom)) - context.strokePath() - } + guard x >= viewPortHandler.offsetLeft && x <= viewPortHandler.chartWidth else { return } + + context.beginPath() + context.move(to: CGPoint(x: x, y: viewPortHandler.contentTop)) + context.addLine(to: CGPoint(x: x, y: viewPortHandler.contentBottom)) + context.strokePath() } - open override func renderLimitLines(context: CGContext) + open func renderLimitLines(context: CGContext) { guard - let xAxis = self.axis as? XAxis, let transformer = self.transformer, - !xAxis.limitLines.isEmpty + !axis.limitLines.isEmpty else { return } let trans = transformer.valueToPixelMatrix - var position = CGPoint(x: 0.0, y: 0.0) + var position = CGPoint.zero - for l in xAxis.limitLines where l.isEnabled + for l in axis.limitLines where l.isEnabled { context.saveGState() defer { context.restoreGState() } @@ -373,7 +424,6 @@ open class XAxisRenderer: AxisRendererBase @objc open func renderLimitLineLine(context: CGContext, limitLine: ChartLimitLine, position: CGPoint) { - context.beginPath() context.move(to: CGPoint(x: position.x, y: viewPortHandler.contentTop)) context.addLine(to: CGPoint(x: position.x, y: viewPortHandler.contentBottom)) @@ -394,55 +444,45 @@ open class XAxisRenderer: AxisRendererBase @objc open func renderLimitLineLabel(context: CGContext, limitLine: ChartLimitLine, position: CGPoint, yOffset: CGFloat) { - let label = limitLine.label + + // if drawing the limit-value label is enabled guard limitLine.drawLabelEnabled, !label.isEmpty else { return } let labelLineHeight = limitLine.valueFont.lineHeight let xOffset: CGFloat = limitLine.lineWidth + limitLine.xOffset - let attributes: [NSAttributedString.Key : Any] = [ - .font : limitLine.valueFont, - .foregroundColor : limitLine.valueTextColor - ] - - let (point, align): (CGPoint, NSTextAlignment) - switch limitLine.labelPosition { - case .topRight: - point = CGPoint( - x: position.x + xOffset, - y: viewPortHandler.contentTop + yOffset - ) + + let align: TextAlignment + let point: CGPoint + + switch limitLine.labelPosition + { + case .rightTop: align = .left + point = CGPoint(x: position.x + xOffset, + y: viewPortHandler.contentTop + yOffset) - case .bottomRight: - point = CGPoint( - x: position.x + xOffset, - y: viewPortHandler.contentBottom - labelLineHeight - yOffset - ) + case .rightBottom: align = .left + point = CGPoint(x: position.x + xOffset, + y: viewPortHandler.contentBottom - labelLineHeight - yOffset) - case .topLeft: - point = CGPoint( - x: position.x - xOffset, - y: viewPortHandler.contentTop + yOffset - ) + case .leftTop: align = .right + point = CGPoint(x: position.x - xOffset, + y: viewPortHandler.contentTop + yOffset) - case .bottomLeft: - point = CGPoint( - x: position.x - xOffset, - y: viewPortHandler.contentBottom - labelLineHeight - yOffset - ) + case .leftBottom: align = .right + point = CGPoint(x: position.x - xOffset, + y: viewPortHandler.contentBottom - labelLineHeight - yOffset) } - ChartUtils.drawText( - context: context, - text: label, - point: point, - align: align, - attributes: attributes - ) + context.drawText(label, + at: point, + align: align, + attributes: [.font: limitLine.valueFont, + .foregroundColor: limitLine.valueTextColor]) } } diff --git a/Source/Charts/Renderers/XAxisRendererHorizontalBarChart.swift b/Source/Charts/Renderers/XAxisRendererHorizontalBarChart.swift index 86c569d9df..a7429dbb69 100644 --- a/Source/Charts/Renderers/XAxisRendererHorizontalBarChart.swift +++ b/Source/Charts/Renderers/XAxisRendererHorizontalBarChart.swift @@ -16,9 +16,9 @@ open class XAxisRendererHorizontalBarChart: XAxisRenderer { internal weak var chart: BarChartView? - @objc public init(viewPortHandler: ViewPortHandler, xAxis: XAxis?, transformer: Transformer?, chart: BarChartView) + @objc public init(viewPortHandler: ViewPortHandler, axis: XAxis, transformer: Transformer?, chart: BarChartView) { - super.init(viewPortHandler: viewPortHandler, xAxis: xAxis, transformer: transformer) + super.init(viewPortHandler: viewPortHandler, axis: axis, transformer: transformer) self.chart = chart } @@ -27,26 +27,17 @@ open class XAxisRendererHorizontalBarChart: XAxisRenderer { var min = min, max = max - if let transformer = self.transformer + if let transformer = self.transformer, + viewPortHandler.contentWidth > 10, + !viewPortHandler.isFullyZoomedOutY { // calculate the starting and entry point of the y-labels (depending on // zoom / contentrect bounds) - if viewPortHandler.contentWidth > 10 && !viewPortHandler.isFullyZoomedOutY - { - let p1 = transformer.valueForTouchPoint(CGPoint(x: viewPortHandler.contentLeft, y: viewPortHandler.contentBottom)) - let p2 = transformer.valueForTouchPoint(CGPoint(x: viewPortHandler.contentLeft, y: viewPortHandler.contentTop)) - - if inverted - { - min = Double(p2.y) - max = Double(p1.y) - } - else - { - min = Double(p1.y) - max = Double(p2.y) - } - } + let p1 = transformer.valueForTouchPoint(CGPoint(x: viewPortHandler.contentLeft, y: viewPortHandler.contentBottom)) + let p2 = transformer.valueForTouchPoint(CGPoint(x: viewPortHandler.contentLeft, y: viewPortHandler.contentTop)) + + min = inverted ? Double(p2.y) : Double(p1.y) + max = inverted ? Double(p1.y) : Double(p2.y) } computeAxisValues(min: min, max: max) @@ -54,55 +45,44 @@ open class XAxisRendererHorizontalBarChart: XAxisRenderer open override func computeSize() { - guard let - xAxis = self.axis as? XAxis - else { return } - - let longest = xAxis.getLongestLabel() as NSString + let longest = axis.getLongestLabel() as NSString - let labelSize = longest.size(withAttributes: [NSAttributedString.Key.font: xAxis.labelFont]) - - let labelWidth = floor(labelSize.width + xAxis.xOffset * 3.5) + let labelSize = longest.size(withAttributes: [.font: axis.labelFont]) + + let labelWidth = floor(labelSize.width + axis.xOffset * 3.5) let labelHeight = labelSize.height - let labelRotatedSize = CGSize(width: labelSize.width, height: labelHeight).rotatedBy(degrees: xAxis.labelRotationAngle) + let labelRotatedSize = CGSize(width: labelSize.width, height: labelHeight).rotatedBy(degrees: axis.labelRotationAngle) - xAxis.labelWidth = labelWidth - xAxis.labelHeight = labelHeight - xAxis.labelRotatedWidth = round(labelRotatedSize.width + xAxis.xOffset * 3.5) - xAxis.labelRotatedHeight = round(labelRotatedSize.height) + axis.labelWidth = labelWidth + axis.labelHeight = labelHeight + axis.labelRotatedWidth = round(labelRotatedSize.width + axis.xOffset * 3.5) + axis.labelRotatedHeight = round(labelRotatedSize.height) } open override func renderAxisLabels(context: CGContext) { guard - let xAxis = self.axis as? XAxis + axis.isEnabled, + axis.isDrawLabelsEnabled, + chart?.data != nil else { return } - if !xAxis.isEnabled || !xAxis.isDrawLabelsEnabled || chart?.data === nil - { - return - } - - let xoffset = xAxis.xOffset - - if xAxis.labelPosition == .top - { + let xoffset = axis.xOffset + + switch axis.labelPosition { + case .top: drawLabels(context: context, pos: viewPortHandler.contentRight + xoffset, anchor: CGPoint(x: 0.0, y: 0.5)) - } - else if xAxis.labelPosition == .topInside - { + + case .topInside: drawLabels(context: context, pos: viewPortHandler.contentRight - xoffset, anchor: CGPoint(x: 1.0, y: 0.5)) - } - else if xAxis.labelPosition == .bottom - { + + case .bottom: drawLabels(context: context, pos: viewPortHandler.contentLeft - xoffset, anchor: CGPoint(x: 1.0, y: 0.5)) - } - else if xAxis.labelPosition == .bottomInside - { + + case .bottomInside: drawLabels(context: context, pos: viewPortHandler.contentLeft + xoffset, anchor: CGPoint(x: 0.0, y: 0.5)) - } - else - { // BOTH SIDED + + case .bothSided: drawLabels(context: context, pos: viewPortHandler.contentRight + xoffset, anchor: CGPoint(x: 0.0, y: 0.5)) drawLabels(context: context, pos: viewPortHandler.contentLeft - xoffset, anchor: CGPoint(x: 1.0, y: 0.5)) } @@ -111,50 +91,35 @@ open class XAxisRendererHorizontalBarChart: XAxisRenderer /// draws the x-labels on the specified y-position open override func drawLabels(context: CGContext, pos: CGFloat, anchor: CGPoint) { - guard - let xAxis = self.axis as? XAxis, - let transformer = self.transformer - else { return } + guard let transformer = self.transformer else { return } - let labelFont = xAxis.labelFont - let labelTextColor = xAxis.labelTextColor - let labelRotationAngleRadians = xAxis.labelRotationAngle.DEG2RAD + let labelFont = axis.labelFont + let labelTextColor = axis.labelTextColor + let labelRotationAngleRadians = axis.labelRotationAngle.DEG2RAD - let centeringEnabled = xAxis.isCenterAxisLabelsEnabled + let centeringEnabled = axis.isCenterAxisLabelsEnabled // pre allocate to save performance (dont allocate in loop) - var position = CGPoint(x: 0.0, y: 0.0) + var position = CGPoint.zero - for i in stride(from: 0, to: xAxis.entryCount, by: 1) + for i in 0.. 0 + if l.drawLabelEnabled, !label.isEmpty { let labelLineHeight = l.valueFont.lineHeight - let xOffset: CGFloat = 4.0 + l.xOffset - let yOffset: CGFloat = l.lineWidth + labelLineHeight + l.yOffset - - if l.labelPosition == .topRight - { - ChartUtils.drawText(context: context, - text: label, - point: CGPoint( - x: viewPortHandler.contentRight - xOffset, - y: position.y - yOffset), - align: .right, - attributes: [NSAttributedString.Key.font: l.valueFont, NSAttributedString.Key.foregroundColor: l.valueTextColor]) - } - else if l.labelPosition == .bottomRight - { - ChartUtils.drawText(context: context, - text: label, - point: CGPoint( - x: viewPortHandler.contentRight - xOffset, - y: position.y + yOffset - labelLineHeight), - align: .right, - attributes: [NSAttributedString.Key.font: l.valueFont, NSAttributedString.Key.foregroundColor: l.valueTextColor]) - } - else if l.labelPosition == .topLeft - { - ChartUtils.drawText(context: context, - text: label, - point: CGPoint( - x: viewPortHandler.contentLeft + xOffset, - y: position.y - yOffset), - align: .left, - attributes: [NSAttributedString.Key.font: l.valueFont, NSAttributedString.Key.foregroundColor: l.valueTextColor]) - } - else + let xOffset = 4.0 + l.xOffset + let yOffset = l.lineWidth + labelLineHeight + l.yOffset + + let align: TextAlignment + let point: CGPoint + + switch l.labelPosition { - ChartUtils.drawText(context: context, - text: label, - point: CGPoint( - x: viewPortHandler.contentLeft + xOffset, - y: position.y + yOffset - labelLineHeight), - align: .left, - attributes: [NSAttributedString.Key.font: l.valueFont, NSAttributedString.Key.foregroundColor: l.valueTextColor]) + case .rightTop: + align = .right + point = CGPoint(x: viewPortHandler.contentRight - xOffset, + y: position.y - yOffset) + + case .rightBottom: + align = .right + point = CGPoint(x: viewPortHandler.contentRight - xOffset, + y: position.y + yOffset - labelLineHeight) + + case .leftTop: + align = .left + point = CGPoint(x: viewPortHandler.contentLeft + xOffset, + y: position.y - yOffset) + + case .leftBottom: + align = .left + point = CGPoint(x: viewPortHandler.contentLeft + xOffset, + y: position.y + yOffset - labelLineHeight) } + + context.drawText(label, + at: point, + align: align, + attributes: [.font: l.valueFont, .foregroundColor: l.valueTextColor]) } } } diff --git a/Source/Charts/Renderers/XAxisRendererRadarChart.swift b/Source/Charts/Renderers/XAxisRendererRadarChart.swift index c5fcedf54c..6dbf2631b2 100644 --- a/Source/Charts/Renderers/XAxisRendererRadarChart.swift +++ b/Source/Charts/Renderers/XAxisRendererRadarChart.swift @@ -16,28 +16,24 @@ open class XAxisRendererRadarChart: XAxisRenderer { @objc open weak var chart: RadarChartView? - @objc public init(viewPortHandler: ViewPortHandler, xAxis: XAxis?, chart: RadarChartView) + @objc public init(viewPortHandler: ViewPortHandler, axis: XAxis, chart: RadarChartView) { - super.init(viewPortHandler: viewPortHandler, xAxis: xAxis, transformer: nil) + super.init(viewPortHandler: viewPortHandler, axis: axis, transformer: nil) self.chart = chart } open override func renderAxisLabels(context: CGContext) { - guard let - xAxis = axis as? XAxis, - let chart = chart + guard + let chart = chart, + axis.isEnabled, + axis.isDrawLabelsEnabled else { return } - - if !xAxis.isEnabled || !xAxis.isDrawLabelsEnabled - { - return - } - - let labelFont = xAxis.labelFont - let labelTextColor = xAxis.labelTextColor - let labelRotationAngleRadians = xAxis.labelRotationAngle.RAD2DEG + + let labelFont = axis.labelFont + let labelTextColor = axis.labelTextColor + let labelRotationAngleRadians = axis.labelRotationAngle.RAD2DEG let drawLabelAnchor = CGPoint(x: 0.5, y: 0.25) let sliceangle = chart.sliceAngle @@ -47,20 +43,17 @@ open class XAxisRendererRadarChart: XAxisRenderer let center = chart.centerOffsets - for i in stride(from: 0, to: chart.data?.maxEntryCountSet?.entryCount ?? 0, by: 1) + for i in 0..<(chart.data?.maxEntryCountSet?.entryCount ?? 0) { - - let label = xAxis.valueFormatter?.stringForValue(Double(i), axis: xAxis) ?? "" - + let label = axis.valueFormatter?.stringForValue(Double(i), axis: axis) ?? "" let angle = (sliceangle * CGFloat(i) + chart.rotationAngle).truncatingRemainder(dividingBy: 360.0) - - let p = center.moving(distance: CGFloat(chart.yRange) * factor + xAxis.labelRotatedWidth / 2.0, atAngle: angle) - + let p = center.moving(distance: CGFloat(chart.yRange) * factor + axis.labelRotatedWidth / 2.0, atAngle: angle) + drawLabel(context: context, formattedLabel: label, x: p.x, - y: p.y - xAxis.labelRotatedHeight / 2.0, - attributes: [NSAttributedString.Key.font: labelFont, NSAttributedString.Key.foregroundColor: labelTextColor], + y: p.y - axis.labelRotatedHeight / 2.0, + attributes: [.font: labelFont, .foregroundColor: labelTextColor], anchor: drawLabelAnchor, angleRadians: labelRotationAngleRadians) } @@ -75,13 +68,11 @@ open class XAxisRendererRadarChart: XAxisRenderer anchor: CGPoint, angleRadians: CGFloat) { - ChartUtils.drawText( - context: context, - text: formattedLabel, - point: CGPoint(x: x, y: y), - attributes: attributes, - anchor: anchor, - angleRadians: angleRadians) + context.drawText(formattedLabel, + at: CGPoint(x: x, y: y), + anchor: anchor, + angleRadians: angleRadians, + attributes: attributes) } open override func renderLimitLines(context: CGContext) diff --git a/Source/Charts/Renderers/YAxisRenderer.swift b/Source/Charts/Renderers/YAxisRenderer.swift index 9d0017f494..e1d8bf65f5 100644 --- a/Source/Charts/Renderers/YAxisRenderer.swift +++ b/Source/Charts/Renderers/YAxisRenderer.swift @@ -12,41 +12,39 @@ import Foundation import CoreGraphics -#if canImport(UIKit) - import UIKit -#endif - -#if canImport(Cocoa) -import Cocoa -#endif @objc(ChartYAxisRenderer) -open class YAxisRenderer: AxisRendererBase +open class YAxisRenderer: NSObject, AxisRenderer { - @objc public init(viewPortHandler: ViewPortHandler, yAxis: YAxis?, transformer: Transformer?) + public let viewPortHandler: ViewPortHandler + public let axis: YAxis + public let transformer: Transformer? + + @objc public init(viewPortHandler: ViewPortHandler, axis: YAxis, transformer: Transformer?) { - super.init(viewPortHandler: viewPortHandler, transformer: transformer, axis: yAxis) + self.viewPortHandler = viewPortHandler + self.axis = axis + self.transformer = transformer + + super.init() } /// draws the y-axis labels to the screen - open override func renderAxisLabels(context: CGContext) + open func renderAxisLabels(context: CGContext) { - guard let yAxis = self.axis as? YAxis else { return } - - if !yAxis.isEnabled || !yAxis.isDrawLabelsEnabled - { - return - } - - let xoffset = yAxis.xOffset - let yoffset = yAxis.labelFont.lineHeight / 2.5 + yAxis.yOffset - - let dependency = yAxis.axisDependency - let labelPosition = yAxis.labelPosition + guard + axis.isEnabled, + axis.isDrawLabelsEnabled + else { return } + + let xoffset = axis.xOffset + let yoffset = axis.labelFont.lineHeight / 2.5 + axis.yOffset - var xPos = CGFloat(0.0) + let dependency = axis.axisDependency + let labelPosition = axis.labelPosition - var textAlign: NSTextAlignment + let xPos: CGFloat + let textAlign: TextAlignment if dependency == .left { @@ -60,7 +58,6 @@ open class YAxisRenderer: AxisRendererBase textAlign = .left xPos = viewPortHandler.offsetLeft + xoffset } - } else { @@ -76,37 +73,35 @@ open class YAxisRenderer: AxisRendererBase } } - drawYLabels( - context: context, - fixedPosition: xPos, - positions: transformedPositions(), - offset: yoffset - yAxis.labelFont.lineHeight, - textAlign: textAlign) + drawYLabels(context: context, + fixedPosition: xPos, + positions: transformedPositions(), + offset: yoffset - axis.labelFont.lineHeight, + textAlign: textAlign) } - open override func renderAxisLine(context: CGContext) + open func renderAxisLine(context: CGContext) { - guard let yAxis = self.axis as? YAxis else { return } - - if !yAxis.isEnabled || !yAxis.drawAxisLineEnabled - { - return - } - + guard + axis.isEnabled, + axis.drawAxisLineEnabled + else { return } + context.saveGState() - - context.setStrokeColor(yAxis.axisLineColor.cgColor) - context.setLineWidth(yAxis.axisLineWidth) - if yAxis.axisLineDashLengths != nil + defer { context.restoreGState() } + + context.setStrokeColor(axis.axisLineColor.cgColor) + context.setLineWidth(axis.axisLineWidth) + if axis.axisLineDashLengths != nil { - context.setLineDash(phase: yAxis.axisLineDashPhase, lengths: yAxis.axisLineDashLengths) + context.setLineDash(phase: axis.axisLineDashPhase, lengths: axis.axisLineDashLengths) } else { context.setLineDash(phase: 0.0, lengths: []) } - if yAxis.axisDependency == .left + if axis.axisDependency == .left { context.beginPath() context.move(to: CGPoint(x: viewPortHandler.contentLeft, y: viewPortHandler.contentTop)) @@ -120,8 +115,6 @@ open class YAxisRenderer: AxisRendererBase context.addLine(to: CGPoint(x: viewPortHandler.contentRight, y: viewPortHandler.contentBottom)) context.strokePath() } - - context.restoreGState() } /// draws the y-labels on the specified x-position @@ -130,46 +123,31 @@ open class YAxisRenderer: AxisRendererBase fixedPosition: CGFloat, positions: [CGPoint], offset: CGFloat, - textAlign: NSTextAlignment) + textAlign: TextAlignment) { - guard - let yAxis = self.axis as? YAxis - else { return } - - let labelFont = yAxis.labelFont - let labelTextColor = yAxis.labelTextColor + let labelFont = axis.labelFont + let labelTextColor = axis.labelTextColor - let from = yAxis.isDrawBottomYLabelEntryEnabled ? 0 : 1 - let to = yAxis.isDrawTopYLabelEntryEnabled ? yAxis.entryCount : (yAxis.entryCount - 1) + let from = axis.isDrawBottomYLabelEntryEnabled ? 0 : 1 + let to = axis.isDrawTopYLabelEntryEnabled ? axis.entryCount : (axis.entryCount - 1) - let xOffset = yAxis.labelXOffset + let xOffset = axis.labelXOffset - for i in stride(from: from, to: to, by: 1) + for i in from.. [CGPoint] { - guard - let yAxis = self.axis as? YAxis, - let transformer = self.transformer - else { return [CGPoint]() } - - var positions = [CGPoint]() - positions.reserveCapacity(yAxis.entryCount) - - let entries = yAxis.entries + guard let transformer = self.transformer else { return [] } - for i in stride(from: 0, to: yAxis.entryCount, by: 1) - { - positions.append(CGPoint(x: 0.0, y: entries[i])) - } - + var positions = axis.entries.map { CGPoint(x: 0.0, y: $0) } transformer.pointValuesToPixel(&positions) return positions @@ -248,27 +213,26 @@ open class YAxisRenderer: AxisRendererBase @objc open func drawZeroLine(context: CGContext) { guard - let yAxis = self.axis as? YAxis, let transformer = self.transformer, - let zeroLineColor = yAxis.zeroLineColor + let zeroLineColor = axis.zeroLineColor else { return } context.saveGState() defer { context.restoreGState() } var clippingRect = viewPortHandler.contentRect - clippingRect.origin.y -= yAxis.zeroLineWidth / 2.0 - clippingRect.size.height += yAxis.zeroLineWidth + clippingRect.origin.y -= axis.zeroLineWidth / 2.0 + clippingRect.size.height += axis.zeroLineWidth context.clip(to: clippingRect) context.setStrokeColor(zeroLineColor.cgColor) - context.setLineWidth(yAxis.zeroLineWidth) + context.setLineWidth(axis.zeroLineWidth) let pos = transformer.pixelForValues(x: 0.0, y: 0.0) - - if yAxis.zeroLineDashLengths != nil + + if axis.zeroLineDashLengths != nil { - context.setLineDash(phase: yAxis.zeroLineDashPhase, lengths: yAxis.zeroLineDashLengths!) + context.setLineDash(phase: axis.zeroLineDashPhase, lengths: axis.zeroLineDashLengths!) } else { @@ -280,35 +244,23 @@ open class YAxisRenderer: AxisRendererBase context.drawPath(using: CGPathDrawingMode.stroke) } - open override func renderLimitLines(context: CGContext) + open func renderLimitLines(context: CGContext) { - guard - let yAxis = self.axis as? YAxis, - let transformer = self.transformer - else { return } + guard let transformer = self.transformer else { return } - let limitLines = yAxis.limitLines - - if limitLines.count == 0 - { - return - } + let limitLines = axis.limitLines + guard !limitLines.isEmpty else { return } + context.saveGState() - + defer { context.restoreGState() } + let trans = transformer.valueToPixelMatrix var position = CGPoint(x: 0.0, y: 0.0) - for i in 0 ..< limitLines.count + for l in limitLines where l.isEnabled { - let l = limitLines[i] - - if !l.isEnabled - { - continue - } - context.saveGState() defer { context.restoreGState() } @@ -341,56 +293,164 @@ open class YAxisRenderer: AxisRendererBase let label = l.label // if drawing the limit-value label is enabled - if l.drawLabelEnabled && label.count > 0 + guard l.drawLabelEnabled, !label.isEmpty else { continue } + + let labelLineHeight = l.valueFont.lineHeight + + let xOffset = 4.0 + l.xOffset + let yOffset = l.lineWidth + labelLineHeight + l.yOffset + + let align: TextAlignment + let point: CGPoint + + switch l.labelPosition { - let labelLineHeight = l.valueFont.lineHeight - - let xOffset: CGFloat = 4.0 + l.xOffset - let yOffset: CGFloat = l.lineWidth + labelLineHeight + l.yOffset - - if l.labelPosition == .topRight - { - ChartUtils.drawText(context: context, - text: label, - point: CGPoint( - x: viewPortHandler.contentRight - xOffset, - y: position.y - yOffset), - align: .right, - attributes: [NSAttributedString.Key.font: l.valueFont, NSAttributedString.Key.foregroundColor: l.valueTextColor]) - } - else if l.labelPosition == .bottomRight - { - ChartUtils.drawText(context: context, - text: label, - point: CGPoint( - x: viewPortHandler.contentRight - xOffset, - y: position.y + yOffset - labelLineHeight), - align: .right, - attributes: [NSAttributedString.Key.font: l.valueFont, NSAttributedString.Key.foregroundColor: l.valueTextColor]) - } - else if l.labelPosition == .topLeft - { - ChartUtils.drawText(context: context, - text: label, - point: CGPoint( - x: viewPortHandler.contentLeft + xOffset, - y: position.y - yOffset), - align: .left, - attributes: [NSAttributedString.Key.font: l.valueFont, NSAttributedString.Key.foregroundColor: l.valueTextColor]) - } - else - { - ChartUtils.drawText(context: context, - text: label, - point: CGPoint( - x: viewPortHandler.contentLeft + xOffset, - y: position.y + yOffset - labelLineHeight), - align: .left, - attributes: [NSAttributedString.Key.font: l.valueFont, NSAttributedString.Key.foregroundColor: l.valueTextColor]) - } + case .rightTop: + align = .right + point = CGPoint(x: viewPortHandler.contentRight - xOffset, + y: position.y - yOffset) + + case .rightBottom: + align = .right + point = CGPoint(x: viewPortHandler.contentRight - xOffset, + y: position.y + yOffset - labelLineHeight) + + case .leftTop: + align = .left + point = CGPoint(x: viewPortHandler.contentLeft + xOffset, + y: position.y - yOffset) + + case .leftBottom: + align = .left + point = CGPoint(x: viewPortHandler.contentLeft + xOffset, + y: position.y + yOffset - labelLineHeight) } + + context.drawText(label, + at: point, + align: align, + attributes: [.font: l.valueFont, .foregroundColor: l.valueTextColor]) + } + } + + @objc open func computeAxis(min: Double, max: Double, inverted: Bool) + { + var min = min, max = max + + if let transformer = self.transformer, + viewPortHandler.contentWidth > 10.0, + !viewPortHandler.isFullyZoomedOutY + { + // calculate the starting and entry point of the y-labels (depending on zoom / contentrect bounds) + let p1 = transformer.valueForTouchPoint(CGPoint(x: viewPortHandler.contentLeft, y: viewPortHandler.contentTop)) + let p2 = transformer.valueForTouchPoint(CGPoint(x: viewPortHandler.contentLeft, y: viewPortHandler.contentBottom)) + + min = inverted ? Double(p1.y) : Double(p2.y) + max = inverted ? Double(p2.y) : Double(p1.y) + } + + computeAxisValues(min: min, max: max) + } + + @objc open func computeAxisValues(min: Double, max: Double) + { + let yMin = min + let yMax = max + + let labelCount = axis.labelCount + let range = abs(yMax - yMin) + + guard + labelCount != 0, + range > 0, + range.isFinite + else + { + axis.entries = [] + axis.centeredEntries = [] + return + } + + // Find out how much spacing (in y value space) between axis values + let rawInterval = range / Double(labelCount) + var interval = rawInterval.roundedToNextSignificant() + + // If granularity is enabled, then do not allow the interval to go below specified granularity. + // This is used to avoid repeated values when rounding values for display. + if axis.granularityEnabled + { + interval = Swift.max(interval, axis.granularity) + } + + // Normalize interval + let intervalMagnitude = pow(10.0, Double(Int(log10(interval)))).roundedToNextSignificant() + let intervalSigDigit = Int(interval / intervalMagnitude) + if intervalSigDigit > 5 + { + // Use one order of magnitude higher, to avoid intervals like 0.9 or 90 + interval = floor(10.0 * Double(intervalMagnitude)) + } + + var n = axis.centerAxisLabelsEnabled ? 1 : 0 + + // force label count + if axis.isForceLabelsEnabled + { + interval = Double(range) / Double(labelCount - 1) + + // Ensure stops contains at least n elements. + axis.entries.removeAll(keepingCapacity: true) + axis.entries.reserveCapacity(labelCount) + + let values = stride(from: yMin, to: Double(labelCount) * interval + yMin, by: interval) + axis.entries.append(contentsOf: values) + + n = labelCount + } + else + { + // no forced count + + var first = interval == 0.0 ? 0.0 : ceil(yMin / interval) * interval + + if axis.centerAxisLabelsEnabled + { + first -= interval + } + + let last = interval == 0.0 ? 0.0 : (floor(yMax / interval) * interval).nextUp + + if interval != 0.0, last != first + { + stride(from: first, through: last, by: interval).forEach { _ in n += 1 } + } + + // Ensure stops contains at least n elements. + axis.entries.removeAll(keepingCapacity: true) + axis.entries.reserveCapacity(labelCount) + + // Fix for IEEE negative zero case (Where value == -0.0, and 0.0 == -0.0) + let values = stride(from: first, to: Double(n) * interval + first, by: interval).map { $0 == 0.0 ? 0.0 : $0 } + axis.entries.append(contentsOf: values) + } + + // set decimals + if interval < 1 + { + axis.decimals = Int(ceil(-log10(interval))) + } + else + { + axis.decimals = 0 + } + + if axis.centerAxisLabelsEnabled + { + axis.centeredEntries.reserveCapacity(n) + axis.centeredEntries.removeAll() + + let offset: Double = interval / 2.0 + axis.centeredEntries.append(contentsOf: axis.entries.map { $0 + offset }) } - - context.restoreGState() } } diff --git a/Source/Charts/Renderers/YAxisRendererHorizontalBarChart.swift b/Source/Charts/Renderers/YAxisRendererHorizontalBarChart.swift index de4f65e522..f4aa877d0a 100644 --- a/Source/Charts/Renderers/YAxisRendererHorizontalBarChart.swift +++ b/Source/Charts/Renderers/YAxisRendererHorizontalBarChart.swift @@ -14,34 +14,26 @@ import CoreGraphics open class YAxisRendererHorizontalBarChart: YAxisRenderer { - public override init(viewPortHandler: ViewPortHandler, yAxis: YAxis?, transformer: Transformer?) + public override init(viewPortHandler: ViewPortHandler, axis: YAxis, transformer: Transformer?) { - super.init(viewPortHandler: viewPortHandler, yAxis: yAxis, transformer: transformer) + super.init(viewPortHandler: viewPortHandler, axis: axis, transformer: transformer) } /// Computes the axis values. open override func computeAxis(min: Double, max: Double, inverted: Bool) { - guard let transformer = self.transformer else { return } - var min = min, max = max // calculate the starting and entry point of the y-labels (depending on zoom / contentrect bounds) - if viewPortHandler.contentHeight > 10.0 && !viewPortHandler.isFullyZoomedOutX + if let transformer = transformer, + viewPortHandler.contentHeight > 10.0, + !viewPortHandler.isFullyZoomedOutX { let p1 = transformer.valueForTouchPoint(CGPoint(x: viewPortHandler.contentLeft, y: viewPortHandler.contentTop)) let p2 = transformer.valueForTouchPoint(CGPoint(x: viewPortHandler.contentRight, y: viewPortHandler.contentTop)) - - if !inverted - { - min = Double(p1.x) - max = Double(p2.x) - } - else - { - min = Double(p2.x) - max = Double(p1.x) - } + + min = inverted ? Double(p2.x) : Double(p1.x) + max = inverted ? Double(p1.x) : Double(p2.x) } computeAxisValues(min: min, max: max) @@ -50,92 +42,77 @@ open class YAxisRendererHorizontalBarChart: YAxisRenderer /// draws the y-axis labels to the screen open override func renderAxisLabels(context: CGContext) { - guard let yAxis = axis as? YAxis else { return } - - if !yAxis.isEnabled || !yAxis.isDrawLabelsEnabled - { - return - } - - let lineHeight = yAxis.labelFont.lineHeight + guard + axis.isEnabled, + axis.isDrawLabelsEnabled + else { return } + + let lineHeight = axis.labelFont.lineHeight let baseYOffset: CGFloat = 2.5 - let dependency = yAxis.axisDependency - let labelPosition = yAxis.labelPosition - - var yPos: CGFloat = 0.0 + let dependency = axis.axisDependency + let labelPosition = axis.labelPosition - if dependency == .left - { - if labelPosition == .outsideChart - { - yPos = viewPortHandler.contentTop - baseYOffset - } - else - { - yPos = viewPortHandler.contentTop - baseYOffset - } - } - else + // Comparing with Android code, the code here is slightly different about lineHeight + let yPos: CGFloat = { - if labelPosition == .outsideChart - { - yPos = viewPortHandler.contentBottom + lineHeight + baseYOffset - } - else + switch (dependency, labelPosition) { - yPos = viewPortHandler.contentBottom + lineHeight + baseYOffset + case (.left, .outsideChart): + return viewPortHandler.contentTop - baseYOffset - lineHeight + + case (.left, .insideChart): + return viewPortHandler.contentTop - baseYOffset - lineHeight + + case (.right, .outsideChart): + return viewPortHandler.contentBottom + baseYOffset + + case (.right, .insideChart): + return viewPortHandler.contentBottom + baseYOffset } - } - - // For compatibility with Android code, we keep above calculation the same, - // And here we pull the line back up - yPos -= lineHeight - + }() + drawYLabels( context: context, fixedPosition: yPos, positions: transformedPositions(), - offset: yAxis.yOffset) + offset: axis.yOffset + ) } open override func renderAxisLine(context: CGContext) { - guard let yAxis = axis as? YAxis else { return } - - if !yAxis.isEnabled || !yAxis.drawAxisLineEnabled - { - return - } - + guard + axis.isEnabled, + axis.drawAxisLineEnabled + else { return } + context.saveGState() + defer { context.restoreGState() } - context.setStrokeColor(yAxis.axisLineColor.cgColor) - context.setLineWidth(yAxis.axisLineWidth) - if yAxis.axisLineDashLengths != nil + context.setStrokeColor(axis.axisLineColor.cgColor) + context.setLineWidth(axis.axisLineWidth) + if axis.axisLineDashLengths != nil { - context.setLineDash(phase: yAxis.axisLineDashPhase, lengths: yAxis.axisLineDashLengths) + context.setLineDash(phase: axis.axisLineDashPhase, lengths: axis.axisLineDashLengths) } else { context.setLineDash(phase: 0.0, lengths: []) } - if yAxis.axisDependency == .left + context.beginPath() + if axis.axisDependency == .left { - context.beginPath() context.move(to: CGPoint(x: viewPortHandler.contentLeft, y: viewPortHandler.contentTop)) context.addLine(to: CGPoint(x: viewPortHandler.contentRight, y: viewPortHandler.contentTop)) - context.strokePath() } else { - context.beginPath() context.move(to: CGPoint(x: viewPortHandler.contentLeft, y: viewPortHandler.contentBottom)) context.addLine(to: CGPoint(x: viewPortHandler.contentRight, y: viewPortHandler.contentBottom)) - context.strokePath() } - - context.restoreGState() + } + context.strokePath() } /// draws the y-labels on the specified x-position @@ -145,38 +122,28 @@ open class YAxisRendererHorizontalBarChart: YAxisRenderer positions: [CGPoint], offset: CGFloat) { - guard let - yAxis = axis as? YAxis - else { return } + let labelFont = axis.labelFont + let labelTextColor = axis.labelTextColor - let labelFont = yAxis.labelFont - let labelTextColor = yAxis.labelTextColor + let from = axis.isDrawBottomYLabelEntryEnabled ? 0 : 1 + let to = axis.isDrawTopYLabelEntryEnabled ? axis.entryCount : (axis.entryCount - 1) - let from = yAxis.isDrawBottomYLabelEntryEnabled ? 0 : 1 - let to = yAxis.isDrawTopYLabelEntryEnabled ? yAxis.entryCount : (yAxis.entryCount - 1) + let xOffset = axis.labelXOffset - let xOffset = yAxis.labelXOffset - - for i in stride(from: from, to: to, by: 1) + for i in from.. [CGPoint] { - guard - let yAxis = self.axis as? YAxis, - let transformer = self.transformer - else { return [CGPoint]() } - - var positions = [CGPoint]() - positions.reserveCapacity(yAxis.entryCount) - - let entries = yAxis.entries - - for i in stride(from: 0, to: yAxis.entryCount, by: 1) - { - positions.append(CGPoint(x: entries[i], y: 0.0)) - } + guard let transformer = self.transformer else { return [] } + var positions = axis.entries.map { CGPoint(x: $0, y: 0.0) } transformer.pointValuesToPixel(&positions) return positions @@ -218,27 +173,26 @@ open class YAxisRendererHorizontalBarChart: YAxisRenderer open override func drawZeroLine(context: CGContext) { guard - let yAxis = self.axis as? YAxis, let transformer = self.transformer, - let zeroLineColor = yAxis.zeroLineColor + let zeroLineColor = axis.zeroLineColor else { return } context.saveGState() defer { context.restoreGState() } var clippingRect = viewPortHandler.contentRect - clippingRect.origin.x -= yAxis.zeroLineWidth / 2.0 - clippingRect.size.width += yAxis.zeroLineWidth + clippingRect.origin.x -= axis.zeroLineWidth / 2.0 + clippingRect.size.width += axis.zeroLineWidth context.clip(to: clippingRect) context.setStrokeColor(zeroLineColor.cgColor) - context.setLineWidth(yAxis.zeroLineWidth) + context.setLineWidth(axis.zeroLineWidth) let pos = transformer.pixelForValues(x: 0.0, y: 0.0) - if yAxis.zeroLineDashLengths != nil + if axis.zeroLineDashLengths != nil { - context.setLineDash(phase: yAxis.zeroLineDashPhase, lengths: yAxis.zeroLineDashLengths!) + context.setLineDash(phase: axis.zeroLineDashPhase, lengths: axis.zeroLineDashLengths!) } else { @@ -247,40 +201,25 @@ open class YAxisRendererHorizontalBarChart: YAxisRenderer context.move(to: CGPoint(x: pos.x - 1.0, y: viewPortHandler.contentTop)) context.addLine(to: CGPoint(x: pos.x - 1.0, y: viewPortHandler.contentBottom)) - context.drawPath(using: CGPathDrawingMode.stroke) + context.drawPath(using: .stroke) } - - private var _limitLineSegmentsBuffer = [CGPoint](repeating: CGPoint(), count: 2) - + open override func renderLimitLines(context: CGContext) { - guard - let yAxis = axis as? YAxis, - let transformer = self.transformer - else { return } + guard let transformer = self.transformer else { return } - let limitLines = yAxis.limitLines + let limitLines = axis.limitLines + + guard !limitLines.isEmpty else { return } - if limitLines.count <= 0 - { - return - } - context.saveGState() - + defer { context.restoreGState() } + let trans = transformer.valueToPixelMatrix - - var position = CGPoint(x: 0.0, y: 0.0) - - for i in 0 ..< limitLines.count + var position = CGPoint.zero + + for l in limitLines where l.isEnabled { - let l = limitLines[i] - - if !l.isEnabled - { - continue - } - context.saveGState() defer { context.restoreGState() } @@ -288,11 +227,10 @@ open class YAxisRendererHorizontalBarChart: YAxisRenderer clippingRect.origin.x -= l.lineWidth / 2.0 clippingRect.size.width += l.lineWidth context.clip(to: clippingRect) - - position.x = CGFloat(l.limit) - position.y = 0.0 - position = position.applying(trans) - + + position = CGPoint(x: l.limit, y: 0) + .applying(trans) + context.beginPath() context.move(to: CGPoint(x: position.x, y: viewPortHandler.contentTop)) context.addLine(to: CGPoint(x: position.x, y: viewPortHandler.contentBottom)) @@ -313,56 +251,44 @@ open class YAxisRendererHorizontalBarChart: YAxisRenderer let label = l.label // if drawing the limit-value label is enabled - if l.drawLabelEnabled && label.count > 0 + if l.drawLabelEnabled, !label.isEmpty { let labelLineHeight = l.valueFont.lineHeight - let xOffset: CGFloat = l.lineWidth + l.xOffset - let yOffset: CGFloat = 2.0 + l.yOffset + let xOffset = l.lineWidth + l.xOffset + let yOffset = 2.0 + l.yOffset - if l.labelPosition == .topRight - { - ChartUtils.drawText(context: context, - text: label, - point: CGPoint( - x: position.x + xOffset, - y: viewPortHandler.contentTop + yOffset), - align: .left, - attributes: [NSAttributedString.Key.font: l.valueFont, NSAttributedString.Key.foregroundColor: l.valueTextColor]) - } - else if l.labelPosition == .bottomRight - { - ChartUtils.drawText(context: context, - text: label, - point: CGPoint( - x: position.x + xOffset, - y: viewPortHandler.contentBottom - labelLineHeight - yOffset), - align: .left, - attributes: [NSAttributedString.Key.font: l.valueFont, NSAttributedString.Key.foregroundColor: l.valueTextColor]) - } - else if l.labelPosition == .topLeft - { - ChartUtils.drawText(context: context, - text: label, - point: CGPoint( - x: position.x - xOffset, - y: viewPortHandler.contentTop + yOffset), - align: .right, - attributes: [NSAttributedString.Key.font: l.valueFont, NSAttributedString.Key.foregroundColor: l.valueTextColor]) - } - else + let align: TextAlignment + let point: CGPoint + + switch l.labelPosition { - ChartUtils.drawText(context: context, - text: label, - point: CGPoint( - x: position.x - xOffset, - y: viewPortHandler.contentBottom - labelLineHeight - yOffset), - align: .right, - attributes: [NSAttributedString.Key.font: l.valueFont, NSAttributedString.Key.foregroundColor: l.valueTextColor]) + case .rightTop: + align = .left + point = CGPoint(x: position.x + xOffset, + y: viewPortHandler.contentTop + yOffset) + + case .rightBottom: + align = .left + point = CGPoint(x: position.x + xOffset, + y: viewPortHandler.contentBottom - labelLineHeight - yOffset) + + case .leftTop: + align = .right + point = CGPoint(x: position.x - xOffset, + y: viewPortHandler.contentTop + yOffset) + + case .leftBottom: + align = .right + point = CGPoint(x: position.x - xOffset, + y: viewPortHandler.contentBottom - labelLineHeight - yOffset) } + + context.drawText(label, + at: point, + align: align, + attributes: [.font: l.valueFont, .foregroundColor: l.valueTextColor]) } } - - context.restoreGState() } } diff --git a/Source/Charts/Renderers/YAxisRendererRadarChart.swift b/Source/Charts/Renderers/YAxisRendererRadarChart.swift index a5e44daa63..3b3cde0bf8 100644 --- a/Source/Charts/Renderers/YAxisRendererRadarChart.swift +++ b/Source/Charts/Renderers/YAxisRendererRadarChart.swift @@ -12,54 +12,46 @@ import Foundation import CoreGraphics -#if canImport(UIKit) - import UIKit -#endif - -#if canImport(Cocoa) -import Cocoa -#endif open class YAxisRendererRadarChart: YAxisRenderer { private weak var chart: RadarChartView? - @objc public init(viewPortHandler: ViewPortHandler, yAxis: YAxis?, chart: RadarChartView) + @objc public init(viewPortHandler: ViewPortHandler, axis: YAxis, chart: RadarChartView) { - super.init(viewPortHandler: viewPortHandler, yAxis: yAxis, transformer: nil) - self.chart = chart + + super.init(viewPortHandler: viewPortHandler, axis: axis, transformer: nil) } open override func computeAxisValues(min yMin: Double, max yMax: Double) { - guard let - axis = axis as? YAxis - else { return } - let labelCount = axis.labelCount let range = abs(yMax - yMin) - if labelCount == 0 || range <= 0 || range.isInfinite + guard labelCount != 0, + range > 0, + range.isFinite + else { - axis.entries = [Double]() - axis.centeredEntries = [Double]() + axis.entries = [] + axis.centeredEntries = [] return } // Find out how much spacing (in yValue space) between axis values let rawInterval = range / Double(labelCount) - var interval = rawInterval.roundedToNextSignficant() - + var interval = rawInterval.roundedToNextSignificant() + // If granularity is enabled, then do not allow the interval to go below specified granularity. // This is used to avoid repeated values when rounding values for display. if axis.isGranularityEnabled { - interval = interval < axis.granularity ? axis.granularity : interval + interval = max(interval, axis.granularity) } // Normalize interval - let intervalMagnitude = pow(10.0, floor(log10(interval))).roundedToNextSignficant() + let intervalMagnitude = pow(10.0, floor(log10(interval))).roundedToNextSignificant() let intervalSigDigit = Int(interval / intervalMagnitude) if intervalSigDigit > 5 @@ -75,19 +67,14 @@ open class YAxisRendererRadarChart: YAxisRenderer // force label count if axis.isForceLabelsEnabled { - let step = Double(range) / Double(labelCount - 1) + let step = range / Double(labelCount - 1) // Ensure stops contains at least n elements. axis.entries.removeAll(keepingCapacity: true) axis.entries.reserveCapacity(labelCount) - - var v = yMin - - for _ in 0 ..< labelCount - { - axis.entries.append(v) - v += step - } + + let values = stride(from: yMin, to: Double(labelCount) * step + yMin, by: step) + axis.entries.append(contentsOf: values) n = labelCount } @@ -106,10 +93,7 @@ open class YAxisRendererRadarChart: YAxisRenderer if interval != 0.0 { - for _ in stride(from: first, through: last, by: interval) - { - n += 1 - } + stride(from: first, through: last, by: interval).forEach { _ in n += 1 } } n += 1 @@ -117,22 +101,10 @@ open class YAxisRendererRadarChart: YAxisRenderer // Ensure stops contains at least n elements. axis.entries.removeAll(keepingCapacity: true) axis.entries.reserveCapacity(labelCount) - - var f = first - var i = 0 - while i < n - { - if f == 0.0 - { - // Fix for IEEE negative zero case (Where value == -0.0, and 0.0 == -0.0) - f = 0.0 - } - axis.entries.append(Double(f)) - - f += interval - i += 1 - } + // Fix for IEEE negative zero case (Where value == -0.0, and 0.0 == -0.0) + let values = stride(from: first, to: Double(n) * interval + first, by: interval).map { $0 == 0.0 ? 0.0 : $0 } + axis.entries.append(contentsOf: values) } // set decimals @@ -147,85 +119,66 @@ open class YAxisRendererRadarChart: YAxisRenderer if centeringEnabled { - axis.centeredEntries.reserveCapacity(n) - axis.centeredEntries.removeAll() - let offset = (axis.entries[1] - axis.entries[0]) / 2.0 - - for i in 0 ..< n - { - axis.centeredEntries.append(axis.entries[i] + offset) - } + axis.centeredEntries = axis.entries.map { $0 + offset } } - axis._axisMinimum = axis.entries[0] - axis._axisMaximum = axis.entries[n-1] + axis._axisMinimum = axis.entries.first! + axis._axisMaximum = axis.entries.last! axis.axisRange = abs(axis._axisMaximum - axis._axisMinimum) } open override func renderAxisLabels(context: CGContext) { - guard let - yAxis = axis as? YAxis, - let chart = chart + guard + let chart = chart, + axis.isEnabled, + axis.isDrawLabelsEnabled else { return } - - if !yAxis.isEnabled || !yAxis.isDrawLabelsEnabled - { - return - } - - let labelFont = yAxis.labelFont - let labelTextColor = yAxis.labelTextColor + + let labelFont = axis.labelFont + let labelTextColor = axis.labelTextColor let center = chart.centerOffsets let factor = chart.factor - let labelLineHeight = yAxis.labelFont.lineHeight + let labelLineHeight = axis.labelFont.lineHeight - let from = yAxis.isDrawBottomYLabelEntryEnabled ? 0 : 1 - let to = yAxis.isDrawTopYLabelEntryEnabled ? yAxis.entryCount : (yAxis.entryCount - 1) + let from = axis.isDrawBottomYLabelEntryEnabled ? 0 : 1 + let to = axis.isDrawTopYLabelEntryEnabled ? axis.entryCount : (axis.entryCount - 1) - let alignment: NSTextAlignment = yAxis.labelAlignment - let xOffset = yAxis.labelXOffset - - for j in stride(from: from, to: to, by: 1) - { - let r = CGFloat(yAxis.entries[j] - yAxis._axisMinimum) * factor - + let alignment = axis.labelAlignment + let xOffset = axis.labelXOffset + + let entries = axis.entries[from..= 0x61 && c.value <= 0x66) ? (c.value - 0x61 + 10) : c.value - 0x30 + argb[i] = UInt(val) * 16 + if length == 3 + { + argb[i] = argb[i] + UInt(val) + } + else { - var c = colorString[index] + c = colorString[index] index = colorString.index(after: index) - - var val = (c.value >= 0x61 && c.value <= 0x66) ? (c.value - 0x61 + 10) : c.value - 0x30 - argb[i] = UInt(val) * 16 - if length == 3 - { - argb[i] = argb[i] + UInt(val) - } - else - { - c = colorString[index] - index = colorString.index(after: index) - - val = (c.value >= 0x61 && c.value <= 0x66) ? (c.value - 0x61 + 10) : c.value - 0x30 - argb[i] = argb[i] + UInt(val) - } - - i += 1 + + val = (c.value >= 0x61 && c.value <= 0x66) ? (c.value - 0x61 + 10) : c.value - 0x30 + argb[i] = argb[i] + UInt(val) } + + i += 1 } - + return NSUIColor(red: CGFloat(argb[1]) / 255.0, green: CGFloat(argb[2]) / 255.0, blue: CGFloat(argb[3]) / 255.0, alpha: CGFloat(argb[0]) / 255.0) } else if colorString.hasPrefix("rgba") diff --git a/Source/Charts/Utils/ChartUtils.swift b/Source/Charts/Utils/ChartUtils.swift index 5e90873b51..10fa091c85 100644 --- a/Source/Charts/Utils/ChartUtils.swift +++ b/Source/Charts/Utils/ChartUtils.swift @@ -12,14 +12,6 @@ import Foundation import CoreGraphics -#if canImport(UIKit) - import UIKit -#endif - -#if canImport(Cocoa) -import Cocoa -#endif - extension Comparable { func clamped(to range: ClosedRange) -> Self @@ -80,7 +72,7 @@ extension CGSize extension Double { /// Rounds the number to the nearest multiple of it's order of magnitude, rounding away from zero if halfway. - func roundedToNextSignficant() -> Double + func roundedToNextSignificant() -> Double { guard !isInfinite, @@ -103,7 +95,7 @@ extension Double self != 0.0 else { return 0 } - let i = self.roundedToNextSignficant() + let i = roundedToNextSignificant() guard !i.isInfinite, @@ -124,155 +116,162 @@ extension CGPoint } } -open class ChartUtils +extension CGContext { - private static var _defaultValueFormatter: IValueFormatter = ChartUtils.generateDefaultValueFormatter() - - open class func drawImage( - context: CGContext, - image: NSUIImage, - x: CGFloat, - y: CGFloat, - size: CGSize) + + open func drawImage(_ image: NSUIImage, atCenter center: CGPoint, size: CGSize) { var drawOffset = CGPoint() - drawOffset.x = x - (size.width / 2) - drawOffset.y = y - (size.height / 2) - - NSUIGraphicsPushContext(context) - + drawOffset.x = center.x - (size.width / 2) + drawOffset.y = center.y - (size.height / 2) + + NSUIGraphicsPushContext(self) + if image.size.width != size.width && image.size.height != size.height { let key = "resized_\(size.width)_\(size.height)" - + // Try to take scaled image from cache of this image var scaledImage = objc_getAssociatedObject(image, key) as? NSUIImage if scaledImage == nil { // Scale the image NSUIGraphicsBeginImageContextWithOptions(size, false, 0.0) - - image.draw(in: CGRect(origin: CGPoint(x: 0, y: 0), size: size)) - + + image.draw(in: CGRect(origin: .zero, size: size)) + scaledImage = NSUIGraphicsGetImageFromCurrentImageContext() NSUIGraphicsEndImageContext() - + // Put the scaled image in a cache owned by the original image objc_setAssociatedObject(image, key, scaledImage, .OBJC_ASSOCIATION_RETAIN_NONATOMIC) } - + scaledImage?.draw(in: CGRect(origin: drawOffset, size: size)) } else { image.draw(in: CGRect(origin: drawOffset, size: size)) } - + NSUIGraphicsPopContext() } - - open class func drawText(context: CGContext, text: String, point: CGPoint, align: NSTextAlignment, attributes: [NSAttributedString.Key : Any]?) + + open func drawText(_ text: String, at point: CGPoint, align: TextAlignment, anchor: CGPoint = CGPoint(x: 0.5, y: 0.5), angleRadians: CGFloat = 0.0, attributes: [NSAttributedString.Key : Any]?) { - var point = point + let drawPoint = getDrawPoint(text: text, point: point, align: align, attributes: attributes) - if align == .center + if (angleRadians == 0.0) { - point.x -= text.size(withAttributes: attributes).width / 2.0 + NSUIGraphicsPushContext(self) + + (text as NSString).draw(at: drawPoint, withAttributes: attributes) + + NSUIGraphicsPopContext() } - else if align == .right + else { - point.x -= text.size(withAttributes: attributes).width + drawText(text, at: drawPoint, anchor: anchor, angleRadians: angleRadians, attributes: attributes) } - - NSUIGraphicsPushContext(context) - - (text as NSString).draw(at: point, withAttributes: attributes) - - NSUIGraphicsPopContext() } - open class func drawText(context: CGContext, text: String, point: CGPoint, attributes: [NSAttributedString.Key : Any]?, anchor: CGPoint, angleRadians: CGFloat) + open func drawText(_ text: String, at point: CGPoint, anchor: CGPoint = CGPoint(x: 0.5, y: 0.5), angleRadians: CGFloat, attributes: [NSAttributedString.Key : Any]?) { var drawOffset = CGPoint() - - NSUIGraphicsPushContext(context) - + + NSUIGraphicsPushContext(self) + if angleRadians != 0.0 { let size = text.size(withAttributes: attributes) - + // Move the text drawing rect in a way that it always rotates around its center drawOffset.x = -size.width * 0.5 drawOffset.y = -size.height * 0.5 - + var translate = point - + // Move the "outer" rect relative to the anchor, assuming its centered if anchor.x != 0.5 || anchor.y != 0.5 { let rotatedSize = size.rotatedBy(radians: angleRadians) - + translate.x -= rotatedSize.width * (anchor.x - 0.5) translate.y -= rotatedSize.height * (anchor.y - 0.5) } - - context.saveGState() - context.translateBy(x: translate.x, y: translate.y) - context.rotate(by: angleRadians) - + + saveGState() + translateBy(x: translate.x, y: translate.y) + rotate(by: angleRadians) + (text as NSString).draw(at: drawOffset, withAttributes: attributes) - - context.restoreGState() + + restoreGState() } else { if anchor.x != 0.0 || anchor.y != 0.0 { let size = text.size(withAttributes: attributes) - + drawOffset.x = -size.width * anchor.x drawOffset.y = -size.height * anchor.y } - + drawOffset.x += point.x drawOffset.y += point.y - + (text as NSString).draw(at: drawOffset, withAttributes: attributes) } - + NSUIGraphicsPopContext() } - - internal class func drawMultilineText(context: CGContext, text: String, knownTextSize: CGSize, point: CGPoint, attributes: [NSAttributedString.Key : Any]?, constrainedToSize: CGSize, anchor: CGPoint, angleRadians: CGFloat) + + private func getDrawPoint(text: String, point: CGPoint, align: TextAlignment, attributes: [NSAttributedString.Key : Any]?) -> CGPoint { - var rect = CGRect(origin: CGPoint(), size: knownTextSize) - - NSUIGraphicsPushContext(context) + var point = point + if align == .center + { + point.x -= text.size(withAttributes: attributes).width / 2.0 + } + else if align == .right + { + point.x -= text.size(withAttributes: attributes).width + } + return point + } + + func drawMultilineText(_ text: String, at point: CGPoint, constrainedTo size: CGSize, anchor: CGPoint, knownTextSize: CGSize, angleRadians: CGFloat, attributes: [NSAttributedString.Key : Any]?) + { + var rect = CGRect(origin: .zero, size: knownTextSize) + + NSUIGraphicsPushContext(self) + if angleRadians != 0.0 { // Move the text drawing rect in a way that it always rotates around its center rect.origin.x = -knownTextSize.width * 0.5 rect.origin.y = -knownTextSize.height * 0.5 - + var translate = point - + // Move the "outer" rect relative to the anchor, assuming its centered if anchor.x != 0.5 || anchor.y != 0.5 { let rotatedSize = knownTextSize.rotatedBy(radians: angleRadians) - + translate.x -= rotatedSize.width * (anchor.x - 0.5) translate.y -= rotatedSize.height * (anchor.y - 0.5) } - - context.saveGState() - context.translateBy(x: translate.x, y: translate.y) - context.rotate(by: angleRadians) - + + saveGState() + translateBy(x: translate.x, y: translate.y) + rotate(by: angleRadians) + (text as NSString).draw(with: rect, options: .usesLineFragmentOrigin, attributes: attributes, context: nil) - - context.restoreGState() + + restoreGState() } else { @@ -281,31 +280,19 @@ open class ChartUtils rect.origin.x = -knownTextSize.width * anchor.x rect.origin.y = -knownTextSize.height * anchor.y } - + rect.origin.x += point.x rect.origin.y += point.y - + (text as NSString).draw(with: rect, options: .usesLineFragmentOrigin, attributes: attributes, context: nil) } - + NSUIGraphicsPopContext() } - - internal class func drawMultilineText(context: CGContext, text: String, point: CGPoint, attributes: [NSAttributedString.Key : Any]?, constrainedToSize: CGSize, anchor: CGPoint, angleRadians: CGFloat) - { - let rect = text.boundingRect(with: constrainedToSize, options: .usesLineFragmentOrigin, attributes: attributes, context: nil) - drawMultilineText(context: context, text: text, knownTextSize: rect.size, point: point, attributes: attributes, constrainedToSize: constrainedToSize, anchor: anchor, angleRadians: angleRadians) - } - private class func generateDefaultValueFormatter() -> IValueFormatter - { - let formatter = DefaultValueFormatter(decimals: 1) - return formatter - } - - /// - Returns: The default value formatter used for all chart components that needs a default - open class func defaultValueFormatter() -> IValueFormatter + func drawMultilineText(_ text: String, at point: CGPoint, constrainedTo size: CGSize, anchor: CGPoint, angleRadians: CGFloat, attributes: [NSAttributedString.Key : Any]?) { - return _defaultValueFormatter + let rect = text.boundingRect(with: size, options: .usesLineFragmentOrigin, attributes: attributes, context: nil) + drawMultilineText(text, at: point, constrainedTo: size, anchor: anchor, knownTextSize: rect.size, angleRadians: angleRadians, attributes: attributes) } } diff --git a/Source/Charts/Utils/Fill.swift b/Source/Charts/Utils/Fill.swift index 1294b3efc0..7a6520f191 100644 --- a/Source/Charts/Utils/Fill.swift +++ b/Source/Charts/Utils/Fill.swift @@ -12,312 +12,199 @@ import Foundation import CoreGraphics -@objc(ChartFillType) -public enum FillType: Int +@objc(ChartFill) +public protocol Fill { - case empty - case color - case linearGradient - case radialGradient - case image - case tiledImage - case layer + + /// Draws the provided path in filled mode with the provided area + @objc func fillPath(context: CGContext, rect: CGRect) } -@objc(ChartFill) -open class Fill: NSObject +@objc(ChartEmptyFill) +public class EmptyFill: NSObject, Fill { - private var _type: FillType = FillType.empty - private var _color: CGColor? - private var _gradient: CGGradient? - private var _gradientAngle: CGFloat = 0.0 - private var _gradientStartOffsetPercent: CGPoint = CGPoint() - private var _gradientStartRadiusPercent: CGFloat = 0.0 - private var _gradientEndOffsetPercent: CGPoint = CGPoint() - private var _gradientEndRadiusPercent: CGFloat = 0.0 - private var _image: CGImage? - private var _layer: CGLayer? - - // MARK: Properties - - @objc open var type: FillType - { - return _type - } - - @objc open var color: CGColor? - { - return _color - } - - @objc open var gradient: CGGradient? - { - return _gradient - } - - @objc open var gradientAngle: CGFloat - { - return _gradientAngle - } - - @objc open var gradientStartOffsetPercent: CGPoint + + public func fillPath(context: CGContext, rect: CGRect) { } +} + +@objc(ChartColorFill) +public class ColorFill: NSObject, Fill +{ + + @objc public let color: CGColor + + @objc public init(cgColor: CGColor) { - return _gradientStartOffsetPercent + self.color = cgColor + super.init() } - - @objc open var gradientStartRadiusPercent: CGFloat + + @objc public convenience init(color: NSUIColor) { - return _gradientStartRadiusPercent + self.init(cgColor: color.cgColor) } - - @objc open var gradientEndOffsetPercent: CGPoint + + public func fillPath(context: CGContext, rect: CGRect) { - return _gradientEndOffsetPercent + context.saveGState() + defer { context.restoreGState() } + + context.setFillColor(color) + context.fillPath() } - - @objc open var gradientEndRadiusPercent: CGFloat +} + +@objc(ChartImageFill) +public class ImageFill: NSObject, Fill +{ + + @objc public let image: CGImage + @objc public let isTiled: Bool + + @objc public init(cgImage: CGImage, isTiled: Bool = false) { - return _gradientEndRadiusPercent + image = cgImage + self.isTiled = isTiled + super.init() } - - @objc open var image: CGImage? + + @objc public convenience init(image: NSUIImage, isTiled: Bool = false) { - return _image + self.init(cgImage: image.cgImage!, isTiled: isTiled) } - - @objc open var layer: CGLayer? + + public func fillPath(context: CGContext, rect: CGRect) { - return _layer + context.saveGState() + defer { context.restoreGState() } + + context.clip() + context.draw(image, in: rect, byTiling: isTiled) } - - // MARK: Constructors - - public override init() +} + +@objc(ChartLayerFill) +public class LayerFill: NSObject, Fill +{ + + @objc public let layer: CGLayer + + @objc public init(layer: CGLayer) { + self.layer = layer + super.init() } - - @objc public init(CGColor: CGColor) + + public func fillPath(context: CGContext, rect: CGRect) { - _type = .color - _color = CGColor + context.saveGState() + defer { context.restoreGState() } + + context.clip() + context.draw(layer, in: rect) } - - @objc public convenience init(color: NSUIColor) +} + +@objc(ChartLinearGradientFill) +public class LinearGradientFill: NSObject, Fill +{ + + @objc public let gradient: CGGradient + @objc public let angle: CGFloat + + @objc public init(gradient: CGGradient, angle: CGFloat = 0) { - self.init(CGColor: color.cgColor) + self.gradient = gradient + self.angle = angle + super.init() } - - @objc public init(linearGradient: CGGradient, angle: CGFloat) + + public func fillPath(context: CGContext, rect: CGRect) { - _type = .linearGradient - _gradient = linearGradient - _gradientAngle = angle + context.saveGState() + defer { context.restoreGState() } + + let radians = (360.0 - angle).DEG2RAD + let centerPoint = CGPoint(x: rect.midX, y: rect.midY) + let xAngleDelta = cos(radians) * rect.width / 2.0 + let yAngleDelta = sin(radians) * rect.height / 2.0 + let startPoint = CGPoint( + x: centerPoint.x - xAngleDelta, + y: centerPoint.y - yAngleDelta + ) + let endPoint = CGPoint( + x: centerPoint.x + xAngleDelta, + y: centerPoint.y + yAngleDelta + ) + + context.clip() + context.drawLinearGradient( + gradient, + start: startPoint, + end: endPoint, + options: [.drawsAfterEndLocation, .drawsBeforeStartLocation] + ) } - +} + +@objc(ChartRadialGradientFill) +public class RadialGradientFill: NSObject, Fill +{ + + @objc public let gradient: CGGradient + @objc public let startOffsetPercent: CGPoint + @objc public let endOffsetPercent: CGPoint + @objc public let startRadiusPercent: CGFloat + @objc public let endRadiusPercent: CGFloat + @objc public init( - radialGradient: CGGradient, + gradient: CGGradient, startOffsetPercent: CGPoint, - startRadiusPercent: CGFloat, endOffsetPercent: CGPoint, - endRadiusPercent: CGFloat - ) + startRadiusPercent: CGFloat, + endRadiusPercent: CGFloat) { - _type = .radialGradient - _gradient = radialGradient - _gradientStartOffsetPercent = startOffsetPercent - _gradientStartRadiusPercent = startRadiusPercent - _gradientEndOffsetPercent = endOffsetPercent - _gradientEndRadiusPercent = endRadiusPercent + self.gradient = gradient + self.startOffsetPercent = startOffsetPercent + self.endOffsetPercent = endOffsetPercent + self.startRadiusPercent = startRadiusPercent + self.endRadiusPercent = endRadiusPercent + super.init() } - - @objc public convenience init(radialGradient: CGGradient) + + @objc public convenience init(gradient: CGGradient) { self.init( - radialGradient: radialGradient, - startOffsetPercent: CGPoint(x: 0.0, y: 0.0), - startRadiusPercent: 0.0, - endOffsetPercent: CGPoint(x: 0.0, y: 0.0), - endRadiusPercent: 1.0 - ) - } - - @objc public init(CGImage: CGImage, tiled: Bool) - { - _type = tiled ? .tiledImage : .image - _image = CGImage - } - - @objc public convenience init(image: NSUIImage, tiled: Bool) - { - self.init(CGImage: image.cgImage!, tiled: tiled) - } - - @objc public convenience init(CGImage: CGImage) - { - self.init(CGImage: CGImage, tiled: false) - } - - @objc public convenience init(image: NSUIImage) - { - self.init(image: image, tiled: false) - } - - @objc public init(CGLayer: CGLayer) - { - _type = .layer - _layer = CGLayer - } - - // MARK: Constructors - - @objc open class func fillWithCGColor(_ CGColor: CGColor) -> Fill - { - return Fill(CGColor: CGColor) - } - - @objc open class func fillWithColor(_ color: NSUIColor) -> Fill - { - return Fill(color: color) - } - - @objc open class func fillWithLinearGradient( - _ linearGradient: CGGradient, - angle: CGFloat) -> Fill - { - return Fill(linearGradient: linearGradient, angle: angle) - } - - @objc open class func fillWithRadialGradient( - _ radialGradient: CGGradient, - startOffsetPercent: CGPoint, - startRadiusPercent: CGFloat, - endOffsetPercent: CGPoint, - endRadiusPercent: CGFloat - ) -> Fill - { - return Fill( - radialGradient: radialGradient, - startOffsetPercent: startOffsetPercent, - startRadiusPercent: startRadiusPercent, - endOffsetPercent: endOffsetPercent, - endRadiusPercent: endRadiusPercent + gradient: gradient, + startOffsetPercent: .zero, + endOffsetPercent: .zero, + startRadiusPercent: 0, + endRadiusPercent: 1 ) } - - @objc open class func fillWithRadialGradient(_ radialGradient: CGGradient) -> Fill - { - return Fill(radialGradient: radialGradient) - } - - @objc open class func fillWithCGImage(_ CGImage: CGImage, tiled: Bool) -> Fill - { - return Fill(CGImage: CGImage, tiled: tiled) - } - - @objc open class func fillWithImage(_ image: NSUIImage, tiled: Bool) -> Fill - { - return Fill(image: image, tiled: tiled) - } - - @objc open class func fillWithCGImage(_ CGImage: CGImage) -> Fill - { - return Fill(CGImage: CGImage) - } - - @objc open class func fillWithImage(_ image: NSUIImage) -> Fill - { - return Fill(image: image) - } - - @objc open class func fillWithCGLayer(_ CGLayer: CGLayer) -> Fill - { - return Fill(CGLayer: CGLayer) - } - - // MARK: Drawing code - - /// Draws the provided path in filled mode with the provided area - @objc open func fillPath( - context: CGContext, - rect: CGRect) + + @objc public func fillPath(context: CGContext, rect: CGRect) { - let fillType = _type - if fillType == .empty - { - return - } - context.saveGState() - - switch fillType - { - case .color: - - context.setFillColor(_color!) - context.fillPath() - - case .image: - - context.clip() - context.draw(_image!, in: rect) - - case .tiledImage: - - context.clip() - context.draw(_image!, in: rect, byTiling: true) - - case .layer: - - context.clip() - context.draw(_layer!, in: rect) - - case .linearGradient: - - let radians = (360.0 - _gradientAngle).DEG2RAD - let centerPoint = CGPoint(x: rect.midX, y: rect.midY) - let xAngleDelta = cos(radians) * rect.width / 2.0 - let yAngleDelta = sin(radians) * rect.height / 2.0 - let startPoint = CGPoint( - x: centerPoint.x - xAngleDelta, - y: centerPoint.y - yAngleDelta - ) - let endPoint = CGPoint( - x: centerPoint.x + xAngleDelta, - y: centerPoint.y + yAngleDelta - ) - - context.clip() - context.drawLinearGradient(_gradient!, - start: startPoint, - end: endPoint, - options: [.drawsAfterEndLocation, .drawsBeforeStartLocation] - ) - - case .radialGradient: - - let centerPoint = CGPoint(x: rect.midX, y: rect.midY) - let radius = max(rect.width, rect.height) / 2.0 - - context.clip() - context.drawRadialGradient(_gradient!, - startCenter: CGPoint( - x: centerPoint.x + rect.width * _gradientStartOffsetPercent.x, - y: centerPoint.y + rect.height * _gradientStartOffsetPercent.y - ), - startRadius: radius * _gradientStartRadiusPercent, - endCenter: CGPoint( - x: centerPoint.x + rect.width * _gradientEndOffsetPercent.x, - y: centerPoint.y + rect.height * _gradientEndOffsetPercent.y - ), - endRadius: radius * _gradientEndRadiusPercent, - options: [.drawsAfterEndLocation, .drawsBeforeStartLocation] - ) - - case .empty: - break - } - - context.restoreGState() + defer { context.restoreGState() } + + let centerPoint = CGPoint(x: rect.midX, y: rect.midY) + let radius = max(rect.width, rect.height) / 2.0 + + context.clip() + context.drawRadialGradient( + gradient, + startCenter: CGPoint( + x: centerPoint.x + rect.width * startOffsetPercent.x, + y: centerPoint.y + rect.height * startOffsetPercent.y + ), + startRadius: radius * startRadiusPercent, + endCenter: CGPoint( + x: centerPoint.x + rect.width * endOffsetPercent.x, + y: centerPoint.y + rect.height * endOffsetPercent.y + ), + endRadius: radius * endRadiusPercent, + options: [.drawsAfterEndLocation, .drawsBeforeStartLocation] + ) } - } diff --git a/Source/Charts/Utils/Platform+Accessibility.swift b/Source/Charts/Utils/Platform+Accessibility.swift index 35668eaba3..d2bced7b26 100644 --- a/Source/Charts/Utils/Platform+Accessibility.swift +++ b/Source/Charts/Utils/Platform+Accessibility.swift @@ -12,18 +12,16 @@ import Foundation #if os(iOS) || os(tvOS) -#if canImport(UIKit) - import UIKit -#endif +import UIKit internal func accessibilityPostLayoutChangedNotification(withElement element: Any? = nil) { - UIAccessibility.post(notification: UIAccessibility.Notification.layoutChanged, argument: element) + UIAccessibility.post(notification: .layoutChanged, argument: element) } internal func accessibilityPostScreenChangedNotification(withElement element: Any? = nil) { - UIAccessibility.post(notification: UIAccessibility.Notification.screenChanged, argument: element) + UIAccessibility.post(notification: .screenChanged, argument: element) } /// A simple abstraction over UIAccessibilityElement and NSAccessibilityElement. @@ -35,7 +33,7 @@ open class NSUIAccessibilityElement: UIAccessibilityElement { didSet { - accessibilityTraits = isHeader ? UIAccessibilityTraits.header : UIAccessibilityTraits.none + accessibilityTraits = isHeader ? .header : .none } } @@ -43,14 +41,14 @@ open class NSUIAccessibilityElement: UIAccessibilityElement { didSet { - accessibilityTraits = isSelected ? UIAccessibilityTraits.selected : UIAccessibilityTraits.none + accessibilityTraits = isSelected ? .selected : .none } } override public init(accessibilityContainer container: Any) { // We can force unwrap since all chart views are subclasses of UIView - containerView = (container as! UIView) + containerView = container as? UIView super.init(accessibilityContainer: container) } @@ -97,18 +95,15 @@ extension NSUIView open override func index(ofAccessibilityElement element: Any) -> Int { guard let axElement = element as? NSUIAccessibilityElement else { return NSNotFound } - return (accessibilityChildren() as? [NSUIAccessibilityElement])? - .firstIndex(of: axElement) ?? NSNotFound + return (accessibilityChildren() as? [NSUIAccessibilityElement])?.firstIndex(of: axElement) ?? NSNotFound } } #endif #if os(OSX) - -#if canImport(AppKit) import AppKit -#endif + internal func accessibilityPostLayoutChangedNotification(withElement element: Any? = nil) { diff --git a/Source/Charts/Utils/Platform.swift b/Source/Charts/Utils/Platform.swift index 3722647d3d..927191cf44 100644 --- a/Source/Charts/Utils/Platform.swift +++ b/Source/Charts/Utils/Platform.swift @@ -1,240 +1,285 @@ import Foundation /** This file provides a thin abstraction layer atop of UIKit (iOS, tvOS) and Cocoa (OS X). The two APIs are very much - alike, and for the chart library's usage of the APIs it is often sufficient to typealias one to the other. The NSUI* - types are aliased to either their UI* implementation (on iOS) or their NS* implementation (on OS X). */ +alike, and for the chart library's usage of the APIs it is often sufficient to typealias one to the other. The NSUI* +types are aliased to either their UI* implementation (on iOS) or their NS* implementation (on OS X). */ #if os(iOS) || os(tvOS) -#if canImport(UIKit) - import UIKit -#endif - -public typealias NSUIFont = UIFont -public typealias NSUIImage = UIImage -public typealias NSUIScrollView = UIScrollView -public typealias NSUIScreen = UIScreen -public typealias NSUIDisplayLink = CADisplayLink + import UIKit -open class NSUIView: UIView -{ - @objc var nsuiLayer: CALayer? - { - return self.layer - } -} -extension UIScrollView -{ - @objc var nsuiIsScrollEnabled: Bool - { - get { return isScrollEnabled } - set { isScrollEnabled = newValue } - } -} + public typealias ParagraphStyle = NSParagraphStyle + public typealias MutableParagraphStyle = NSMutableParagraphStyle + public typealias TextAlignment = NSTextAlignment + public typealias NSUIFont = UIFont + public typealias NSUIImage = UIImage + public typealias NSUIScrollView = UIScrollView + public typealias NSUIScreen = UIScreen + public typealias NSUIDisplayLink = CADisplayLink -extension UIScreen -{ - @objc final var nsuiScale: CGFloat + extension NSUIColor { - return self.scale - } -} - -#endif - -#if os(OSX) -import Cocoa -import Quartz + var nsuirgba: (red: CGFloat, green: CGFloat, blue: CGFloat, alpha: CGFloat)? { + var red: CGFloat = 0 + var green: CGFloat = 0 + var blue: CGFloat = 0 + var alpha: CGFloat = 0 -public typealias NSUIFont = NSFont -public typealias NSUIImage = NSImage -public typealias NSUIScrollView = NSScrollView -public typealias NSUIScreen = NSScreen + guard getRed(&red, green: &green, blue: &blue, alpha: &alpha) else { + return nil + } -/** On OS X there is no CADisplayLink. Use a 60 fps timer to render the animations. */ -public class NSUIDisplayLink -{ - private var timer: Timer? - private var displayLink: CVDisplayLink? - private var _timestamp: CFTimeInterval = 0.0 - - private weak var _target: AnyObject? - private var _selector: Selector - - public var timestamp: CFTimeInterval - { - return _timestamp + return (red: red, green: green, blue: blue, alpha: alpha) + } } - init(target: Any, selector: Selector) + open class NSUIView: UIView { - _target = target as AnyObject - _selector = selector - - if CVDisplayLinkCreateWithActiveCGDisplays(&displayLink) == kCVReturnSuccess - { - - CVDisplayLinkSetOutputCallback(displayLink!, { (displayLink, inNow, inOutputTime, flagsIn, flagsOut, userData) -> CVReturn in - - let _self = unsafeBitCast(userData, to: NSUIDisplayLink.self) - - _self._timestamp = CFAbsoluteTimeGetCurrent() - _self._target?.performSelector(onMainThread: _self._selector, with: _self, waitUntilDone: false) - - return kCVReturnSuccess - }, Unmanaged.passUnretained(self).toOpaque()) - } - else + @objc var nsuiLayer: CALayer? { - timer = Timer(timeInterval: 1.0 / 60.0, target: target, selector: selector, userInfo: nil, repeats: true) + return self.layer } - } - - deinit - { - stop() } - open func add(to runloop: RunLoop, forMode mode: RunLoop.Mode) + extension UIScrollView { - if displayLink != nil + @objc var nsuiIsScrollEnabled: Bool { - CVDisplayLinkStart(displayLink!) + get { return isScrollEnabled } + set { isScrollEnabled = newValue } } - else if timer != nil + } + + extension UIScreen + { + @objc final var nsuiScale: CGFloat { - runloop.add(timer!, forMode: mode) + return self.scale } } - open func remove(from: RunLoop, forMode: RunLoop.Mode) + func NSUIMainScreen() -> NSUIScreen? { - stop() + return NSUIScreen.main } - private func stop() +#endif + +#if os(OSX) + import Cocoa + import Quartz + + public typealias ParagraphStyle = NSParagraphStyle + public typealias MutableParagraphStyle = NSMutableParagraphStyle + public typealias TextAlignment = NSTextAlignment + public typealias NSUIFont = NSFont + public typealias NSUIImage = NSImage + public typealias NSUIScrollView = NSScrollView + public typealias NSUIScreen = NSScreen + + /** On OS X there is no CADisplayLink. Use a 60 fps timer to render the animations. */ + public class NSUIDisplayLink { - if displayLink != nil + private var timer: Timer? + private var displayLink: CVDisplayLink? + private var _timestamp: CFTimeInterval = 0.0 + + private weak var _target: AnyObject? + private var _selector: Selector + + public var timestamp: CFTimeInterval { - CVDisplayLinkStop(displayLink!) + return _timestamp } - if timer != nil + + init(target: AnyObject, selector: Selector) { - timer?.invalidate() + _target = target + _selector = selector + + if CVDisplayLinkCreateWithActiveCGDisplays(&displayLink) == kCVReturnSuccess + { + + CVDisplayLinkSetOutputCallback(displayLink!, { (displayLink, inNow, inOutputTime, flagsIn, flagsOut, userData) -> CVReturn in + + let _self = unsafeBitCast(userData, to: NSUIDisplayLink.self) + + _self._timestamp = CFAbsoluteTimeGetCurrent() + _self._target?.performSelector(onMainThread: _self._selector, with: _self, waitUntilDone: false) + + return kCVReturnSuccess + }, Unmanaged.passUnretained(self).toOpaque()) + } + else + { + timer = Timer(timeInterval: 1.0 / 60.0, target: target, selector: selector, userInfo: nil, repeats: true) + } + } + + deinit + { + stop() } - } -} - -extension NSView -{ - final var nsuiGestureRecognizers: [NSGestureRecognizer]? - { - return self.gestureRecognizers - } -} -extension NSScrollView -{ - var nsuiIsScrollEnabled: Bool - { - get { return scrollEnabled } - set { scrollEnabled = newValue } - } -} + open func add(to runloop: RunLoop, forMode mode: RunLoop.Mode) + { + if displayLink != nil + { + CVDisplayLinkStart(displayLink!) + } + else if timer != nil + { + runloop.add(timer!, forMode: mode) + } + } -open class NSUIView: NSView -{ - /// A private constant to set the accessibility role during initialization. - /// It ensures parity with the iOS element ordering as well as numbered counts of chart components. - /// (See Platform+Accessibility for details) - private let role: NSAccessibility.Role = .list + open func remove(from: RunLoop, forMode: RunLoop.Mode) + { + stop() + } + + private func stop() + { + if displayLink != nil + { + CVDisplayLinkStop(displayLink!) + } + if timer != nil + { + timer?.invalidate() + } + } + } - public override init(frame frameRect: NSRect) + extension NSUIColor { - super.init(frame: frameRect) - setAccessibilityRole(role) + var nsuirgba: (red: CGFloat, green: CGFloat, blue: CGFloat, alpha: CGFloat)? { + var red: CGFloat = 0 + var green: CGFloat = 0 + var blue: CGFloat = 0 + var alpha: CGFloat = 0 + + guard let colorSpaceModel = cgColor.colorSpace?.model else { + return nil + } + guard colorSpaceModel == .rgb else { + return nil + } + + getRed(&red, green: &green, blue: &blue, alpha: &alpha) + return (red: red, green: green, blue: blue, alpha: alpha) + } } - required public init?(coder decoder: NSCoder) + extension NSView { - super.init(coder: decoder) - setAccessibilityRole(role) - } + final var nsuiGestureRecognizers: [NSGestureRecognizer]? + { + return self.gestureRecognizers + } + } - public final override var isFlipped: Bool + extension NSScrollView { - return true + var nsuiIsScrollEnabled: Bool + { + get { return scrollEnabled } + set { scrollEnabled = newValue } + } } - - func setNeedsDisplay() + + open class NSUIView: NSView { - self.setNeedsDisplay(self.bounds) - } - + /// A private constant to set the accessibility role during initialization. + /// It ensures parity with the iOS element ordering as well as numbered counts of chart components. + /// (See Platform+Accessibility for details) + private let role: NSAccessibility.Role = .list - open var backgroundColor: NSUIColor? + public override init(frame frameRect: NSRect) { - get + super.init(frame: frameRect) + setAccessibilityRole(role) + } + + required public init?(coder decoder: NSCoder) { - return self.layer?.backgroundColor == nil - ? nil - : NSColor(cgColor: self.layer!.backgroundColor!) + super.init(coder: decoder) + setAccessibilityRole(role) } - set + + public final override var isFlipped: Bool { - self.wantsLayer = true - self.layer?.backgroundColor = newValue == nil ? nil : newValue!.cgColor + return true + } + + func setNeedsDisplay() + { + self.setNeedsDisplay(self.bounds) + } + + open var backgroundColor: NSUIColor? + { + get + { + return self.layer?.backgroundColor == nil + ? nil + : NSColor(cgColor: self.layer!.backgroundColor!) + } + set + { + self.wantsLayer = true + self.layer?.backgroundColor = newValue == nil ? nil : newValue!.cgColor + } } - } - final var nsuiLayer: CALayer? - { - return self.layer - } -} + final var nsuiLayer: CALayer? + { + return self.layer + } + } -extension NSFont -{ - var lineHeight: CGFloat + extension NSFont { - // Not sure if this is right, but it looks okay - return self.boundingRectForFont.size.height - } -} + var lineHeight: CGFloat + { + // Not sure if this is right, but it looks okay + return self.boundingRectForFont.size.height + } + } -extension NSScreen -{ - final var nsuiScale: CGFloat + extension NSScreen { - return self.backingScaleFactor - } -} + final var nsuiScale: CGFloat + { + return self.backingScaleFactor + } + } -extension NSImage -{ - var cgImage: CGImage? + extension NSImage { - return self.cgImage(forProposedRect: nil, context: nil, hints: nil) - } -} + var cgImage: CGImage? + { + return self.cgImage(forProposedRect: nil, context: nil, hints: nil) + } + } -extension NSScrollView -{ - /// NOTE: Unable to disable scrolling in macOS - var scrollEnabled: Bool + extension NSScrollView { - get - { - return true - } - set + var scrollEnabled: Bool { - } + get + { + return true + } + set + { + // FIXME: We can't disable scrolling it on OSX + } + } } -} + func NSUIMainScreen() -> NSUIScreen? + { + return NSUIScreen.main + } + #endif - -extension NSUIScreen -{ - class var nsuiMain: NSUIScreen? { .main } -} diff --git a/Source/Charts/Utils/Sequence+KeyPath.swift b/Source/Charts/Utils/Sequence+KeyPath.swift new file mode 100644 index 0000000000..fd3679893c --- /dev/null +++ b/Source/Charts/Utils/Sequence+KeyPath.swift @@ -0,0 +1,19 @@ +// +// Sequence+KeyPath.swift +// Charts +// +// Created by Jacob Christie on 2020-12-15. +// + +extension Sequence { + func max( + by keyPath: KeyPath, + areInIncreasingOrder: (T, T) -> Bool + ) -> Element? { + self.max { areInIncreasingOrder($0[keyPath: keyPath], $1[keyPath: keyPath]) } + } + + func max(by keyPath: KeyPath) -> Element? { + max(by: keyPath, areInIncreasingOrder: <) + } +} diff --git a/Source/Charts/Utils/Transformer.swift b/Source/Charts/Utils/Transformer.swift index b50ea823c5..db27d17c22 100644 --- a/Source/Charts/Utils/Transformer.swift +++ b/Source/Charts/Utils/Transformer.swift @@ -17,37 +17,37 @@ import CoreGraphics open class Transformer: NSObject { /// matrix to map the values to the screen pixels - internal var _matrixValueToPx = CGAffineTransform.identity + internal var matrixValueToPx = CGAffineTransform.identity /// matrix for handling the different offsets of the chart - internal var _matrixOffset = CGAffineTransform.identity + internal var matrixOffset = CGAffineTransform.identity - internal var _viewPortHandler: ViewPortHandler + internal var viewPortHandler: ViewPortHandler @objc public init(viewPortHandler: ViewPortHandler) { - _viewPortHandler = viewPortHandler + self.viewPortHandler = viewPortHandler } /// Prepares the matrix that transforms values to pixels. Calculates the scale factors from the charts size and offsets. @objc open func prepareMatrixValuePx(chartXMin: Double, deltaX: CGFloat, deltaY: CGFloat, chartYMin: Double) { - var scaleX = (_viewPortHandler.contentWidth / deltaX) - var scaleY = (_viewPortHandler.contentHeight / deltaY) + var scaleX = (viewPortHandler.contentWidth / deltaX) + var scaleY = (viewPortHandler.contentHeight / deltaY) - if CGFloat.infinity == scaleX + if .infinity == scaleX { scaleX = 0.0 } - if CGFloat.infinity == scaleY + if .infinity == scaleY { scaleY = 0.0 } // setup all matrices - _matrixValueToPx = CGAffineTransform.identity - _matrixValueToPx = _matrixValueToPx.scaledBy(x: scaleX, y: -scaleY) - _matrixValueToPx = _matrixValueToPx.translatedBy(x: CGFloat(-chartXMin), y: CGFloat(-chartYMin)) + matrixValueToPx = CGAffineTransform.identity + .scaledBy(x: scaleX, y: -scaleY) + .translatedBy(x: CGFloat(-chartXMin), y: CGFloat(-chartYMin)) } /// Prepares the matrix that contains all offsets. @@ -55,12 +55,12 @@ open class Transformer: NSObject { if !inverted { - _matrixOffset = CGAffineTransform(translationX: _viewPortHandler.offsetLeft, y: _viewPortHandler.chartHeight - _viewPortHandler.offsetBottom) + matrixOffset = CGAffineTransform(translationX: viewPortHandler.offsetLeft, y: viewPortHandler.chartHeight - viewPortHandler.offsetBottom) } else { - _matrixOffset = CGAffineTransform(scaleX: 1.0, y: -1.0) - _matrixOffset = _matrixOffset.translatedBy(x: _viewPortHandler.offsetLeft, y: -_viewPortHandler.offsetTop) + matrixOffset = CGAffineTransform(scaleX: 1.0, y: -1.0) + .translatedBy(x: viewPortHandler.offsetLeft, y: -viewPortHandler.offsetTop) } } @@ -158,8 +158,8 @@ open class Transformer: NSObject @objc open var valueToPixelMatrix: CGAffineTransform { return - _matrixValueToPx.concatenating(_viewPortHandler.touchMatrix - ).concatenating(_matrixOffset + matrixValueToPx.concatenating(viewPortHandler.touchMatrix) + .concatenating(matrixOffset ) } diff --git a/Source/Charts/Utils/TransformerHorizontalBarChart.swift b/Source/Charts/Utils/TransformerHorizontalBarChart.swift index d7e657bd25..1a7d5579cd 100644 --- a/Source/Charts/Utils/TransformerHorizontalBarChart.swift +++ b/Source/Charts/Utils/TransformerHorizontalBarChart.swift @@ -20,13 +20,13 @@ open class TransformerHorizontalBarChart: Transformer { if !inverted { - _matrixOffset = CGAffineTransform(translationX: _viewPortHandler.offsetLeft, y: _viewPortHandler.chartHeight - _viewPortHandler.offsetBottom) + matrixOffset = CGAffineTransform(translationX: viewPortHandler.offsetLeft, y: viewPortHandler.chartHeight - viewPortHandler.offsetBottom) } else { - _matrixOffset = CGAffineTransform(scaleX: -1.0, y: 1.0) - _matrixOffset = _matrixOffset.translatedBy(x: -(_viewPortHandler.chartWidth - _viewPortHandler.offsetRight), - y: _viewPortHandler.chartHeight - _viewPortHandler.offsetBottom) + matrixOffset = CGAffineTransform(scaleX: -1.0, y: 1.0) + .translatedBy(x: -(viewPortHandler.chartWidth - viewPortHandler.offsetRight), + y: viewPortHandler.chartHeight - viewPortHandler.offsetBottom) } } } diff --git a/Source/Charts/Utils/ViewPortHandler.swift b/Source/Charts/Utils/ViewPortHandler.swift old mode 100755 new mode 100644 index 8916d068a8..bf27481b13 --- a/Source/Charts/Utils/ViewPortHandler.swift +++ b/Source/Charts/Utils/ViewPortHandler.swift @@ -17,44 +17,44 @@ import CoreGraphics open class ViewPortHandler: NSObject { /// matrix used for touch events - private var _touchMatrix = CGAffineTransform.identity - + @objc open private(set) var touchMatrix = CGAffineTransform.identity + /// this rectangle defines the area in which graph values can be drawn - private var _contentRect = CGRect() - - private var _chartWidth = CGFloat(0.0) - private var _chartHeight = CGFloat(0.0) + @objc open private(set) var contentRect = CGRect() + @objc open private(set) var chartWidth: CGFloat = 0 + @objc open private(set) var chartHeight: CGFloat = 0 + /// minimum scale value on the y-axis - private var _minScaleY = CGFloat(1.0) - + @objc open private(set) var minScaleY: CGFloat = 1.0 + /// maximum scale value on the y-axis - private var _maxScaleY = CGFloat.greatestFiniteMagnitude - + @objc open private(set) var maxScaleY = CGFloat.greatestFiniteMagnitude + /// minimum scale value on the x-axis - private var _minScaleX = CGFloat(1.0) - + @objc open private(set) var minScaleX: CGFloat = 1.0 + /// maximum scale value on the x-axis - private var _maxScaleX = CGFloat.greatestFiniteMagnitude - + @objc open private(set) var maxScaleX = CGFloat.greatestFiniteMagnitude + /// contains the current scale factor of the x-axis - private var _scaleX = CGFloat(1.0) - + @objc open private(set) var scaleX: CGFloat = 1.0 + /// contains the current scale factor of the y-axis - private var _scaleY = CGFloat(1.0) - - /// current translation (drag distance) on the x-axis - private var _transX = CGFloat(0.0) - - /// current translation (drag distance) on the y-axis - private var _transY = CGFloat(0.0) - + @objc open private(set) var scaleY: CGFloat = 1.0 + + /// current translation (drag / pan) distance on the x-axis + @objc open private(set) var transX: CGFloat = 0 + + /// current translation (drag / pan) distance on the y-axis + @objc open private(set) var transY: CGFloat = 0 + /// offset that allows the chart to be dragged over its bounds on the x-axis - private var _transOffsetX = CGFloat(0.0) - + private var transOffsetX: CGFloat = 0 + /// offset that allows the chart to be dragged over its bounds on the x-axis - private var _transOffsetY = CGFloat(0.0) - + private var transOffsetY: CGFloat = 0 + /// Constructor - don't forget calling setChartDimens(...) @objc public init(width: CGFloat, height: CGFloat) { @@ -70,100 +70,79 @@ open class ViewPortHandler: NSObject let offsetRight = self.offsetRight let offsetBottom = self.offsetBottom - _chartHeight = height - _chartWidth = width + chartHeight = height + chartWidth = width restrainViewPort(offsetLeft: offsetLeft, offsetTop: offsetTop, offsetRight: offsetRight, offsetBottom: offsetBottom) } @objc open var hasChartDimens: Bool { - if _chartHeight > 0.0 && _chartWidth > 0.0 - { - return true - } - else - { - return false - } + return chartHeight > 0.0 + && chartWidth > 0.0 } @objc open func restrainViewPort(offsetLeft: CGFloat, offsetTop: CGFloat, offsetRight: CGFloat, offsetBottom: CGFloat) { - _contentRect.origin.x = offsetLeft - _contentRect.origin.y = offsetTop - _contentRect.size.width = _chartWidth - offsetLeft - offsetRight - _contentRect.size.height = _chartHeight - offsetBottom - offsetTop + contentRect.origin.x = offsetLeft + contentRect.origin.y = offsetTop + contentRect.size.width = chartWidth - offsetLeft - offsetRight + contentRect.size.height = chartHeight - offsetBottom - offsetTop } @objc open var offsetLeft: CGFloat { - return _contentRect.origin.x + return contentRect.origin.x } @objc open var offsetRight: CGFloat { - return _chartWidth - _contentRect.size.width - _contentRect.origin.x + return chartWidth - contentRect.size.width - contentRect.origin.x } @objc open var offsetTop: CGFloat { - return _contentRect.origin.y + return contentRect.origin.y } @objc open var offsetBottom: CGFloat { - return _chartHeight - _contentRect.size.height - _contentRect.origin.y + return chartHeight - contentRect.size.height - contentRect.origin.y } @objc open var contentTop: CGFloat { - return _contentRect.origin.y + return contentRect.origin.y } @objc open var contentLeft: CGFloat { - return _contentRect.origin.x + return contentRect.origin.x } @objc open var contentRight: CGFloat { - return _contentRect.origin.x + _contentRect.size.width + return contentRect.origin.x + contentRect.size.width } @objc open var contentBottom: CGFloat { - return _contentRect.origin.y + _contentRect.size.height + return contentRect.origin.y + contentRect.size.height } @objc open var contentWidth: CGFloat { - return _contentRect.size.width + return contentRect.size.width } @objc open var contentHeight: CGFloat { - return _contentRect.size.height - } - - @objc open var contentRect: CGRect - { - return _contentRect + return contentRect.size.height } - + @objc open var contentCenter: CGPoint { - return CGPoint(x: _contentRect.origin.x + _contentRect.size.width / 2.0, y: _contentRect.origin.y + _contentRect.size.height / 2.0) - } - - @objc open var chartHeight: CGFloat - { - return _chartHeight - } - - @objc open var chartWidth: CGFloat - { - return _chartWidth + return CGPoint(x: contentRect.origin.x + contentRect.size.width / 2.0, y: contentRect.origin.y + contentRect.size.height / 2.0) } // MARK: - Scaling/Panning etc. @@ -171,16 +150,15 @@ open class ViewPortHandler: NSObject /// Zooms by the specified zoom factors. @objc open func zoom(scaleX: CGFloat, scaleY: CGFloat) -> CGAffineTransform { - return _touchMatrix.scaledBy(x: scaleX, y: scaleY) + return touchMatrix.scaledBy(x: scaleX, y: scaleY) } /// Zooms around the specified center @objc open func zoom(scaleX: CGFloat, scaleY: CGFloat, x: CGFloat, y: CGFloat) -> CGAffineTransform { - var matrix = _touchMatrix.translatedBy(x: x, y: y) - matrix = matrix.scaledBy(x: scaleX, y: scaleY) - matrix = matrix.translatedBy(x: -x, y: -y) - return matrix + return touchMatrix.translatedBy(x: x, y: y) + .scaledBy(x: scaleX, y: scaleY) + .translatedBy(x: -x, y: -y) } /// Zooms in by 1.4, x and y are the coordinates (in pixels) of the zoom center. @@ -204,7 +182,7 @@ open class ViewPortHandler: NSObject /// Sets the scale factor to the specified values. @objc open func setZoom(scaleX: CGFloat, scaleY: CGFloat) -> CGAffineTransform { - var matrix = _touchMatrix + var matrix = touchMatrix matrix.a = scaleX matrix.d = scaleY return matrix @@ -213,22 +191,22 @@ open class ViewPortHandler: NSObject /// Sets the scale factor to the specified values. x and y is pivot. @objc open func setZoom(scaleX: CGFloat, scaleY: CGFloat, x: CGFloat, y: CGFloat) -> CGAffineTransform { - var matrix = _touchMatrix + var matrix = touchMatrix matrix.a = 1.0 matrix.d = 1.0 matrix = matrix.translatedBy(x: x, y: y) - matrix = matrix.scaledBy(x: scaleX, y: scaleY) - matrix = matrix.translatedBy(x: -x, y: -y) + .scaledBy(x: scaleX, y: scaleY) + .translatedBy(x: -x, y: -y) return matrix } /// Resets all zooming and dragging and makes the chart fit exactly it's bounds. @objc open func fitScreen() -> CGAffineTransform { - _minScaleX = 1.0 - _minScaleY = 1.0 + minScaleX = 1.0 + minScaleY = 1.0 - return CGAffineTransform.identity + return .identity } /// Translates to the specified point. @@ -237,7 +215,7 @@ open class ViewPortHandler: NSObject let translateX = pt.x - offsetLeft let translateY = pt.y - offsetTop - let matrix = _touchMatrix.concatenating(CGAffineTransform(translationX: -translateX, y: -translateY)) + let matrix = touchMatrix.concatenating(CGAffineTransform(translationX: -translateX, y: -translateY)) return matrix } @@ -250,160 +228,91 @@ open class ViewPortHandler: NSObject let translateX = pt.x - offsetLeft let translateY = pt.y - offsetTop - let matrix = _touchMatrix.concatenating(CGAffineTransform(translationX: -translateX, y: -translateY)) + let matrix = touchMatrix.concatenating(CGAffineTransform(translationX: -translateX, y: -translateY)) refresh(newMatrix: matrix, chart: chart, invalidate: true) } /// call this method to refresh the graph with a given matrix @objc @discardableResult open func refresh(newMatrix: CGAffineTransform, chart: ChartViewBase, invalidate: Bool) -> CGAffineTransform { - _touchMatrix = newMatrix + touchMatrix = newMatrix // make sure scale and translation are within their bounds - limitTransAndScale(matrix: &_touchMatrix, content: _contentRect) + limitTransAndScale(matrix: &touchMatrix, content: contentRect) chart.setNeedsDisplay() - return _touchMatrix + return touchMatrix } /// limits the maximum scale and X translation of the given matrix - private func limitTransAndScale(matrix: inout CGAffineTransform, content: CGRect?) + private func limitTransAndScale(matrix: inout CGAffineTransform, content: CGRect) { // min scale-x is 1 - _scaleX = min(max(_minScaleX, matrix.a), _maxScaleX) + scaleX = min(max(minScaleX, matrix.a), maxScaleX) // min scale-y is 1 - _scaleY = min(max(_minScaleY, matrix.d), _maxScaleY) - - - var width: CGFloat = 0.0 - var height: CGFloat = 0.0 + scaleY = min(max(minScaleY, matrix.d), maxScaleY) - if content != nil - { - width = content!.width - height = content!.height - } - - let maxTransX = -width * (_scaleX - 1.0) - _transX = min(max(matrix.tx, maxTransX - _transOffsetX), _transOffsetX) + let width = content.width + let height = content.height + + let maxTransX = -width * (scaleX - 1.0) + transX = min(max(matrix.tx, maxTransX - transOffsetX), transOffsetX) - let maxTransY = height * (_scaleY - 1.0) - _transY = max(min(matrix.ty, maxTransY + _transOffsetY), -_transOffsetY) + let maxTransY = height * (scaleY - 1.0) + transY = max(min(matrix.ty, maxTransY + transOffsetY), -transOffsetY) - matrix.tx = _transX - matrix.a = _scaleX - matrix.ty = _transY - matrix.d = _scaleY + matrix.tx = transX + matrix.a = scaleX + matrix.ty = transY + matrix.d = scaleY } /// Sets the minimum scale factor for the x-axis @objc open func setMinimumScaleX(_ xScale: CGFloat) { - var newValue = xScale - - if newValue < 1.0 - { - newValue = 1.0 - } - - _minScaleX = newValue - - limitTransAndScale(matrix: &_touchMatrix, content: _contentRect) + minScaleX = max(xScale, 1) + limitTransAndScale(matrix: &touchMatrix, content: contentRect) } /// Sets the maximum scale factor for the x-axis @objc open func setMaximumScaleX(_ xScale: CGFloat) { - var newValue = xScale - - if newValue == 0.0 - { - newValue = CGFloat.greatestFiniteMagnitude - } - - _maxScaleX = newValue - - limitTransAndScale(matrix: &_touchMatrix, content: _contentRect) + maxScaleX = xScale == 0 ? .greatestFiniteMagnitude : xScale + limitTransAndScale(matrix: &touchMatrix, content: contentRect) } /// Sets the minimum and maximum scale factors for the x-axis @objc open func setMinMaxScaleX(minScaleX: CGFloat, maxScaleX: CGFloat) { - var newMin = minScaleX - var newMax = maxScaleX - - if newMin < 1.0 - { - newMin = 1.0 - } - if newMax == 0.0 - { - newMax = CGFloat.greatestFiniteMagnitude - } - - _minScaleX = newMin - _maxScaleX = maxScaleX - - limitTransAndScale(matrix: &_touchMatrix, content: _contentRect) + self.minScaleX = max(minScaleX, 1) + self.maxScaleX = maxScaleX == 0 ? .greatestFiniteMagnitude : maxScaleX + limitTransAndScale(matrix: &touchMatrix, content: contentRect) } /// Sets the minimum scale factor for the y-axis @objc open func setMinimumScaleY(_ yScale: CGFloat) { - var newValue = yScale - - if newValue < 1.0 - { - newValue = 1.0 - } - - _minScaleY = newValue - - limitTransAndScale(matrix: &_touchMatrix, content: _contentRect) + minScaleY = max(yScale, 1) + limitTransAndScale(matrix: &touchMatrix, content: contentRect) } /// Sets the maximum scale factor for the y-axis @objc open func setMaximumScaleY(_ yScale: CGFloat) { - var newValue = yScale - - if newValue == 0.0 - { - newValue = CGFloat.greatestFiniteMagnitude - } - - _maxScaleY = newValue - - limitTransAndScale(matrix: &_touchMatrix, content: _contentRect) + maxScaleY = yScale == 0 ? .greatestFiniteMagnitude : yScale + limitTransAndScale(matrix: &touchMatrix, content: contentRect) } @objc open func setMinMaxScaleY(minScaleY: CGFloat, maxScaleY: CGFloat) { - var minScaleY = minScaleY, maxScaleY = maxScaleY - - if minScaleY < 1.0 - { - minScaleY = 1.0 - } - - if maxScaleY == 0.0 - { - maxScaleY = CGFloat.greatestFiniteMagnitude - } - - _minScaleY = minScaleY - _maxScaleY = maxScaleY - - limitTransAndScale(matrix: &_touchMatrix, content: _contentRect) - } - @objc open var touchMatrix: CGAffineTransform - { - return _touchMatrix + self.minScaleY = max(minScaleY, 1) + self.maxScaleY = maxScaleY == 0 ? .greatestFiniteMagnitude : maxScaleY + limitTransAndScale(matrix: &touchMatrix, content: contentRect) } - + // MARK: - Boundaries Check @objc open func isInBoundsX(_ x: CGFloat) -> Bool @@ -434,24 +343,24 @@ open class ViewPortHandler: NSObject @objc open func isInBoundsLeft(_ x: CGFloat) -> Bool { - return _contentRect.origin.x <= x + 1.0 + return contentRect.origin.x <= x + 1.0 } @objc open func isInBoundsRight(_ x: CGFloat) -> Bool { let x = floor(x * 100.0) / 100.0 - return (_contentRect.origin.x + _contentRect.size.width) >= x - 1.0 + return (contentRect.origin.x + contentRect.size.width) >= x - 1.0 } @objc open func isInBoundsTop(_ y: CGFloat) -> Bool { - return _contentRect.origin.y <= y + return contentRect.origin.y <= y } @objc open func isInBoundsBottom(_ y: CGFloat) -> Bool { let normalizedY = floor(y * 100.0) / 100.0 - return (_contentRect.origin.y + _contentRect.size.height) >= normalizedY + return (contentRect.origin.y + contentRect.size.height) >= normalizedY } /** @@ -500,54 +409,6 @@ open class ViewPortHandler: NSObject return false } - /// The current x-scale factor - @objc open var scaleX: CGFloat - { - return _scaleX - } - - /// The current y-scale factor - @objc open var scaleY: CGFloat - { - return _scaleY - } - - /// The minimum x-scale factor - @objc open var minScaleX: CGFloat - { - return _minScaleX - } - - /// The minimum y-scale factor - @objc open var minScaleY: CGFloat - { - return _minScaleY - } - - /// The minimum x-scale factor - @objc open var maxScaleX: CGFloat - { - return _maxScaleX - } - - /// The minimum y-scale factor - @objc open var maxScaleY: CGFloat - { - return _maxScaleY - } - - /// The translation (drag / pan) distance on the x-axis - @objc open var transX: CGFloat - { - return _transX - } - - /// The translation (drag / pan) distance on the y-axis - @objc open var transY: CGFloat - { - return _transY - } - /// if the chart is fully zoomed out, return true @objc open var isFullyZoomedOut: Bool { @@ -557,54 +418,54 @@ open class ViewPortHandler: NSObject /// `true` if the chart is fully zoomed out on it's y-axis (vertical). @objc open var isFullyZoomedOutY: Bool { - return !(_scaleY > _minScaleY || _minScaleY > 1.0) + return !(scaleY > minScaleY || minScaleY > 1.0) } /// `true` if the chart is fully zoomed out on it's x-axis (horizontal). @objc open var isFullyZoomedOutX: Bool { - return !(_scaleX > _minScaleX || _minScaleX > 1.0) + return !(scaleX > minScaleX || minScaleX > 1.0) } /// Set an offset in pixels that allows the user to drag the chart over it's bounds on the x-axis. @objc open func setDragOffsetX(_ offset: CGFloat) { - _transOffsetX = offset + transOffsetX = offset } /// Set an offset in pixels that allows the user to drag the chart over it's bounds on the y-axis. @objc open func setDragOffsetY(_ offset: CGFloat) { - _transOffsetY = offset + transOffsetY = offset } /// `true` if both drag offsets (x and y) are zero or smaller. @objc open var hasNoDragOffset: Bool { - return _transOffsetX <= 0.0 && _transOffsetY <= 0.0 + return transOffsetX <= 0.0 && transOffsetY <= 0.0 } /// `true` if the chart is not yet fully zoomed out on the x-axis @objc open var canZoomOutMoreX: Bool { - return _scaleX > _minScaleX + return scaleX > minScaleX } /// `true` if the chart is not yet fully zoomed in on the x-axis @objc open var canZoomInMoreX: Bool { - return _scaleX < _maxScaleX + return scaleX < maxScaleX } /// `true` if the chart is not yet fully zoomed out on the y-axis @objc open var canZoomOutMoreY: Bool { - return _scaleY > _minScaleY + return scaleY > minScaleY } /// `true` if the chart is not yet fully zoomed in on the y-axis @objc open var canZoomInMoreY: Bool { - return _scaleY < _maxScaleY + return scaleY < maxScaleY } } diff --git a/Tests/Charts/LineChartTests.swift b/Tests/Charts/LineChartTests.swift deleted file mode 100755 index 98d484a54c..0000000000 --- a/Tests/Charts/LineChartTests.swift +++ /dev/null @@ -1,81 +0,0 @@ -import XCTest -import FBSnapshotTestCase -@testable import Charts - -class LineChartTests: FBSnapshotTestCase -{ - - var chart: LineChartView! - var dataSet: LineChartDataSet! - - override func setUp() - { - super.setUp() - - // Set to `true` to re-capture all snapshots - self.recordMode = false - - // Sample data - let values: [Double] = [8, 104, 81, 93, 52, 44, 97, 101, 75, 28, - 76, 25, 20, 13, 52, 44, 57, 23, 45, 91, - 99, 14, 84, 48, 40, 71, 106, 41, 45, 61] - - var entries: [ChartDataEntry] = Array() - - for (i, value) in values.enumerated() - { - entries.append(ChartDataEntry(x: Double(i), y: value, icon: UIImage(named: "icon", in: Bundle(for: self.classForCoder), compatibleWith: nil))) - } - - dataSet = LineChartDataSet(entries: entries, label: "First unit test data") - dataSet.drawIconsEnabled = false - dataSet.iconsOffset = CGPoint(x: 0, y: 20.0) - - chart = LineChartView(frame: CGRect(x: 0, y: 0, width: 480, height: 350)) - chart.backgroundColor = NSUIColor.clear - chart.leftAxis.axisMinimum = 0.0 - chart.rightAxis.axisMinimum = 0.0 - chart.data = LineChartData(dataSet: dataSet) - } - - override func tearDown() - { - // Put teardown code here. This method is called after the invocation of each test method in the class. - super.tearDown() - } - - func testDefaultValues() - { - ChartsSnapshotVerifyView(chart, identifier: Snapshot.identifier(UIScreen.main.bounds.size), overallTolerance: Snapshot.tolerance) - } - - func testHidesValues() - { - dataSet.drawValuesEnabled = false - ChartsSnapshotVerifyView(chart, identifier: Snapshot.identifier(UIScreen.main.bounds.size), overallTolerance: Snapshot.tolerance) - } - - func testDoesntDrawCircles() - { - dataSet.drawCirclesEnabled = false - ChartsSnapshotVerifyView(chart, identifier: Snapshot.identifier(UIScreen.main.bounds.size), overallTolerance: Snapshot.tolerance) - } - - func testIsCubic() - { - dataSet.mode = LineChartDataSet.Mode.cubicBezier - ChartsSnapshotVerifyView(chart, identifier: Snapshot.identifier(UIScreen.main.bounds.size), overallTolerance: Snapshot.tolerance) - } - - func testDoesntDrawCircleHole() - { - dataSet.drawCircleHoleEnabled = false - ChartsSnapshotVerifyView(chart, identifier: Snapshot.identifier(UIScreen.main.bounds.size), overallTolerance: Snapshot.tolerance) - } - - func testDrawIcons() - { - dataSet.drawIconsEnabled = true - ChartsSnapshotVerifyView(chart, identifier: Snapshot.identifier(UIScreen.main.bounds.size), overallTolerance: Snapshot.tolerance) - } -} diff --git a/Tests/Charts/Snapshot.swift b/Tests/Charts/Snapshot.swift deleted file mode 100644 index bc1c28cf4e..0000000000 --- a/Tests/Charts/Snapshot.swift +++ /dev/null @@ -1,29 +0,0 @@ -import CoreGraphics -import FBSnapshotTestCase - -public struct Snapshot -{ - public static let tolerance: CGFloat = 0.001 - - public static func identifier(_ size: CGSize) -> String { - #if os(tvOS) - let identifier = "tvOS" - #elseif os(iOS) - let identifier = "iOS" - #elseif os(OSX) - let identifier = "macOS" - #else - let identifier = "" - #endif - - return "\(identifier)_\(size.width)_\(size.height)" - } -} - -public extension FBSnapshotTestCase -{ - func ChartsSnapshotVerifyView(_ view: UIView, identifier: String = "", suffixes: NSOrderedSet = NSOrderedSet(object: "_64"), perPixelTolerance: CGFloat = 0, overallTolerance: CGFloat = 0, file: StaticString = #file, line: UInt = #line) - { - FBSnapshotVerifyView(view, identifier: identifier, suffixes: suffixes, perPixelTolerance: perPixelTolerance, overallTolerance: overallTolerance, file: file, line: line) - } -} diff --git a/Tests/Charts/BarChartTests.swift b/Tests/ChartsTests/BarChartTests.swift similarity index 60% rename from Tests/Charts/BarChartTests.swift rename to Tests/ChartsTests/BarChartTests.swift index c27ef6f22e..ae71408f8a 100644 --- a/Tests/Charts/BarChartTests.swift +++ b/Tests/ChartsTests/BarChartTests.swift @@ -1,416 +1,370 @@ -import XCTest -import FBSnapshotTestCase @testable import Charts +import SnapshotTesting +import XCTest -class BarChartTests: FBSnapshotTestCase -{ - override func setUp() - { +class BarChartTests: XCTestCase { + private lazy var icon = UIImage(named: "icon", in: Bundle(for: classForCoder), compatibleWith: nil)! + + override func setUp() { super.setUp() - - // Set to `true` to re-capture all snapshots - self.recordMode = false } - - override func tearDown() - { + + override func tearDown() { // Put teardown code here. This method is called after the invocation of each test method in the class. super.tearDown() } - - //MARK: Prepare - func setupCustomValuesDataEntries(values: [Double]) -> [ChartDataEntry] - { + + // MARK: Prepare + + func setupCustomValuesDataEntries(values: [Double]) -> [ChartDataEntry] { var entries: [ChartDataEntry] = Array() - for (i, value) in values.enumerated() - { - entries.append(BarChartDataEntry(x: Double(i), y: value, icon: UIImage(named: "icon", in: Bundle(for: self.classForCoder), compatibleWith: nil))) + for (i, value) in values.enumerated() { + entries.append(BarChartDataEntry(x: Double(i), y: value, icon: icon)) } return entries } - func setupDefaultValuesDataEntries() -> [ChartDataEntry] - { + func setupDefaultValuesDataEntries() -> [ChartDataEntry] { let values: [Double] = [8, 104, -81, 93, 52, -44, 97, 101, -75, 28, -76, 25, 20, -13, 52, 44, -57, 23, 45, -91, 99, 14, -84, 48, 40, -71, 106, 41, -45, 61] return setupCustomValuesDataEntries(values: values) } - func setupPositiveValuesDataEntries() -> [ChartDataEntry] - { + func setupPositiveValuesDataEntries() -> [ChartDataEntry] { let values: [Double] = [8, 104, 81, 93, 52, 44, 97, 101, 75, 28, 76, 25, 20, 13, 52, 44, 57, 23, 45, 91, 99, 14, 84, 48, 40, 71, 106, 41, 45, 61] return setupCustomValuesDataEntries(values: values) } - func setupNegativeValuesDataEntries() -> [ChartDataEntry] - { + func setupNegativeValuesDataEntries() -> [ChartDataEntry] { let values: [Double] = [-8, -104, -81, -93, -52, -44, -97, -101, -75, -28, -76, -25, -20, -13, -52, -44, -57, -23, -45, -91, -99, -14, -84, -48, -40, -71, -106, -41, -45, -61] return setupCustomValuesDataEntries(values: values) } - func setupZeroValuesDataEntries() -> [ChartDataEntry] - { + func setupZeroValuesDataEntries() -> [ChartDataEntry] { let values = [Double](repeating: 0.0, count: 30) return setupCustomValuesDataEntries(values: values) } - func setupStackedValuesDataEntries() -> [ChartDataEntry] - { + func setupStackedValuesDataEntries() -> [ChartDataEntry] { var entries: [ChartDataEntry] = Array() - entries.append(BarChartDataEntry(x: 0, yValues: [28, 50, 60, 30, 42], icon: UIImage(named: "icon"))) - entries.append(BarChartDataEntry(x: 1, yValues: [-20, -36, -52, -40, -15], icon: UIImage(named: "icon"))) - entries.append(BarChartDataEntry(x: 2, yValues: [10, 30, 40, 90, 72], icon: UIImage(named: "icon"))) - entries.append(BarChartDataEntry(x: 3, yValues: [-40, -50, -30, -60, -20], icon: UIImage(named: "icon"))) - entries.append(BarChartDataEntry(x: 4, yValues: [10, 40, 60, 45, 62], icon: UIImage(named: "icon"))) + entries.append(BarChartDataEntry(x: 0, yValues: [28, 50, 60, 30, 42], icon: icon)) + entries.append(BarChartDataEntry(x: 1, yValues: [-20, -36, -52, -40, -15], icon: icon)) + entries.append(BarChartDataEntry(x: 2, yValues: [10, 30, 40, 90, 72], icon: icon)) + entries.append(BarChartDataEntry(x: 3, yValues: [-40, -50, -30, -60, -20], icon: icon)) + entries.append(BarChartDataEntry(x: 4, yValues: [10, 40, 60, 45, 62], icon: icon)) return entries } - func setupDefaultStackedDataSet(chartDataEntries: [ChartDataEntry]) -> BarChartDataSet - { + func setupDefaultStackedDataSet(chartDataEntries: [ChartDataEntry]) -> BarChartDataSet { let dataSet = BarChartDataSet(entries: chartDataEntries, label: "Stacked bar chart unit test data") dataSet.drawIconsEnabled = false dataSet.iconsOffset = CGPoint(x: 0, y: -10.0) - dataSet.colors = Array(arrayLiteral:NSUIColor(red: 46/255.0, green: 204/255.0, blue: 113/255.0, alpha: 1.0), - NSUIColor(red: 241/255.0, green: 196/255.0, blue: 15/255.0, alpha: 1.0), - NSUIColor(red: 231/255.0, green: 76/255.0, blue: 60/255.0, alpha: 1.0), - NSUIColor(red: 52/255.0, green: 152/255.0, blue: 219/255.0, alpha: 1.0) - ) + dataSet.colors = Array(arrayLiteral: NSUIColor(red: 46 / 255.0, green: 204 / 255.0, blue: 113 / 255.0, alpha: 1.0), + NSUIColor(red: 241 / 255.0, green: 196 / 255.0, blue: 15 / 255.0, alpha: 1.0), + NSUIColor(red: 231 / 255.0, green: 76 / 255.0, blue: 60 / 255.0, alpha: 1.0), + NSUIColor(red: 52 / 255.0, green: 152 / 255.0, blue: 219 / 255.0, alpha: 1.0)) return dataSet } - func setupDefaultDataSet(chartDataEntries: [ChartDataEntry]) -> BarChartDataSet - { + func setupDefaultDataSet(chartDataEntries: [ChartDataEntry]) -> BarChartDataSet { let dataSet = BarChartDataSet(entries: chartDataEntries, label: "Bar chart unit test data") dataSet.drawIconsEnabled = false dataSet.iconsOffset = CGPoint(x: 0, y: -10.0) return dataSet } - func setupDefaultChart(dataSets: [BarChartDataSet]) -> BarChartView - { + func setupDefaultChart(dataSets: [BarChartDataSet]) -> BarChartView { let data = BarChartData(dataSets: dataSets) data.barWidth = 0.85 - + let chart = BarChartView(frame: CGRect(x: 0, y: 0, width: 480, height: 350)) chart.backgroundColor = NSUIColor.clear chart.data = data return chart } - - //MARK: Start Test - func testDefaultValues() - { + + // MARK: Start Test + + func testDefaultValues() { let dataEntries = setupDefaultValuesDataEntries() let dataSet = setupDefaultDataSet(chartDataEntries: dataEntries) let chart = setupDefaultChart(dataSets: [dataSet]) - ChartsSnapshotVerifyView(chart, identifier: Snapshot.identifier(UIScreen.main.bounds.size), overallTolerance: Snapshot.tolerance) - + assertChartSnapshot(matching: chart) } - func testDefaultBarDataSetLabels() - { + func testDefaultBarDataSetLabels() { let dataEntries = setupDefaultValuesDataEntries() let dataSet = BarChartDataSet(entries: dataEntries) dataSet.drawIconsEnabled = false let chart = setupDefaultChart(dataSets: [dataSet]) - ChartsSnapshotVerifyView(chart, identifier: Snapshot.identifier(UIScreen.main.bounds.size), overallTolerance: Snapshot.tolerance) + assertChartSnapshot(matching: chart) } - func testZeroValues() - { + func testZeroValues() { let dataEntries = setupZeroValuesDataEntries() let dataSet = setupDefaultDataSet(chartDataEntries: dataEntries) let chart = setupDefaultChart(dataSets: [dataSet]) - ChartsSnapshotVerifyView(chart, identifier: Snapshot.identifier(UIScreen.main.bounds.size), overallTolerance: Snapshot.tolerance) + assertChartSnapshot(matching: chart) } - func testPositiveValues() - { + func testPositiveValues() { let dataEntries = setupPositiveValuesDataEntries() let dataSet = setupDefaultDataSet(chartDataEntries: dataEntries) let chart = setupDefaultChart(dataSets: [dataSet]) - ChartsSnapshotVerifyView(chart, identifier: Snapshot.identifier(UIScreen.main.bounds.size), overallTolerance: Snapshot.tolerance) + assertChartSnapshot(matching: chart) } - func testPositiveValuesWithCustomAxisMaximum() - { + func testPositiveValuesWithCustomAxisMaximum() { let dataEntries = setupPositiveValuesDataEntries() let dataSet = setupDefaultDataSet(chartDataEntries: dataEntries) let chart = setupDefaultChart(dataSets: [dataSet]) chart.leftAxis.axisMaximum = 50 chart.clipValuesToContentEnabled = true chart.notifyDataSetChanged() - ChartsSnapshotVerifyView(chart, identifier: Snapshot.identifier(UIScreen.main.bounds.size), overallTolerance: Snapshot.tolerance) + assertChartSnapshot(matching: chart) } - func testPositiveValuesWithCustomAxisMaximum2() - { + func testPositiveValuesWithCustomAxisMaximum2() { let dataEntries = setupPositiveValuesDataEntries() let dataSet = setupDefaultDataSet(chartDataEntries: dataEntries) let chart = setupDefaultChart(dataSets: [dataSet]) chart.leftAxis.axisMaximum = -10 chart.notifyDataSetChanged() - ChartsSnapshotVerifyView(chart, identifier: Snapshot.identifier(UIScreen.main.bounds.size), overallTolerance: Snapshot.tolerance) + assertChartSnapshot(matching: chart) } - func testPositiveValuesWithCustomAxisMinimum() - { + func testPositiveValuesWithCustomAxisMinimum() { let dataEntries = setupPositiveValuesDataEntries() let dataSet = setupDefaultDataSet(chartDataEntries: dataEntries) let chart = setupDefaultChart(dataSets: [dataSet]) chart.leftAxis.axisMinimum = 50 chart.notifyDataSetChanged() - ChartsSnapshotVerifyView(chart, identifier: Snapshot.identifier(UIScreen.main.bounds.size), overallTolerance: Snapshot.tolerance) + assertChartSnapshot(matching: chart) } - func testPositiveValuesWithCustomAxisMinimum2() - { + func testPositiveValuesWithCustomAxisMinimum2() { let dataEntries = setupPositiveValuesDataEntries() let dataSet = setupDefaultDataSet(chartDataEntries: dataEntries) let chart = setupDefaultChart(dataSets: [dataSet]) chart.leftAxis.axisMinimum = 110 chart.notifyDataSetChanged() - ChartsSnapshotVerifyView(chart, identifier: Snapshot.identifier(UIScreen.main.bounds.size), overallTolerance: Snapshot.tolerance) + assertChartSnapshot(matching: chart) } - func testPositiveValuesWithCustomAxisMaximumAndCustomAxisMaximum() - { + func testPositiveValuesWithCustomAxisMaximumAndCustomAxisMaximum() { let dataEntries = setupPositiveValuesDataEntries() let dataSet = setupDefaultDataSet(chartDataEntries: dataEntries) let chart = setupDefaultChart(dataSets: [dataSet]) - //If min is greater than max, then min and max will be exchanged. + // If min is greater than max, then min and max will be exchanged. chart.leftAxis.axisMaximum = 200 chart.leftAxis.axisMinimum = -10 chart.notifyDataSetChanged() - ChartsSnapshotVerifyView(chart, identifier: Snapshot.identifier(UIScreen.main.bounds.size), overallTolerance: Snapshot.tolerance) + assertChartSnapshot(matching: chart) } - func testNegativeValues() - { + func testNegativeValues() { let dataEntries = setupNegativeValuesDataEntries() let dataSet = setupDefaultDataSet(chartDataEntries: dataEntries) let chart = setupDefaultChart(dataSets: [dataSet]) - ChartsSnapshotVerifyView(chart, identifier: Snapshot.identifier(UIScreen.main.bounds.size), overallTolerance: Snapshot.tolerance) + assertChartSnapshot(matching: chart) } - func testNegativeValuesWithCustomAxisMaximum() - { + func testNegativeValuesWithCustomAxisMaximum() { let dataEntries = setupNegativeValuesDataEntries() let dataSet = setupDefaultDataSet(chartDataEntries: dataEntries) let chart = setupDefaultChart(dataSets: [dataSet]) chart.leftAxis.axisMaximum = 10 chart.notifyDataSetChanged() - ChartsSnapshotVerifyView(chart, identifier: Snapshot.identifier(UIScreen.main.bounds.size), overallTolerance: Snapshot.tolerance) + assertChartSnapshot(matching: chart) } - func testNegativeValuesWithCustomAxisMaximum2() - { + func testNegativeValuesWithCustomAxisMaximum2() { let dataEntries = setupNegativeValuesDataEntries() let dataSet = setupDefaultDataSet(chartDataEntries: dataEntries) let chart = setupDefaultChart(dataSets: [dataSet]) chart.leftAxis.axisMaximum = -150 chart.notifyDataSetChanged() - ChartsSnapshotVerifyView(chart, identifier: Snapshot.identifier(UIScreen.main.bounds.size), overallTolerance: Snapshot.tolerance) + assertChartSnapshot(matching: chart) } - - func testNegativeValuesWithCustomAxisMinimum() - { + func testNegativeValuesWithCustomAxisMinimum() { let dataEntries = setupNegativeValuesDataEntries() let dataSet = setupDefaultDataSet(chartDataEntries: dataEntries) let chart = setupDefaultChart(dataSets: [dataSet]) chart.leftAxis.axisMinimum = -200 chart.notifyDataSetChanged() - ChartsSnapshotVerifyView(chart, identifier: Snapshot.identifier(UIScreen.main.bounds.size), overallTolerance: Snapshot.tolerance) + assertChartSnapshot(matching: chart) } - func testNegativeValuesWithCustomAxisMinimum2() - { + func testNegativeValuesWithCustomAxisMinimum2() { let dataEntries = setupNegativeValuesDataEntries() let dataSet = setupDefaultDataSet(chartDataEntries: dataEntries) let chart = setupDefaultChart(dataSets: [dataSet]) chart.leftAxis.axisMinimum = 10 chart.notifyDataSetChanged() - ChartsSnapshotVerifyView(chart, identifier: Snapshot.identifier(UIScreen.main.bounds.size), overallTolerance: Snapshot.tolerance) + assertChartSnapshot(matching: chart) } - func testNegativeValuesWithCustomAxisMaximumAndCustomAxisMaximum() - { + func testNegativeValuesWithCustomAxisMaximumAndCustomAxisMaximum() { let dataEntries = setupNegativeValuesDataEntries() let dataSet = setupDefaultDataSet(chartDataEntries: dataEntries) let chart = setupDefaultChart(dataSets: [dataSet]) - //If min is greater than max, then min and max will be exchanged. + // If min is greater than max, then min and max will be exchanged. chart.leftAxis.axisMaximum = 10 chart.leftAxis.axisMinimum = -200 chart.notifyDataSetChanged() - ChartsSnapshotVerifyView(chart, identifier: Snapshot.identifier(UIScreen.main.bounds.size), overallTolerance: Snapshot.tolerance) + assertChartSnapshot(matching: chart) } - func testHidesValues() - { + func testHidesValues() { let dataEntries = setupDefaultValuesDataEntries() let dataSet = setupDefaultDataSet(chartDataEntries: dataEntries) let chart = setupDefaultChart(dataSets: [dataSet]) dataSet.drawValuesEnabled = false chart.notifyDataSetChanged() - ChartsSnapshotVerifyView(chart, identifier: Snapshot.identifier(UIScreen.main.bounds.size), overallTolerance: Snapshot.tolerance) + assertChartSnapshot(matching: chart) } - func testNotDrawValueAboveBars() - { + func testNotDrawValueAboveBars() { let dataEntries = setupDefaultValuesDataEntries() let dataSet = setupDefaultDataSet(chartDataEntries: dataEntries) let chart = setupDefaultChart(dataSets: [dataSet]) chart.drawValueAboveBarEnabled = false chart.notifyDataSetChanged() - ChartsSnapshotVerifyView(chart, identifier: Snapshot.identifier(UIScreen.main.bounds.size), overallTolerance: Snapshot.tolerance) + assertChartSnapshot(matching: chart) } - func testStackedDrawValues() - { + func testStackedDrawValues() { let dataEntries = setupStackedValuesDataEntries() let dataSet = setupDefaultStackedDataSet(chartDataEntries: dataEntries) let chart = setupDefaultChart(dataSets: [dataSet]) chart.notifyDataSetChanged() - ChartsSnapshotVerifyView(chart, identifier: Snapshot.identifier(UIScreen.main.bounds.size), overallTolerance: Snapshot.tolerance) + assertChartSnapshot(matching: chart) } - func testStackedNotDrawValues() - { + func testStackedNotDrawValues() { let dataEntries = setupStackedValuesDataEntries() let dataSet = setupDefaultStackedDataSet(chartDataEntries: dataEntries) dataSet.drawValuesEnabled = false let chart = setupDefaultChart(dataSets: [dataSet]) chart.notifyDataSetChanged() - ChartsSnapshotVerifyView(chart, identifier: Snapshot.identifier(UIScreen.main.bounds.size), overallTolerance: Snapshot.tolerance) + assertChartSnapshot(matching: chart) } - func testStackedNotDrawValuesAboveBars() - { + func testStackedNotDrawValuesAboveBars() { let dataEntries = setupStackedValuesDataEntries() let dataSet = setupDefaultStackedDataSet(chartDataEntries: dataEntries) let chart = setupDefaultChart(dataSets: [dataSet]) chart.drawValueAboveBarEnabled = false chart.notifyDataSetChanged() - ChartsSnapshotVerifyView(chart, identifier: Snapshot.identifier(UIScreen.main.bounds.size), overallTolerance: Snapshot.tolerance) + assertChartSnapshot(matching: chart) } - - func testHideLeftAxis() - { + + func testHideLeftAxis() { let dataEntries = setupDefaultValuesDataEntries() let dataSet = setupDefaultDataSet(chartDataEntries: dataEntries) let chart = setupDefaultChart(dataSets: [dataSet]) chart.leftAxis.enabled = false chart.notifyDataSetChanged() - ChartsSnapshotVerifyView(chart, identifier: Snapshot.identifier(UIScreen.main.bounds.size), overallTolerance: Snapshot.tolerance) + assertChartSnapshot(matching: chart) } - - func testHideRightAxis() - { + + func testHideRightAxis() { let dataEntries = setupDefaultValuesDataEntries() let dataSet = setupDefaultDataSet(chartDataEntries: dataEntries) let chart = setupDefaultChart(dataSets: [dataSet]) chart.rightAxis.enabled = false chart.notifyDataSetChanged() - ChartsSnapshotVerifyView(chart, identifier: Snapshot.identifier(UIScreen.main.bounds.size), overallTolerance: Snapshot.tolerance) + assertChartSnapshot(matching: chart) } - func testInvertedLeftAxis() - { + func testInvertedLeftAxis() { let dataEntries = setupDefaultValuesDataEntries() let dataSet = setupDefaultDataSet(chartDataEntries: dataEntries) let chart = setupDefaultChart(dataSets: [dataSet]) chart.leftAxis.inverted = true chart.notifyDataSetChanged() - ChartsSnapshotVerifyView(chart, identifier: Snapshot.identifier(UIScreen.main.bounds.size), overallTolerance: Snapshot.tolerance) + assertChartSnapshot(matching: chart) } - func testInvertedLeftAxisWithNegativeValues() - { + func testInvertedLeftAxisWithNegativeValues() { let dataEntries = setupNegativeValuesDataEntries() let dataSet = setupDefaultDataSet(chartDataEntries: dataEntries) let chart = setupDefaultChart(dataSets: [dataSet]) chart.leftAxis.inverted = true chart.notifyDataSetChanged() - ChartsSnapshotVerifyView(chart, identifier: Snapshot.identifier(UIScreen.main.bounds.size), overallTolerance: Snapshot.tolerance) + assertChartSnapshot(matching: chart) } - func testInvertedLeftAxisWithPositiveValues() - { + func testInvertedLeftAxisWithPositiveValues() { let dataEntries = setupPositiveValuesDataEntries() let dataSet = setupDefaultDataSet(chartDataEntries: dataEntries) let chart = setupDefaultChart(dataSets: [dataSet]) chart.leftAxis.inverted = true chart.notifyDataSetChanged() - ChartsSnapshotVerifyView(chart, identifier: Snapshot.identifier(UIScreen.main.bounds.size), overallTolerance: Snapshot.tolerance) + assertChartSnapshot(matching: chart) } - func testInvertedRightAxis() - { + func testInvertedRightAxis() { let dataEntries = setupDefaultValuesDataEntries() let dataSet = setupDefaultDataSet(chartDataEntries: dataEntries) dataSet.axisDependency = .right let chart = setupDefaultChart(dataSets: [dataSet]) chart.rightAxis.inverted = true chart.notifyDataSetChanged() - ChartsSnapshotVerifyView(chart, identifier: Snapshot.identifier(UIScreen.main.bounds.size), overallTolerance: Snapshot.tolerance) + assertChartSnapshot(matching: chart) } - func testInvertedRightAxisWithNegativeValues() - { + func testInvertedRightAxisWithNegativeValues() { let dataEntries = setupNegativeValuesDataEntries() let dataSet = setupDefaultDataSet(chartDataEntries: dataEntries) dataSet.axisDependency = .right let chart = setupDefaultChart(dataSets: [dataSet]) chart.rightAxis.inverted = true chart.notifyDataSetChanged() - ChartsSnapshotVerifyView(chart, identifier: Snapshot.identifier(UIScreen.main.bounds.size), overallTolerance: Snapshot.tolerance) + assertChartSnapshot(matching: chart) } - func testInvertedRightAxisWithPositiveValues() - { + func testInvertedRightAxisWithPositiveValues() { let dataEntries = setupPositiveValuesDataEntries() let dataSet = setupDefaultDataSet(chartDataEntries: dataEntries) dataSet.axisDependency = .right let chart = setupDefaultChart(dataSets: [dataSet]) chart.rightAxis.inverted = true chart.notifyDataSetChanged() - ChartsSnapshotVerifyView(chart, identifier: Snapshot.identifier(UIScreen.main.bounds.size), overallTolerance: Snapshot.tolerance) + assertChartSnapshot(matching: chart) } - - func testHideHorizontalGridlines() - { + + func testHideHorizontalGridlines() { let dataEntries = setupDefaultValuesDataEntries() let dataSet = setupDefaultDataSet(chartDataEntries: dataEntries) let chart = setupDefaultChart(dataSets: [dataSet]) chart.leftAxis.drawGridLinesEnabled = false chart.rightAxis.drawGridLinesEnabled = false chart.notifyDataSetChanged() - ChartsSnapshotVerifyView(chart, identifier: Snapshot.identifier(UIScreen.main.bounds.size), overallTolerance: Snapshot.tolerance) + assertChartSnapshot(matching: chart) } - - func testHideVerticalGridlines() - { + + func testHideVerticalGridlines() { let dataEntries = setupDefaultValuesDataEntries() let dataSet = setupDefaultDataSet(chartDataEntries: dataEntries) let chart = setupDefaultChart(dataSets: [dataSet]) chart.xAxis.drawGridLinesEnabled = false chart.notifyDataSetChanged() - ChartsSnapshotVerifyView(chart, identifier: Snapshot.identifier(UIScreen.main.bounds.size), overallTolerance: Snapshot.tolerance) + assertChartSnapshot(matching: chart) } - - func testDrawIcons() - { + + func testDrawIcons() { let dataEntries = setupDefaultValuesDataEntries() let dataSet = setupDefaultDataSet(chartDataEntries: dataEntries) let chart = setupDefaultChart(dataSets: [dataSet]) dataSet.drawIconsEnabled = true chart.notifyDataSetChanged() - ChartsSnapshotVerifyView(chart, identifier: Snapshot.identifier(UIScreen.main.bounds.size), overallTolerance: Snapshot.tolerance) + assertChartSnapshot(matching: chart) } } diff --git a/ChartDataTests.swift b/Tests/ChartsTests/ChartDataTests.swift similarity index 63% rename from ChartDataTests.swift rename to Tests/ChartsTests/ChartDataTests.swift index 4e4cdbab94..5b697f710b 100644 --- a/ChartDataTests.swift +++ b/Tests/ChartsTests/ChartDataTests.swift @@ -5,11 +5,10 @@ // Created by Peter Kaminski on 1/23/20. // -import XCTest @testable import Charts +import XCTest class ChartDataTests: XCTestCase { - var data: ScatterChartData! private enum SetLabels { @@ -18,52 +17,51 @@ class ChartDataTests: XCTestCase { static let three = "label3" static let badLabel = "Bad label" } - + override func setUp() { super.setUp() - + let setCount = 5 let range: UInt32 = 32 - let values1 = (0.. ChartDataEntry in + let values1 = (0 ..< setCount).map { (i) -> ChartDataEntry in let val = Double(arc4random_uniform(range) + 3) return ChartDataEntry(x: Double(i), y: val) } - let values2 = (0.. ChartDataEntry in + let values2 = (0 ..< setCount).map { (i) -> ChartDataEntry in let val = Double(arc4random_uniform(range) + 3) return ChartDataEntry(x: Double(i), y: val) } - let values3 = (0.. ChartDataEntry in + let values3 = (0 ..< setCount).map { (i) -> ChartDataEntry in let val = Double(arc4random_uniform(range) + 3) return ChartDataEntry(x: Double(i), y: val) } - + let set1 = ScatterChartDataSet(entries: values1, label: SetLabels.one) let set2 = ScatterChartDataSet(entries: values2, label: SetLabels.two) let set3 = ScatterChartDataSet(entries: values3, label: SetLabels.three) - + data = ScatterChartData(dataSets: [set1, set2, set3]) } - + func testGetDataSetByLabelCaseSensitive() { - XCTAssertTrue(data.getDataSetByLabel(SetLabels.one, ignorecase: false)?.label == SetLabels.one) - XCTAssertTrue(data.getDataSetByLabel(SetLabels.two, ignorecase: false)?.label == SetLabels.two) - XCTAssertTrue(data.getDataSetByLabel(SetLabels.three, ignorecase: false)?.label == SetLabels.three) - XCTAssertTrue(data.getDataSetByLabel(SetLabels.one.uppercased(), ignorecase: false) == nil) + XCTAssertTrue(data.dataSet(forLabel: SetLabels.one, ignorecase: false)?.label == SetLabels.one) + XCTAssertTrue(data.dataSet(forLabel: SetLabels.two, ignorecase: false)?.label == SetLabels.two) + XCTAssertTrue(data.dataSet(forLabel: SetLabels.three, ignorecase: false)?.label == SetLabels.three) + XCTAssertTrue(data.dataSet(forLabel: SetLabels.one.uppercased(), ignorecase: false) == nil) } - + func testGetDataSetByLabelIgnoreCase() { - XCTAssertTrue(data.getDataSetByLabel(SetLabels.one, ignorecase: true)?.label == SetLabels.one) - XCTAssertTrue(data.getDataSetByLabel(SetLabels.two, ignorecase: true)?.label == SetLabels.two) - XCTAssertTrue(data.getDataSetByLabel(SetLabels.three, ignorecase: true)?.label == SetLabels.three) - - XCTAssertTrue(data.getDataSetByLabel(SetLabels.one.uppercased(), ignorecase: true)?.label == SetLabels.one) - XCTAssertTrue(data.getDataSetByLabel(SetLabels.two.uppercased(), ignorecase: true)?.label == SetLabels.two) - XCTAssertTrue(data.getDataSetByLabel(SetLabels.three.uppercased(), ignorecase: true)?.label == SetLabels.three) + XCTAssertTrue(data.dataSet(forLabel: SetLabels.one, ignorecase: true)?.label == SetLabels.one) + XCTAssertTrue(data.dataSet(forLabel: SetLabels.two, ignorecase: true)?.label == SetLabels.two) + XCTAssertTrue(data.dataSet(forLabel: SetLabels.three, ignorecase: true)?.label == SetLabels.three) + + XCTAssertTrue(data.dataSet(forLabel: SetLabels.one.uppercased(), ignorecase: true)?.label == SetLabels.one) + XCTAssertTrue(data.dataSet(forLabel: SetLabels.two.uppercased(), ignorecase: true)?.label == SetLabels.two) + XCTAssertTrue(data.dataSet(forLabel: SetLabels.three.uppercased(), ignorecase: true)?.label == SetLabels.three) } - + func testGetDataSetByLabelNilWithBadLabel() { - XCTAssertTrue(data.getDataSetByLabel(SetLabels.badLabel, ignorecase: true) == nil) - XCTAssertTrue(data.getDataSetByLabel(SetLabels.badLabel, ignorecase: false) == nil) + XCTAssertTrue(data.dataSet(forLabel: SetLabels.badLabel, ignorecase: true) == nil) + XCTAssertTrue(data.dataSet(forLabel: SetLabels.badLabel, ignorecase: false) == nil) } } - diff --git a/Tests/Charts/ChartUtilsTests.swift b/Tests/ChartsTests/ChartUtilsTests.swift similarity index 89% rename from Tests/Charts/ChartUtilsTests.swift rename to Tests/ChartsTests/ChartUtilsTests.swift index 9e5da3a07b..ae5b134a29 100644 --- a/Tests/Charts/ChartUtilsTests.swift +++ b/Tests/ChartsTests/ChartUtilsTests.swift @@ -1,75 +1,68 @@ -import XCTest @testable import Charts +import XCTest class ChartUtilsTests: XCTestCase { - override func setUp() { super.setUp() // Put setup code here. This method is called before the invocation of each test method in the class. } - + override func tearDown() { // Put teardown code here. This method is called after the invocation of each test method in the class. super.tearDown() } - + func testDecimalWithNaN() { - let number = Double.nan - + let actual = number.decimalPlaces let expected = 0 - + XCTAssertEqual(expected, actual) } - + func testDecimalWithInfinite() { - let number = Double.infinity - + let actual = number.decimalPlaces let expected = 0 - + XCTAssertEqual(expected, actual) } - + func testDecimalWithZero() { - let number = 0.0 - + let actual = number.decimalPlaces let expected = 0 - + XCTAssertEqual(expected, actual) } - + func testDecimalWithMaxValue() { - let number = Double.greatestFiniteMagnitude - + let actual = number.decimalPlaces let expected = 0 - + XCTAssertEqual(expected, actual) } - + func testDecimalWithMinValue() { - let number = Double.leastNormalMagnitude - + let actual = number.decimalPlaces let expected = 310 // Don't think this is supposed to be this value maybe 0? - + XCTAssertEqual(expected, actual) } - + func testDecimalWithNormalValue() { - let number = 13.123123 - + let actual = number.decimalPlaces let expected = 1 // Don't think this is supposed to be this value maybe 6? - + XCTAssertEqual(expected, actual) } } diff --git a/Tests/Charts/CombinedChartTests.swift b/Tests/ChartsTests/CombinedChartTests.swift similarity index 67% rename from Tests/Charts/CombinedChartTests.swift rename to Tests/ChartsTests/CombinedChartTests.swift index 9c19f4dcd4..a0edd67da2 100644 --- a/Tests/Charts/CombinedChartTests.swift +++ b/Tests/ChartsTests/CombinedChartTests.swift @@ -5,22 +5,20 @@ // Created by Xuan Liu on 14/10/2017. // -import XCTest -import FBSnapshotTestCase @testable import Charts +import SnapshotTesting +import XCTest -class CombinedChartTests: FBSnapshotTestCase -{ +class CombinedChartTests: XCTestCase { var chart: CombinedChartView! var lineDataSet: LineChartDataSet! var barDataSet: BarChartDataSet! - override func setUp() - { + override func setUp() { super.setUp() // Set to `true` to re-capture all snapshots - self.recordMode = false + isRecording = false // Sample data let combinedData = CombinedChartData() @@ -33,17 +31,15 @@ class CombinedChartTests: FBSnapshotTestCase chart.data = combinedData } - func generateBarData() -> BarChartData - { + func generateBarData() -> BarChartData { let values: [Double] = [8, 104, 81, 93, 52, 44, 97, 101, 75, 28, 76, 25, 20, 13, 52, 44, 57, 23, 45, 91, 99, 14, 84, 48, 40, 71, 106, 41, 45, 61] var entries: [ChartDataEntry] = Array() - for (i, value) in values.enumerated() - { - entries.append(BarChartDataEntry(x: Double(i), y: value, icon: UIImage(named: "icon", in: Bundle(for: self.classForCoder), compatibleWith: nil))) + for (i, value) in values.enumerated() { + entries.append(BarChartDataEntry(x: Double(i), y: value, icon: UIImage(named: "icon", in: Bundle(for: classForCoder), compatibleWith: nil))) } barDataSet = BarChartDataSet(entries: entries, label: "Bar chart unit test data") @@ -54,17 +50,15 @@ class CombinedChartTests: FBSnapshotTestCase return data } - func generateLineData() -> LineChartData - { + func generateLineData() -> LineChartData { let values: [Double] = [0, 254, 81, 93, 52, 44, 97, 101, 75, 28, 76, 25, 20, 13, 52, 44, 57, 23, 45, 91, 99, 14, 84, 48, 40, 71, 106, 41, 45, 61] var entries: [ChartDataEntry] = Array() - for (i, value) in values.enumerated() - { - entries.append(ChartDataEntry(x: Double(i), y: value, icon: UIImage(named: "icon", in: Bundle(for: self.classForCoder), compatibleWith: nil))) + for (i, value) in values.enumerated() { + entries.append(ChartDataEntry(x: Double(i), y: value, icon: UIImage(named: "icon", in: Bundle(for: classForCoder), compatibleWith: nil))) } lineDataSet = LineChartDataSet(entries: entries, label: "Line chart unit test data") @@ -72,33 +66,28 @@ class CombinedChartTests: FBSnapshotTestCase return LineChartData(dataSet: lineDataSet) } - override func tearDown() - { + override func tearDown() { // Put teardown code here. This method is called after the invocation of each test method in the class. super.tearDown() } - func testDefaultAxisDependency() - { - ChartsSnapshotVerifyView(chart, identifier: Snapshot.identifier(UIScreen.main.bounds.size), overallTolerance: Snapshot.tolerance) + func testDefaultAxisDependency() { + assertChartSnapshot(matching: chart) } - func testLeftRightAxisDependency() - { + func testLeftRightAxisDependency() { lineDataSet.axisDependency = .left barDataSet.axisDependency = .right chart.data?.notifyDataChanged() chart.notifyDataSetChanged() - ChartsSnapshotVerifyView(chart, identifier: Snapshot.identifier(UIScreen.main.bounds.size), overallTolerance: Snapshot.tolerance) + assertChartSnapshot(matching: chart) } - func testAllRightAxisDependency() - { + func testAllRightAxisDependency() { lineDataSet.axisDependency = .right barDataSet.axisDependency = .right chart.data?.notifyDataChanged() chart.notifyDataSetChanged() - ChartsSnapshotVerifyView(chart, identifier: Snapshot.identifier(UIScreen.main.bounds.size), overallTolerance: Snapshot.tolerance) + assertChartSnapshot(matching: chart) } } - diff --git a/Tests/Charts/EquatableTests.swift b/Tests/ChartsTests/EquatableTests.swift similarity index 99% rename from Tests/Charts/EquatableTests.swift rename to Tests/ChartsTests/EquatableTests.swift index 26074aa266..3f122985dd 100644 --- a/Tests/Charts/EquatableTests.swift +++ b/Tests/ChartsTests/EquatableTests.swift @@ -5,8 +5,8 @@ // Created by Jacob Christie on 2017-11-13. // -import XCTest @testable import Charts +import XCTest class EquatableTests: XCTestCase { func testChartDataEntryEquality() { @@ -42,4 +42,3 @@ class EquatableTests: XCTestCase { XCTAssertFalse(high1 == high2) } } - diff --git a/Tests/Charts/HorizontalBarChartTests.swift b/Tests/ChartsTests/HorizontalBarChartTests.swift similarity index 65% rename from Tests/Charts/HorizontalBarChartTests.swift rename to Tests/ChartsTests/HorizontalBarChartTests.swift index 1b67a0dd27..7ef83a1eaf 100644 --- a/Tests/Charts/HorizontalBarChartTests.swift +++ b/Tests/ChartsTests/HorizontalBarChartTests.swift @@ -5,39 +5,33 @@ // Created by Xuan Liu on 2019/3/20. // -import XCTest -import FBSnapshotTestCase @testable import Charts +import SnapshotTesting +import XCTest -class HorizontalBarChartTests: FBSnapshotTestCase -{ - - override func setUp() - { +class HorizontalBarChartTests: XCTestCase { + override func setUp() { super.setUp() // Set to `true` to re-capture all snapshots - self.recordMode = false + isRecording = false } - override func tearDown() - { + override func tearDown() { // Put teardown code here. This method is called after the invocation of each test method in the class. super.tearDown() } - //MARK: Prepare - func setupCustomValuesDataEntries(values: [Double]) -> [ChartDataEntry] - { + // MARK: Prepare + + func setupCustomValuesDataEntries(values: [Double]) -> [ChartDataEntry] { var entries: [ChartDataEntry] = Array() - for (i, value) in values.enumerated() - { - entries.append(BarChartDataEntry(x: Double(i), y: value, icon: UIImage(named: "icon", in: Bundle(for: self.classForCoder), compatibleWith: nil))) + for (i, value) in values.enumerated() { + entries.append(BarChartDataEntry(x: Double(i), y: value, icon: UIImage(named: "icon", in: Bundle(for: classForCoder), compatibleWith: nil))) } return entries } - func setupStackedvaluesDataEntries() -> [ChartDataEntry] - { + func setupStackedvaluesDataEntries() -> [ChartDataEntry] { var entries: [ChartDataEntry] = Array() entries.append(BarChartDataEntry(x: 0, yValues: [28, 50, 60, 30, 42], icon: UIImage(named: "icon"))) entries.append(BarChartDataEntry(x: 1, yValues: [-20, -36, -52, -40, -15], icon: UIImage(named: "icon"))) @@ -47,37 +41,32 @@ class HorizontalBarChartTests: FBSnapshotTestCase return entries } - func setupDefaultValuesDataEntries() -> [ChartDataEntry] - { + func setupDefaultValuesDataEntries() -> [ChartDataEntry] { let values: [Double] = [8, 104, -81, 93, 52, -44, 97, 101, -75, 28, -76, 25, 20, -13, 52, 44, -57, 23, 45, -91, 99, 14, -84, 48, 40, -71, 106, 41, -45, 61] return setupCustomValuesDataEntries(values: values) } - func setupDefaultDataSet(chartDataEntries: [ChartDataEntry]) -> BarChartDataSet - { + func setupDefaultDataSet(chartDataEntries: [ChartDataEntry]) -> BarChartDataSet { let dataSet = BarChartDataSet(entries: chartDataEntries, label: "Bar chart unit test data") dataSet.drawIconsEnabled = false dataSet.iconsOffset = CGPoint(x: 0, y: -10.0) return dataSet } - func setupDefaultStackedDataSet(chartDataEntries: [ChartDataEntry]) -> BarChartDataSet - { + func setupDefaultStackedDataSet(chartDataEntries: [ChartDataEntry]) -> BarChartDataSet { let dataSet = BarChartDataSet(entries: chartDataEntries, label: "Stacked bar chart unit test data") dataSet.drawIconsEnabled = false dataSet.iconsOffset = CGPoint(x: 0, y: -10.0) - dataSet.colors = Array(arrayLiteral:NSUIColor(red: 46/255.0, green: 204/255.0, blue: 113/255.0, alpha: 1.0), - NSUIColor(red: 241/255.0, green: 196/255.0, blue: 15/255.0, alpha: 1.0), - NSUIColor(red: 231/255.0, green: 76/255.0, blue: 60/255.0, alpha: 1.0), - NSUIColor(red: 52/255.0, green: 152/255.0, blue: 219/255.0, alpha: 1.0) - ) + dataSet.colors = Array(arrayLiteral: NSUIColor(red: 46 / 255.0, green: 204 / 255.0, blue: 113 / 255.0, alpha: 1.0), + NSUIColor(red: 241 / 255.0, green: 196 / 255.0, blue: 15 / 255.0, alpha: 1.0), + NSUIColor(red: 231 / 255.0, green: 76 / 255.0, blue: 60 / 255.0, alpha: 1.0), + NSUIColor(red: 52 / 255.0, green: 152 / 255.0, blue: 219 / 255.0, alpha: 1.0)) return dataSet } - func setupDefaultChart(dataSets: [BarChartDataSet]) -> BarChartView - { + func setupDefaultChart(dataSets: [BarChartDataSet]) -> BarChartView { let data = BarChartData(dataSets: dataSets) data.barWidth = 0.85 @@ -87,61 +76,56 @@ class HorizontalBarChartTests: FBSnapshotTestCase return chart } - //MARK: Start Test - func testDefaultValues() - { + // MARK: Start Test + + func testDefaultValues() { let dataEntries = setupDefaultValuesDataEntries() let dataSet = setupDefaultDataSet(chartDataEntries: dataEntries) let chart = setupDefaultChart(dataSets: [dataSet]) - ChartsSnapshotVerifyView(chart, identifier: Snapshot.identifier(UIScreen.main.bounds.size), overallTolerance: Snapshot.tolerance) + assertChartSnapshot(matching: chart) } - func testHidesValues() - { + func testHidesValues() { let dataEntries = setupDefaultValuesDataEntries() let dataSet = setupDefaultDataSet(chartDataEntries: dataEntries) let chart = setupDefaultChart(dataSets: [dataSet]) dataSet.drawValuesEnabled = false chart.notifyDataSetChanged() - ChartsSnapshotVerifyView(chart, identifier: Snapshot.identifier(UIScreen.main.bounds.size), overallTolerance: Snapshot.tolerance) + assertChartSnapshot(matching: chart) } - func testNotDrawValueAboveBars() - { + func testNotDrawValueAboveBars() { let dataEntries = setupDefaultValuesDataEntries() let dataSet = setupDefaultDataSet(chartDataEntries: dataEntries) let chart = setupDefaultChart(dataSets: [dataSet]) chart.drawValueAboveBarEnabled = false chart.notifyDataSetChanged() - ChartsSnapshotVerifyView(chart, identifier: Snapshot.identifier(UIScreen.main.bounds.size), overallTolerance: Snapshot.tolerance) + assertChartSnapshot(matching: chart) } - func testStackedDrawValues() - { + func testStackedDrawValues() { let dataEntries = setupStackedvaluesDataEntries() let dataSet = setupDefaultStackedDataSet(chartDataEntries: dataEntries) let chart = setupDefaultChart(dataSets: [dataSet]) chart.notifyDataSetChanged() - ChartsSnapshotVerifyView(chart, identifier: Snapshot.identifier(UIScreen.main.bounds.size), overallTolerance: Snapshot.tolerance) + assertChartSnapshot(matching: chart) } - func testStackedNotDrawValues() - { + func testStackedNotDrawValues() { let dataEntries = setupStackedvaluesDataEntries() let dataSet = setupDefaultStackedDataSet(chartDataEntries: dataEntries) dataSet.drawValuesEnabled = false let chart = setupDefaultChart(dataSets: [dataSet]) chart.notifyDataSetChanged() - ChartsSnapshotVerifyView(chart, identifier: Snapshot.identifier(UIScreen.main.bounds.size), overallTolerance: Snapshot.tolerance) + assertChartSnapshot(matching: chart) } - func testStackedNotDrawValuesAboveBars() - { + func testStackedNotDrawValuesAboveBars() { let dataEntries = setupStackedvaluesDataEntries() let dataSet = setupDefaultStackedDataSet(chartDataEntries: dataEntries) let chart = setupDefaultChart(dataSets: [dataSet]) chart.drawValueAboveBarEnabled = false chart.notifyDataSetChanged() - ChartsSnapshotVerifyView(chart, identifier: Snapshot.identifier(UIScreen.main.bounds.size), overallTolerance: Snapshot.tolerance) + assertChartSnapshot(matching: chart) } } diff --git a/Tests/ChartsTests/LineChartTests.swift b/Tests/ChartsTests/LineChartTests.swift new file mode 100755 index 0000000000..e9bebf0416 --- /dev/null +++ b/Tests/ChartsTests/LineChartTests.swift @@ -0,0 +1,72 @@ +@testable import Charts +import SnapshotTesting +import XCTest + +class LineChartTests: XCTestCase { + private lazy var icon = UIImage(named: "icon", in: Bundle(for: classForCoder), compatibleWith: nil)! + + var chart: LineChartView! + var dataSet: LineChartDataSet! + + override func setUp() { + super.setUp() + + // Set to `true` to re-capture all snapshots + isRecording = false + + // Sample data + let values: [Double] = [8, 104, 81, 93, 52, 44, 97, 101, 75, 28, + 76, 25, 20, 13, 52, 44, 57, 23, 45, 91, + 99, 14, 84, 48, 40, 71, 106, 41, 45, 61] + + var entries: [ChartDataEntry] = Array() + + for (i, value) in values.enumerated() { + entries.append(ChartDataEntry(x: Double(i), y: value, icon: icon)) + } + + dataSet = LineChartDataSet(entries: entries, label: "First unit test data") + dataSet.drawIconsEnabled = false + dataSet.iconsOffset = CGPoint(x: 0, y: 20.0) + + chart = LineChartView(frame: CGRect(x: 0, y: 0, width: 480, height: 350)) + chart.backgroundColor = NSUIColor.clear + chart.leftAxis.axisMinimum = 0.0 + chart.rightAxis.axisMinimum = 0.0 + chart.data = LineChartData(dataSet: dataSet) + } + + override func tearDown() { + // Put teardown code here. This method is called after the invocation of each test method in the class. + super.tearDown() + } + + func testDefaultValues() { + assertChartSnapshot(matching: chart) + } + + func testHidesValues() { + dataSet.drawValuesEnabled = false + assertChartSnapshot(matching: chart) + } + + func testDoesntDrawCircles() { + dataSet.drawCirclesEnabled = false + assertChartSnapshot(matching: chart) + } + + func testIsCubic() { + dataSet.mode = LineChartDataSet.Mode.cubicBezier + assertChartSnapshot(matching: chart) + } + + func testDoesntDrawCircleHole() { + dataSet.drawCircleHoleEnabled = false + assertChartSnapshot(matching: chart) + } + + func testDrawIcons() { + dataSet.drawIconsEnabled = true + assertChartSnapshot(matching: chart) + } +} diff --git a/Tests/Charts/PieChartTests.swift b/Tests/ChartsTests/PieChartTests.swift similarity index 51% rename from Tests/Charts/PieChartTests.swift rename to Tests/ChartsTests/PieChartTests.swift index 441823efa4..3fb3717cb5 100644 --- a/Tests/Charts/PieChartTests.swift +++ b/Tests/ChartsTests/PieChartTests.swift @@ -1,87 +1,79 @@ -import XCTest -import FBSnapshotTestCase @testable import Charts +import SnapshotTesting +import XCTest + +class PieChartTests: XCTestCase { + private lazy var icon = UIImage(named: "icon", in: Bundle(for: classForCoder), compatibleWith: nil)! -class PieChartTests: FBSnapshotTestCase -{ - var chart: PieChartView! var dataSet: PieChartDataSet! - - override func setUp() - { + + override func setUp() { super.setUp() - + // Set to `true` to re-capture all snapshots - self.recordMode = false - + isRecording = false + // Sample data let values: [Double] = [11, 33, 81, 52, 97, 101, 75] - + var entries: [PieChartDataEntry] = Array() - - for value in values - { - entries.append(PieChartDataEntry(value: value, icon: UIImage(named: "icon", in: Bundle(for: self.classForCoder), compatibleWith: nil))) + + for value in values { + entries.append(PieChartDataEntry(value: value, icon: icon)) } - + dataSet = PieChartDataSet(entries: entries, label: "First unit test data") dataSet.drawIconsEnabled = false dataSet.iconsOffset = CGPoint(x: 0, y: 20.0) - + dataSet.colors = ChartColorTemplates.vordiplom() + ChartColorTemplates.joyful() + ChartColorTemplates.colorful() + ChartColorTemplates.liberty() + ChartColorTemplates.pastel() - + [UIColor(red: 51/255, green: 181/255, blue: 229/255, alpha: 1)] + + [UIColor(red: 51 / 255, green: 181 / 255, blue: 229 / 255, alpha: 1)] + chart = PieChartView(frame: CGRect(x: 0, y: 0, width: 480, height: 350)) chart.backgroundColor = NSUIColor.clear chart.centerText = "PieChart Unit Test" chart.data = PieChartData(dataSet: dataSet) } - - override func tearDown() - { + + override func tearDown() { // Put teardown code here. This method is called after the invocation of each test method in the class. super.tearDown() } - - func testDefaultValues() - { - ChartsSnapshotVerifyView(chart, identifier: Snapshot.identifier(UIScreen.main.bounds.size), overallTolerance: Snapshot.tolerance) + + func testDefaultValues() { + assertChartSnapshot(matching: chart) } - - func testHidesValues() - { + + func testHidesValues() { dataSet.drawValuesEnabled = false - ChartsSnapshotVerifyView(chart, identifier: Snapshot.identifier(UIScreen.main.bounds.size), overallTolerance: Snapshot.tolerance) + assertChartSnapshot(matching: chart) } - - func testDrawIcons() - { + + func testDrawIcons() { dataSet.drawIconsEnabled = true - ChartsSnapshotVerifyView(chart, identifier: Snapshot.identifier(UIScreen.main.bounds.size), overallTolerance: Snapshot.tolerance) + assertChartSnapshot(matching: chart) } - - func testHideCenterLabel() - { + + func testHideCenterLabel() { chart.drawCenterTextEnabled = false - ChartsSnapshotVerifyView(chart, identifier: Snapshot.identifier(UIScreen.main.bounds.size), overallTolerance: Snapshot.tolerance) + assertChartSnapshot(matching: chart) } - func testHighlightDisabled() - { + func testHighlightDisabled() { chart.data?.dataSets[0].highlightEnabled = false chart.highlightValue(x: 1.0, dataSetIndex: 0, callDelegate: false) - ChartsSnapshotVerifyView(chart, identifier: Snapshot.identifier(UIScreen.main.bounds.size), overallTolerance: Snapshot.tolerance) + assertChartSnapshot(matching: chart) } - func testHighlightEnabled() - { + func testHighlightEnabled() { // by default, it's enabled chart.highlightValue(x: 1.0, dataSetIndex: 0, callDelegate: false) - ChartsSnapshotVerifyView(chart, identifier: Snapshot.identifier(UIScreen.main.bounds.size), overallTolerance: Snapshot.tolerance) + assertChartSnapshot(matching: chart) } } diff --git a/Tests/Supporting Files/Info.plist b/Tests/ChartsTests/Resources/Info.plist similarity index 100% rename from Tests/Supporting Files/Info.plist rename to Tests/ChartsTests/Resources/Info.plist diff --git a/Tests/ChartsTests/Resources/Media.xcassets/Contents.json b/Tests/ChartsTests/Resources/Media.xcassets/Contents.json new file mode 100644 index 0000000000..73c00596a7 --- /dev/null +++ b/Tests/ChartsTests/Resources/Media.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Tests/Supporting Files/Media.xcassets/icon.imageset/Contents.json b/Tests/ChartsTests/Resources/Media.xcassets/icon.imageset/Contents.json similarity index 100% rename from Tests/Supporting Files/Media.xcassets/icon.imageset/Contents.json rename to Tests/ChartsTests/Resources/Media.xcassets/icon.imageset/Contents.json diff --git a/Tests/Supporting Files/Media.xcassets/icon.imageset/star-1.png b/Tests/ChartsTests/Resources/Media.xcassets/icon.imageset/star-1.png similarity index 100% rename from Tests/Supporting Files/Media.xcassets/icon.imageset/star-1.png rename to Tests/ChartsTests/Resources/Media.xcassets/icon.imageset/star-1.png diff --git a/Tests/Supporting Files/Media.xcassets/icon.imageset/star-2.png b/Tests/ChartsTests/Resources/Media.xcassets/icon.imageset/star-2.png similarity index 100% rename from Tests/Supporting Files/Media.xcassets/icon.imageset/star-2.png rename to Tests/ChartsTests/Resources/Media.xcassets/icon.imageset/star-2.png diff --git a/Tests/Supporting Files/Media.xcassets/icon.imageset/star.png b/Tests/ChartsTests/Resources/Media.xcassets/icon.imageset/star.png similarity index 100% rename from Tests/Supporting Files/Media.xcassets/icon.imageset/star.png rename to Tests/ChartsTests/Resources/Media.xcassets/icon.imageset/star.png diff --git a/Tests/ChartsTests/Utilities.swift b/Tests/ChartsTests/Utilities.swift new file mode 100644 index 0000000000..a58ab9a6a1 --- /dev/null +++ b/Tests/ChartsTests/Utilities.swift @@ -0,0 +1,56 @@ +import Charts +import SnapshotTesting +import UIKit +import XCTest + +private enum Snapshot { + static func identifier(_ size: CGSize) -> String { + #if os(tvOS) + let identifier = "tvOS" + #elseif os(iOS) + let identifier = "iOS" + #elseif os(OSX) + let identifier = "macOS" + #else + let identifier = "" + #endif + + return "\(identifier)_\(size.width)_\(size.height)" + } +} + +func assertChartSnapshot( + matching value: @autoclosure () throws -> Value, + record recording: Bool = false, + timeout: TimeInterval = 5, + file: StaticString = #file, + testName: String = #function, + line: UInt = #line +) { + let fileUrl = URL(fileURLWithPath: "\(file)", isDirectory: false) + let fileName = fileUrl.deletingPathExtension().lastPathComponent + + #if arch(arm64) + let snapshotDirectory = fileUrl.deletingLastPathComponent() + .appendingPathComponent("__Snapshots__Silicon__") + .appendingPathComponent(fileName) + .path + #else + let snapshotDirectory = fileUrl.deletingLastPathComponent() + .appendingPathComponent("__Snapshots__x86__") + .appendingPathComponent(fileName) + .path + #endif + + let failure = verifySnapshot( + matching: try value(), + as: .image, + record: recording, + snapshotDirectory: snapshotDirectory, + timeout: timeout, + file: file, + testName: testName + Snapshot.identifier(UIScreen.main.bounds.size) + ) + guard let message = failure else { return } + XCTFail(message, file: file, line: line) +} diff --git a/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testDefaultBarDataSetLabels-iOS_390-0_844-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testDefaultBarDataSetLabels-iOS_390-0_844-0.1.png new file mode 100644 index 0000000000..3e8b7d4abc Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testDefaultBarDataSetLabels-iOS_390-0_844-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testDefaultBarDataSetLabels-tvOS_1920-0_1080-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testDefaultBarDataSetLabels-tvOS_1920-0_1080-0.1.png new file mode 100644 index 0000000000..4eb66576a5 Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testDefaultBarDataSetLabels-tvOS_1920-0_1080-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testDefaultValues-iOS_390-0_844-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testDefaultValues-iOS_390-0_844-0.1.png new file mode 100644 index 0000000000..0892d2dec8 Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testDefaultValues-iOS_390-0_844-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testDefaultValues-tvOS_1920-0_1080-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testDefaultValues-tvOS_1920-0_1080-0.1.png new file mode 100644 index 0000000000..09049799b2 Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testDefaultValues-tvOS_1920-0_1080-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testDrawIcons-iOS_390-0_844-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testDrawIcons-iOS_390-0_844-0.1.png new file mode 100644 index 0000000000..3883e47cca Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testDrawIcons-iOS_390-0_844-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testDrawIcons-tvOS_1920-0_1080-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testDrawIcons-tvOS_1920-0_1080-0.1.png new file mode 100644 index 0000000000..c4f9641fba Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testDrawIcons-tvOS_1920-0_1080-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testHideHorizontalGridlines-iOS_390-0_844-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testHideHorizontalGridlines-iOS_390-0_844-0.1.png new file mode 100644 index 0000000000..c4fcdfda66 Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testHideHorizontalGridlines-iOS_390-0_844-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testHideHorizontalGridlines-tvOS_1920-0_1080-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testHideHorizontalGridlines-tvOS_1920-0_1080-0.1.png new file mode 100644 index 0000000000..7cd2816ca1 Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testHideHorizontalGridlines-tvOS_1920-0_1080-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testHideLeftAxis-iOS_390-0_844-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testHideLeftAxis-iOS_390-0_844-0.1.png new file mode 100644 index 0000000000..21a429fe00 Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testHideLeftAxis-iOS_390-0_844-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testHideLeftAxis-tvOS_1920-0_1080-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testHideLeftAxis-tvOS_1920-0_1080-0.1.png new file mode 100644 index 0000000000..eef3f98ff8 Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testHideLeftAxis-tvOS_1920-0_1080-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testHideRightAxis-iOS_390-0_844-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testHideRightAxis-iOS_390-0_844-0.1.png new file mode 100644 index 0000000000..db8347db76 Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testHideRightAxis-iOS_390-0_844-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testHideRightAxis-tvOS_1920-0_1080-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testHideRightAxis-tvOS_1920-0_1080-0.1.png new file mode 100644 index 0000000000..e19a58f5df Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testHideRightAxis-tvOS_1920-0_1080-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testHideVerticalGridlines-iOS_390-0_844-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testHideVerticalGridlines-iOS_390-0_844-0.1.png new file mode 100644 index 0000000000..c212898f05 Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testHideVerticalGridlines-iOS_390-0_844-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testHideVerticalGridlines-tvOS_1920-0_1080-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testHideVerticalGridlines-tvOS_1920-0_1080-0.1.png new file mode 100644 index 0000000000..2f74c65e13 Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testHideVerticalGridlines-tvOS_1920-0_1080-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testHidesValues-iOS_390-0_844-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testHidesValues-iOS_390-0_844-0.1.png new file mode 100644 index 0000000000..1668755ece Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testHidesValues-iOS_390-0_844-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testHidesValues-tvOS_1920-0_1080-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testHidesValues-tvOS_1920-0_1080-0.1.png new file mode 100644 index 0000000000..925ebdd17c Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testHidesValues-tvOS_1920-0_1080-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testInvertedLeftAxis-iOS_390-0_844-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testInvertedLeftAxis-iOS_390-0_844-0.1.png new file mode 100644 index 0000000000..17e80d5f1d Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testInvertedLeftAxis-iOS_390-0_844-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testInvertedLeftAxis-tvOS_1920-0_1080-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testInvertedLeftAxis-tvOS_1920-0_1080-0.1.png new file mode 100644 index 0000000000..8852d3d07d Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testInvertedLeftAxis-tvOS_1920-0_1080-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testInvertedLeftAxisWithNegativeValues-iOS_390-0_844-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testInvertedLeftAxisWithNegativeValues-iOS_390-0_844-0.1.png new file mode 100644 index 0000000000..b9747b50db Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testInvertedLeftAxisWithNegativeValues-iOS_390-0_844-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testInvertedLeftAxisWithNegativeValues-tvOS_1920-0_1080-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testInvertedLeftAxisWithNegativeValues-tvOS_1920-0_1080-0.1.png new file mode 100644 index 0000000000..9af55f080d Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testInvertedLeftAxisWithNegativeValues-tvOS_1920-0_1080-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testInvertedLeftAxisWithPositiveValues-iOS_390-0_844-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testInvertedLeftAxisWithPositiveValues-iOS_390-0_844-0.1.png new file mode 100644 index 0000000000..54080ecc1e Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testInvertedLeftAxisWithPositiveValues-iOS_390-0_844-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testInvertedLeftAxisWithPositiveValues-tvOS_1920-0_1080-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testInvertedLeftAxisWithPositiveValues-tvOS_1920-0_1080-0.1.png new file mode 100644 index 0000000000..abd85b9a9f Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testInvertedLeftAxisWithPositiveValues-tvOS_1920-0_1080-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testInvertedRightAxis-iOS_390-0_844-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testInvertedRightAxis-iOS_390-0_844-0.1.png new file mode 100644 index 0000000000..fd4c6dbe4a Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testInvertedRightAxis-iOS_390-0_844-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testInvertedRightAxis-tvOS_1920-0_1080-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testInvertedRightAxis-tvOS_1920-0_1080-0.1.png new file mode 100644 index 0000000000..f2bbef8898 Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testInvertedRightAxis-tvOS_1920-0_1080-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testInvertedRightAxisWithNegativeValues-iOS_390-0_844-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testInvertedRightAxisWithNegativeValues-iOS_390-0_844-0.1.png new file mode 100644 index 0000000000..6dff576bb3 Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testInvertedRightAxisWithNegativeValues-iOS_390-0_844-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testInvertedRightAxisWithNegativeValues-tvOS_1920-0_1080-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testInvertedRightAxisWithNegativeValues-tvOS_1920-0_1080-0.1.png new file mode 100644 index 0000000000..0c1ad46ada Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testInvertedRightAxisWithNegativeValues-tvOS_1920-0_1080-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testInvertedRightAxisWithPositiveValues-iOS_390-0_844-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testInvertedRightAxisWithPositiveValues-iOS_390-0_844-0.1.png new file mode 100644 index 0000000000..934c3fe73d Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testInvertedRightAxisWithPositiveValues-iOS_390-0_844-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testInvertedRightAxisWithPositiveValues-tvOS_1920-0_1080-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testInvertedRightAxisWithPositiveValues-tvOS_1920-0_1080-0.1.png new file mode 100644 index 0000000000..2220543b51 Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testInvertedRightAxisWithPositiveValues-tvOS_1920-0_1080-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testNegativeValues-iOS_390-0_844-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testNegativeValues-iOS_390-0_844-0.1.png new file mode 100644 index 0000000000..837500f587 Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testNegativeValues-iOS_390-0_844-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testNegativeValues-tvOS_1920-0_1080-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testNegativeValues-tvOS_1920-0_1080-0.1.png new file mode 100644 index 0000000000..6f9a2cb6f5 Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testNegativeValues-tvOS_1920-0_1080-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testNegativeValuesWithCustomAxisMaximum-iOS_390-0_844-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testNegativeValuesWithCustomAxisMaximum-iOS_390-0_844-0.1.png new file mode 100644 index 0000000000..2711bf4b48 Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testNegativeValuesWithCustomAxisMaximum-iOS_390-0_844-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testNegativeValuesWithCustomAxisMaximum-tvOS_1920-0_1080-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testNegativeValuesWithCustomAxisMaximum-tvOS_1920-0_1080-0.1.png new file mode 100644 index 0000000000..033f959609 Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testNegativeValuesWithCustomAxisMaximum-tvOS_1920-0_1080-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testNegativeValuesWithCustomAxisMaximum2-iOS_390-0_844-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testNegativeValuesWithCustomAxisMaximum2-iOS_390-0_844-0.1.png new file mode 100644 index 0000000000..a8ab93f71f Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testNegativeValuesWithCustomAxisMaximum2-iOS_390-0_844-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testNegativeValuesWithCustomAxisMaximum2-tvOS_1920-0_1080-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testNegativeValuesWithCustomAxisMaximum2-tvOS_1920-0_1080-0.1.png new file mode 100644 index 0000000000..6017ba2034 Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testNegativeValuesWithCustomAxisMaximum2-tvOS_1920-0_1080-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testNegativeValuesWithCustomAxisMaximumAndCustomAxisMaximum-iOS_390-0_844-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testNegativeValuesWithCustomAxisMaximumAndCustomAxisMaximum-iOS_390-0_844-0.1.png new file mode 100644 index 0000000000..a3cbab697e Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testNegativeValuesWithCustomAxisMaximumAndCustomAxisMaximum-iOS_390-0_844-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testNegativeValuesWithCustomAxisMaximumAndCustomAxisMaximum-tvOS_1920-0_1080-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testNegativeValuesWithCustomAxisMaximumAndCustomAxisMaximum-tvOS_1920-0_1080-0.1.png new file mode 100644 index 0000000000..3dfd3d5889 Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testNegativeValuesWithCustomAxisMaximumAndCustomAxisMaximum-tvOS_1920-0_1080-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testNegativeValuesWithCustomAxisMinimum-iOS_390-0_844-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testNegativeValuesWithCustomAxisMinimum-iOS_390-0_844-0.1.png new file mode 100644 index 0000000000..f4e494c86b Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testNegativeValuesWithCustomAxisMinimum-iOS_390-0_844-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testNegativeValuesWithCustomAxisMinimum-tvOS_1920-0_1080-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testNegativeValuesWithCustomAxisMinimum-tvOS_1920-0_1080-0.1.png new file mode 100644 index 0000000000..a8e384f101 Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testNegativeValuesWithCustomAxisMinimum-tvOS_1920-0_1080-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testNegativeValuesWithCustomAxisMinimum2-iOS_390-0_844-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testNegativeValuesWithCustomAxisMinimum2-iOS_390-0_844-0.1.png new file mode 100644 index 0000000000..6be13199f0 Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testNegativeValuesWithCustomAxisMinimum2-iOS_390-0_844-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testNegativeValuesWithCustomAxisMinimum2-tvOS_1920-0_1080-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testNegativeValuesWithCustomAxisMinimum2-tvOS_1920-0_1080-0.1.png new file mode 100644 index 0000000000..5df868b0c6 Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testNegativeValuesWithCustomAxisMinimum2-tvOS_1920-0_1080-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testNotDrawValueAboveBars-iOS_390-0_844-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testNotDrawValueAboveBars-iOS_390-0_844-0.1.png new file mode 100644 index 0000000000..c867b55900 Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testNotDrawValueAboveBars-iOS_390-0_844-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testNotDrawValueAboveBars-tvOS_1920-0_1080-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testNotDrawValueAboveBars-tvOS_1920-0_1080-0.1.png new file mode 100644 index 0000000000..5e48c901ed Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testNotDrawValueAboveBars-tvOS_1920-0_1080-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testPositiveValues-iOS_390-0_844-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testPositiveValues-iOS_390-0_844-0.1.png new file mode 100644 index 0000000000..6866816781 Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testPositiveValues-iOS_390-0_844-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testPositiveValues-tvOS_1920-0_1080-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testPositiveValues-tvOS_1920-0_1080-0.1.png new file mode 100644 index 0000000000..9de6c48070 Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testPositiveValues-tvOS_1920-0_1080-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testPositiveValuesWithCustomAxisMaximum-iOS_390-0_844-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testPositiveValuesWithCustomAxisMaximum-iOS_390-0_844-0.1.png new file mode 100644 index 0000000000..49977084eb Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testPositiveValuesWithCustomAxisMaximum-iOS_390-0_844-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testPositiveValuesWithCustomAxisMaximum-tvOS_1920-0_1080-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testPositiveValuesWithCustomAxisMaximum-tvOS_1920-0_1080-0.1.png new file mode 100644 index 0000000000..b7a865d70d Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testPositiveValuesWithCustomAxisMaximum-tvOS_1920-0_1080-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testPositiveValuesWithCustomAxisMaximum2-iOS_390-0_844-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testPositiveValuesWithCustomAxisMaximum2-iOS_390-0_844-0.1.png new file mode 100644 index 0000000000..db91ee6dbc Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testPositiveValuesWithCustomAxisMaximum2-iOS_390-0_844-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testPositiveValuesWithCustomAxisMaximum2-tvOS_1920-0_1080-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testPositiveValuesWithCustomAxisMaximum2-tvOS_1920-0_1080-0.1.png new file mode 100644 index 0000000000..eeae48f4c5 Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testPositiveValuesWithCustomAxisMaximum2-tvOS_1920-0_1080-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testPositiveValuesWithCustomAxisMaximumAndCustomAxisMaximum-iOS_390-0_844-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testPositiveValuesWithCustomAxisMaximumAndCustomAxisMaximum-iOS_390-0_844-0.1.png new file mode 100644 index 0000000000..93b7c8f5c1 Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testPositiveValuesWithCustomAxisMaximumAndCustomAxisMaximum-iOS_390-0_844-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testPositiveValuesWithCustomAxisMaximumAndCustomAxisMaximum-tvOS_1920-0_1080-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testPositiveValuesWithCustomAxisMaximumAndCustomAxisMaximum-tvOS_1920-0_1080-0.1.png new file mode 100644 index 0000000000..ca4ac87748 Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testPositiveValuesWithCustomAxisMaximumAndCustomAxisMaximum-tvOS_1920-0_1080-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testPositiveValuesWithCustomAxisMinimum-iOS_390-0_844-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testPositiveValuesWithCustomAxisMinimum-iOS_390-0_844-0.1.png new file mode 100644 index 0000000000..55c60434d7 Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testPositiveValuesWithCustomAxisMinimum-iOS_390-0_844-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testPositiveValuesWithCustomAxisMinimum-tvOS_1920-0_1080-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testPositiveValuesWithCustomAxisMinimum-tvOS_1920-0_1080-0.1.png new file mode 100644 index 0000000000..54c6fd0f6f Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testPositiveValuesWithCustomAxisMinimum-tvOS_1920-0_1080-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testPositiveValuesWithCustomAxisMinimum2-iOS_390-0_844-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testPositiveValuesWithCustomAxisMinimum2-iOS_390-0_844-0.1.png new file mode 100644 index 0000000000..1bbfc6b7bb Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testPositiveValuesWithCustomAxisMinimum2-iOS_390-0_844-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testPositiveValuesWithCustomAxisMinimum2-tvOS_1920-0_1080-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testPositiveValuesWithCustomAxisMinimum2-tvOS_1920-0_1080-0.1.png new file mode 100644 index 0000000000..271de6a323 Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testPositiveValuesWithCustomAxisMinimum2-tvOS_1920-0_1080-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testStackedDrawValues-iOS_390-0_844-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testStackedDrawValues-iOS_390-0_844-0.1.png new file mode 100644 index 0000000000..9e6dac5da7 Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testStackedDrawValues-iOS_390-0_844-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testStackedDrawValues-tvOS_1920-0_1080-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testStackedDrawValues-tvOS_1920-0_1080-0.1.png new file mode 100644 index 0000000000..70cf6c0121 Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testStackedDrawValues-tvOS_1920-0_1080-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testStackedNotDrawValues-iOS_390-0_844-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testStackedNotDrawValues-iOS_390-0_844-0.1.png new file mode 100644 index 0000000000..af4666a8f4 Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testStackedNotDrawValues-iOS_390-0_844-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testStackedNotDrawValues-tvOS_1920-0_1080-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testStackedNotDrawValues-tvOS_1920-0_1080-0.1.png new file mode 100644 index 0000000000..9f324a709c Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testStackedNotDrawValues-tvOS_1920-0_1080-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testStackedNotDrawValuesAboveBars-iOS_390-0_844-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testStackedNotDrawValuesAboveBars-iOS_390-0_844-0.1.png new file mode 100644 index 0000000000..3b19058905 Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testStackedNotDrawValuesAboveBars-iOS_390-0_844-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testStackedNotDrawValuesAboveBars-tvOS_1920-0_1080-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testStackedNotDrawValuesAboveBars-tvOS_1920-0_1080-0.1.png new file mode 100644 index 0000000000..e5abe404da Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testStackedNotDrawValuesAboveBars-tvOS_1920-0_1080-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testZeroValues-iOS_390-0_844-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testZeroValues-iOS_390-0_844-0.1.png new file mode 100644 index 0000000000..b2ab786a97 Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testZeroValues-iOS_390-0_844-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testZeroValues-tvOS_1920-0_1080-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testZeroValues-tvOS_1920-0_1080-0.1.png new file mode 100644 index 0000000000..6e1b511235 Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testZeroValues-tvOS_1920-0_1080-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/CombinedChartTests/testAllRightAxisDependency-iOS_390-0_844-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/CombinedChartTests/testAllRightAxisDependency-iOS_390-0_844-0.1.png new file mode 100644 index 0000000000..fe74075f71 Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/CombinedChartTests/testAllRightAxisDependency-iOS_390-0_844-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/CombinedChartTests/testAllRightAxisDependency-tvOS_1920-0_1080-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/CombinedChartTests/testAllRightAxisDependency-tvOS_1920-0_1080-0.1.png new file mode 100644 index 0000000000..12d273d938 Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/CombinedChartTests/testAllRightAxisDependency-tvOS_1920-0_1080-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/CombinedChartTests/testDefaultAxisDependency-iOS_390-0_844-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/CombinedChartTests/testDefaultAxisDependency-iOS_390-0_844-0.1.png new file mode 100644 index 0000000000..fe74075f71 Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/CombinedChartTests/testDefaultAxisDependency-iOS_390-0_844-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/CombinedChartTests/testDefaultAxisDependency-tvOS_1920-0_1080-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/CombinedChartTests/testDefaultAxisDependency-tvOS_1920-0_1080-0.1.png new file mode 100644 index 0000000000..12d273d938 Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/CombinedChartTests/testDefaultAxisDependency-tvOS_1920-0_1080-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/CombinedChartTests/testLeftRightAxisDependency-iOS_390-0_844-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/CombinedChartTests/testLeftRightAxisDependency-iOS_390-0_844-0.1.png new file mode 100644 index 0000000000..b271521e6e Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/CombinedChartTests/testLeftRightAxisDependency-iOS_390-0_844-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/CombinedChartTests/testLeftRightAxisDependency-tvOS_1920-0_1080-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/CombinedChartTests/testLeftRightAxisDependency-tvOS_1920-0_1080-0.1.png new file mode 100644 index 0000000000..4d5fc540a5 Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/CombinedChartTests/testLeftRightAxisDependency-tvOS_1920-0_1080-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/HorizontalBarChartTests/testDefaultValues-iOS_390-0_844-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/HorizontalBarChartTests/testDefaultValues-iOS_390-0_844-0.1.png new file mode 100644 index 0000000000..78d7674f18 Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/HorizontalBarChartTests/testDefaultValues-iOS_390-0_844-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/HorizontalBarChartTests/testDefaultValues-tvOS_1920-0_1080-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/HorizontalBarChartTests/testDefaultValues-tvOS_1920-0_1080-0.1.png new file mode 100644 index 0000000000..bd7d26f4e9 Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/HorizontalBarChartTests/testDefaultValues-tvOS_1920-0_1080-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/HorizontalBarChartTests/testHidesValues-iOS_390-0_844-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/HorizontalBarChartTests/testHidesValues-iOS_390-0_844-0.1.png new file mode 100644 index 0000000000..0d30832851 Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/HorizontalBarChartTests/testHidesValues-iOS_390-0_844-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/HorizontalBarChartTests/testHidesValues-tvOS_1920-0_1080-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/HorizontalBarChartTests/testHidesValues-tvOS_1920-0_1080-0.1.png new file mode 100644 index 0000000000..93dcf9bae6 Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/HorizontalBarChartTests/testHidesValues-tvOS_1920-0_1080-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/HorizontalBarChartTests/testNotDrawValueAboveBars-iOS_390-0_844-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/HorizontalBarChartTests/testNotDrawValueAboveBars-iOS_390-0_844-0.1.png new file mode 100644 index 0000000000..31bc074b0e Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/HorizontalBarChartTests/testNotDrawValueAboveBars-iOS_390-0_844-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/HorizontalBarChartTests/testNotDrawValueAboveBars-tvOS_1920-0_1080-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/HorizontalBarChartTests/testNotDrawValueAboveBars-tvOS_1920-0_1080-0.1.png new file mode 100644 index 0000000000..56b7ff3046 Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/HorizontalBarChartTests/testNotDrawValueAboveBars-tvOS_1920-0_1080-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/HorizontalBarChartTests/testStackedDrawValues-iOS_390-0_844-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/HorizontalBarChartTests/testStackedDrawValues-iOS_390-0_844-0.1.png new file mode 100644 index 0000000000..a720689084 Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/HorizontalBarChartTests/testStackedDrawValues-iOS_390-0_844-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/HorizontalBarChartTests/testStackedDrawValues-tvOS_1920-0_1080-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/HorizontalBarChartTests/testStackedDrawValues-tvOS_1920-0_1080-0.1.png new file mode 100644 index 0000000000..cc59dbea73 Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/HorizontalBarChartTests/testStackedDrawValues-tvOS_1920-0_1080-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/HorizontalBarChartTests/testStackedNotDrawValues-iOS_390-0_844-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/HorizontalBarChartTests/testStackedNotDrawValues-iOS_390-0_844-0.1.png new file mode 100644 index 0000000000..2a1e0256cc Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/HorizontalBarChartTests/testStackedNotDrawValues-iOS_390-0_844-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/HorizontalBarChartTests/testStackedNotDrawValues-tvOS_1920-0_1080-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/HorizontalBarChartTests/testStackedNotDrawValues-tvOS_1920-0_1080-0.1.png new file mode 100644 index 0000000000..c214925371 Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/HorizontalBarChartTests/testStackedNotDrawValues-tvOS_1920-0_1080-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/HorizontalBarChartTests/testStackedNotDrawValuesAboveBars-iOS_390-0_844-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/HorizontalBarChartTests/testStackedNotDrawValuesAboveBars-iOS_390-0_844-0.1.png new file mode 100644 index 0000000000..af53b13d28 Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/HorizontalBarChartTests/testStackedNotDrawValuesAboveBars-iOS_390-0_844-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/HorizontalBarChartTests/testStackedNotDrawValuesAboveBars-tvOS_1920-0_1080-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/HorizontalBarChartTests/testStackedNotDrawValuesAboveBars-tvOS_1920-0_1080-0.1.png new file mode 100644 index 0000000000..3a1cffca7d Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/HorizontalBarChartTests/testStackedNotDrawValuesAboveBars-tvOS_1920-0_1080-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/LineChartTests/testDefaultValues-iOS_390-0_844-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/LineChartTests/testDefaultValues-iOS_390-0_844-0.1.png new file mode 100644 index 0000000000..a870bdea68 Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/LineChartTests/testDefaultValues-iOS_390-0_844-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/LineChartTests/testDefaultValues-tvOS_1920-0_1080-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/LineChartTests/testDefaultValues-tvOS_1920-0_1080-0.1.png new file mode 100644 index 0000000000..c87af73197 Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/LineChartTests/testDefaultValues-tvOS_1920-0_1080-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/LineChartTests/testDoesntDrawCircleHole-iOS_390-0_844-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/LineChartTests/testDoesntDrawCircleHole-iOS_390-0_844-0.1.png new file mode 100644 index 0000000000..081483c028 Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/LineChartTests/testDoesntDrawCircleHole-iOS_390-0_844-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/LineChartTests/testDoesntDrawCircleHole-tvOS_1920-0_1080-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/LineChartTests/testDoesntDrawCircleHole-tvOS_1920-0_1080-0.1.png new file mode 100644 index 0000000000..a8d0c3561b Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/LineChartTests/testDoesntDrawCircleHole-tvOS_1920-0_1080-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/LineChartTests/testDoesntDrawCircles-iOS_390-0_844-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/LineChartTests/testDoesntDrawCircles-iOS_390-0_844-0.1.png new file mode 100644 index 0000000000..fa29fbdbb4 Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/LineChartTests/testDoesntDrawCircles-iOS_390-0_844-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/LineChartTests/testDoesntDrawCircles-tvOS_1920-0_1080-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/LineChartTests/testDoesntDrawCircles-tvOS_1920-0_1080-0.1.png new file mode 100644 index 0000000000..4599f86420 Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/LineChartTests/testDoesntDrawCircles-tvOS_1920-0_1080-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/LineChartTests/testDrawIcons-iOS_390-0_844-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/LineChartTests/testDrawIcons-iOS_390-0_844-0.1.png new file mode 100644 index 0000000000..34f8800fa2 Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/LineChartTests/testDrawIcons-iOS_390-0_844-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/LineChartTests/testDrawIcons-tvOS_1920-0_1080-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/LineChartTests/testDrawIcons-tvOS_1920-0_1080-0.1.png new file mode 100644 index 0000000000..03d30f79c2 Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/LineChartTests/testDrawIcons-tvOS_1920-0_1080-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/LineChartTests/testHidesValues-iOS_390-0_844-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/LineChartTests/testHidesValues-iOS_390-0_844-0.1.png new file mode 100644 index 0000000000..3e8a21b773 Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/LineChartTests/testHidesValues-iOS_390-0_844-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/LineChartTests/testHidesValues-tvOS_1920-0_1080-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/LineChartTests/testHidesValues-tvOS_1920-0_1080-0.1.png new file mode 100644 index 0000000000..18b76d8dec Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/LineChartTests/testHidesValues-tvOS_1920-0_1080-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/LineChartTests/testIsCubic-iOS_390-0_844-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/LineChartTests/testIsCubic-iOS_390-0_844-0.1.png new file mode 100644 index 0000000000..600cbae5a8 Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/LineChartTests/testIsCubic-iOS_390-0_844-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/LineChartTests/testIsCubic-tvOS_1920-0_1080-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/LineChartTests/testIsCubic-tvOS_1920-0_1080-0.1.png new file mode 100644 index 0000000000..cb8c37026c Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/LineChartTests/testIsCubic-tvOS_1920-0_1080-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/PieChartTests/testDefaultValues-iOS_390-0_844-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/PieChartTests/testDefaultValues-iOS_390-0_844-0.1.png new file mode 100644 index 0000000000..57f59ece0a Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/PieChartTests/testDefaultValues-iOS_390-0_844-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/PieChartTests/testDefaultValues-tvOS_1920-0_1080-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/PieChartTests/testDefaultValues-tvOS_1920-0_1080-0.1.png new file mode 100644 index 0000000000..181877a9c3 Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/PieChartTests/testDefaultValues-tvOS_1920-0_1080-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/PieChartTests/testDrawIcons-iOS_390-0_844-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/PieChartTests/testDrawIcons-iOS_390-0_844-0.1.png new file mode 100644 index 0000000000..37896c9c13 Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/PieChartTests/testDrawIcons-iOS_390-0_844-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/PieChartTests/testDrawIcons-tvOS_1920-0_1080-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/PieChartTests/testDrawIcons-tvOS_1920-0_1080-0.1.png new file mode 100644 index 0000000000..f70a82ff73 Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/PieChartTests/testDrawIcons-tvOS_1920-0_1080-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/PieChartTests/testHideCenterLabel-iOS_390-0_844-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/PieChartTests/testHideCenterLabel-iOS_390-0_844-0.1.png new file mode 100644 index 0000000000..9e96ba33ad Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/PieChartTests/testHideCenterLabel-iOS_390-0_844-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/PieChartTests/testHideCenterLabel-tvOS_1920-0_1080-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/PieChartTests/testHideCenterLabel-tvOS_1920-0_1080-0.1.png new file mode 100644 index 0000000000..a3cbbc063c Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/PieChartTests/testHideCenterLabel-tvOS_1920-0_1080-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/PieChartTests/testHidesValues-iOS_390-0_844-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/PieChartTests/testHidesValues-iOS_390-0_844-0.1.png new file mode 100644 index 0000000000..aba01d1d5f Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/PieChartTests/testHidesValues-iOS_390-0_844-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/PieChartTests/testHidesValues-tvOS_1920-0_1080-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/PieChartTests/testHidesValues-tvOS_1920-0_1080-0.1.png new file mode 100644 index 0000000000..727d8dc48c Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/PieChartTests/testHidesValues-tvOS_1920-0_1080-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/PieChartTests/testHighlightDisabled-iOS_390-0_844-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/PieChartTests/testHighlightDisabled-iOS_390-0_844-0.1.png new file mode 100644 index 0000000000..57f59ece0a Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/PieChartTests/testHighlightDisabled-iOS_390-0_844-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/PieChartTests/testHighlightDisabled-tvOS_1920-0_1080-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/PieChartTests/testHighlightDisabled-tvOS_1920-0_1080-0.1.png new file mode 100644 index 0000000000..181877a9c3 Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/PieChartTests/testHighlightDisabled-tvOS_1920-0_1080-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/PieChartTests/testHighlightEnabled-iOS_390-0_844-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/PieChartTests/testHighlightEnabled-iOS_390-0_844-0.1.png new file mode 100644 index 0000000000..c4ffda6085 Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/PieChartTests/testHighlightEnabled-iOS_390-0_844-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/PieChartTests/testHighlightEnabled-tvOS_1920-0_1080-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/PieChartTests/testHighlightEnabled-tvOS_1920-0_1080-0.1.png new file mode 100644 index 0000000000..1794f68073 Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/PieChartTests/testHighlightEnabled-tvOS_1920-0_1080-0.1.png differ diff --git "a/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testDefaultBarDataSetLabels-iOS_390-0_844-0.1.png" "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testDefaultBarDataSetLabels-iOS_390-0_844-0.1.png" new file mode 100644 index 0000000000..846d865d4d Binary files /dev/null and "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testDefaultBarDataSetLabels-iOS_390-0_844-0.1.png" differ diff --git "a/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testDefaultBarDataSetLabels-tvOS_1920-0_1080-0.1.png" "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testDefaultBarDataSetLabels-tvOS_1920-0_1080-0.1.png" new file mode 100644 index 0000000000..c28c5899c3 Binary files /dev/null and "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testDefaultBarDataSetLabels-tvOS_1920-0_1080-0.1.png" differ diff --git "a/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testDefaultValues-iOS_390-0_844-0.1.png" "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testDefaultValues-iOS_390-0_844-0.1.png" new file mode 100644 index 0000000000..46c59dbc89 Binary files /dev/null and "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testDefaultValues-iOS_390-0_844-0.1.png" differ diff --git "a/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testDefaultValues-tvOS_1920-0_1080-0.1.png" "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testDefaultValues-tvOS_1920-0_1080-0.1.png" new file mode 100644 index 0000000000..868d903920 Binary files /dev/null and "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testDefaultValues-tvOS_1920-0_1080-0.1.png" differ diff --git "a/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testDrawIcons-iOS_390-0_844-0.1.png" "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testDrawIcons-iOS_390-0_844-0.1.png" new file mode 100644 index 0000000000..fdc7e1cd26 Binary files /dev/null and "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testDrawIcons-iOS_390-0_844-0.1.png" differ diff --git "a/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testDrawIcons-tvOS_1920-0_1080-0.1.png" "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testDrawIcons-tvOS_1920-0_1080-0.1.png" new file mode 100644 index 0000000000..1c3dd72301 Binary files /dev/null and "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testDrawIcons-tvOS_1920-0_1080-0.1.png" differ diff --git "a/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testHideHorizontalGridlines-iOS_390-0_844-0.1.png" "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testHideHorizontalGridlines-iOS_390-0_844-0.1.png" new file mode 100644 index 0000000000..7cb87b8c32 Binary files /dev/null and "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testHideHorizontalGridlines-iOS_390-0_844-0.1.png" differ diff --git "a/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testHideHorizontalGridlines-tvOS_1920-0_1080-0.1.png" "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testHideHorizontalGridlines-tvOS_1920-0_1080-0.1.png" new file mode 100644 index 0000000000..18e7076bca Binary files /dev/null and "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testHideHorizontalGridlines-tvOS_1920-0_1080-0.1.png" differ diff --git "a/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testHideLeftAxis-iOS_390-0_844-0.1.png" "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testHideLeftAxis-iOS_390-0_844-0.1.png" new file mode 100644 index 0000000000..3a4689a680 Binary files /dev/null and "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testHideLeftAxis-iOS_390-0_844-0.1.png" differ diff --git "a/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testHideLeftAxis-tvOS_1920-0_1080-0.1.png" "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testHideLeftAxis-tvOS_1920-0_1080-0.1.png" new file mode 100644 index 0000000000..78e4a571da Binary files /dev/null and "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testHideLeftAxis-tvOS_1920-0_1080-0.1.png" differ diff --git "a/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testHideRightAxis-iOS_390-0_844-0.1.png" "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testHideRightAxis-iOS_390-0_844-0.1.png" new file mode 100644 index 0000000000..39a52c6745 Binary files /dev/null and "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testHideRightAxis-iOS_390-0_844-0.1.png" differ diff --git "a/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testHideRightAxis-tvOS_1920-0_1080-0.1.png" "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testHideRightAxis-tvOS_1920-0_1080-0.1.png" new file mode 100644 index 0000000000..fd3b486cea Binary files /dev/null and "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testHideRightAxis-tvOS_1920-0_1080-0.1.png" differ diff --git "a/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testHideVerticalGridlines-iOS_390-0_844-0.1.png" "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testHideVerticalGridlines-iOS_390-0_844-0.1.png" new file mode 100644 index 0000000000..267e59002a Binary files /dev/null and "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testHideVerticalGridlines-iOS_390-0_844-0.1.png" differ diff --git "a/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testHideVerticalGridlines-tvOS_1920-0_1080-0.1.png" "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testHideVerticalGridlines-tvOS_1920-0_1080-0.1.png" new file mode 100644 index 0000000000..f24d8227a4 Binary files /dev/null and "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testHideVerticalGridlines-tvOS_1920-0_1080-0.1.png" differ diff --git "a/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testHidesValues-iOS_390-0_844-0.1.png" "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testHidesValues-iOS_390-0_844-0.1.png" new file mode 100644 index 0000000000..b6917b5b60 Binary files /dev/null and "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testHidesValues-iOS_390-0_844-0.1.png" differ diff --git "a/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testHidesValues-tvOS_1920-0_1080-0.1.png" "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testHidesValues-tvOS_1920-0_1080-0.1.png" new file mode 100644 index 0000000000..5c97a1d11c Binary files /dev/null and "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testHidesValues-tvOS_1920-0_1080-0.1.png" differ diff --git "a/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testInvertedLeftAxis-iOS_390-0_844-0.1.png" "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testInvertedLeftAxis-iOS_390-0_844-0.1.png" new file mode 100644 index 0000000000..88b8c6c84f Binary files /dev/null and "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testInvertedLeftAxis-iOS_390-0_844-0.1.png" differ diff --git "a/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testInvertedLeftAxis-tvOS_1920-0_1080-0.1.png" "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testInvertedLeftAxis-tvOS_1920-0_1080-0.1.png" new file mode 100644 index 0000000000..8310c68f28 Binary files /dev/null and "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testInvertedLeftAxis-tvOS_1920-0_1080-0.1.png" differ diff --git "a/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testInvertedLeftAxisWithNegativeValues-iOS_390-0_844-0.1.png" "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testInvertedLeftAxisWithNegativeValues-iOS_390-0_844-0.1.png" new file mode 100644 index 0000000000..a4b796dbd3 Binary files /dev/null and "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testInvertedLeftAxisWithNegativeValues-iOS_390-0_844-0.1.png" differ diff --git "a/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testInvertedLeftAxisWithNegativeValues-tvOS_1920-0_1080-0.1.png" "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testInvertedLeftAxisWithNegativeValues-tvOS_1920-0_1080-0.1.png" new file mode 100644 index 0000000000..12e219437d Binary files /dev/null and "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testInvertedLeftAxisWithNegativeValues-tvOS_1920-0_1080-0.1.png" differ diff --git "a/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testInvertedLeftAxisWithPositiveValues-iOS_390-0_844-0.1.png" "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testInvertedLeftAxisWithPositiveValues-iOS_390-0_844-0.1.png" new file mode 100644 index 0000000000..9959c04a3f Binary files /dev/null and "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testInvertedLeftAxisWithPositiveValues-iOS_390-0_844-0.1.png" differ diff --git "a/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testInvertedLeftAxisWithPositiveValues-tvOS_1920-0_1080-0.1.png" "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testInvertedLeftAxisWithPositiveValues-tvOS_1920-0_1080-0.1.png" new file mode 100644 index 0000000000..e45a47a55f Binary files /dev/null and "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testInvertedLeftAxisWithPositiveValues-tvOS_1920-0_1080-0.1.png" differ diff --git "a/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testInvertedRightAxis-iOS_390-0_844-0.1.png" "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testInvertedRightAxis-iOS_390-0_844-0.1.png" new file mode 100644 index 0000000000..fe0de42f4e Binary files /dev/null and "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testInvertedRightAxis-iOS_390-0_844-0.1.png" differ diff --git "a/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testInvertedRightAxis-tvOS_1920-0_1080-0.1.png" "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testInvertedRightAxis-tvOS_1920-0_1080-0.1.png" new file mode 100644 index 0000000000..4940e553be Binary files /dev/null and "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testInvertedRightAxis-tvOS_1920-0_1080-0.1.png" differ diff --git "a/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testInvertedRightAxisWithNegativeValues-iOS_390-0_844-0.1.png" "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testInvertedRightAxisWithNegativeValues-iOS_390-0_844-0.1.png" new file mode 100644 index 0000000000..0a8159fa6a Binary files /dev/null and "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testInvertedRightAxisWithNegativeValues-iOS_390-0_844-0.1.png" differ diff --git "a/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testInvertedRightAxisWithNegativeValues-tvOS_1920-0_1080-0.1.png" "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testInvertedRightAxisWithNegativeValues-tvOS_1920-0_1080-0.1.png" new file mode 100644 index 0000000000..a71eebb351 Binary files /dev/null and "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testInvertedRightAxisWithNegativeValues-tvOS_1920-0_1080-0.1.png" differ diff --git "a/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testInvertedRightAxisWithPositiveValues-iOS_390-0_844-0.1.png" "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testInvertedRightAxisWithPositiveValues-iOS_390-0_844-0.1.png" new file mode 100644 index 0000000000..0807be8114 Binary files /dev/null and "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testInvertedRightAxisWithPositiveValues-iOS_390-0_844-0.1.png" differ diff --git "a/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testInvertedRightAxisWithPositiveValues-tvOS_1920-0_1080-0.1.png" "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testInvertedRightAxisWithPositiveValues-tvOS_1920-0_1080-0.1.png" new file mode 100644 index 0000000000..f2494217a6 Binary files /dev/null and "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testInvertedRightAxisWithPositiveValues-tvOS_1920-0_1080-0.1.png" differ diff --git "a/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testNegativeValues-iOS_390-0_844-0.1.png" "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testNegativeValues-iOS_390-0_844-0.1.png" new file mode 100644 index 0000000000..77b1434c89 Binary files /dev/null and "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testNegativeValues-iOS_390-0_844-0.1.png" differ diff --git "a/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testNegativeValues-tvOS_1920-0_1080-0.1.png" "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testNegativeValues-tvOS_1920-0_1080-0.1.png" new file mode 100644 index 0000000000..3fdb5b2eb3 Binary files /dev/null and "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testNegativeValues-tvOS_1920-0_1080-0.1.png" differ diff --git "a/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testNegativeValuesWithCustomAxisMaximum-iOS_390-0_844-0.1.png" "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testNegativeValuesWithCustomAxisMaximum-iOS_390-0_844-0.1.png" new file mode 100644 index 0000000000..7ce3b3c028 Binary files /dev/null and "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testNegativeValuesWithCustomAxisMaximum-iOS_390-0_844-0.1.png" differ diff --git "a/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testNegativeValuesWithCustomAxisMaximum-tvOS_1920-0_1080-0.1.png" "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testNegativeValuesWithCustomAxisMaximum-tvOS_1920-0_1080-0.1.png" new file mode 100644 index 0000000000..d93df63473 Binary files /dev/null and "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testNegativeValuesWithCustomAxisMaximum-tvOS_1920-0_1080-0.1.png" differ diff --git "a/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testNegativeValuesWithCustomAxisMaximum2-iOS_390-0_844-0.1.png" "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testNegativeValuesWithCustomAxisMaximum2-iOS_390-0_844-0.1.png" new file mode 100644 index 0000000000..41f6b26d2e Binary files /dev/null and "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testNegativeValuesWithCustomAxisMaximum2-iOS_390-0_844-0.1.png" differ diff --git "a/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testNegativeValuesWithCustomAxisMaximum2-tvOS_1920-0_1080-0.1.png" "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testNegativeValuesWithCustomAxisMaximum2-tvOS_1920-0_1080-0.1.png" new file mode 100644 index 0000000000..9983c98397 Binary files /dev/null and "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testNegativeValuesWithCustomAxisMaximum2-tvOS_1920-0_1080-0.1.png" differ diff --git "a/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testNegativeValuesWithCustomAxisMaximumAndCustomAxisMaximum-iOS_390-0_844-0.1.png" "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testNegativeValuesWithCustomAxisMaximumAndCustomAxisMaximum-iOS_390-0_844-0.1.png" new file mode 100644 index 0000000000..5eae196a0e Binary files /dev/null and "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testNegativeValuesWithCustomAxisMaximumAndCustomAxisMaximum-iOS_390-0_844-0.1.png" differ diff --git "a/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testNegativeValuesWithCustomAxisMaximumAndCustomAxisMaximum-tvOS_1920-0_1080-0.1.png" "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testNegativeValuesWithCustomAxisMaximumAndCustomAxisMaximum-tvOS_1920-0_1080-0.1.png" new file mode 100644 index 0000000000..d2771bb62a Binary files /dev/null and "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testNegativeValuesWithCustomAxisMaximumAndCustomAxisMaximum-tvOS_1920-0_1080-0.1.png" differ diff --git "a/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testNegativeValuesWithCustomAxisMinimum-iOS_390-0_844-0.1.png" "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testNegativeValuesWithCustomAxisMinimum-iOS_390-0_844-0.1.png" new file mode 100644 index 0000000000..91341b3059 Binary files /dev/null and "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testNegativeValuesWithCustomAxisMinimum-iOS_390-0_844-0.1.png" differ diff --git "a/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testNegativeValuesWithCustomAxisMinimum-tvOS_1920-0_1080-0.1.png" "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testNegativeValuesWithCustomAxisMinimum-tvOS_1920-0_1080-0.1.png" new file mode 100644 index 0000000000..f34e77e235 Binary files /dev/null and "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testNegativeValuesWithCustomAxisMinimum-tvOS_1920-0_1080-0.1.png" differ diff --git "a/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testNegativeValuesWithCustomAxisMinimum2-iOS_390-0_844-0.1.png" "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testNegativeValuesWithCustomAxisMinimum2-iOS_390-0_844-0.1.png" new file mode 100644 index 0000000000..be83a2771e Binary files /dev/null and "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testNegativeValuesWithCustomAxisMinimum2-iOS_390-0_844-0.1.png" differ diff --git "a/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testNegativeValuesWithCustomAxisMinimum2-tvOS_1920-0_1080-0.1.png" "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testNegativeValuesWithCustomAxisMinimum2-tvOS_1920-0_1080-0.1.png" new file mode 100644 index 0000000000..d833bb600f Binary files /dev/null and "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testNegativeValuesWithCustomAxisMinimum2-tvOS_1920-0_1080-0.1.png" differ diff --git "a/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testNotDrawValueAboveBars-iOS_390-0_844-0.1.png" "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testNotDrawValueAboveBars-iOS_390-0_844-0.1.png" new file mode 100644 index 0000000000..7b8419b986 Binary files /dev/null and "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testNotDrawValueAboveBars-iOS_390-0_844-0.1.png" differ diff --git "a/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testNotDrawValueAboveBars-tvOS_1920-0_1080-0.1.png" "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testNotDrawValueAboveBars-tvOS_1920-0_1080-0.1.png" new file mode 100644 index 0000000000..01fd83653f Binary files /dev/null and "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testNotDrawValueAboveBars-tvOS_1920-0_1080-0.1.png" differ diff --git "a/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testPositiveValues-iOS_390-0_844-0.1.png" "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testPositiveValues-iOS_390-0_844-0.1.png" new file mode 100644 index 0000000000..0ada371676 Binary files /dev/null and "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testPositiveValues-iOS_390-0_844-0.1.png" differ diff --git "a/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testPositiveValues-tvOS_1920-0_1080-0.1.png" "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testPositiveValues-tvOS_1920-0_1080-0.1.png" new file mode 100644 index 0000000000..d6ba0836b6 Binary files /dev/null and "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testPositiveValues-tvOS_1920-0_1080-0.1.png" differ diff --git "a/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testPositiveValuesWithCustomAxisMaximum-iOS_390-0_844-0.1.png" "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testPositiveValuesWithCustomAxisMaximum-iOS_390-0_844-0.1.png" new file mode 100644 index 0000000000..626f000cda Binary files /dev/null and "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testPositiveValuesWithCustomAxisMaximum-iOS_390-0_844-0.1.png" differ diff --git "a/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testPositiveValuesWithCustomAxisMaximum-tvOS_1920-0_1080-0.1.png" "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testPositiveValuesWithCustomAxisMaximum-tvOS_1920-0_1080-0.1.png" new file mode 100644 index 0000000000..405338b2ae Binary files /dev/null and "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testPositiveValuesWithCustomAxisMaximum-tvOS_1920-0_1080-0.1.png" differ diff --git "a/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testPositiveValuesWithCustomAxisMaximum2-iOS_390-0_844-0.1.png" "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testPositiveValuesWithCustomAxisMaximum2-iOS_390-0_844-0.1.png" new file mode 100644 index 0000000000..56abec06aa Binary files /dev/null and "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testPositiveValuesWithCustomAxisMaximum2-iOS_390-0_844-0.1.png" differ diff --git "a/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testPositiveValuesWithCustomAxisMaximum2-tvOS_1920-0_1080-0.1.png" "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testPositiveValuesWithCustomAxisMaximum2-tvOS_1920-0_1080-0.1.png" new file mode 100644 index 0000000000..c54261fd80 Binary files /dev/null and "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testPositiveValuesWithCustomAxisMaximum2-tvOS_1920-0_1080-0.1.png" differ diff --git "a/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testPositiveValuesWithCustomAxisMaximumAndCustomAxisMaximum-iOS_390-0_844-0.1.png" "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testPositiveValuesWithCustomAxisMaximumAndCustomAxisMaximum-iOS_390-0_844-0.1.png" new file mode 100644 index 0000000000..189f6e56e2 Binary files /dev/null and "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testPositiveValuesWithCustomAxisMaximumAndCustomAxisMaximum-iOS_390-0_844-0.1.png" differ diff --git "a/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testPositiveValuesWithCustomAxisMaximumAndCustomAxisMaximum-tvOS_1920-0_1080-0.1.png" "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testPositiveValuesWithCustomAxisMaximumAndCustomAxisMaximum-tvOS_1920-0_1080-0.1.png" new file mode 100644 index 0000000000..27ede67ab9 Binary files /dev/null and "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testPositiveValuesWithCustomAxisMaximumAndCustomAxisMaximum-tvOS_1920-0_1080-0.1.png" differ diff --git "a/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testPositiveValuesWithCustomAxisMinimum-iOS_390-0_844-0.1.png" "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testPositiveValuesWithCustomAxisMinimum-iOS_390-0_844-0.1.png" new file mode 100644 index 0000000000..487687dc36 Binary files /dev/null and "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testPositiveValuesWithCustomAxisMinimum-iOS_390-0_844-0.1.png" differ diff --git "a/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testPositiveValuesWithCustomAxisMinimum-tvOS_1920-0_1080-0.1.png" "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testPositiveValuesWithCustomAxisMinimum-tvOS_1920-0_1080-0.1.png" new file mode 100644 index 0000000000..dcb47d6459 Binary files /dev/null and "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testPositiveValuesWithCustomAxisMinimum-tvOS_1920-0_1080-0.1.png" differ diff --git "a/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testPositiveValuesWithCustomAxisMinimum2-iOS_390-0_844-0.1.png" "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testPositiveValuesWithCustomAxisMinimum2-iOS_390-0_844-0.1.png" new file mode 100644 index 0000000000..4c9440f576 Binary files /dev/null and "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testPositiveValuesWithCustomAxisMinimum2-iOS_390-0_844-0.1.png" differ diff --git "a/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testPositiveValuesWithCustomAxisMinimum2-tvOS_1920-0_1080-0.1.png" "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testPositiveValuesWithCustomAxisMinimum2-tvOS_1920-0_1080-0.1.png" new file mode 100644 index 0000000000..0e0bcd1e81 Binary files /dev/null and "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testPositiveValuesWithCustomAxisMinimum2-tvOS_1920-0_1080-0.1.png" differ diff --git "a/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testStackedDrawValues-iOS_390-0_844-0.1.png" "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testStackedDrawValues-iOS_390-0_844-0.1.png" new file mode 100644 index 0000000000..d6e003d6d5 Binary files /dev/null and "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testStackedDrawValues-iOS_390-0_844-0.1.png" differ diff --git "a/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testStackedDrawValues-tvOS_1920-0_1080-0.1.png" "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testStackedDrawValues-tvOS_1920-0_1080-0.1.png" new file mode 100644 index 0000000000..4a839e3131 Binary files /dev/null and "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testStackedDrawValues-tvOS_1920-0_1080-0.1.png" differ diff --git "a/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testStackedNotDrawValues-iOS_390-0_844-0.1.png" "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testStackedNotDrawValues-iOS_390-0_844-0.1.png" new file mode 100644 index 0000000000..edf2b5af8b Binary files /dev/null and "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testStackedNotDrawValues-iOS_390-0_844-0.1.png" differ diff --git "a/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testStackedNotDrawValues-tvOS_1920-0_1080-0.1.png" "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testStackedNotDrawValues-tvOS_1920-0_1080-0.1.png" new file mode 100644 index 0000000000..cd17b0532d Binary files /dev/null and "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testStackedNotDrawValues-tvOS_1920-0_1080-0.1.png" differ diff --git "a/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testStackedNotDrawValuesAboveBars-iOS_390-0_844-0.1.png" "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testStackedNotDrawValuesAboveBars-iOS_390-0_844-0.1.png" new file mode 100644 index 0000000000..2511565dc4 Binary files /dev/null and "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testStackedNotDrawValuesAboveBars-iOS_390-0_844-0.1.png" differ diff --git "a/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testStackedNotDrawValuesAboveBars-tvOS_1920-0_1080-0.1.png" "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testStackedNotDrawValuesAboveBars-tvOS_1920-0_1080-0.1.png" new file mode 100644 index 0000000000..e3fd158516 Binary files /dev/null and "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testStackedNotDrawValuesAboveBars-tvOS_1920-0_1080-0.1.png" differ diff --git "a/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testZeroValues-iOS_390-0_844-0.1.png" "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testZeroValues-iOS_390-0_844-0.1.png" new file mode 100644 index 0000000000..2a68d6a9fe Binary files /dev/null and "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testZeroValues-iOS_390-0_844-0.1.png" differ diff --git "a/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testZeroValues-tvOS_1920-0_1080-0.1.png" "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testZeroValues-tvOS_1920-0_1080-0.1.png" new file mode 100644 index 0000000000..283dbabd94 Binary files /dev/null and "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/BarChartTests/testZeroValues-tvOS_1920-0_1080-0.1.png" differ diff --git "a/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/CombinedChartTests/testAllRightAxisDependency-iOS_390-0_844-0.1.png" "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/CombinedChartTests/testAllRightAxisDependency-iOS_390-0_844-0.1.png" new file mode 100644 index 0000000000..c4565d0fdf Binary files /dev/null and "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/CombinedChartTests/testAllRightAxisDependency-iOS_390-0_844-0.1.png" differ diff --git "a/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/CombinedChartTests/testAllRightAxisDependency-tvOS_1920-0_1080-0.1.png" "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/CombinedChartTests/testAllRightAxisDependency-tvOS_1920-0_1080-0.1.png" new file mode 100644 index 0000000000..ed80ddd27f Binary files /dev/null and "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/CombinedChartTests/testAllRightAxisDependency-tvOS_1920-0_1080-0.1.png" differ diff --git "a/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/CombinedChartTests/testDefaultAxisDependency-iOS_390-0_844-0.1.png" "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/CombinedChartTests/testDefaultAxisDependency-iOS_390-0_844-0.1.png" new file mode 100644 index 0000000000..c4565d0fdf Binary files /dev/null and "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/CombinedChartTests/testDefaultAxisDependency-iOS_390-0_844-0.1.png" differ diff --git "a/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/CombinedChartTests/testDefaultAxisDependency-tvOS_1920-0_1080-0.1.png" "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/CombinedChartTests/testDefaultAxisDependency-tvOS_1920-0_1080-0.1.png" new file mode 100644 index 0000000000..ed80ddd27f Binary files /dev/null and "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/CombinedChartTests/testDefaultAxisDependency-tvOS_1920-0_1080-0.1.png" differ diff --git "a/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/CombinedChartTests/testLeftRightAxisDependency-iOS_390-0_844-0.1.png" "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/CombinedChartTests/testLeftRightAxisDependency-iOS_390-0_844-0.1.png" new file mode 100644 index 0000000000..d1e69dbd21 Binary files /dev/null and "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/CombinedChartTests/testLeftRightAxisDependency-iOS_390-0_844-0.1.png" differ diff --git "a/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/CombinedChartTests/testLeftRightAxisDependency-tvOS_1920-0_1080-0.1.png" "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/CombinedChartTests/testLeftRightAxisDependency-tvOS_1920-0_1080-0.1.png" new file mode 100644 index 0000000000..da704f900a Binary files /dev/null and "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/CombinedChartTests/testLeftRightAxisDependency-tvOS_1920-0_1080-0.1.png" differ diff --git "a/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/HorizontalBarChartTests/testDefaultValues-iOS_390-0_844-0.1.png" "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/HorizontalBarChartTests/testDefaultValues-iOS_390-0_844-0.1.png" new file mode 100644 index 0000000000..e891e3c99f Binary files /dev/null and "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/HorizontalBarChartTests/testDefaultValues-iOS_390-0_844-0.1.png" differ diff --git "a/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/HorizontalBarChartTests/testDefaultValues-tvOS_1920-0_1080-0.1.png" "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/HorizontalBarChartTests/testDefaultValues-tvOS_1920-0_1080-0.1.png" new file mode 100644 index 0000000000..a0dfdf8890 Binary files /dev/null and "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/HorizontalBarChartTests/testDefaultValues-tvOS_1920-0_1080-0.1.png" differ diff --git "a/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/HorizontalBarChartTests/testHidesValues-iOS_390-0_844-0.1.png" "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/HorizontalBarChartTests/testHidesValues-iOS_390-0_844-0.1.png" new file mode 100644 index 0000000000..093011787e Binary files /dev/null and "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/HorizontalBarChartTests/testHidesValues-iOS_390-0_844-0.1.png" differ diff --git "a/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/HorizontalBarChartTests/testHidesValues-tvOS_1920-0_1080-0.1.png" "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/HorizontalBarChartTests/testHidesValues-tvOS_1920-0_1080-0.1.png" new file mode 100644 index 0000000000..99199ce357 Binary files /dev/null and "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/HorizontalBarChartTests/testHidesValues-tvOS_1920-0_1080-0.1.png" differ diff --git "a/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/HorizontalBarChartTests/testNotDrawValueAboveBars-iOS_390-0_844-0.1.png" "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/HorizontalBarChartTests/testNotDrawValueAboveBars-iOS_390-0_844-0.1.png" new file mode 100644 index 0000000000..a6580131d9 Binary files /dev/null and "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/HorizontalBarChartTests/testNotDrawValueAboveBars-iOS_390-0_844-0.1.png" differ diff --git "a/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/HorizontalBarChartTests/testNotDrawValueAboveBars-tvOS_1920-0_1080-0.1.png" "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/HorizontalBarChartTests/testNotDrawValueAboveBars-tvOS_1920-0_1080-0.1.png" new file mode 100644 index 0000000000..0e9a239b69 Binary files /dev/null and "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/HorizontalBarChartTests/testNotDrawValueAboveBars-tvOS_1920-0_1080-0.1.png" differ diff --git "a/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/HorizontalBarChartTests/testStackedDrawValues-iOS_390-0_844-0.1.png" "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/HorizontalBarChartTests/testStackedDrawValues-iOS_390-0_844-0.1.png" new file mode 100644 index 0000000000..a13167c2c7 Binary files /dev/null and "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/HorizontalBarChartTests/testStackedDrawValues-iOS_390-0_844-0.1.png" differ diff --git "a/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/HorizontalBarChartTests/testStackedDrawValues-tvOS_1920-0_1080-0.1.png" "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/HorizontalBarChartTests/testStackedDrawValues-tvOS_1920-0_1080-0.1.png" new file mode 100644 index 0000000000..568012a7be Binary files /dev/null and "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/HorizontalBarChartTests/testStackedDrawValues-tvOS_1920-0_1080-0.1.png" differ diff --git "a/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/HorizontalBarChartTests/testStackedNotDrawValues-iOS_390-0_844-0.1.png" "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/HorizontalBarChartTests/testStackedNotDrawValues-iOS_390-0_844-0.1.png" new file mode 100644 index 0000000000..155e95532b Binary files /dev/null and "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/HorizontalBarChartTests/testStackedNotDrawValues-iOS_390-0_844-0.1.png" differ diff --git "a/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/HorizontalBarChartTests/testStackedNotDrawValues-tvOS_1920-0_1080-0.1.png" "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/HorizontalBarChartTests/testStackedNotDrawValues-tvOS_1920-0_1080-0.1.png" new file mode 100644 index 0000000000..5b400df49e Binary files /dev/null and "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/HorizontalBarChartTests/testStackedNotDrawValues-tvOS_1920-0_1080-0.1.png" differ diff --git "a/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/HorizontalBarChartTests/testStackedNotDrawValuesAboveBars-iOS_390-0_844-0.1.png" "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/HorizontalBarChartTests/testStackedNotDrawValuesAboveBars-iOS_390-0_844-0.1.png" new file mode 100644 index 0000000000..6530fdda26 Binary files /dev/null and "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/HorizontalBarChartTests/testStackedNotDrawValuesAboveBars-iOS_390-0_844-0.1.png" differ diff --git "a/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/HorizontalBarChartTests/testStackedNotDrawValuesAboveBars-tvOS_1920-0_1080-0.1.png" "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/HorizontalBarChartTests/testStackedNotDrawValuesAboveBars-tvOS_1920-0_1080-0.1.png" new file mode 100644 index 0000000000..d30afb0227 Binary files /dev/null and "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/HorizontalBarChartTests/testStackedNotDrawValuesAboveBars-tvOS_1920-0_1080-0.1.png" differ diff --git "a/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/LineChartTests/testDefaultValues-iOS_390-0_844-0.1.png" "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/LineChartTests/testDefaultValues-iOS_390-0_844-0.1.png" new file mode 100644 index 0000000000..ee2017ce23 Binary files /dev/null and "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/LineChartTests/testDefaultValues-iOS_390-0_844-0.1.png" differ diff --git "a/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/LineChartTests/testDefaultValues-tvOS_1920-0_1080-0.1.png" "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/LineChartTests/testDefaultValues-tvOS_1920-0_1080-0.1.png" new file mode 100644 index 0000000000..4951994455 Binary files /dev/null and "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/LineChartTests/testDefaultValues-tvOS_1920-0_1080-0.1.png" differ diff --git "a/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/LineChartTests/testDoesntDrawCircleHole-iOS_390-0_844-0.1.png" "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/LineChartTests/testDoesntDrawCircleHole-iOS_390-0_844-0.1.png" new file mode 100644 index 0000000000..7af25276da Binary files /dev/null and "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/LineChartTests/testDoesntDrawCircleHole-iOS_390-0_844-0.1.png" differ diff --git "a/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/LineChartTests/testDoesntDrawCircleHole-tvOS_1920-0_1080-0.1.png" "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/LineChartTests/testDoesntDrawCircleHole-tvOS_1920-0_1080-0.1.png" new file mode 100644 index 0000000000..7b0f4c9495 Binary files /dev/null and "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/LineChartTests/testDoesntDrawCircleHole-tvOS_1920-0_1080-0.1.png" differ diff --git "a/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/LineChartTests/testDoesntDrawCircles-iOS_390-0_844-0.1.png" "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/LineChartTests/testDoesntDrawCircles-iOS_390-0_844-0.1.png" new file mode 100644 index 0000000000..f02279d62e Binary files /dev/null and "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/LineChartTests/testDoesntDrawCircles-iOS_390-0_844-0.1.png" differ diff --git "a/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/LineChartTests/testDoesntDrawCircles-tvOS_1920-0_1080-0.1.png" "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/LineChartTests/testDoesntDrawCircles-tvOS_1920-0_1080-0.1.png" new file mode 100644 index 0000000000..74709e5a4f Binary files /dev/null and "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/LineChartTests/testDoesntDrawCircles-tvOS_1920-0_1080-0.1.png" differ diff --git "a/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/LineChartTests/testDrawIcons-iOS_390-0_844-0.1.png" "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/LineChartTests/testDrawIcons-iOS_390-0_844-0.1.png" new file mode 100644 index 0000000000..bd2a90c0e9 Binary files /dev/null and "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/LineChartTests/testDrawIcons-iOS_390-0_844-0.1.png" differ diff --git "a/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/LineChartTests/testDrawIcons-tvOS_1920-0_1080-0.1.png" "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/LineChartTests/testDrawIcons-tvOS_1920-0_1080-0.1.png" new file mode 100644 index 0000000000..52f46b522c Binary files /dev/null and "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/LineChartTests/testDrawIcons-tvOS_1920-0_1080-0.1.png" differ diff --git "a/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/LineChartTests/testHidesValues-iOS_390-0_844-0.1.png" "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/LineChartTests/testHidesValues-iOS_390-0_844-0.1.png" new file mode 100644 index 0000000000..649cb6d977 Binary files /dev/null and "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/LineChartTests/testHidesValues-iOS_390-0_844-0.1.png" differ diff --git "a/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/LineChartTests/testHidesValues-tvOS_1920-0_1080-0.1.png" "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/LineChartTests/testHidesValues-tvOS_1920-0_1080-0.1.png" new file mode 100644 index 0000000000..3b3435878c Binary files /dev/null and "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/LineChartTests/testHidesValues-tvOS_1920-0_1080-0.1.png" differ diff --git "a/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/LineChartTests/testIsCubic-iOS_390-0_844-0.1.png" "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/LineChartTests/testIsCubic-iOS_390-0_844-0.1.png" new file mode 100644 index 0000000000..175dacbe10 Binary files /dev/null and "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/LineChartTests/testIsCubic-iOS_390-0_844-0.1.png" differ diff --git "a/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/LineChartTests/testIsCubic-tvOS_1920-0_1080-0.1.png" "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/LineChartTests/testIsCubic-tvOS_1920-0_1080-0.1.png" new file mode 100644 index 0000000000..a7c052d652 Binary files /dev/null and "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/LineChartTests/testIsCubic-tvOS_1920-0_1080-0.1.png" differ diff --git "a/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/PieChartTests/testDefaultValues-iOS_390-0_844-0.1.png" "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/PieChartTests/testDefaultValues-iOS_390-0_844-0.1.png" new file mode 100644 index 0000000000..5eaaa6bffe Binary files /dev/null and "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/PieChartTests/testDefaultValues-iOS_390-0_844-0.1.png" differ diff --git "a/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/PieChartTests/testDefaultValues-tvOS_1920-0_1080-0.1.png" "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/PieChartTests/testDefaultValues-tvOS_1920-0_1080-0.1.png" new file mode 100644 index 0000000000..01ca397618 Binary files /dev/null and "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/PieChartTests/testDefaultValues-tvOS_1920-0_1080-0.1.png" differ diff --git "a/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/PieChartTests/testDrawIcons-iOS_390-0_844-0.1.png" "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/PieChartTests/testDrawIcons-iOS_390-0_844-0.1.png" new file mode 100644 index 0000000000..4fe46c06d1 Binary files /dev/null and "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/PieChartTests/testDrawIcons-iOS_390-0_844-0.1.png" differ diff --git "a/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/PieChartTests/testDrawIcons-tvOS_1920-0_1080-0.1.png" "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/PieChartTests/testDrawIcons-tvOS_1920-0_1080-0.1.png" new file mode 100644 index 0000000000..3fb65ff737 Binary files /dev/null and "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/PieChartTests/testDrawIcons-tvOS_1920-0_1080-0.1.png" differ diff --git "a/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/PieChartTests/testHideCenterLabel-iOS_390-0_844-0.1.png" "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/PieChartTests/testHideCenterLabel-iOS_390-0_844-0.1.png" new file mode 100644 index 0000000000..14a491f534 Binary files /dev/null and "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/PieChartTests/testHideCenterLabel-iOS_390-0_844-0.1.png" differ diff --git "a/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/PieChartTests/testHideCenterLabel-tvOS_1920-0_1080-0.1.png" "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/PieChartTests/testHideCenterLabel-tvOS_1920-0_1080-0.1.png" new file mode 100644 index 0000000000..97149813c0 Binary files /dev/null and "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/PieChartTests/testHideCenterLabel-tvOS_1920-0_1080-0.1.png" differ diff --git "a/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/PieChartTests/testHidesValues-iOS_390-0_844-0.1.png" "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/PieChartTests/testHidesValues-iOS_390-0_844-0.1.png" new file mode 100644 index 0000000000..1a27ba394b Binary files /dev/null and "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/PieChartTests/testHidesValues-iOS_390-0_844-0.1.png" differ diff --git "a/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/PieChartTests/testHidesValues-tvOS_1920-0_1080-0.1.png" "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/PieChartTests/testHidesValues-tvOS_1920-0_1080-0.1.png" new file mode 100644 index 0000000000..2c3671f99e Binary files /dev/null and "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/PieChartTests/testHidesValues-tvOS_1920-0_1080-0.1.png" differ diff --git "a/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/PieChartTests/testHighlightDisabled-iOS_390-0_844-0.1.png" "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/PieChartTests/testHighlightDisabled-iOS_390-0_844-0.1.png" new file mode 100644 index 0000000000..5eaaa6bffe Binary files /dev/null and "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/PieChartTests/testHighlightDisabled-iOS_390-0_844-0.1.png" differ diff --git "a/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/PieChartTests/testHighlightDisabled-tvOS_1920-0_1080-0.1.png" "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/PieChartTests/testHighlightDisabled-tvOS_1920-0_1080-0.1.png" new file mode 100644 index 0000000000..01ca397618 Binary files /dev/null and "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/PieChartTests/testHighlightDisabled-tvOS_1920-0_1080-0.1.png" differ diff --git "a/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/PieChartTests/testHighlightEnabled-iOS_390-0_844-0.1.png" "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/PieChartTests/testHighlightEnabled-iOS_390-0_844-0.1.png" new file mode 100644 index 0000000000..11d3557dd5 Binary files /dev/null and "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/PieChartTests/testHighlightEnabled-iOS_390-0_844-0.1.png" differ diff --git "a/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/PieChartTests/testHighlightEnabled-tvOS_1920-0_1080-0.1.png" "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/PieChartTests/testHighlightEnabled-tvOS_1920-0_1080-0.1.png" new file mode 100644 index 0000000000..0be51fe6fb Binary files /dev/null and "b/Tests/ChartsTests/__Snapshots__\357\243\277Silicon__/PieChartTests/testHighlightEnabled-tvOS_1920-0_1080-0.1.png" differ diff --git a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testDefaultBarDataSetLabels_iOS_375_0_667_0@2x.png b/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testDefaultBarDataSetLabels_iOS_375_0_667_0@2x.png deleted file mode 100644 index ed12b4a030..0000000000 Binary files a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testDefaultBarDataSetLabels_iOS_375_0_667_0@2x.png and /dev/null differ diff --git a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testDefaultBarDataSetLabels_tvOS_1920_0_1080_0@1x.png b/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testDefaultBarDataSetLabels_tvOS_1920_0_1080_0@1x.png deleted file mode 100644 index 774b80ba50..0000000000 Binary files a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testDefaultBarDataSetLabels_tvOS_1920_0_1080_0@1x.png and /dev/null differ diff --git a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testDefaultValues_iOS_375_0_667_0@2x.png b/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testDefaultValues_iOS_375_0_667_0@2x.png deleted file mode 100644 index f37161c2dc..0000000000 Binary files a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testDefaultValues_iOS_375_0_667_0@2x.png and /dev/null differ diff --git a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testDefaultValues_tvOS_1920_0_1080_0@1x.png b/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testDefaultValues_tvOS_1920_0_1080_0@1x.png deleted file mode 100644 index 0c3753bc36..0000000000 Binary files a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testDefaultValues_tvOS_1920_0_1080_0@1x.png and /dev/null differ diff --git a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testDrawIcons_iOS_375_0_667_0@2x.png b/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testDrawIcons_iOS_375_0_667_0@2x.png deleted file mode 100644 index fa118f9dc9..0000000000 Binary files a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testDrawIcons_iOS_375_0_667_0@2x.png and /dev/null differ diff --git a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testDrawIcons_tvOS_1920_0_1080_0@1x.png b/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testDrawIcons_tvOS_1920_0_1080_0@1x.png deleted file mode 100644 index d436812f3f..0000000000 Binary files a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testDrawIcons_tvOS_1920_0_1080_0@1x.png and /dev/null differ diff --git a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testHideHorizontalGridlines_iOS_375_0_667_0@2x.png b/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testHideHorizontalGridlines_iOS_375_0_667_0@2x.png deleted file mode 100644 index 3286ae7343..0000000000 Binary files a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testHideHorizontalGridlines_iOS_375_0_667_0@2x.png and /dev/null differ diff --git a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testHideHorizontalGridlines_tvOS_1920_0_1080_0@1x.png b/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testHideHorizontalGridlines_tvOS_1920_0_1080_0@1x.png deleted file mode 100644 index 8f34ba9249..0000000000 Binary files a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testHideHorizontalGridlines_tvOS_1920_0_1080_0@1x.png and /dev/null differ diff --git a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testHideLeftAxis_iOS_375_0_667_0@2x.png b/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testHideLeftAxis_iOS_375_0_667_0@2x.png deleted file mode 100644 index 97624e5799..0000000000 Binary files a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testHideLeftAxis_iOS_375_0_667_0@2x.png and /dev/null differ diff --git a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testHideLeftAxis_tvOS_1920_0_1080_0@1x.png b/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testHideLeftAxis_tvOS_1920_0_1080_0@1x.png deleted file mode 100644 index 0cd6395365..0000000000 Binary files a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testHideLeftAxis_tvOS_1920_0_1080_0@1x.png and /dev/null differ diff --git a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testHideRightAxis_iOS_375_0_667_0@2x.png b/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testHideRightAxis_iOS_375_0_667_0@2x.png deleted file mode 100644 index 183f5d9957..0000000000 Binary files a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testHideRightAxis_iOS_375_0_667_0@2x.png and /dev/null differ diff --git a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testHideRightAxis_tvOS_1920_0_1080_0@1x.png b/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testHideRightAxis_tvOS_1920_0_1080_0@1x.png deleted file mode 100644 index 6f1f26cc12..0000000000 Binary files a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testHideRightAxis_tvOS_1920_0_1080_0@1x.png and /dev/null differ diff --git a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testHideVerticalGridlines_iOS_375_0_667_0@2x.png b/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testHideVerticalGridlines_iOS_375_0_667_0@2x.png deleted file mode 100644 index aa9c31f8ee..0000000000 Binary files a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testHideVerticalGridlines_iOS_375_0_667_0@2x.png and /dev/null differ diff --git a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testHideVerticalGridlines_tvOS_1920_0_1080_0@1x.png b/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testHideVerticalGridlines_tvOS_1920_0_1080_0@1x.png deleted file mode 100644 index 8bc1be8efa..0000000000 Binary files a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testHideVerticalGridlines_tvOS_1920_0_1080_0@1x.png and /dev/null differ diff --git a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testHidesValues_iOS_375_0_667_0@2x.png b/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testHidesValues_iOS_375_0_667_0@2x.png deleted file mode 100644 index e9edc193db..0000000000 Binary files a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testHidesValues_iOS_375_0_667_0@2x.png and /dev/null differ diff --git a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testHidesValues_tvOS_1920_0_1080_0@1x.png b/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testHidesValues_tvOS_1920_0_1080_0@1x.png deleted file mode 100644 index 9ff97061b2..0000000000 Binary files a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testHidesValues_tvOS_1920_0_1080_0@1x.png and /dev/null differ diff --git a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testInvertedLeftAxisWithNegativeValues_iOS_375_0_667_0@2x.png b/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testInvertedLeftAxisWithNegativeValues_iOS_375_0_667_0@2x.png deleted file mode 100644 index 164c274922..0000000000 Binary files a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testInvertedLeftAxisWithNegativeValues_iOS_375_0_667_0@2x.png and /dev/null differ diff --git a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testInvertedLeftAxisWithNegativeValues_tvOS_1920_0_1080_0@1x.png b/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testInvertedLeftAxisWithNegativeValues_tvOS_1920_0_1080_0@1x.png deleted file mode 100644 index ecd7f1f039..0000000000 Binary files a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testInvertedLeftAxisWithNegativeValues_tvOS_1920_0_1080_0@1x.png and /dev/null differ diff --git a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testInvertedLeftAxisWithPositiveValues_iOS_375_0_667_0@2x.png b/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testInvertedLeftAxisWithPositiveValues_iOS_375_0_667_0@2x.png deleted file mode 100644 index d3a3cb6f63..0000000000 Binary files a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testInvertedLeftAxisWithPositiveValues_iOS_375_0_667_0@2x.png and /dev/null differ diff --git a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testInvertedLeftAxisWithPositiveValues_tvOS_1920_0_1080_0@1x.png b/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testInvertedLeftAxisWithPositiveValues_tvOS_1920_0_1080_0@1x.png deleted file mode 100644 index 3efd56abda..0000000000 Binary files a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testInvertedLeftAxisWithPositiveValues_tvOS_1920_0_1080_0@1x.png and /dev/null differ diff --git a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testInvertedLeftAxis_iOS_375_0_667_0@2x.png b/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testInvertedLeftAxis_iOS_375_0_667_0@2x.png deleted file mode 100644 index 90426d8829..0000000000 Binary files a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testInvertedLeftAxis_iOS_375_0_667_0@2x.png and /dev/null differ diff --git a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testInvertedLeftAxis_tvOS_1920_0_1080_0@1x.png b/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testInvertedLeftAxis_tvOS_1920_0_1080_0@1x.png deleted file mode 100644 index 88c52a1ddd..0000000000 Binary files a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testInvertedLeftAxis_tvOS_1920_0_1080_0@1x.png and /dev/null differ diff --git a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testInvertedRightAxisWithNegativeValues_iOS_375_0_667_0@2x.png b/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testInvertedRightAxisWithNegativeValues_iOS_375_0_667_0@2x.png deleted file mode 100644 index bdb9e2e393..0000000000 Binary files a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testInvertedRightAxisWithNegativeValues_iOS_375_0_667_0@2x.png and /dev/null differ diff --git a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testInvertedRightAxisWithNegativeValues_tvOS_1920_0_1080_0@1x.png b/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testInvertedRightAxisWithNegativeValues_tvOS_1920_0_1080_0@1x.png deleted file mode 100644 index d040175809..0000000000 Binary files a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testInvertedRightAxisWithNegativeValues_tvOS_1920_0_1080_0@1x.png and /dev/null differ diff --git a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testInvertedRightAxisWithPositiveValues_iOS_375_0_667_0@2x.png b/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testInvertedRightAxisWithPositiveValues_iOS_375_0_667_0@2x.png deleted file mode 100644 index 71d44dd75c..0000000000 Binary files a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testInvertedRightAxisWithPositiveValues_iOS_375_0_667_0@2x.png and /dev/null differ diff --git a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testInvertedRightAxisWithPositiveValues_tvOS_1920_0_1080_0@1x.png b/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testInvertedRightAxisWithPositiveValues_tvOS_1920_0_1080_0@1x.png deleted file mode 100644 index 88974cc04a..0000000000 Binary files a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testInvertedRightAxisWithPositiveValues_tvOS_1920_0_1080_0@1x.png and /dev/null differ diff --git a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testInvertedRightAxis_iOS_375_0_667_0@2x.png b/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testInvertedRightAxis_iOS_375_0_667_0@2x.png deleted file mode 100644 index 6df80b26a5..0000000000 Binary files a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testInvertedRightAxis_iOS_375_0_667_0@2x.png and /dev/null differ diff --git a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testInvertedRightAxis_tvOS_1920_0_1080_0@1x.png b/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testInvertedRightAxis_tvOS_1920_0_1080_0@1x.png deleted file mode 100644 index 23bf75fb63..0000000000 Binary files a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testInvertedRightAxis_tvOS_1920_0_1080_0@1x.png and /dev/null differ diff --git a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testNegativeValuesWithCustomAxisMaximum2_iOS_375_0_667_0@2x.png b/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testNegativeValuesWithCustomAxisMaximum2_iOS_375_0_667_0@2x.png deleted file mode 100644 index 6958d3adc8..0000000000 Binary files a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testNegativeValuesWithCustomAxisMaximum2_iOS_375_0_667_0@2x.png and /dev/null differ diff --git a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testNegativeValuesWithCustomAxisMaximum2_tvOS_1920_0_1080_0@1x.png b/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testNegativeValuesWithCustomAxisMaximum2_tvOS_1920_0_1080_0@1x.png deleted file mode 100644 index 15b171c9ab..0000000000 Binary files a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testNegativeValuesWithCustomAxisMaximum2_tvOS_1920_0_1080_0@1x.png and /dev/null differ diff --git a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testNegativeValuesWithCustomAxisMaximumAndCustomAxisMaximum_iOS_375_0_667_0@2x.png b/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testNegativeValuesWithCustomAxisMaximumAndCustomAxisMaximum_iOS_375_0_667_0@2x.png deleted file mode 100644 index ebf463b774..0000000000 Binary files a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testNegativeValuesWithCustomAxisMaximumAndCustomAxisMaximum_iOS_375_0_667_0@2x.png and /dev/null differ diff --git a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testNegativeValuesWithCustomAxisMaximumAndCustomAxisMaximum_tvOS_1920_0_1080_0@1x.png b/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testNegativeValuesWithCustomAxisMaximumAndCustomAxisMaximum_tvOS_1920_0_1080_0@1x.png deleted file mode 100644 index a7783dfc5d..0000000000 Binary files a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testNegativeValuesWithCustomAxisMaximumAndCustomAxisMaximum_tvOS_1920_0_1080_0@1x.png and /dev/null differ diff --git a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testNegativeValuesWithCustomAxisMaximum_iOS_375_0_667_0@2x.png b/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testNegativeValuesWithCustomAxisMaximum_iOS_375_0_667_0@2x.png deleted file mode 100644 index 5d53732954..0000000000 Binary files a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testNegativeValuesWithCustomAxisMaximum_iOS_375_0_667_0@2x.png and /dev/null differ diff --git a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testNegativeValuesWithCustomAxisMaximum_tvOS_1920_0_1080_0@1x.png b/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testNegativeValuesWithCustomAxisMaximum_tvOS_1920_0_1080_0@1x.png deleted file mode 100644 index d3259c2754..0000000000 Binary files a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testNegativeValuesWithCustomAxisMaximum_tvOS_1920_0_1080_0@1x.png and /dev/null differ diff --git a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testNegativeValuesWithCustomAxisMinimum2_iOS_375_0_667_0@2x.png b/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testNegativeValuesWithCustomAxisMinimum2_iOS_375_0_667_0@2x.png deleted file mode 100644 index 678b86f67b..0000000000 Binary files a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testNegativeValuesWithCustomAxisMinimum2_iOS_375_0_667_0@2x.png and /dev/null differ diff --git a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testNegativeValuesWithCustomAxisMinimum2_tvOS_1920_0_1080_0@1x.png b/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testNegativeValuesWithCustomAxisMinimum2_tvOS_1920_0_1080_0@1x.png deleted file mode 100644 index 22e3d6681a..0000000000 Binary files a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testNegativeValuesWithCustomAxisMinimum2_tvOS_1920_0_1080_0@1x.png and /dev/null differ diff --git a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testNegativeValuesWithCustomAxisMinimum_iOS_375_0_667_0@2x.png b/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testNegativeValuesWithCustomAxisMinimum_iOS_375_0_667_0@2x.png deleted file mode 100644 index f9c1a2915f..0000000000 Binary files a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testNegativeValuesWithCustomAxisMinimum_iOS_375_0_667_0@2x.png and /dev/null differ diff --git a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testNegativeValuesWithCustomAxisMinimum_tvOS_1920_0_1080_0@1x.png b/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testNegativeValuesWithCustomAxisMinimum_tvOS_1920_0_1080_0@1x.png deleted file mode 100644 index d58e9f0e19..0000000000 Binary files a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testNegativeValuesWithCustomAxisMinimum_tvOS_1920_0_1080_0@1x.png and /dev/null differ diff --git a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testNegativeValues_iOS_375_0_667_0@2x.png b/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testNegativeValues_iOS_375_0_667_0@2x.png deleted file mode 100644 index 263c6fdb11..0000000000 Binary files a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testNegativeValues_iOS_375_0_667_0@2x.png and /dev/null differ diff --git a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testNegativeValues_tvOS_1920_0_1080_0@1x.png b/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testNegativeValues_tvOS_1920_0_1080_0@1x.png deleted file mode 100644 index 8f8931a9ee..0000000000 Binary files a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testNegativeValues_tvOS_1920_0_1080_0@1x.png and /dev/null differ diff --git a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testNotDrawValueAboveBars_iOS_375_0_667_0@2x.png b/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testNotDrawValueAboveBars_iOS_375_0_667_0@2x.png deleted file mode 100644 index 2cd95fcd29..0000000000 Binary files a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testNotDrawValueAboveBars_iOS_375_0_667_0@2x.png and /dev/null differ diff --git a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testNotDrawValueAboveBars_tvOS_1920_0_1080_0@1x.png b/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testNotDrawValueAboveBars_tvOS_1920_0_1080_0@1x.png deleted file mode 100644 index f78d593abc..0000000000 Binary files a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testNotDrawValueAboveBars_tvOS_1920_0_1080_0@1x.png and /dev/null differ diff --git a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testPositiveValuesWithCustomAxisMaximum2_iOS_375_0_667_0@2x.png b/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testPositiveValuesWithCustomAxisMaximum2_iOS_375_0_667_0@2x.png deleted file mode 100644 index 492ba243e7..0000000000 Binary files a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testPositiveValuesWithCustomAxisMaximum2_iOS_375_0_667_0@2x.png and /dev/null differ diff --git a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testPositiveValuesWithCustomAxisMaximum2_tvOS_1920_0_1080_0@1x.png b/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testPositiveValuesWithCustomAxisMaximum2_tvOS_1920_0_1080_0@1x.png deleted file mode 100644 index 3a302b11ef..0000000000 Binary files a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testPositiveValuesWithCustomAxisMaximum2_tvOS_1920_0_1080_0@1x.png and /dev/null differ diff --git a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testPositiveValuesWithCustomAxisMaximumAndCustomAxisMaximum_iOS_375_0_667_0@2x.png b/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testPositiveValuesWithCustomAxisMaximumAndCustomAxisMaximum_iOS_375_0_667_0@2x.png deleted file mode 100644 index bd9997596f..0000000000 Binary files a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testPositiveValuesWithCustomAxisMaximumAndCustomAxisMaximum_iOS_375_0_667_0@2x.png and /dev/null differ diff --git a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testPositiveValuesWithCustomAxisMaximumAndCustomAxisMaximum_tvOS_1920_0_1080_0@1x.png b/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testPositiveValuesWithCustomAxisMaximumAndCustomAxisMaximum_tvOS_1920_0_1080_0@1x.png deleted file mode 100644 index b21e7efb19..0000000000 Binary files a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testPositiveValuesWithCustomAxisMaximumAndCustomAxisMaximum_tvOS_1920_0_1080_0@1x.png and /dev/null differ diff --git a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testPositiveValuesWithCustomAxisMaximum_iOS_375_0_667_0@2x.png b/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testPositiveValuesWithCustomAxisMaximum_iOS_375_0_667_0@2x.png deleted file mode 100644 index 5e9eaa550c..0000000000 Binary files a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testPositiveValuesWithCustomAxisMaximum_iOS_375_0_667_0@2x.png and /dev/null differ diff --git a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testPositiveValuesWithCustomAxisMaximum_tvOS_1920_0_1080_0@1x.png b/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testPositiveValuesWithCustomAxisMaximum_tvOS_1920_0_1080_0@1x.png deleted file mode 100644 index e50fd51a6e..0000000000 Binary files a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testPositiveValuesWithCustomAxisMaximum_tvOS_1920_0_1080_0@1x.png and /dev/null differ diff --git a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testPositiveValuesWithCustomAxisMinimum2_iOS_375_0_667_0@2x.png b/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testPositiveValuesWithCustomAxisMinimum2_iOS_375_0_667_0@2x.png deleted file mode 100644 index d46682b1cd..0000000000 Binary files a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testPositiveValuesWithCustomAxisMinimum2_iOS_375_0_667_0@2x.png and /dev/null differ diff --git a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testPositiveValuesWithCustomAxisMinimum2_tvOS_1920_0_1080_0@1x.png b/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testPositiveValuesWithCustomAxisMinimum2_tvOS_1920_0_1080_0@1x.png deleted file mode 100644 index 3dbb3abeba..0000000000 Binary files a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testPositiveValuesWithCustomAxisMinimum2_tvOS_1920_0_1080_0@1x.png and /dev/null differ diff --git a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testPositiveValuesWithCustomAxisMinimum_iOS_375_0_667_0@2x.png b/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testPositiveValuesWithCustomAxisMinimum_iOS_375_0_667_0@2x.png deleted file mode 100644 index 405978378b..0000000000 Binary files a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testPositiveValuesWithCustomAxisMinimum_iOS_375_0_667_0@2x.png and /dev/null differ diff --git a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testPositiveValuesWithCustomAxisMinimum_tvOS_1920_0_1080_0@1x.png b/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testPositiveValuesWithCustomAxisMinimum_tvOS_1920_0_1080_0@1x.png deleted file mode 100644 index fcd79d809a..0000000000 Binary files a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testPositiveValuesWithCustomAxisMinimum_tvOS_1920_0_1080_0@1x.png and /dev/null differ diff --git a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testPositiveValues_iOS_375_0_667_0@2x.png b/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testPositiveValues_iOS_375_0_667_0@2x.png deleted file mode 100644 index 0a30c8668c..0000000000 Binary files a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testPositiveValues_iOS_375_0_667_0@2x.png and /dev/null differ diff --git a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testPositiveValues_tvOS_1920_0_1080_0@1x.png b/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testPositiveValues_tvOS_1920_0_1080_0@1x.png deleted file mode 100644 index a3b6d33cf2..0000000000 Binary files a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testPositiveValues_tvOS_1920_0_1080_0@1x.png and /dev/null differ diff --git a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testStackedDrawValues_iOS_375_0_667_0@2x.png b/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testStackedDrawValues_iOS_375_0_667_0@2x.png deleted file mode 100644 index 6af925dcdf..0000000000 Binary files a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testStackedDrawValues_iOS_375_0_667_0@2x.png and /dev/null differ diff --git a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testStackedDrawValues_tvOS_1920_0_1080_0@1x.png b/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testStackedDrawValues_tvOS_1920_0_1080_0@1x.png deleted file mode 100644 index 26d05bd632..0000000000 Binary files a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testStackedDrawValues_tvOS_1920_0_1080_0@1x.png and /dev/null differ diff --git a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testStackedNotDrawValuesAboveBars_iOS_375_0_667_0@2x.png b/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testStackedNotDrawValuesAboveBars_iOS_375_0_667_0@2x.png deleted file mode 100644 index e4bb0d9ee3..0000000000 Binary files a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testStackedNotDrawValuesAboveBars_iOS_375_0_667_0@2x.png and /dev/null differ diff --git a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testStackedNotDrawValuesAboveBars_tvOS_1920_0_1080_0@1x.png b/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testStackedNotDrawValuesAboveBars_tvOS_1920_0_1080_0@1x.png deleted file mode 100644 index 0de93883fd..0000000000 Binary files a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testStackedNotDrawValuesAboveBars_tvOS_1920_0_1080_0@1x.png and /dev/null differ diff --git a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testStackedNotDrawValues_iOS_375_0_667_0@2x.png b/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testStackedNotDrawValues_iOS_375_0_667_0@2x.png deleted file mode 100644 index 9cc9abe59a..0000000000 Binary files a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testStackedNotDrawValues_iOS_375_0_667_0@2x.png and /dev/null differ diff --git a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testStackedNotDrawValues_tvOS_1920_0_1080_0@1x.png b/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testStackedNotDrawValues_tvOS_1920_0_1080_0@1x.png deleted file mode 100644 index b54f6c4335..0000000000 Binary files a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testStackedNotDrawValues_tvOS_1920_0_1080_0@1x.png and /dev/null differ diff --git a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testZeroValues_iOS_375_0_667_0@2x.png b/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testZeroValues_iOS_375_0_667_0@2x.png deleted file mode 100644 index 0267597461..0000000000 Binary files a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testZeroValues_iOS_375_0_667_0@2x.png and /dev/null differ diff --git a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testZeroValues_tvOS_1920_0_1080_0@1x.png b/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testZeroValues_tvOS_1920_0_1080_0@1x.png deleted file mode 100644 index 9e29303ea9..0000000000 Binary files a/Tests/ReferenceImages_64/ChartsTests.BarChartTests/testZeroValues_tvOS_1920_0_1080_0@1x.png and /dev/null differ diff --git a/Tests/ReferenceImages_64/ChartsTests.CombinedChartTests/testAllRightAxisDependency_iOS_375_0_667_0@2x.png b/Tests/ReferenceImages_64/ChartsTests.CombinedChartTests/testAllRightAxisDependency_iOS_375_0_667_0@2x.png deleted file mode 100644 index de7f99f3c7..0000000000 Binary files a/Tests/ReferenceImages_64/ChartsTests.CombinedChartTests/testAllRightAxisDependency_iOS_375_0_667_0@2x.png and /dev/null differ diff --git a/Tests/ReferenceImages_64/ChartsTests.CombinedChartTests/testAllRightAxisDependency_tvOS_1920_0_1080_0@1x.png b/Tests/ReferenceImages_64/ChartsTests.CombinedChartTests/testAllRightAxisDependency_tvOS_1920_0_1080_0@1x.png deleted file mode 100644 index 706f6598ab..0000000000 Binary files a/Tests/ReferenceImages_64/ChartsTests.CombinedChartTests/testAllRightAxisDependency_tvOS_1920_0_1080_0@1x.png and /dev/null differ diff --git a/Tests/ReferenceImages_64/ChartsTests.CombinedChartTests/testDefaultAxisDependency_iOS_375_0_667_0@2x.png b/Tests/ReferenceImages_64/ChartsTests.CombinedChartTests/testDefaultAxisDependency_iOS_375_0_667_0@2x.png deleted file mode 100644 index de7f99f3c7..0000000000 Binary files a/Tests/ReferenceImages_64/ChartsTests.CombinedChartTests/testDefaultAxisDependency_iOS_375_0_667_0@2x.png and /dev/null differ diff --git a/Tests/ReferenceImages_64/ChartsTests.CombinedChartTests/testDefaultAxisDependency_tvOS_1920_0_1080_0@1x.png b/Tests/ReferenceImages_64/ChartsTests.CombinedChartTests/testDefaultAxisDependency_tvOS_1920_0_1080_0@1x.png deleted file mode 100644 index 706f6598ab..0000000000 Binary files a/Tests/ReferenceImages_64/ChartsTests.CombinedChartTests/testDefaultAxisDependency_tvOS_1920_0_1080_0@1x.png and /dev/null differ diff --git a/Tests/ReferenceImages_64/ChartsTests.CombinedChartTests/testLeftRightAxisDependency_iOS_375_0_667_0@2x.png b/Tests/ReferenceImages_64/ChartsTests.CombinedChartTests/testLeftRightAxisDependency_iOS_375_0_667_0@2x.png deleted file mode 100644 index 9637196675..0000000000 Binary files a/Tests/ReferenceImages_64/ChartsTests.CombinedChartTests/testLeftRightAxisDependency_iOS_375_0_667_0@2x.png and /dev/null differ diff --git a/Tests/ReferenceImages_64/ChartsTests.CombinedChartTests/testLeftRightAxisDependency_tvOS_1920_0_1080_0@1x.png b/Tests/ReferenceImages_64/ChartsTests.CombinedChartTests/testLeftRightAxisDependency_tvOS_1920_0_1080_0@1x.png deleted file mode 100644 index 4a9d5f683f..0000000000 Binary files a/Tests/ReferenceImages_64/ChartsTests.CombinedChartTests/testLeftRightAxisDependency_tvOS_1920_0_1080_0@1x.png and /dev/null differ diff --git a/Tests/ReferenceImages_64/ChartsTests.HorizontalBarChartTests/testDefaultValues_iOS_375_0_667_0@2x.png b/Tests/ReferenceImages_64/ChartsTests.HorizontalBarChartTests/testDefaultValues_iOS_375_0_667_0@2x.png deleted file mode 100644 index 67bae60fc9..0000000000 Binary files a/Tests/ReferenceImages_64/ChartsTests.HorizontalBarChartTests/testDefaultValues_iOS_375_0_667_0@2x.png and /dev/null differ diff --git a/Tests/ReferenceImages_64/ChartsTests.HorizontalBarChartTests/testDefaultValues_tvOS_1920_0_1080_0@1x.png b/Tests/ReferenceImages_64/ChartsTests.HorizontalBarChartTests/testDefaultValues_tvOS_1920_0_1080_0@1x.png deleted file mode 100644 index cfa81c6b27..0000000000 Binary files a/Tests/ReferenceImages_64/ChartsTests.HorizontalBarChartTests/testDefaultValues_tvOS_1920_0_1080_0@1x.png and /dev/null differ diff --git a/Tests/ReferenceImages_64/ChartsTests.HorizontalBarChartTests/testHidesValues_iOS_375_0_667_0@2x.png b/Tests/ReferenceImages_64/ChartsTests.HorizontalBarChartTests/testHidesValues_iOS_375_0_667_0@2x.png deleted file mode 100644 index 90e0e89231..0000000000 Binary files a/Tests/ReferenceImages_64/ChartsTests.HorizontalBarChartTests/testHidesValues_iOS_375_0_667_0@2x.png and /dev/null differ diff --git a/Tests/ReferenceImages_64/ChartsTests.HorizontalBarChartTests/testHidesValues_tvOS_1920_0_1080_0@1x.png b/Tests/ReferenceImages_64/ChartsTests.HorizontalBarChartTests/testHidesValues_tvOS_1920_0_1080_0@1x.png deleted file mode 100644 index 370e141b82..0000000000 Binary files a/Tests/ReferenceImages_64/ChartsTests.HorizontalBarChartTests/testHidesValues_tvOS_1920_0_1080_0@1x.png and /dev/null differ diff --git a/Tests/ReferenceImages_64/ChartsTests.HorizontalBarChartTests/testNotDrawValueAboveBars_iOS_375_0_667_0@2x.png b/Tests/ReferenceImages_64/ChartsTests.HorizontalBarChartTests/testNotDrawValueAboveBars_iOS_375_0_667_0@2x.png deleted file mode 100644 index 66fbc7f45a..0000000000 Binary files a/Tests/ReferenceImages_64/ChartsTests.HorizontalBarChartTests/testNotDrawValueAboveBars_iOS_375_0_667_0@2x.png and /dev/null differ diff --git a/Tests/ReferenceImages_64/ChartsTests.HorizontalBarChartTests/testNotDrawValueAboveBars_tvOS_1920_0_1080_0@1x.png b/Tests/ReferenceImages_64/ChartsTests.HorizontalBarChartTests/testNotDrawValueAboveBars_tvOS_1920_0_1080_0@1x.png deleted file mode 100644 index 2b8e7ef5e4..0000000000 Binary files a/Tests/ReferenceImages_64/ChartsTests.HorizontalBarChartTests/testNotDrawValueAboveBars_tvOS_1920_0_1080_0@1x.png and /dev/null differ diff --git a/Tests/ReferenceImages_64/ChartsTests.HorizontalBarChartTests/testStackedDrawValues_iOS_375_0_667_0@2x.png b/Tests/ReferenceImages_64/ChartsTests.HorizontalBarChartTests/testStackedDrawValues_iOS_375_0_667_0@2x.png deleted file mode 100644 index 60c8c2e363..0000000000 Binary files a/Tests/ReferenceImages_64/ChartsTests.HorizontalBarChartTests/testStackedDrawValues_iOS_375_0_667_0@2x.png and /dev/null differ diff --git a/Tests/ReferenceImages_64/ChartsTests.HorizontalBarChartTests/testStackedDrawValues_tvOS_1920_0_1080_0@1x.png b/Tests/ReferenceImages_64/ChartsTests.HorizontalBarChartTests/testStackedDrawValues_tvOS_1920_0_1080_0@1x.png deleted file mode 100644 index e04192c0df..0000000000 Binary files a/Tests/ReferenceImages_64/ChartsTests.HorizontalBarChartTests/testStackedDrawValues_tvOS_1920_0_1080_0@1x.png and /dev/null differ diff --git a/Tests/ReferenceImages_64/ChartsTests.HorizontalBarChartTests/testStackedNotDrawValuesAboveBars_iOS_375_0_667_0@2x.png b/Tests/ReferenceImages_64/ChartsTests.HorizontalBarChartTests/testStackedNotDrawValuesAboveBars_iOS_375_0_667_0@2x.png deleted file mode 100644 index 697cfae5b7..0000000000 Binary files a/Tests/ReferenceImages_64/ChartsTests.HorizontalBarChartTests/testStackedNotDrawValuesAboveBars_iOS_375_0_667_0@2x.png and /dev/null differ diff --git a/Tests/ReferenceImages_64/ChartsTests.HorizontalBarChartTests/testStackedNotDrawValuesAboveBars_tvOS_1920_0_1080_0@1x.png b/Tests/ReferenceImages_64/ChartsTests.HorizontalBarChartTests/testStackedNotDrawValuesAboveBars_tvOS_1920_0_1080_0@1x.png deleted file mode 100644 index e6a04a8123..0000000000 Binary files a/Tests/ReferenceImages_64/ChartsTests.HorizontalBarChartTests/testStackedNotDrawValuesAboveBars_tvOS_1920_0_1080_0@1x.png and /dev/null differ diff --git a/Tests/ReferenceImages_64/ChartsTests.HorizontalBarChartTests/testStackedNotDrawValues_iOS_375_0_667_0@2x.png b/Tests/ReferenceImages_64/ChartsTests.HorizontalBarChartTests/testStackedNotDrawValues_iOS_375_0_667_0@2x.png deleted file mode 100644 index 08b18724c6..0000000000 Binary files a/Tests/ReferenceImages_64/ChartsTests.HorizontalBarChartTests/testStackedNotDrawValues_iOS_375_0_667_0@2x.png and /dev/null differ diff --git a/Tests/ReferenceImages_64/ChartsTests.HorizontalBarChartTests/testStackedNotDrawValues_tvOS_1920_0_1080_0@1x.png b/Tests/ReferenceImages_64/ChartsTests.HorizontalBarChartTests/testStackedNotDrawValues_tvOS_1920_0_1080_0@1x.png deleted file mode 100644 index 2969600354..0000000000 Binary files a/Tests/ReferenceImages_64/ChartsTests.HorizontalBarChartTests/testStackedNotDrawValues_tvOS_1920_0_1080_0@1x.png and /dev/null differ diff --git a/Tests/ReferenceImages_64/ChartsTests.LineChartTests/testDefaultValues_iOS_375_0_667_0@2x.png b/Tests/ReferenceImages_64/ChartsTests.LineChartTests/testDefaultValues_iOS_375_0_667_0@2x.png deleted file mode 100644 index 0bcfa84a8c..0000000000 Binary files a/Tests/ReferenceImages_64/ChartsTests.LineChartTests/testDefaultValues_iOS_375_0_667_0@2x.png and /dev/null differ diff --git a/Tests/ReferenceImages_64/ChartsTests.LineChartTests/testDefaultValues_tvOS_1920_0_1080_0@1x.png b/Tests/ReferenceImages_64/ChartsTests.LineChartTests/testDefaultValues_tvOS_1920_0_1080_0@1x.png deleted file mode 100644 index 94c78ed3e8..0000000000 Binary files a/Tests/ReferenceImages_64/ChartsTests.LineChartTests/testDefaultValues_tvOS_1920_0_1080_0@1x.png and /dev/null differ diff --git a/Tests/ReferenceImages_64/ChartsTests.LineChartTests/testDoesntDrawCircleHole_iOS_375_0_667_0@2x.png b/Tests/ReferenceImages_64/ChartsTests.LineChartTests/testDoesntDrawCircleHole_iOS_375_0_667_0@2x.png deleted file mode 100644 index ed42d1740f..0000000000 Binary files a/Tests/ReferenceImages_64/ChartsTests.LineChartTests/testDoesntDrawCircleHole_iOS_375_0_667_0@2x.png and /dev/null differ diff --git a/Tests/ReferenceImages_64/ChartsTests.LineChartTests/testDoesntDrawCircleHole_tvOS_1920_0_1080_0@1x.png b/Tests/ReferenceImages_64/ChartsTests.LineChartTests/testDoesntDrawCircleHole_tvOS_1920_0_1080_0@1x.png deleted file mode 100644 index 8f51194b2e..0000000000 Binary files a/Tests/ReferenceImages_64/ChartsTests.LineChartTests/testDoesntDrawCircleHole_tvOS_1920_0_1080_0@1x.png and /dev/null differ diff --git a/Tests/ReferenceImages_64/ChartsTests.LineChartTests/testDoesntDrawCircles_iOS_375_0_667_0@2x.png b/Tests/ReferenceImages_64/ChartsTests.LineChartTests/testDoesntDrawCircles_iOS_375_0_667_0@2x.png deleted file mode 100644 index 8ff11365ca..0000000000 Binary files a/Tests/ReferenceImages_64/ChartsTests.LineChartTests/testDoesntDrawCircles_iOS_375_0_667_0@2x.png and /dev/null differ diff --git a/Tests/ReferenceImages_64/ChartsTests.LineChartTests/testDoesntDrawCircles_tvOS_1920_0_1080_0@1x.png b/Tests/ReferenceImages_64/ChartsTests.LineChartTests/testDoesntDrawCircles_tvOS_1920_0_1080_0@1x.png deleted file mode 100644 index 733cf574ef..0000000000 Binary files a/Tests/ReferenceImages_64/ChartsTests.LineChartTests/testDoesntDrawCircles_tvOS_1920_0_1080_0@1x.png and /dev/null differ diff --git a/Tests/ReferenceImages_64/ChartsTests.LineChartTests/testDrawIcons_iOS_375_0_667_0@2x.png b/Tests/ReferenceImages_64/ChartsTests.LineChartTests/testDrawIcons_iOS_375_0_667_0@2x.png deleted file mode 100644 index 233cdd31fc..0000000000 Binary files a/Tests/ReferenceImages_64/ChartsTests.LineChartTests/testDrawIcons_iOS_375_0_667_0@2x.png and /dev/null differ diff --git a/Tests/ReferenceImages_64/ChartsTests.LineChartTests/testDrawIcons_tvOS_1920_0_1080_0@1x.png b/Tests/ReferenceImages_64/ChartsTests.LineChartTests/testDrawIcons_tvOS_1920_0_1080_0@1x.png deleted file mode 100644 index a42b7e83cf..0000000000 Binary files a/Tests/ReferenceImages_64/ChartsTests.LineChartTests/testDrawIcons_tvOS_1920_0_1080_0@1x.png and /dev/null differ diff --git a/Tests/ReferenceImages_64/ChartsTests.LineChartTests/testHidesValues_iOS_375_0_667_0@2x.png b/Tests/ReferenceImages_64/ChartsTests.LineChartTests/testHidesValues_iOS_375_0_667_0@2x.png deleted file mode 100644 index df7f9637db..0000000000 Binary files a/Tests/ReferenceImages_64/ChartsTests.LineChartTests/testHidesValues_iOS_375_0_667_0@2x.png and /dev/null differ diff --git a/Tests/ReferenceImages_64/ChartsTests.LineChartTests/testHidesValues_tvOS_1920_0_1080_0@1x.png b/Tests/ReferenceImages_64/ChartsTests.LineChartTests/testHidesValues_tvOS_1920_0_1080_0@1x.png deleted file mode 100644 index 4539e71aac..0000000000 Binary files a/Tests/ReferenceImages_64/ChartsTests.LineChartTests/testHidesValues_tvOS_1920_0_1080_0@1x.png and /dev/null differ diff --git a/Tests/ReferenceImages_64/ChartsTests.LineChartTests/testIsCubic_iOS_375_0_667_0@2x.png b/Tests/ReferenceImages_64/ChartsTests.LineChartTests/testIsCubic_iOS_375_0_667_0@2x.png deleted file mode 100644 index 17ffc30cbe..0000000000 Binary files a/Tests/ReferenceImages_64/ChartsTests.LineChartTests/testIsCubic_iOS_375_0_667_0@2x.png and /dev/null differ diff --git a/Tests/ReferenceImages_64/ChartsTests.LineChartTests/testIsCubic_tvOS_1920_0_1080_0@1x.png b/Tests/ReferenceImages_64/ChartsTests.LineChartTests/testIsCubic_tvOS_1920_0_1080_0@1x.png deleted file mode 100644 index a930e41f3c..0000000000 Binary files a/Tests/ReferenceImages_64/ChartsTests.LineChartTests/testIsCubic_tvOS_1920_0_1080_0@1x.png and /dev/null differ diff --git a/Tests/ReferenceImages_64/ChartsTests.PieChartTests/testDefaultValues_iOS_375_0_667_0@2x.png b/Tests/ReferenceImages_64/ChartsTests.PieChartTests/testDefaultValues_iOS_375_0_667_0@2x.png deleted file mode 100644 index 231fbbbe2c..0000000000 Binary files a/Tests/ReferenceImages_64/ChartsTests.PieChartTests/testDefaultValues_iOS_375_0_667_0@2x.png and /dev/null differ diff --git a/Tests/ReferenceImages_64/ChartsTests.PieChartTests/testDefaultValues_tvOS_1920_0_1080_0@1x.png b/Tests/ReferenceImages_64/ChartsTests.PieChartTests/testDefaultValues_tvOS_1920_0_1080_0@1x.png deleted file mode 100644 index 005701e06d..0000000000 Binary files a/Tests/ReferenceImages_64/ChartsTests.PieChartTests/testDefaultValues_tvOS_1920_0_1080_0@1x.png and /dev/null differ diff --git a/Tests/ReferenceImages_64/ChartsTests.PieChartTests/testDrawIcons_iOS_375_0_667_0@2x.png b/Tests/ReferenceImages_64/ChartsTests.PieChartTests/testDrawIcons_iOS_375_0_667_0@2x.png deleted file mode 100644 index d9068109d8..0000000000 Binary files a/Tests/ReferenceImages_64/ChartsTests.PieChartTests/testDrawIcons_iOS_375_0_667_0@2x.png and /dev/null differ diff --git a/Tests/ReferenceImages_64/ChartsTests.PieChartTests/testDrawIcons_tvOS_1920_0_1080_0@1x.png b/Tests/ReferenceImages_64/ChartsTests.PieChartTests/testDrawIcons_tvOS_1920_0_1080_0@1x.png deleted file mode 100644 index 4ff0b1afb4..0000000000 Binary files a/Tests/ReferenceImages_64/ChartsTests.PieChartTests/testDrawIcons_tvOS_1920_0_1080_0@1x.png and /dev/null differ diff --git a/Tests/ReferenceImages_64/ChartsTests.PieChartTests/testHideCenterLabel_iOS_375_0_667_0@2x.png b/Tests/ReferenceImages_64/ChartsTests.PieChartTests/testHideCenterLabel_iOS_375_0_667_0@2x.png deleted file mode 100644 index d71579a46e..0000000000 Binary files a/Tests/ReferenceImages_64/ChartsTests.PieChartTests/testHideCenterLabel_iOS_375_0_667_0@2x.png and /dev/null differ diff --git a/Tests/ReferenceImages_64/ChartsTests.PieChartTests/testHideCenterLabel_tvOS_1920_0_1080_0@1x.png b/Tests/ReferenceImages_64/ChartsTests.PieChartTests/testHideCenterLabel_tvOS_1920_0_1080_0@1x.png deleted file mode 100644 index bb58d49f04..0000000000 Binary files a/Tests/ReferenceImages_64/ChartsTests.PieChartTests/testHideCenterLabel_tvOS_1920_0_1080_0@1x.png and /dev/null differ diff --git a/Tests/ReferenceImages_64/ChartsTests.PieChartTests/testHidesValues_iOS_375_0_667_0@2x.png b/Tests/ReferenceImages_64/ChartsTests.PieChartTests/testHidesValues_iOS_375_0_667_0@2x.png deleted file mode 100644 index 9cc8ca4e03..0000000000 Binary files a/Tests/ReferenceImages_64/ChartsTests.PieChartTests/testHidesValues_iOS_375_0_667_0@2x.png and /dev/null differ diff --git a/Tests/ReferenceImages_64/ChartsTests.PieChartTests/testHidesValues_tvOS_1920_0_1080_0@1x.png b/Tests/ReferenceImages_64/ChartsTests.PieChartTests/testHidesValues_tvOS_1920_0_1080_0@1x.png deleted file mode 100644 index 5bf07c7a0d..0000000000 Binary files a/Tests/ReferenceImages_64/ChartsTests.PieChartTests/testHidesValues_tvOS_1920_0_1080_0@1x.png and /dev/null differ diff --git a/Tests/ReferenceImages_64/ChartsTests.PieChartTests/testHighlightDisabled_iOS_375_0_667_0@2x.png b/Tests/ReferenceImages_64/ChartsTests.PieChartTests/testHighlightDisabled_iOS_375_0_667_0@2x.png deleted file mode 100644 index 231fbbbe2c..0000000000 Binary files a/Tests/ReferenceImages_64/ChartsTests.PieChartTests/testHighlightDisabled_iOS_375_0_667_0@2x.png and /dev/null differ diff --git a/Tests/ReferenceImages_64/ChartsTests.PieChartTests/testHighlightDisabled_tvOS_1920_0_1080_0@1x.png b/Tests/ReferenceImages_64/ChartsTests.PieChartTests/testHighlightDisabled_tvOS_1920_0_1080_0@1x.png deleted file mode 100644 index 005701e06d..0000000000 Binary files a/Tests/ReferenceImages_64/ChartsTests.PieChartTests/testHighlightDisabled_tvOS_1920_0_1080_0@1x.png and /dev/null differ diff --git a/Tests/ReferenceImages_64/ChartsTests.PieChartTests/testHighlightEnabled_iOS_375_0_667_0@2x.png b/Tests/ReferenceImages_64/ChartsTests.PieChartTests/testHighlightEnabled_iOS_375_0_667_0@2x.png deleted file mode 100644 index 3d9608c435..0000000000 Binary files a/Tests/ReferenceImages_64/ChartsTests.PieChartTests/testHighlightEnabled_iOS_375_0_667_0@2x.png and /dev/null differ diff --git a/Tests/ReferenceImages_64/ChartsTests.PieChartTests/testHighlightEnabled_tvOS_1920_0_1080_0@1x.png b/Tests/ReferenceImages_64/ChartsTests.PieChartTests/testHighlightEnabled_tvOS_1920_0_1080_0@1x.png deleted file mode 100644 index b4adb17e3c..0000000000 Binary files a/Tests/ReferenceImages_64/ChartsTests.PieChartTests/testHighlightEnabled_tvOS_1920_0_1080_0@1x.png and /dev/null differ diff --git a/Tests/Supporting Files/Media.xcassets/Contents.json b/Tests/Supporting Files/Media.xcassets/Contents.json deleted file mode 100644 index da4a164c91..0000000000 --- a/Tests/Supporting Files/Media.xcassets/Contents.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/carthage.sh b/carthage.sh new file mode 100755 index 0000000000..adffae883c --- /dev/null +++ b/carthage.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash + +# carthage.sh +# Usage example: ./carthage.sh build --platform iOS + +set -euo pipefail + +xcconfig=$(mktemp /tmp/static.xcconfig.XXXXXX) +trap 'rm -f "$xcconfig"' INT TERM HUP EXIT + +# For Xcode 12 make sure EXCLUDED_ARCHS is set to arm architectures otherwise +# the build will fail on lipo due to duplicate architectures. +echo 'EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_simulator__NATIVE_ARCH_64_BIT_x86_64__XCODE_1200 = arm64 arm64e armv7 armv7s armv6 armv8' >> $xcconfig +echo 'EXCLUDED_ARCHS = $(inherited) $(EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_$(EFFECTIVE_PLATFORM_SUFFIX)__NATIVE_ARCH_64_BIT_$(NATIVE_ARCH_64_BIT)__XCODE_$(XCODE_VERSION_MAJOR))' >> $xcconfig + +export XCODE_XCCONFIG_FILE="$xcconfig" +carthage "$@" diff --git a/scripts/build-dependencies.sh b/scripts/build-dependencies.sh deleted file mode 100755 index 8f0eca0b05..0000000000 --- a/scripts/build-dependencies.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/sh - -function build_dependencies { - - has_dependencies=$(ls Carthage/Build/**/*.framework 2> /dev/null | wc -l) - - if [ $has_dependencies != 0 ] - then - echo "Depencies have already been built." - else - echo "Building dependencies..." - carthage bootstrap - fi -} - -function alert_to_install_carthage { - echo "error: Carthage was not found! In order to build Charts you need to use Carthage to build its dependencies. Carthage can be downloaded from https://github.com/Carthage/Carthage." - exit 1 -} - -if hash carthage 2>/dev/null -then - build_dependencies -else - alert_to_install_carthage -fi diff --git a/scripts/copy-carthage-frameworks.sh b/scripts/copy-carthage-frameworks.sh deleted file mode 100755 index 435f2c32ea..0000000000 --- a/scripts/copy-carthage-frameworks.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh - -case "$PLATFORM_NAME" in - macosx) plat=Mac;; - iphone*) plat=iOS;; - watch*) plat=watchOS;; - appletv*) plat=tvOS;; - *) echo "error: Unknown PLATFORM_NAME: $PLATFORM_NAME"; exit 1;; -esac - -for (( n = 0; n < SCRIPT_INPUT_FILE_COUNT; n++ )); do - VAR=SCRIPT_INPUT_FILE_$n - framework=$(basename "${!VAR}") - export SCRIPT_INPUT_FILE_$n="$SRCROOT"/Carthage/Build/$plat/"$framework" -done - -/usr/local/bin/carthage copy-frameworks || exit - -for (( n = 0; n < SCRIPT_INPUT_FILE_COUNT; n++ )); do - VAR=SCRIPT_INPUT_FILE_$n - source=${!VAR}.dSYM - dest=${BUILT_PRODUCTS_DIR}/$(basename "$source") - ditto "$source" "$dest" || exit -done \ No newline at end of file