Compare commits

..

489 Commits

Author SHA1 Message Date
terryworona 52c8d632b7 Updated readme 2016-01-21 13:28:43 -08:00
terryworona 59eebf6015 even more cleanup 2016-01-21 13:21:45 -08:00
terryworona 036c01dc03 More naming convention fixes 2016-01-21 13:18:15 -08:00
terryworona 063079f171 Fixed datasource naming conventions 2016-01-21 13:15:33 -08:00
terryworona dc56268f29 exposed dot dimming value 2016-01-21 13:13:48 -08:00
terryworona f56b539fe4 change log and pod spec 2016-01-20 15:25:41 -08:00
terryworona e4b0820418 Fixed one more warning 2016-01-20 15:22:20 -08:00
terryworona d30d5b9c96 Updated change log 2016-01-20 14:55:17 -08:00
terryworona 8db9d7baaf Updated pod spec 2016-01-20 14:54:24 -08:00
terryworona d49515c97e Fixed warnings 2016-01-20 14:53:04 -08:00
terryworona 7dfcd44d8c Updated change log and pod spec 2016-01-20 14:31:01 -08:00
terryworona 4e511f7164 Fixed #197 2016-01-20 14:25:49 -08:00
terryworona cd2c79ffa7 new version 2016-01-18 20:19:43 -08:00
terryworona fb2a7eeddd Merge pull request #196 from yasuoza/explicit_dependencies_import
Make sure to import dependent framework header explicitly
2016-01-18 20:18:18 -08:00
Yasuharu Ozaki 2268aed332 Make sure to import dependent frameworks explicitly 2016-01-18 14:32:35 +09:00
terryworona 4eacbe3696 Updated pod spec and change log 2016-01-15 18:43:11 -08:00
terryworona 9842010481 More warning fixes 2016-01-15 18:37:04 -08:00
terryworona 94bb2dcd74 Cleaning up warnings 2016-01-15 18:20:37 -08:00
terryworona 59e84471ae Updated change log 2016-01-14 18:30:39 -08:00
terryworona b4de0170bc Updated pod spec 2016-01-14 18:26:56 -08:00
terryworona 0b87b394d5 Typo 2016-01-14 15:28:14 -08:00
terryworona 4d8339e5a0 Merge pull request #195 from Jawbone/reload-animated
JBChartView 3.0
2016-01-14 15:25:42 -08:00
terryworona 389d62c3a3 Removed unused folder 2016-01-12 23:22:15 -08:00
terryworona 56ba13a6c9 Cleaning up demo classes 2016-01-12 20:39:30 -08:00
terryworona bc92697057 Fixed gradient fill bug 2015-12-31 17:02:48 -08:00
terryworona fe4b092c93 more edits 2015-12-30 19:53:08 -08:00
terryworona ce4804d312 more updates 2015-12-30 19:51:34 -08:00
terryworona 9f667c36ee customization updates to readme 2015-12-30 19:49:24 -08:00
terryworona 693a202cb3 Note on line fill limitations 2015-12-30 19:02:17 -08:00
terryworona 463378ea05 edits 2015-12-30 18:57:11 -08:00
terryworona 29a3d41153 Added reloadData animated notes 2015-12-30 18:56:16 -08:00
terryworona 3f679eec13 even more refactors 2015-12-30 18:29:46 -08:00
terryworona db4b7daf63 general refactors and cleanup 2015-12-30 18:23:31 -08:00
terryworona 2bae885a90 Do not animate fill paths 2015-12-29 10:31:27 -08:00
terryworona 7de33f9b35 finally fixed project structure 2015-12-28 15:19:24 -08:00
terryworona ce2cda8169 Fixed shape path stroke glitch 2015-12-28 15:08:29 -08:00
terryworona 2fc1655e38 fixed messed up commit 2015-12-28 15:04:57 -08:00
terryworona ae753b0143 Fixed project structure 2015-12-28 14:29:15 -08:00
terryworona e75a9322ab Updated gradient alpha comments 2015-12-28 14:12:05 -08:00
terryworona aba0069c5b Fixed gradient alphas (comments to come) 2015-12-28 14:05:32 -08:00
terryworona af8d0f8034 fill animations (not working, thanks Apple) 2015-12-28 13:13:24 -08:00
terryworona 1beb08c624 More cleanup 2015-12-28 12:58:34 -08:00
terryworona 3c4d63c923 More cleanup 2015-12-28 12:34:07 -08:00
terryworona e070aa6adf more line cleanup 2015-12-28 12:30:14 -08:00
terryworona 0fb01f8e68 Fixed reload checks 2015-12-28 12:15:33 -08:00
Terry Worona 749f7ae791 More cleanup 2015-12-26 18:57:07 -05:00
Terry Worona 3585fd1931 removed unnecessary datasource functions 2015-12-26 18:47:37 -05:00
Terry Worona 17935febb6 lines view delegate to ds 2015-12-26 01:11:30 -05:00
Terry Worona 248de92212 dots view delegate to ds 2015-12-26 01:03:29 -05:00
Terry Worona 9cd945c23b more cleanup 2015-12-26 00:57:00 -05:00
Terry Worona e43db2cbb1 More refactors 2015-12-26 00:48:01 -05:00
Terry Worona d1b7c13e8c More class refactors 2015-12-26 00:11:01 -05:00
Terry Worona 95e5750400 moved gradient layer 2015-12-25 23:29:32 -05:00
Terry Worona c8493610f5 moving some libraries around 2015-12-25 23:23:12 -05:00
Terry Worona 48879d8bb7 more rework 2015-12-25 23:10:32 -05:00
Terry Worona 403d067112 more refactor 2015-12-25 23:04:24 -05:00
Terry Worona 03d8a003ff more refactor 2015-12-25 22:41:03 -05:00
Terry Worona 6a67d26823 bar chart datasource 2015-12-25 22:31:23 -05:00
Terry Worona 435a2f10c3 More cleanup 2015-12-25 22:23:20 -05:00
Terry Worona 12850655ad removed cruft 2015-12-24 23:23:45 -05:00
Terry Worona d5636cc52e reuse gradient layers on reload 2015-12-24 23:21:14 -05:00
Terry Worona 8c39279ac6 constant cleanup 2015-12-24 22:18:23 -05:00
Terry Worona 16a8050282 Fixed crashers 2015-12-24 22:02:29 -05:00
Terry Worona 3489cfc55a More refactor 2015-12-24 21:49:16 -05:00
Terry Worona 2445b49f63 gradients working again 2015-12-24 19:47:06 -05:00
Terry Worona a0cfae180d More refactor progress 2015-12-24 18:31:47 -05:00
Terry Worona 60f805c57e Major refactor of line chart data model 2015-12-24 17:10:48 -05:00
terryworona 532d4da903 more cleanup 2015-12-17 19:45:05 -08:00
terryworona ec39feec10 Cleanup 2015-12-17 19:44:55 -08:00
terryworona 1a79f12190 more restructure and cleanup 2015-12-17 19:08:03 -08:00
terryworona 9a1e6c6671 Big refactors of line data model and helpers 2015-12-17 18:49:21 -08:00
terryworona 0f1944be24 Merge branch 'master' of https://github.com/Jawbone/JBChartView into reload-animated 2015-12-17 13:53:26 -08:00
terryworona 5cb25a0a5b update changelog and podspec 2015-12-16 20:55:23 -08:00
terryworona e7c84aa4de Fixed #192 2015-12-16 20:53:31 -08:00
terryworona e8fda5bcf5 Experimenting! 2015-12-16 20:05:09 -08:00
terryworona c9f3012e5c Getter cleanup 2015-12-15 21:30:39 -08:00
terryworona 880d85adda Gradient layer cleanup 2015-12-15 21:27:41 -08:00
terryworona d5f2782308 ignore touches and state changes when reloading 2015-12-15 19:28:03 -08:00
terryworona e40620498e starting to animate line charts 2015-12-15 19:22:58 -08:00
terryworona d3ee78fb6d Added bar chart animated reloads 2015-12-15 18:23:00 -08:00
terryworona b7f7324d96 updated pod spec and change log 2015-12-04 17:38:38 -08:00
terryworona 78b2aa1964 Fixed up gradient bars 2015-12-04 15:22:59 -08:00
terryworona d9ab659422 Updated readme 2015-12-04 15:14:26 -08:00
terryworona 71df60f9a3 added bar chart gradient support 2015-12-04 14:30:47 -08:00
terryworona 728b9420a9 Fixed crasher 2015-12-04 13:04:12 -08:00
terryworona fe42e4f61d PR cleanup 2015-12-04 13:02:16 -08:00
terryworona 45cf0d66ba Merge with master 2015-12-03 17:48:25 -08:00
Terry Worona 5aecb0ba92 Fixed readme typo 2015-11-22 19:13:52 -08:00
Terry Worona 6f14f4099f Updated pod spec and change log 2015-11-22 19:01:36 -08:00
Terry Worona 9fa369ce8d Updated pod spec 2015-11-22 18:59:49 -08:00
Terry Worona 9828034f6b Fixed #94 2015-11-22 18:52:54 -08:00
Terry Worona 58f57fcef2 new version 2015-11-22 13:31:25 -08:00
Terry Worona 78390657d7 Added iPhone 6 support for demo app 2015-11-22 13:17:58 -08:00
Terry Worona 87a5de93af Updated readme 2015-11-22 13:09:50 -08:00
Terry Worona edfca9b780 Moving customization readme 2015-11-22 12:50:02 -08:00
Terry Worona 14c7aa7c98 Updated change log 2015-11-22 12:47:05 -08:00
terryworona b928cd1849 Fixed #159 for real this time 2015-11-20 18:13:19 -08:00
terryworona 2d6c6e291d More cleanup 2015-11-20 17:57:22 -08:00
terryworona 5addeeae83 Spacing 2015-11-20 16:58:30 -08:00
terryworona ec14cc002e Reverted #153 (won't enhance) 2015-11-20 16:47:32 -08:00
terryworona e3174efa9e Fixed #159 2015-11-20 16:08:56 -08:00
terryworona 4a1380668e Enhancement #153 2015-11-20 15:10:52 -08:00
terryworona 3752b7d598 Hide vertical selection when touches begin. 2015-11-19 09:51:26 -08:00
terryworona e1d10ffb7e Updated readme for 185 2015-11-18 17:28:07 -08:00
terryworona f2e5641d58 Fixed #185 2015-11-18 17:23:04 -08:00
terryworona b0c68377a3 Fixed #146 2015-11-18 15:32:01 -08:00
terryworona d3cb39b566 Updated project for iOS 9 support 2015-11-18 14:35:32 -08:00
terryworona 99f727c0d6 updated changelog and pod spec 2015-09-18 11:44:35 -07:00
terryworona b6bc9c29ca readme and comment 2015-09-18 11:41:05 -07:00
terryworona 124eabe98c Merge pull request #188 from andrewloyola/line-chart-touch-ignore
Delegate call to ignore touches on selected lines
2015-09-18 11:30:20 -07:00
Andrew Loyola 1f0f3351c3 Delegate call do ignore touches on selected lines
If you want to display more lines than are touchable, you can use this to ignore certain line indices
2015-09-18 11:20:50 -04:00
Terry Worona 5f8863ede1 updated changeling 2015-08-12 09:07:14 -07:00
Terry Worona bf8d5de61e updated pod spec 2015-08-12 08:49:11 -07:00
Terry Worona 23935a3b55 small cleanup 2015-08-12 08:47:26 -07:00
terryworona f7d15d4905 Merge pull request #183 from 0xPr0xy/master
Return the available height instead of 0
2015-08-12 08:43:08 -07:00
Peter IJlst 372b69ff4a Merge branch 'release/fix-invisible-bars' 2015-08-12 09:16:22 +02:00
Peter IJlst b17a37c1d7 in normalizedHeightForRawHeight () method return availableHeight instead of 0.
Fixes: http://stackoverflow.com/questions/24123794/color-of-bar-chart-not-displaying-in-jbchartview
2015-08-12 09:12:33 +02:00
Ben Norris 69ce275d1a Adds support for gradients to line charts 2015-06-17 13:55:19 -06:00
terryworona a1f34f78fb updated changelog and pod spec 2015-04-30 15:20:27 -07:00
terryworona 15e73af3b3 Merge pull request #165 from eventualbuddha/nil-delegate-and-datasource-on-dealloc
Nil out delegate and datasource on dealloc
2015-04-30 15:13:33 -07:00
Brian Donovan aac41605aa Add dealloc methods to the demos.
This is proper Cocoa etiquette and may help others prevent crashes in
their own apps.
2015-04-30 11:48:47 -07:00
Brian Donovan 0bfc904f58 Ensure our own subviews with a delegate are cleaned up.
This can potentially cause a crash if the `linesView` or `dotsView`
were to send a message to its delegate after the delegate was dealloc’d.
2015-04-30 11:45:25 -07:00
terryworona b54f27e67d Updated changelog and podspec 2015-04-16 11:54:01 -07:00
terryworona ff17a56eff Fixes #157 2015-04-16 11:52:27 -07:00
terryworona 93d98d7b87 updated changeling and pod spec 2015-04-13 12:48:49 -07:00
terryworona ba0a44ba3f Fixed radius width on demo line charts 2015-04-13 11:54:53 -07:00
terryworona 621e9a7386 removed extra synthesize calls for #154 2015-04-13 11:44:21 -07:00
terryworona 28ad5d7557 Merge pull request #154 from amro/master
Fix warnings when building w/ Xcode 6.3
2015-04-13 11:37:32 -07:00
Amro Mousa d299cd6e7e Fix warnings in Xcode 6.3
These warnings are problematic for those who
build with warnings as errors.
2015-04-09 09:43:18 -07:00
Terry Worona abf14f342a Updated readme for issue #150 2015-04-01 12:33:11 -07:00
Terry Worona 299405efe1 Updated pod spec 2015-03-30 20:07:03 -07:00
Terry Worona 27ebf131c9 Updated changelog 2015-03-30 19:07:34 -07:00
Terry Worona e3c8fb2794 Fixes #118 - access to bar and dot views 2015-03-30 19:03:44 -07:00
Terry Worona 93bea88b47 updated readme and header comments for #99 2015-03-30 16:03:45 -07:00
Terry Worona fe7f8bbae7 Fixes issue #99 - radius is now a true dot radius (not diameter) 2015-03-30 15:59:34 -07:00
Terry Worona 394bb70599 Cleaned up pr 143 2015-03-30 15:19:48 -07:00
terryworona 4e1411c302 Merge pull request #143 from ADVSENSOR/empty_data
Fix crash and warnings that can occur when a chart line has no data
2015-03-30 15:15:48 -07:00
Terry Worona 21bc7d3a3e List updates 2015-03-30 15:09:31 -07:00
terryworona 21dc1d004a Merge pull request #144 from ADVSENSOR/tooltip_zorder
Keep tooltip subviews above line subviews
2015-03-30 14:21:25 -07:00
Terry Worona 40e4434e18 Readme update 2015-03-30 14:13:04 -07:00
Terry Worona ac3c379af4 Code cleanup 2015-03-30 14:12:07 -07:00
Terry Worona 2c803e87dd cleaned up strings 2015-03-30 14:09:58 -07:00
Terry Worona 7efeaa1ef1 updated line chart docs 2015-03-30 14:04:35 -07:00
Terry Worona a454e221a6 Updated readme 2015-03-30 14:02:52 -07:00
terryworona 7046cf7045 Merge pull request #116 from sebastianreloaded/missing_values
Add ability to have the line start or end at any given point
2015-03-30 13:56:08 -07:00
terryworona e4b0fddd16 Merge pull request #142 from skywinder/add-change-log-file
Add automatically generated change log file.
2015-03-30 13:46:29 -07:00
Sebastian Opel b1c632f5a3 added docu in readme 2015-03-25 11:56:51 +01:00
Sebastian Opel 162619b825 coding style fixes 2015-03-17 10:45:37 +01:00
Sebastian Opel 32cbb39d0b if all points are NAN no need to continue the path 2015-03-17 10:43:46 +01:00
Trevor Harmon 3a0fac18c5 Keep tooltip subviews above line subviews 2015-03-07 16:43:51 -08:00
Trevor Harmon 4c0a22d962 Fix crash and warnings that can occur when a chart line has no data 2015-03-07 14:27:24 -08:00
Petr Korolev 76c1c41886 Added automatically generated change log file 2015-03-05 15:29:07 +02:00
Terry Worona e3b8ccd704 Fixed #140 2015-03-04 22:34:39 -08:00
terryworona b179f20ef9 Merge pull request #127 from paal123/patch-1
Update README.md
2014-11-25 08:56:52 -08:00
paal123 d89472dea5 Update README.md
Removed a small typo resulting in errors during execution.
2014-11-25 16:12:02 +01:00
Sebastian Opel 907a4f25ae added missing points to new example fake data 2014-10-23 17:08:03 +02:00
Sebastian Opel 51454fe3f6 added a copy of linechart example as a new example for missing points 2014-10-23 17:06:09 +02:00
Sebastian Opel 131f251df8 added handling of missing values within a linechart
JBLineChartView uses numberOfVerticalValuesAtLineIndex to define the number
of points, but subsequently requires that all chartPoints have a value anyway.
This commit allows you to use NAN within the charts data.
2014-10-23 16:44:44 +02:00
Terry Worona 64451dd5ac pod spec and read me updates 2014-09-22 19:05:18 -07:00
Terry Worona 36d72ce510 change log and comments 2014-09-22 19:03:25 -07:00
Terry Worona efd8f97335 Removed changes for setFrame 2014-09-22 19:00:10 -07:00
Terry Worona 243c28cffb update to change log, read me, pod spec, etc 2014-09-22 11:18:11 -07:00
Terry Worona 66bf3b14e8 Fixed #111 2014-09-22 11:16:48 -07:00
Terry Worona 7287712da3 More cleanup of compiler warnings on iOS 8 2014-09-22 11:11:32 -07:00
Terry Worona e71db56a76 updated read me, change log, etc 2014-09-19 19:41:52 -07:00
Terry Worona 4be903eda7 fixed some compiler warnings 2014-09-19 19:35:37 -07:00
Terry Worona d5210eff99 Updated read me, change log and pod spec 2014-09-08 22:35:27 -07:00
Terry Worona 956386c7db Cleanup 2014-09-08 22:17:52 -07:00
terryworona c6dfb48047 Merge pull request #106 from eventualbuddha/reduce-numberOfLinesInLineChartView-calls
Only call `numberOfLinesInLineChartView:` once per loop.
2014-09-08 22:17:06 -07:00
terryworona fff2bd22d6 Merge pull request #107 from thefirstnikhil/master
iOS Framework Support
2014-09-08 22:08:46 -07:00
Nikhil Kalra 23e8e3084a iOS Framework Support
Added a UIKit import statement for use when JBChartView is added to a
Xcode project as a framework (iOS 8).
2014-09-05 21:48:15 -07:00
Brian Donovan d04eaa2622 Only call numberOfLinesInLineChartView: once per loop. 2014-09-05 11:18:21 -07:00
Terry Worona e24d2487f1 updated pod spec 2014-08-29 15:23:25 -07:00
Terry Worona d3a92dd70f updated read me and change log fixed issue #100 2014-08-29 15:22:56 -07:00
Terry Worona c73f494034 added custom dot view hide functionality on selection events 2014-08-29 15:19:49 -07:00
Terry Worona 80708acda1 Updated pod spec 2014-08-28 14:52:58 -07:00
Terry Worona 6308ee1b19 Updated read me and change log 2014-08-28 14:50:42 -07:00
Terry Worona 62965bbd9f Finished line chart padding extension properties 2014-08-28 13:51:33 -07:00
Terry Worona 06bf8b5033 Finished bar chart padding extension properties 2014-08-28 13:37:39 -07:00
Terry Worona c2a16d0fbb added optional protocol for footer/header padding extensions 2014-08-28 13:24:13 -07:00
Terry Worona 9548b2ab32 Don't extend selection views into padding 2014-08-28 13:14:58 -07:00
Terry Worona 295fb40a0b Fixed up bar charts to utilize padding properly 2014-08-28 13:01:57 -07:00
Terry Worona e29ebd39ab Updated line chart view for footer padding 2014-08-28 12:10:35 -07:00
Terry Worona 27b0493b9b Added footer padding property and updated bar chart to use it 2014-08-28 12:00:04 -07:00
Terry Worona 04f40aac1a Updated read me 2014-08-27 11:35:42 -07:00
Terry Worona 833f6e9080 Fixed issue #97 2014-08-27 11:27:58 -07:00
Terry Worona eb48db2e73 Updated comment 2014-08-27 11:21:45 -07:00
Terry Worona 55b6dae956 Cleaned up bar pop animations 2014-08-27 11:19:45 -07:00
Terry Worona c44b276ae1 fixed vertical selection adjustment 2014-08-26 19:14:15 -07:00
Terry Worona 93f3d1862e simplified bar chart animations and added invert flag 2014-08-26 19:02:06 -07:00
Terry Worona 19a4a0bf5c Updated pod spec 2014-08-26 15:49:59 -07:00
Terry Worona 9d43c6dd23 updated read me and pod spec 2014-08-26 15:49:21 -07:00
Terry Worona 8598ff1488 Fixed issue #93 2014-08-26 15:46:03 -07:00
Terry Worona b9d28bfd59 Updated pod spec 2014-08-26 15:40:00 -07:00
Terry Worona dd1dce758e updated read me and change log 2014-08-26 15:39:25 -07:00
Terry Worona 9fce2fc1c0 Fixed #95 2014-08-26 15:35:40 -07:00
Terry Worona ab1cf713e6 Fixed bar chart selection view for non-homogenous bar widths 2014-08-26 15:29:05 -07:00
Terry Worona 4363147303 updated read me 2014-08-22 18:19:34 -07:00
Terry Worona 8a1770c6df Updated pod spec 2014-08-22 18:13:52 -07:00
Terry Worona f84f322598 updated read me 2014-08-22 18:13:20 -07:00
Terry Worona 04e1aa5b98 Hide custom dots on selector for now 2014-08-22 18:10:30 -07:00
Terry Worona ab07aa2399 Fixed padding issues 2014-08-22 15:36:08 -07:00
Terry Worona f01e11a0e2 Added custom dot views to line chart 2014-08-22 14:21:06 -07:00
Terry Worona 76984c7c7c added protocols for custom dots 2014-08-22 12:07:09 -07:00
Terry Worona d38a04a70d Added dot radius on a per horizontal index basis 2014-08-22 11:52:53 -07:00
Terry Worona 385d5b3589 Updated pod spec 2014-08-14 19:26:18 -07:00
Terry Worona 90100c7277 updated read me and change log 2014-08-14 19:25:39 -07:00
Terry Worona eca1c0507e Cleaned up PR #90 2014-08-14 19:23:19 -07:00
terryworona ac870e45ce Merge pull request #90 from mszaro/master
Add per-line vertical selection color support.
2014-08-14 19:17:19 -07:00
mszaro 74f588b7e6 Update comment. 2014-08-14 18:51:48 -07:00
mszaro 406b64ae0c Implement per-line vertical selection colors 2014-08-14 18:50:55 -07:00
Terry Worona 92e56d78c5 updates specs and read me 2014-08-14 18:01:04 -07:00
Terry Worona 36ec328346 Fixed issue #89 2014-08-14 17:57:39 -07:00
Terry Worona b763ae540c updated version 2014-08-07 13:33:46 -07:00
Terry Worona 7ffdf6d9da Fixed issue #83 2014-08-07 13:30:48 -07:00
Terry Worona 6531c68574 version update 2014-08-04 13:37:33 -07:00
Terry Worona ebae36bd2f Pushed base datasource and delegate protocols up to JBChartView (for extensibility) 2014-08-04 13:17:04 -07:00
Terry Worona 8cdff2891c Updated version 2014-08-04 10:15:05 -07:00
Terry Worona 333200d041 Fixed issue #77 2014-08-04 10:13:05 -07:00
Terry Worona 6ad3bd7692 Readme update 2014-08-02 12:20:25 -07:00
Terry Worona 3531e593da update change log, read me, pod spec 2014-08-02 12:13:12 -07:00
Terry Worona eeb9ca604c More refactors 2014-08-02 12:02:01 -07:00
Terry Worona b884108dbb More line chart refactors 2014-08-02 11:46:25 -07:00
Terry Worona 00dd74f733 Started JBLineChartView refactor 2014-08-02 11:22:58 -07:00
Terry Worona c1938147d8 Cleaned up warning 2014-08-02 11:17:09 -07:00
Terry Worona e17c5419f4 Refactor JBBarChartView datasource and delegate 2014-08-02 11:14:36 -07:00
Terry Worona d0cb8b0307 Updated pod spec 2014-07-31 13:30:53 -07:00
Terry Worona fe81df094e Updated change log and read me 2014-07-31 13:29:58 -07:00
Terry Worona 0dae570cc6 Fixed line width bug for JBLineChartView 2014-07-31 13:28:07 -07:00
Terry Worona c5c93cb660 update version, read me, pod spec 2014-07-25 16:43:34 -07:00
Terry Worona 3df69b0a9c more demo chart cleanup 2014-07-25 16:19:28 -07:00
Terry Worona 30305cdde9 String cleanup 2014-07-25 16:12:00 -07:00
Terry Worona 8e1cbba06f Fixed chart coloring 2014-07-25 16:00:07 -07:00
Terry Worona 97e5acdb1a added area controller and assets 2014-07-25 15:55:48 -07:00
Terry Worona 47f1f0ba8d Reverted base to iOS 6 2014-07-25 15:22:08 -07:00
Terry Worona 0be9465049 Fixed OS checks 2014-07-25 15:18:47 -07:00
Terry Worona 7bed3dd5d0 updated pod spec, change log and read me 2014-07-25 14:18:23 -07:00
Luo Sheng 4f1f6760d5 Update the Podspec. 2014-07-25 12:28:33 +08:00
Luo Sheng 8103a1aea4 Make the demo run in iOS 6 too. 2014-07-25 12:27:51 +08:00
Luo Sheng dc6dc647ad Use sizeWithFont: method for iOS 6. 2014-07-25 12:23:26 +08:00
Terry Worona b6ea1a502a Updated pod spec 2014-07-24 16:20:10 -07:00
Terry Worona afcf328158 Fixed readme 2014-07-24 15:43:47 -07:00
Terry Worona 49cf12c568 updated read me and change log of fill functions 2014-07-24 15:39:37 -07:00
Terry Worona 0d4b942b74 Merge branch 'master' of https://github.com/Jawbone/JBChartView 2014-07-24 15:25:22 -07:00
Terry Worona 30a369796f Minor cleanup of PR #71 2014-07-24 15:25:15 -07:00
Terry Worona f2f35312e4 Updated read me 2014-07-24 14:32:22 -07:00
terryworona d32f09a584 Merge pull request #67 from jonparker/master
Added documentation for usage in a Swift project
2014-07-18 11:15:44 -07:00
Damien Legrand 80e179df1d Fill Color
Fill color for line chart :
* Default color is clearColor
* The user can define a color and a selection color for each line with
two new methods in JBLineChartViewDataSource protocol
2014-07-17 17:38:24 +02:00
Terry Worona 48da335f09 added spark friends link 2014-06-30 19:24:06 -07:00
Terry Worona 70c1fb897c added more demos section 2014-06-24 13:05:52 -07:00
Terry Worona 30df02f804 screen update 2014-06-24 12:58:50 -07:00
Terry Worona 9ba20e9e14 updated screenshot 2014-06-24 12:52:37 -07:00
Terry Worona d6d1dd8461 Updated screenshot 2014-06-24 12:21:21 -07:00
Jonathan Parker b0de620503 Added link to iOS documentation. 2014-06-23 15:49:26 +10:00
Jonathan Parker 8e81fb20cd Added instructions for use in a Swift project. 2014-06-23 15:46:37 +10:00
Terry Worona a303422d8e updated read me, pod spec, etc 2014-05-13 19:44:52 -07:00
Terry Worona 1aff68557f Cleaned up demo code and add min value to bar charts 2014-05-13 19:42:14 -07:00
terryworona ac3744c0c9 Merge pull request #57 from pala/master
Fixed barView's frame.
2014-05-13 19:33:55 -07:00
Tao Zhang a6ea0c30f8 Update JBBarChartView.m 2014-05-13 21:56:02 -04:00
pala ea531e3cb1 Fixed barView's frame. 2014-05-13 19:42:06 -04:00
terryworona b1a3ebd4ed Merge pull request #55 from pala/patch-1
Update sample code in readme
2014-05-13 10:39:24 -07:00
Tao Zhang 554f93f3d3 Update sample code 2014-05-12 23:41:25 -04:00
Terry Worona 2ddd38fc9d updated change log 2014-05-07 09:55:10 -07:00
Terry Worona 6691f7a8c3 Updated comment, read me, pod spec, etc 2014-05-07 09:47:32 -07:00
terryworona c015531c85 Merge pull request #53 from skywinder/bar-color-delegate
Add delegate method barChartView:colorForBarViewAtIndex: to JBBarChartViewDataSource
2014-05-07 09:40:43 -07:00
terryworona 3d036edc96 Merge pull request #52 from skywinder/compiling-warrnings-and-typos
Compiling warrnings and typos
2014-05-07 09:36:48 -07:00
Petr Korolev 85c30351fe Add new delegate method to JBBarChartView
Implement logic to set specifed color before set the default kJBBarChartViewDefaultBarColor
Add call of this code to Example project
2014-05-07 15:33:50 +03:00
Petr Korolev d37383a352 fix typo 2014-05-07 14:59:34 +03:00
Petr Korolev 3c6cf24cf7 Cast to correct return type (NSUInteger) 2014-05-07 14:37:28 +03:00
Terry Worona 8dbb2679ee Updated log, spec and read me 2014-05-06 14:05:24 -07:00
Terry Worona 867466d1d1 More more compile error 2014-05-06 14:04:17 -07:00
Terry Worona 2046131143 Updated read me, pod spec, etc. 2014-05-06 13:40:21 -07:00
Terry Worona 208a727d88 Fixed compiler warnings 2014-05-06 13:38:24 -07:00
Terry Worona 43c6e9486f Updated version, pod spec, etc 2014-05-05 12:33:39 -07:00
Terry Worona 49206a01ed Fixed issue #48 2014-05-05 12:31:12 -07:00
Terry Worona e2b17820bf readme updates 2014-05-04 14:47:21 -07:00
Terry Worona b59904e5b9 updated for new version 2014-05-04 14:45:27 -07:00
Terry Worona 1d8f78d751 Fixed issue #48 2014-05-04 14:07:27 -07:00
Terry Worona 3cc39124b8 updated version 2014-05-04 09:48:10 -07:00
terryworona bedd7e2c71 Merge pull request #49 from simonnickel/master
fixed typo, renamed mininum -> minimum
2014-05-04 09:44:03 -07:00
Simon Nickel 786af91666 fixed typo, renamed mininum -> minimum 2014-05-03 22:18:42 +02:00
Terry Worona b7927cddb7 Fixes issue #46 2014-04-30 22:58:47 -07:00
Terry Worona 0f2d4d766c updated change log, pod spec, etc 2014-04-30 10:04:01 -07:00
terryworona 64de3e6e23 Merge pull request #45 from ktran03/smoothCurveFix
Smooth curve fix
2014-04-30 09:59:22 -07:00
ktran03 87fb8ee7b8 missing variable in condition 2014-04-29 22:03:40 -04:00
ktran03 7c0dfe3eb5 smooth curve fix for more straight line cases 2014-04-29 21:55:47 -04:00
Terry Worona 87b62ad2b1 updated change log, pod spec, read me 2014-04-28 12:06:03 -07:00
Terry Worona 9c0d788418 More style updates 2014-04-28 12:00:59 -07:00
Terry Worona de009f0236 PR #39 cleanup 2014-04-28 11:25:45 -07:00
ktran03 d46e4fe14d changed compare condition to using slope instead of vertical diff 2014-04-26 18:32:40 -04:00
ktran03 236336fdf3 added check for y-value difference if exceeds threshold 2014-04-25 15:14:16 -04:00
ktran03 9b60a1d662 Expose smooth option through delegate, fix diffs 2014-04-24 14:35:54 -04:00
ktran03 3700b4e2e2 smooth curve using bezierpath 2014-04-19 20:15:53 -04:00
Terry Worona 8c03033a1c Added screenshot to pod spec 2014-04-18 10:14:42 -07:00
Terry Worona bb084b1b89 Fixes issue #34 2014-04-17 18:32:58 -07:00
Terry Worona 1c7c8b2e52 Updated read me, pod spec etc for new version 2014-04-14 10:36:07 -07:00
Terry Worona 79a57d98e3 Clamp selection width to width of chart 2014-04-14 10:32:50 -07:00
Terry Worona 20d6b6081b Fixed comment 2014-04-14 10:30:24 -07:00
terryworona 20bbbdcc86 Merge pull request #37 from veducm/master
Added delegate method to configure the width of the vertical selection bar in a line chart.
2014-04-14 10:27:51 -07:00
Edu Caselles 51ac8a1d63 Added delegate method to configure the width of the vertical selection bar in a line chart. 2014-04-14 01:35:20 +02:00
Terry Worona 68d04a2cdb Fixes issue #36 2014-04-12 09:11:41 -07:00
Terry Worona b7734ef189 Updated for new version 2014-04-11 15:02:46 -07:00
Terry Worona f6d2fe8b62 Fixed issue #33 2014-04-11 15:00:33 -07:00
Terry Worona 5c9679f448 updated read me, etc for new version 2014-04-10 16:18:52 -07:00
Terry Worona 037225a386 Fixed issue #30 2014-04-10 16:15:28 -07:00
terryworona 0fe979bd22 Merge pull request #30 from gumbypp/master
JBChartView: needs initWithCoder initializer for inflation from a xib
2014-04-10 16:13:34 -07:00
Dale Low 31b64ed7e4 JBChartView: needs initWithCoder initializer for inflation from a xib 2014-04-10 16:00:27 -07:00
Terry Worona c30398c3ea Updated readme 2014-04-10 13:23:26 -07:00
Terry Worona bc08322a3a Updated version 2014-04-10 13:13:38 -07:00
Terry Worona 213973f4ed Fixing line chart padding calculations for custom dot radius 2014-04-10 11:20:16 -07:00
Terry Worona 28d40bcb31 Added dot radius callbacks for line charts 2014-04-10 10:58:47 -07:00
Terry Worona d4df0184a2 Updated change log, pod spec and read me 2014-04-03 14:49:36 -07:00
Terry Worona 4f313aab80 Added state force setters 2014-04-03 14:48:01 -07:00
Terry Worona b6262462c5 Updated pod spec change log and read me 2014-04-02 11:49:52 -07:00
Terry Worona 1080089753 Added dynamic padding to line chart view 2014-04-02 11:46:42 -07:00
Terry Worona 0afba01a9a Updated read me and pod spec 2014-04-02 10:26:59 -07:00
Terry Worona 63b47667ec Fixed min and max value properties 2014-04-02 09:08:12 -07:00
Terry Worona 4d6baf066f cleaned up cached constants 2014-04-02 08:50:43 -07:00
Terry Worona 359ef7d0ea Updated read me, change log and podspec 2014-03-30 21:50:00 -07:00
Terry Worona 7b1e6475f2 Clamp min and value values if supplied 2014-03-30 21:47:00 -07:00
Terry Worona 2b8853780c added optional min and max value properties to JBChartView 2014-03-30 21:27:00 -07:00
Terry Worona 0754e2e5d2 min height patches 2014-03-29 19:20:15 -07:00
Terry Worona 52b722013e updated change log 2014-03-27 16:05:00 -07:00
Terry Worona 4ef9b6442e Changelog updates 2014-03-27 14:21:15 -07:00
Terry Worona 177e076807 Readme update 2014-03-27 14:11:12 -07:00
Terry Worona 21969d759d changelog styling 2014-03-27 14:08:28 -07:00
Terry Worona 4fd6f1cb63 Added change log 2014-03-27 14:06:32 -07:00
Terry Worona 804ce2ca67 Updated line chart header comments 2014-03-27 13:02:07 -07:00
Terry Worona 485cfb9631 Fixed dot selections 2014-03-27 12:54:12 -07:00
Terry Worona 4640dede3a updated pod spec 2014-03-26 15:14:46 -07:00
Terry Worona 1b90c6e16f Updated read me 2014-03-26 15:13:53 -07:00
Terry Worona 15b53aa68e added line smooth bools 2014-03-26 15:05:37 -07:00
Terry Worona 0e277dc347 more dot selection cleanup 2014-03-26 14:12:05 -07:00
Terry Worona 6de42998c0 selection cleanups 2014-03-26 14:09:38 -07:00
Terry Worona a1e4be3a5d Dot selections 2014-03-26 14:01:29 -07:00
Terry Worona acaf6fb4dc moved dot function to datasource for line graphs 2014-03-26 12:49:35 -07:00
Terry Worona 5894610278 finished new line chart animations 2014-03-26 11:55:58 -07:00
Terry Worona e605e60f28 Line chart animation cleanup 2014-03-26 11:34:24 -07:00
Terry Worona 33b3c9518f Simplifying line chart animations 2014-03-26 10:40:44 -07:00
Terry Worona aec3d31e17 much work on dot views for lines 2014-03-25 16:56:46 -07:00
Terry Worona c99a0429b4 Implementation cleanup 2014-03-25 16:08:28 -07:00
Terry Worona f9fc90244f created custom line dot views 2014-03-25 16:07:38 -07:00
Terry Worona 6b0198f732 Created dot view class to get perfect circles 2014-03-25 15:59:47 -07:00
Terry Worona f0e52b42d7 More class naming convention changes 2014-03-25 15:47:26 -07:00
Terry Worona 381850ada4 Updated view names 2014-03-25 15:40:00 -07:00
Terry Worona 8b22d5fadd Started dot line implementation 2014-03-25 15:35:10 -07:00
Terry Worona 01171b9487 Updated read me and version 2014-03-19 13:32:27 -07:00
Terry Worona d3a1ce1c25 Fixed issue #22 2014-03-19 13:30:26 -07:00
Terry Worona 3b6863786f Updated read me 2014-03-19 13:27:00 -07:00
Terry Worona 1d39945e62 added frame and reload docs to readme 2014-03-18 17:56:17 -07:00
Terry Worona f0f1d5174e More read me work 2014-03-18 17:38:14 -07:00
Terry Worona 11e0f21e03 More read me work 2014-03-18 17:35:57 -07:00
Terry Worona 59183657e8 Center image 2014-03-18 17:35:26 -07:00
Terry Worona 47a75d4291 updated image 2014-03-18 17:34:41 -07:00
Terry Worona 32a449f460 Updated read me and pod spec 2014-03-18 17:32:42 -07:00
terryworona d9aea500bf Merge pull request #21 from Jawbone/multi_line
Multiple Line Support & Tooltips
2014-03-18 17:31:32 -07:00
Terry Worona 8c947322ae Added new line to constants file 2014-03-18 17:28:45 -07:00
Terry Worona 5b397a4f49 fixed assert comment 2014-03-18 17:28:23 -07:00
Terry Worona 44c79e8a7c Minor fix to bar chart datasource 2014-03-18 17:03:14 -07:00
Terry Worona 40db9062ce Line view assert checks 2014-03-18 17:01:07 -07:00
Terry Worona dafb0f81d4 More asserts for bar charts 2014-03-18 16:54:43 -07:00
Terry Worona f8df682b62 more asserts 2014-03-18 16:48:34 -07:00
Terry Worona 293dc29183 Added asserts 2014-03-18 16:48:12 -07:00
Terry Worona ef1b8b3414 Fixed extreme value bugs 2014-03-18 16:24:50 -07:00
Terry Worona 58bbb99c94 Updated read me 2014-03-18 16:04:18 -07:00
Terry Worona b829884008 Cleaned up strings and random chart data 2014-03-18 15:12:06 -07:00
Terry Worona e82756172b Cleaning up string constants 2014-03-18 14:08:30 -07:00
Terry Worona 58651a3325 fixed line chart out of bounds crash 2014-03-18 11:47:58 -07:00
Terry Worona 328b5775aa Changed line chart style order 2014-03-17 14:27:43 -07:00
Terry Worona 64f22aa758 more readme 2014-03-17 14:22:58 -07:00
Terry Worona bc9e9c31b5 Cleaning up read me 2014-03-17 14:21:13 -07:00
Terry Worona c4d1d2ade3 Updated read me and pod spec 2014-03-17 14:15:37 -07:00
Terry Worona 97874ce1ef Updated project settings 2014-03-17 14:15:28 -07:00
Terry Worona dcc826e8a6 Added nib init support 2014-03-17 11:28:22 -07:00
Terry Worona 31bb7a0a2b more tooltip views 2014-03-17 11:08:16 -07:00
Terry Worona d83742315f more tooltip cleanup 2014-03-17 11:06:41 -07:00
Terry Worona 7e4cbc0533 More tooltip work 2014-03-17 10:57:34 -07:00
Terry Worona 87d752c5e3 Improving chart tooltip position 2014-03-17 10:39:03 -07:00
Terry Worona 5f2de0e862 More tooltip work and tooltip tip view 2014-03-17 10:32:48 -07:00
Terry Worona 0d4f17dd25 Updated line separator size 2014-03-13 17:57:05 -07:00
Terry Worona 9ba965ecf0 added tooltip to bar chart view 2014-03-13 16:53:49 -07:00
Terry Worona 31b0ba8e28 moved tooltip functionality to base chart controller 2014-03-13 16:46:57 -07:00
Terry Worona 9edd9d562a Merge branch 'master' of https://github.com/Jawbone/JBChartView into multi_line 2014-03-13 16:21:13 -07:00
Terry Worona d30abc6a1a Fixed issue #19 2014-03-13 16:12:22 -07:00
Terry Worona 78d1bfb275 Information view cleanup 2014-03-12 19:16:10 -07:00
Terry Worona b6de13f1ac more tooltip and touch work 2014-03-12 18:42:43 -07:00
Terry Worona 1dbd52fd75 tooltip work 2014-03-12 18:27:32 -07:00
Terry Worona 0917d4b6b8 more opacity work 2014-03-12 16:47:31 -07:00
Terry Worona d10b42dc5a added line dims on selection 2014-03-12 16:45:24 -07:00
Terry Worona 78f34ecaa5 more constant cleanup 2014-03-12 16:27:48 -07:00
Terry Worona cc2d356223 cleaning up line controller 2014-03-12 16:25:09 -07:00
Terry Worona 2c8a578f92 added interface comments 2014-03-12 16:15:03 -07:00
Terry Worona 2e5b1c4d01 line chart line style work 2014-03-12 16:03:05 -07:00
Terry Worona a58ac858ab Integer cleanup and adding line customization 2014-03-12 15:17:30 -07:00
Terry Worona ebfb4c421e Added comments 2014-03-11 15:02:32 -07:00
Terry Worona b08324e6dd Fixed chart extremes 2014-03-11 14:58:39 -07:00
Terry Worona 72dda814c6 more line cleanup 2014-03-11 14:01:49 -07:00
Terry Worona e76daca899 updated datasource functions 2014-03-11 12:04:38 -07:00
Terry Worona bafcc02862 updating chart comments 2014-03-11 11:51:50 -07:00
Terry Worona 9d80750467 Internal line view cleanup 2014-03-11 11:28:06 -07:00
Terry Worona 8c93fafa37 Multiple line selections finally working. 2014-03-10 19:14:35 -07:00
Terry Worona e518246f26 line selection working 2014-03-07 15:01:16 -08:00
Terry Worona a1256c3297 single line selections 2014-03-07 14:18:14 -08:00
Terry Worona 84ca6d41ae Line selection 2014-03-05 19:31:19 -08:00
Terry Worona d94ef105cf consolidated touch code 2014-03-05 16:41:36 -08:00
Terry Worona 361985f236 More selection view cleanup 2014-03-05 16:29:27 -08:00
Terry Worona 6987b4636a more property cleanup 2014-03-05 16:04:01 -08:00
Terry Worona 18f56fa818 more property renaming for selection views 2014-03-05 15:59:05 -08:00
Terry Worona 5724b8424f Property renaming 2014-03-05 14:57:15 -08:00
Terry Worona f62b3be08e Line chart line selection logic 2014-03-05 14:52:20 -08:00
Terry Worona a4c21168ab hooking up line index logic 2014-03-04 11:56:23 -08:00
Terry Worona f1ec5add4b Updated shows selection bool naming 2014-03-04 11:53:29 -08:00
Terry Worona 62ed0c6496 Started multi line support 2014-03-04 11:36:24 -08:00
Terry Worona 3d5e5c3e1d Updated podspect 2014-03-02 17:24:33 -08:00
Terry Worona 7e33f7121a Updated read me 2014-03-02 17:23:53 -08:00
Terry Worona 09fefa292a Added assert check for line width and added hookups to demo project 2014-03-02 17:16:51 -08:00
Terry Worona 47c6d744ba added periods to comments 2014-03-02 17:14:49 -08:00
Terry Worona fc32f8282e Moved pod spec back into /Classes 2014-03-02 17:10:31 -08:00
terryworona 7ee84c24f0 Merge pull request #15 from kmcbride/line-customization
Added customization for line width
2014-03-02 17:06:44 -08:00
Terry Worona 12a15f1051 Added default init for bar and line charts. 2014-03-02 16:49:03 -08:00
Kylan McBride 6a8f927510 Moved podspec location 2014-02-14 22:36:25 -08:00
Kylan McBride 3bf16ecae9 Added line width customization 2014-02-14 22:34:23 -08:00
Kylan McBride 5a7b211f16 Fixed Typo and excess whitespace 2014-02-14 22:32:44 -08:00
terryworona 189c907bb9 Merge pull request #14 from Undo1/patch-1
fix spelling mistake
2014-02-14 09:38:35 -08:00
Undo1 6f16ae64ab fix spelling mistake 2014-02-13 20:06:11 -07:00
Terry Worona b911dfa9e2 Updated version 2014-02-11 16:47:54 -08:00
Terry Worona 2335a371b6 Fixed selection view cancelled bug 2014-02-07 10:23:48 -08:00
Terry Worona b41d7ad944 Don't clip bar chart views 2014-02-07 09:52:57 -08:00
Terry Worona 4ffb2e1e0c Fixed minor bar chart animation bugs 2014-02-07 09:39:56 -08:00
Terry Worona 9ae2adb81c Updated version and read me 2014-02-06 10:58:29 -08:00
Terry Worona 185782daab Fixed compilation warnings 2014-02-06 10:48:28 -08:00
Terry Worona 51acae13a1 updated read me and pod spec 2014-01-06 13:25:55 -08:00
Terry Worona 03217243d9 Fixed float bugs 2014-01-06 12:23:21 -08:00
Terry Worona 072e45902d Removed unused cached height 2014-01-06 12:08:30 -08:00
Terry Worona 326037ce93 Added precision to line and bar charts & fixed cached height bug 2014-01-06 12:06:19 -08:00
terryworona f447549666 Merge pull request #11 from sampage/patch-1
Fixes small typos in README
2014-01-06 10:39:48 -08:00
Sam Page eba1d39ba3 Fixes small typos in README
"initialze" -> "initialize"
2014-01-06 15:51:15 +11:00
Terry Worona 8d28b65add Updated pod spec to latest version 2014-01-03 10:57:33 -08:00
Terry Worona e72a54356e Updated datasource to require CGFloats for heights instead of Integers. ss 2014-01-03 10:54:28 -08:00
Terry Worona 86440913ba Updated read me and pod spec 2014-01-02 10:20:51 -08:00
Terry Worona c1ac9e4a2f Remove ivar access except for designated functions 2014-01-02 10:02:47 -08:00
terryworona 6f185f9e53 Merge pull request #8 from l4u/cache
Reset cached max height on data reload Fixes #7
2014-01-02 10:00:55 -08:00
Leo Lou d142629dd3 Reset cached max height on data reload Fixes #7 2014-01-02 18:33:45 +08:00
Terry Worona 84d9c0f5da updated pod spec and read me 2013-12-26 10:00:12 -05:00
Terry Worona 5f400d3c91 Updated datasource to request bar view instead of color 2013-12-25 17:25:58 -05:00
Terry Worona 409b58c53c updated pod spec and read me 2013-12-23 18:02:30 -05:00
Terry Worona 0b6108dea8 resolved #4 | removed bar shadow from bar chart subviews 2013-12-23 17:50:20 -05:00
Terry Worona c7fe1c4114 updated specs and readme 2013-12-17 11:37:47 -08:00
Terry Worona 318d59dadd Fixed footer touches up alpha bug 2013-12-17 11:35:45 -08:00
Terry Worona ffd12921a4 updated read me and podspec 2013-12-14 23:26:16 -08:00
Terry Worona ef2f02743f Added footer view checks for selection views 2013-12-14 23:24:28 -08:00
terryworona 74d63d31e3 Merge pull request #2 from joelkraut/master
If there is no footer view, bars won't be added to the chart.
2013-12-14 23:18:42 -08:00
Joel Kraut 49c7bdee0c If there is no footer view, bars won't be added to the chart. 2013-12-13 15:43:58 -08:00
Terry Worona 851e78c668 Updated read me to use raw links 2013-12-11 13:42:53 -08:00
Terry Worona 03c2a3bcc3 Update read me 2013-12-09 19:13:46 -08:00
Terry Worona 21bb7ba160 Moved license back to root 2013-12-09 19:13:22 -08:00
Terry Worona 7fdd5d3fd4 Reverted pod spec and demo version 2013-12-06 16:35:02 -08:00
Terry Worona 61785ce2ae Updated pod spec and demo version 2013-12-06 16:30:46 -08:00
Terry Worona 37c0af3b9f added license back into pod class directory 2013-12-06 15:56:56 -08:00
Terry Worona b9f05fc663 Updated read me 2013-12-06 15:40:37 -08:00
Terry Worona 5694e92c8e updated read me 2013-12-06 15:37:55 -08:00
Terry Worona 9b45ea0a3e moved license, updated read me, and tag 2013-12-06 15:35:23 -08:00
Terry Worona fff3c5e604 moved license and updated pod spec 2013-12-05 17:53:44 -08:00
Terry Worona c411f6def5 Updated pod spec 2013-12-05 17:50:54 -08:00
Terry Worona 0143a80159 Updated pod spec and chart constants 2013-12-05 17:17:35 -08:00
Terry Worona 11582c5264 Updated pod spec version 2013-12-05 17:07:24 -08:00
Terry Worona 6c5ea8541b revert image overviews 2013-11-21 16:19:06 -08:00
Terry Worona 8b523246b1 center images 2013-11-21 16:16:39 -08:00
Terry Worona ac6d2b9795 screenshots back in read me 2013-11-21 16:15:54 -08:00
Terry Worona a28f8001e6 Updated read me 2013-11-21 16:06:30 -08:00
terryworona 424796abe7 Merge pull request #1 from terryworona/master
JBChartViewDemo and JBChartView
2013-11-21 15:50:04 -08:00
Terry Worona 1ca8816ed2 Support for iOS 7 only 2013-11-20 15:25:52 -08:00
Terry Worona 523cc43cfd Safe block copies. 2013-11-20 12:23:05 -08:00
Terry Worona 61622a7a2c Fixed < iOS 7 issues 2013-11-20 12:04:53 -08:00
Terry Worona a9b1164887 more code review improvements 2013-11-20 11:35:59 -08:00
Terry Worona dadbb15a42 split out selection view into single instance 2013-11-20 11:32:41 -08:00
Terry Worona 3013f009f4 Added default comments to chart protocols 2013-11-20 11:13:37 -08:00
Terry Worona f938ab839c shape layer improvements (code review) 2013-11-19 18:32:11 -08:00
Terry Worona 1c1dd00cd2 code review comments 2013-11-19 18:19:17 -08:00
Terry Worona efd23addd4 code review comments 2013-11-19 18:18:42 -08:00
Terry Worona 57ee6e4c0a Cleaned up chart information view layout code 2013-11-19 18:17:04 -08:00
Terry Worona 2fae7ae37e switched over max and min to fmax fmin 2013-11-19 17:30:43 -08:00
Terry Worona b52f77d97e Added explicit required protocols 2013-11-19 17:24:57 -08:00
Terry Worona 5fde466dec removed static color alpha function and replaced with native one 2013-11-19 17:23:36 -08:00
Terry Worona a557e4b84e code review cleanup 2013-11-19 17:18:35 -08:00
Terry Worona 03ba74ee6b added line chart unselect index 2013-11-14 15:55:39 -08:00
Terry Worona 9908faf9b9 added bar chart unselect index 2013-11-14 15:48:57 -08:00
Terry Worona 068d86d109 JBChartViewDemo and JBChartView classes 2013-11-13 21:36:09 -08:00
Terry Worona 4bf53d2d39 first commit 2013-11-13 21:32:09 -08:00
407 changed files with 9384 additions and 5852 deletions
+22 -3
View File
@@ -1,4 +1,23 @@
.*.sw?
# OS X
.DS_Store
.rbenv-version
Gemfile.lock
# Xcode
build/
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata
*.xccheckout
profile
*.moved-aside
DerivedData
*.hmap
*.xccheckout
# CocoaPods
Pods
-5
View File
@@ -1,5 +0,0 @@
language: ruby
rvm:
- 1.8.7
- 1.9.3
install: rake travis:setup
@@ -1,12 +0,0 @@
Pod::Spec.new do |s|
s.name = 'A2DynamicDelegate'
s.version = '1.0.1'
s.license = 'BSD'
s.summary = 'Blocks are to functions as A2DynamicDelegate is to delegates.'
s.homepage = 'https://github.com/pandamonia/A2DynamicDelegate'
s.author = { 'Alexsander Akers' => 'a2@pandamonia.us',
'Zachary Waldowski' => 'zwaldowski@gmail.com' }
s.source = { :git => 'https://github.com/pandamonia/A2DynamicDelegate.git', :tag => 'v1.0.1' }
s.source_files = 'A2DynamicDelegate.{h,m}', 'A2BlockDelegate.{h,m}'
end
@@ -1,12 +0,0 @@
Pod::Spec.new do |s|
s.name = 'A2DynamicDelegate'
s.version = '1.0.2'
s.license = 'BSD'
s.summary = 'Blocks are to functions as A2DynamicDelegate is to delegates.'
s.homepage = 'https://github.com/pandamonia/A2DynamicDelegate'
s.author = { 'Alexsander Akers' => 'a2@pandamonia.us',
'Zachary Waldowski' => 'zwaldowski@gmail.com' }
s.source = { :git => 'https://github.com/pandamonia/A2DynamicDelegate.git', :tag => 'v1.0.2' }
s.source_files = 'A2DynamicDelegate.{h,m}', 'A2BlockDelegate.{h,m}'
end
@@ -1,12 +0,0 @@
Pod::Spec.new do |s|
s.name = 'A2DynamicDelegate'
s.version = '1.0.3'
s.license = 'BSD'
s.summary = 'Blocks are to functions as A2DynamicDelegate is to delegates.'
s.homepage = 'https://github.com/pandamonia/A2DynamicDelegate'
s.author = { 'Alexsander Akers' => 'a2@pandamonia.us',
'Zachary Waldowski' => 'zwaldowski@gmail.com' }
s.source = { :git => 'https://github.com/pandamonia/A2DynamicDelegate.git', :tag => 'v1.0.3' }
s.source_files = 'A2DynamicDelegate.{h,m}', 'A2BlockDelegate.{h,m}'
end
@@ -1,12 +0,0 @@
Pod::Spec.new do |s|
s.name = 'A2DynamicDelegate'
s.version = '1.0.4'
s.license = 'BSD'
s.summary = 'Blocks are to functions as A2DynamicDelegate is to delegates.'
s.homepage = 'https://github.com/pandamonia/A2DynamicDelegate'
s.author = { 'Alexsander Akers' => 'a2@pandamonia.us',
'Zachary Waldowski' => 'zwaldowski@gmail.com' }
s.source = { :git => 'https://github.com/pandamonia/A2DynamicDelegate.git', :tag => 'v1.0.4' }
s.source_files = 'A2DynamicDelegate.{h,m}', 'A2BlockDelegate.{h,m}'
end
@@ -1,12 +0,0 @@
Pod::Spec.new do |s|
s.name = 'A2DynamicDelegate'
s.version = '1.0.5'
s.license = 'BSD'
s.summary = 'Blocks are to functions as A2DynamicDelegate is to delegates.'
s.homepage = 'https://github.com/pandamonia/A2DynamicDelegate'
s.author = { 'Alexsander Akers' => 'a2@pandamonia.us',
'Zachary Waldowski' => 'zwaldowski@gmail.com' }
s.source = { :git => 'https://github.com/pandamonia/A2DynamicDelegate.git', :tag => 'v1.0.5' }
s.source_files = 'A2DynamicDelegate.{h,m}', 'A2BlockDelegate.{h,m}'
end
@@ -1,12 +0,0 @@
Pod::Spec.new do |s|
s.name = 'A2DynamicDelegate'
s.version = '1.0.6'
s.license = 'BSD'
s.summary = 'Blocks are to functions as A2DynamicDelegate is to delegates.'
s.homepage = 'https://github.com/pandamonia/A2DynamicDelegate'
s.author = { 'Alexsander Akers' => 'a2@pandamonia.us',
'Zachary Waldowski' => 'zwaldowski@gmail.com' }
s.source = { :git => 'https://github.com/pandamonia/A2DynamicDelegate.git', :tag => 'v1.0.6' }
s.source_files = 'A2DynamicDelegate.{h,m}', 'A2BlockDelegate.{h,m}'
end
@@ -1,12 +0,0 @@
Pod::Spec.new do |s|
s.name = 'A2DynamicDelegate'
s.version = '1.0.7'
s.license = 'BSD'
s.summary = 'Blocks are to functions as A2DynamicDelegate is to delegates.'
s.homepage = 'https://github.com/pandamonia/A2DynamicDelegate'
s.author = { 'Alexsander Akers' => 'a2@pandamonia.us',
'Zachary Waldowski' => 'zwaldowski@gmail.com' }
s.source = { :git => 'https://github.com/pandamonia/A2DynamicDelegate.git', :tag => 'v1.0.7' }
s.source_files = 'A2DynamicDelegate.{h,m}', 'A2BlockDelegate.{h,m}'
end
@@ -1,12 +0,0 @@
Pod::Spec.new do |s|
s.name = 'A2DynamicDelegate'
s.version = '1.0'
s.license = 'BSD'
s.summary = 'Blocks are to functions as A2DynamicDelegate is to delegates.'
s.homepage = 'https://github.com/pandamonia/A2DynamicDelegate'
s.author = { 'Alexsander Akers' => 'a2@pandamonia.us',
'Zachary Waldowski' => 'zwaldowski@gmail.com' }
s.source = { :git => 'https://github.com/pandamonia/A2DynamicDelegate.git', :tag => 'v1.0' }
s.source_files = 'A2DynamicDelegate.{h,m}', 'A2BlockDelegate.{h,m}'
end
@@ -1,11 +0,0 @@
Pod::Spec.new do |s|
s.name = 'A2StoryboardSegueContext'
s.version = '1.0.1'
s.license = 'BSD'
s.summary = 'Supplement your segues\' identifier strings with context objects.'
s.homepage = 'https://github.com/pandamonia/A2StoryboardSegueContext/'
s.author = { 'Alexsander Akers' => 'a2@pandamonia.us' }
s.source = { :git => 'https://github.com/pandamonia/A2StoryboardSegueContext.git', :tag => 'v1.0.1' }
s.platform = :ios
s.source_files = 'A2StoryboardSegueContext.{h,m}'
end
@@ -1,11 +0,0 @@
Pod::Spec.new do |s|
s.name = 'A2StoryboardSegueContext'
s.version = '1.0'
s.license = 'BSD'
s.summary = 'Supplement your segues\' identifier strings with context objects.'
s.homepage = 'https://github.com/pandamonia/A2StoryboardSegueContext/'
s.author = { 'Alexsander Akers' => 'a2@pandamonia.us' }
s.source = { :git => 'https://github.com/pandamonia/A2StoryboardSegueContext.git', :tag => 'v1.0' }
s.platform = :ios
s.source_files = 'A2StoryboardSegueContext.{h,m}'
end
@@ -1,12 +0,0 @@
Pod::Spec.new do |s|
s.name = 'ABContactHelper'
s.version = '0.0.1'
s.license = 'BSD'
s.summary = 'Objective-C Address Book wrapper.'
s.homepage = 'https://github.com/erica/ABContactHelper'
s.author = { 'Erica Sadun' => '' }
s.source = { :git => 'https://github.com/erica/ABContactHelper.git', :commit => 'de4bc411fd45db5e7b5b13f38704764bc1e1bcd1' }
s.platform = :ios
s.source_files = 'ABContact.{h,m}', 'ABGroup.{h,m}', 'ABContactsHelper.{h,m}'
s.frameworks = 'AddressBook', 'AddressBookUI'
end
@@ -1,15 +0,0 @@
Pod::Spec.new do |s|
s.name = 'ADVProgressBar'
s.version = '0.0.1'
s.license = 'MIT'
s.summary = 'Progress Bar Design with Percentage values'
s.homepage = 'https://github.com/appdesignvault'
s.author = { 'appdesignvault' => 'appdesignvault' }
s.source = { :git => 'https://github.com/appdesignvault/ADVProgressBar.git', :commit => 'ff88e5ce20fed36b1e0e2da167f0b7f51e62ce8c' }
s.platform = :ios
s.source_files = 'ADVProgressBar/Classes/*.{h,m}'
s.resources = "ADVProgressBar/Resources/*.png"
s.framework = 'UIKit'
s.clean_paths = "ADVProgressBar.xcodeproj" , 'ADVProgressBar/en.lproj' , 'ADVProgressBar/ADVAppDelegate.{h,m}' , 'ADVProgressBar/ADVViewController.{h,m}' , 'ADVProgressBar/ADVProgressBar-Info.plist' , 'ADVProgressBar/ADVProgressBar-Prefix.pch'
s.requires_arc = true
end
@@ -1,11 +0,0 @@
Pod::Spec.new do |s|
s.name = 'AFHTTPRequestOperationLogger'
s.version = '0.9.0'
s.license = 'MIT'
s.summary = 'AFNetworking Extension for HTTP Request Logging'
s.homepage = 'https://github.com/AFNetworking/AFHTTPRequestOperationLogger'
s.authors = { 'Mattt Thompson' => 'm@mattt.me' }
s.source = { :git => 'https://github.com/AFNetworking/AFHTTPRequestOperationLogger.git', :tag => '0.9.0' }
s.source_files = 'AFHTTPRequestOperationLogger.{h,m}'
s.dependency 'AFNetworking', '0.9.0'
end
-23
View File
@@ -1,23 +0,0 @@
Pod::Spec.new do |s|
s.name = 'AFNetworking'
s.version = '0.5.1'
s.summary = 'A delightful iOS networking library with NSOperations and block-based callbacks'
s.homepage = 'https://github.com/gowalla/AFNetworking'
s.author = { 'Gowalla' => 'live@gowalla.com' }
s.source = { :git => 'https://github.com/gowalla/AFNetworking.git', :tag => '0.5.1' }
if config.ios?
s.source_files = 'AFNetworking' # everything
else
s.source_files = %w{
AFNetworking/AFHTTPRequestOperation.h
AFNetworking/AFJSONRequestOperation.h
AFNetworking/NSData+AFNetworking.h
AFNetworking/NSMutableURLRequest+AFNetworking.h
AFNetworking/NSString+AFNetworking.h
}
end
s.library = 'z'
s.dependency 'JSONKit'
end
-15
View File
@@ -1,15 +0,0 @@
Pod::Spec.new do |s|
s.name = 'AFNetworking'
s.version = '0.7.0'
s.summary = 'A delightful iOS networking library with NSOperations and block-based callbacks'
s.homepage = 'https://github.com/AFNetworking/AFNetworking'
s.author = {'Mattt Thompson' => 'm@mattt.me', 'Scott Raymond' => 'sco@gowalla.com'}
s.source = { :git => 'https://github.com/AFNetworking/AFNetworking.git', :tag => '0.7.0' }
s.source_files = 'AFNetworking'
s.clean_paths = ['iOS Example', 'Mac Example', 'AFNetworking.xcworkspace']
s.library = 'z'
s.dependency 'JSONKit'
end
-12
View File
@@ -1,12 +0,0 @@
Pod::Spec.new do |s|
s.name = 'AFNetworking'
s.version = '0.9.0'
s.license = 'MIT'
s.summary = 'A delightful iOS and OS X networking framework'
s.homepage = 'https://github.com/AFNetworking/AFNetworking'
s.authors = {'Mattt Thompson' => 'm@mattt.me', 'Scott Raymond' => 'sco@gowalla.com'}
s.source = { :git => 'https://github.com/AFNetworking/AFNetworking.git', :tag => '0.9.0' }
s.source_files = 'AFNetworking'
s.clean_paths = ['iOS Example', 'Mac Example', 'AFNetworking.xcworkspace']
s.framework = 'SystemConfiguration'
end
-12
View File
@@ -1,12 +0,0 @@
Pod::Spec.new do |s|
s.name = 'AFNetworking'
s.version = '0.9.1'
s.license = 'MIT'
s.summary = 'A delightful iOS and OS X networking framework'
s.homepage = 'https://github.com/AFNetworking/AFNetworking'
s.authors = {'Mattt Thompson' => 'm@mattt.me', 'Scott Raymond' => 'sco@gowalla.com'}
s.source = { :git => 'https://github.com/AFNetworking/AFNetworking.git', :tag => '0.9.1' }
s.source_files = 'AFNetworking'
s.clean_paths = ['iOS Example', 'Mac Example', 'AFNetworking.xcworkspace']
s.framework = 'SystemConfiguration'
end
@@ -1,10 +0,0 @@
Pod::Spec.new do |s|
s.name = 'AFOAuth2Client'
s.version = '0.0.1'
s.summary = 'AFNetworking Extension for OAuth 2 Authentication'
s.homepage = 'https://github.com/AFNetworking/AFOAuth2Client'
s.author = { 'Mattt Thompson' => 'm@mattt.me' }
s.source = { :git => 'https://github.com/AFNetworking/AFOAuth2Client.git',
:commit => '068c25f83b800451cf0b5ba0da7a6a018252c0a9' }
s.source_files = '*.{h,m}'
end
@@ -1,33 +0,0 @@
Pod::Spec.new do |s|
s.name = 'ASIHTTPRequest'
s.version = '1.8.1'
s.summary = 'Easy to use CFNetwork wrapper for HTTP requests, Objective-C, Mac OS X and iPhone.'
s.homepage = 'http://allseeing-i.com/ASIHTTPRequest'
s.author = { 'Ben Copsey' => 'ben@allseeing-i.com' }
s.source = { :git => 'https://github.com/pokeb/asi-http-request.git', :tag => 'v1.8.1' }
s.description = %{
ASIHTTPRequest is an easy to use wrapper around the CFNetwork API that
makes some of the more tedious aspects of communicating with web servers
easier. It is written in Objective-C and works in both Mac OS X and iPhone
applications.
It is suitable performing basic HTTP requests and interacting with
REST-based services (GET / POST / PUT / DELETE). The included
ASIFormDataRequest subclass makes it easy to submit POST data and files
using multipart/form-data.
}
s.clean_paths = '*Sample', 'External', '*.xcodeproj', 'Build Scripts'
if config.ios?
s.dependency 'Reachability' #, '~> 2.0', '>= 2.0.4'
s.source_files = 'Classes'
s.frameworks = 'MobileCoreServices', 'CFNetwork', 'CoreGraphics'
else
s.source_files = FileList['Classes/*.*'].exclude(/ASIAuthenticationDialog\.\w$/)
s.frameworks = 'SystemConfiguration', 'CoreServices'
end
s.library = 'z.1'
end
@@ -1,17 +0,0 @@
Pod::Spec.new do |s|
s.name = 'ASIWebPageRequest'
s.version = '1.8.1'
s.homepage = 'http://allseeing-i.com/ASIHTTPRequest/ASIWebPageRequest'
s.author = { 'Ben Copsey' => 'ben@allseeing-i.com' }
s.summary = 'The ASIWebPageRequest class included with ASIHTTPRequest lets you ' \
'download complete webpages, including external resources like ' \
'images and stylesheets.'
s.part_of_dependency = 'ASIHTTPRequest', '1.8.1'
s.source_files = 'Classes/ASIWebPageRequest/*.m', 'Classes/ASIWebPageRequest/*.h'
s.library = 'xml2.2.7.3'
s.xcconfig = { 'HEADER_SEARCH_PATHS' => '$(SDKROOT)/usr/include/libxml2' }
end
@@ -1,14 +0,0 @@
Pod::Spec.new do |s|
s.name = 'ASStarRatingView'
s.version = '0.1.0'
s.license = 'MIT'
s.summary = "ASStarRatingView is a control to rating with stars, it is simple to use and configurable"
s.homepage = 'https://github.com/bl0ckme/ASStarRatingView'
s.author = { 'Sam Yang' => 'yanguango@gmail.com' }
s.source = { :git => 'https://github.com/bl0ckme/ASStarRatingView.git', :tag => 'v0.1.0' }
s.description = "ASStarRatingView is a control to rating with stars, it is simple to use and configurable"
s.platform = :ios
s.source_files = 'ASStarRatingView/**/*.{h,m}'
s.resources = "ASStarRatingView/stars/*.png"
s.clean_path = "ASStarRatingViewDemo"
end
-12
View File
@@ -1,12 +0,0 @@
Pod::Spec.new do |s|
s.name = 'ATMHud'
s.version = '0.0.1'
s.platform = :ios
s.summary = 'Library for the creation of HUDs in iPhone applications.'
s.homepage = 'https://github.com/atomton/ATMHud'
s.author = { 'Marcel Müller' => 'pool@atomton.net' }
s.source = { :git => 'git://github.com/atomton/ATMHud.git', :commit => 'fc79fed7268362c744de5470169db0a381866ad7' }
s.source_files = 'ATM*.{h,m}'
s.resources = '11-x.png', '19-check.png', 'pop.wav'
s.frameworks = 'QuartzCore', 'AudioToolbox'
end
@@ -1,22 +0,0 @@
Pod::Spec.new do |s|
s.name = 'AUIAnimatedText'
s.version = '0.0.1'
s.summary = 'A drop-in UILabel replacement that makes almost all properties animatable by using a CATextLayer instead of CALayer.'
s.homepage = 'https://github.com/adam-siton/AUIAnimatedText'
s.author = { 'Adam Siton'=> 'adamsiton@gmail.com' }
s.source = { :git => 'https://github.com/adam-siton/AUIAnimatedText.git' }
s.description = 'Properties animatable in AUIAnimatableText and not in UILabel: textColor, text, font, fontSize.'
s.platform = :ios
s.source_files = 'AUIAnimatedText/AUIAnimatedText/AUIAnimatableLabel.{h,m}', 'AUIAnimatedText/AUIAnimatedText/UIFont+CoreTextExtensions.{h,m}'
s.clean_paths =
'AUIAnimatedText/AUIAnimatedTextTests',
'AUIAnimatedText/AUIAnimatedText.xcodeproj',
'AUIAnimatedText/AUIAnimatedText/en.lproj',
'AUIAnimatedText/AUIAnimatedText/iPhone',
'AUIAnimatedText/AUIAnimatedText/AUIAnimatedText-Info.plist',
'AUIAnimatedText/AUIAnimatedText/AUIAnimatedText-Prefix.pch',
'AUIAnimatedText/AUIAnimatedText/AUIAnimatedTextAppDelegate.{h,m}',
'AUIAnimatedText/AUIAnimatedText/RootViewController.{h,m,xib}',
'AUIAnimatedText/AUIAnimatedText/main.m'
s.framework = 'CoreText', 'QuartzCore', 'CoreGraphics', 'UIKit'
end
-11
View File
@@ -1,11 +0,0 @@
Pod::Spec.new do |s|
s.name = 'Appirater'
s.version = '0.0.1'
s.platform = :ios
s.summary = "A utility that reminds your iPhone app's users to review the app."
s.homepage = 'http://arashpayan.com/blog/2009/09/07/presenting-appirater/'
s.author = { 'Arash Payan' => 'arash.payan@gmail.com' }
s.source = { :git => 'git://github.com/arashpayan/appirater.git', :commit => '0f3776a47b17bd4f6cbee0ad02c9450869d26c42' }
s.source_files = '*.{h,m}'
s.frameworks = 'CFNetwork', 'SystemConfiguration'
end
-12
View File
@@ -1,12 +0,0 @@
Pod::Spec.new do |s|
s.name = 'Appirater'
s.version = '0.0.2'
s.platform = :ios
s.summary = "A utility that reminds your iPhone app's users to review the app."
s.homepage = 'http://arashpayan.com/blog/2009/09/07/presenting-appirater/'
s.author = { 'Arash Payan' => 'arash.payan@gmail.com' }
s.source = { :git => 'git://github.com/mk/appirater.git', :tag => '0.0.2' }
s.source_files = '*.{h,m}'
s.frameworks = 'CFNetwork', 'SystemConfiguration'
s.resource = 'Appirater.bundle'
end
-28
View File
@@ -1,28 +0,0 @@
Pod::Spec.new do |s|
s.name = 'BaseKit'
s.version = '0.1.0'
s.license = 'Apache 2'
s.summary = 'BaseKit is a set of IOS class to make your life easier.'
s.homepage = 'https://github.com/brunow/BaseKit'
s.author = { 'Bruno Wernimont' => 'bruno.wernimont+github@gmail.com' }
s.source = { :git => 'https://github.com/brunow/BaseKit.git', :tag => '0.1' }
s.description = 'BaseKit is a set of IOS class to make your life easier.'
s.platform = :ios
s.clean_paths = 'Examples', 'GHUnitIOS.framework', 'Test', 'Vendor', 'README.md', '.gitignore', 'BaseKit.xcodeproj'
s.subspec 'Core' do |core|
core.source_files = 'Code/Core/*.{h,m}'
end
s.subspec 'View' do |view|
view.source_files = 'Code/View/*.{h,m}'
view.dependency 'BaseKit/Core'
end
s.subspec 'CellMapping' do |cell_mapping|
cell_mapping.source_files = 'Code/CellMapping/*.{h,m}'
cell_mapping.dependency 'BaseKit/Core'
cell_mapping.dependency 'BaseKit/View'
end
end
-23
View File
@@ -1,23 +0,0 @@
Pod::Spec.new do |s|
s.name = 'BlocksKit'
s.version = '0.5.0' # picked some version number as the project doesn't have one yet
s.summary = 'The Objective-C block utilities you always wish you had.'
s.homepage = 'https://github.com/zwaldowski/BlocksKit'
s.author = { 'Zachary Waldowski' => 'zwaldowski@gmail.com'}
s.source = { :git => 'https://github.com/zwaldowski/BlocksKit.git', :commit => '84b12bd081c71b17e56c133002eee8f8577e9a24' }
s.source_files = 'BlocksKit'
s.frameworks = 'MessageUI'
s.requires_arc = true
s.clean_paths = 'BlocksKit.xcodeproj/', 'GHUnitIOS.framework/', 'Tests/', '.gitignore'
def s.post_install(target)
prefix_header = config.project_pods_root + target.prefix_header_filename
prefix_header.open('a') do |file|
file.puts(%{#ifdef __OBJC__\n#import <dispatch/dispatch.h>\n#import "BKGlobals.h"\n#endif})
end
end
end
-23
View File
@@ -1,23 +0,0 @@
Pod::Spec.new do |s|
s.name = 'BlocksKit'
s.version = '0.9.0'
s.summary = 'The Objective-C block utilities you always wish you had.'
s.homepage = 'https://github.com/zwaldowski/BlocksKit'
s.author = { 'Zachary Waldowski' => 'zwaldowski@gmail.com'}
s.source = { :git => 'https://github.com/zwaldowski/BlocksKit.git', :tag => 'v0.9' }
s.source_files = 'BlocksKit'
s.frameworks = 'MessageUI'
s.requires_arc = true
s.clean_paths = 'BlocksKit.xcodeproj/', 'GHUnitIOS.framework/', 'Tests/', '.gitignore'
def s.post_install(target)
prefix_header = config.project_pods_root + target.prefix_header_filename
prefix_header.open('a') do |file|
file.puts(%{#ifdef __OBJC__\n#import <dispatch/dispatch.h>\n#import "BKGlobals.h"\n#endif})
end
end
end
-23
View File
@@ -1,23 +0,0 @@
Pod::Spec.new do |s|
s.name = 'BlocksKit'
s.version = '0.9.5'
s.summary = 'The Objective-C block utilities you always wish you had.'
s.homepage = 'https://github.com/zwaldowski/BlocksKit'
s.author = { 'Zachary Waldowski' => 'zwaldowski@gmail.com'}
s.source = { :git => 'https://github.com/zwaldowski/BlocksKit.git', :tag => 'v0.9.5' }
s.source_files = 'BlocksKit'
s.frameworks = 'MessageUI'
s.requires_arc = true
s.clean_paths = 'BlocksKit.xcodeproj/', 'GHUnitIOS.framework/', 'Tests/', '.gitignore'
def s.post_install(target)
prefix_header = config.project_pods_root + target.prefix_header_filename
prefix_header.open('a') do |file|
file.puts(%{#ifdef __OBJC__\n#import <dispatch/dispatch.h>\n#import "BlocksKit.h"\n#endif})
end
end
end
-22
View File
@@ -1,22 +0,0 @@
Pod::Spec.new do |s|
s.name = 'BlocksKit'
s.version = '1.0.0'
s.license = 'MIT'
s.summary = 'The Objective-C block utilities you always wish you had.'
s.homepage = 'https://github.com/zwaldowski/BlocksKit'
s.author = { 'Zachary Waldowski' => 'zwaldowski@gmail.com',
'Alexsander Akers' => 'a2@pandamonia.us' }
s.source = { :git => 'https://github.com/zwaldowski/BlocksKit.git', :tag => 'v1.0.0' }
s.source_files = 'BlocksKit'
s.dependency 'A2DynamicDelegate'
s.clean_paths = 'GHUnitIOS.framework/', 'Tests/', 'BlocksKit.xcodeproj/', '.gitignore'
if config.ios?
s.frameworks = 'MessageUI'
end
def s.post_install(target)
prefix_header = config.project_pods_root + target.prefix_header_filename
prefix_header.open('a') do |file|
file.puts(%{#ifdef __OBJC__\n#import "BlocksKit.h"\n#endif})
end
end
end
-22
View File
@@ -1,22 +0,0 @@
Pod::Spec.new do |s|
s.name = 'BlocksKit'
s.version = '1.0.1'
s.license = 'MIT'
s.summary = 'The Objective-C block utilities you always wish you had.'
s.homepage = 'https://github.com/zwaldowski/BlocksKit'
s.author = { 'Zachary Waldowski' => 'zwaldowski@gmail.com',
'Alexsander Akers' => 'a2@pandamonia.us' }
s.source = { :git => 'https://github.com/zwaldowski/BlocksKit.git', :tag => 'v1.0.1' }
s.source_files = 'BlocksKit'
s.dependency 'A2DynamicDelegate'
s.clean_paths = 'GHUnitIOS.framework/', 'Tests/', 'BlocksKit.xcodeproj/', '.gitignore'
if config.ios?
s.frameworks = 'MessageUI'
end
def s.post_install(target)
prefix_header = config.project_pods_root + target.prefix_header_filename
prefix_header.open('a') do |file|
file.puts(%{#ifdef __OBJC__\n#import "BlocksKit.h"\n#endif})
end
end
end
-22
View File
@@ -1,22 +0,0 @@
Pod::Spec.new do |s|
s.name = 'BlocksKit'
s.version = '1.0.2'
s.license = 'MIT'
s.summary = 'The Objective-C block utilities you always wish you had.'
s.homepage = 'https://github.com/zwaldowski/BlocksKit'
s.author = { 'Zachary Waldowski' => 'zwaldowski@gmail.com',
'Alexsander Akers' => 'a2@pandamonia.us' }
s.source = { :git => 'https://github.com/zwaldowski/BlocksKit.git', :tag => 'v1.0.2' }
s.source_files = 'BlocksKit'
s.dependency 'A2DynamicDelegate'
s.clean_paths = 'GHUnitIOS.framework/', 'Tests/', 'BlocksKit.xcodeproj/', '.gitignore'
if config.ios?
s.frameworks = 'MessageUI'
end
def s.post_install(target)
prefix_header = config.project_pods_root + target.prefix_header_filename
prefix_header.open('a') do |file|
file.puts(%{#ifdef __OBJC__\n#import "BlocksKit.h"\n#endif})
end
end
end
-22
View File
@@ -1,22 +0,0 @@
Pod::Spec.new do |s|
s.name = 'BlocksKit'
s.version = '1.0.3'
s.license = 'MIT'
s.summary = 'The Objective-C block utilities you always wish you had.'
s.homepage = 'https://github.com/zwaldowski/BlocksKit'
s.author = { 'Zachary Waldowski' => 'zwaldowski@gmail.com',
'Alexsander Akers' => 'a2@pandamonia.us' }
s.source = { :git => 'https://github.com/zwaldowski/BlocksKit.git', :tag => 'v1.0.3' }
s.source_files = 'BlocksKit'
s.dependency 'A2DynamicDelegate'
s.clean_paths = 'GHUnitIOS.framework/', 'Tests/', 'BlocksKit.xcodeproj/', '.gitignore'
if config.ios?
s.frameworks = 'MessageUI'
end
def s.post_install(target)
prefix_header = config.project_pods_root + target.prefix_header_filename
prefix_header.open('a') do |file|
file.puts(%{#ifdef __OBJC__\n#import "BlocksKit.h"\n#endif})
end
end
end
-22
View File
@@ -1,22 +0,0 @@
Pod::Spec.new do |s|
s.name = 'BlocksKit'
s.version = '1.0.4'
s.license = 'MIT'
s.summary = 'The Objective-C block utilities you always wish you had.'
s.homepage = 'https://github.com/zwaldowski/BlocksKit'
s.author = { 'Zachary Waldowski' => 'zwaldowski@gmail.com',
'Alexsander Akers' => 'a2@pandamonia.us' }
s.source = { :git => 'https://github.com/zwaldowski/BlocksKit.git', :tag => 'v1.0.4' }
s.source_files = 'BlocksKit'
s.dependency 'A2DynamicDelegate'
s.clean_paths = 'GHUnitIOS.framework/', 'Tests/', 'BlocksKit.xcodeproj/', '.gitignore'
if config.ios?
s.frameworks = 'MessageUI'
end
def s.post_install(target)
prefix_header = config.project_pods_root + target.prefix_header_filename
prefix_header.open('a') do |file|
file.puts(%{#ifdef __OBJC__\n#import "BlocksKit.h"\n#endif})
end
end
end
-22
View File
@@ -1,22 +0,0 @@
Pod::Spec.new do |s|
s.name = 'BlocksKit'
s.version = '1.0.5'
s.license = 'MIT'
s.summary = 'The Objective-C block utilities you always wish you had.'
s.homepage = 'https://github.com/zwaldowski/BlocksKit'
s.author = { 'Zachary Waldowski' => 'zwaldowski@gmail.com',
'Alexsander Akers' => 'a2@pandamonia.us' }
s.source = { :git => 'https://github.com/zwaldowski/BlocksKit.git', :tag => 'v1.0.5' }
s.source_files = 'BlocksKit'
s.dependency 'A2DynamicDelegate'
s.clean_paths = 'GHUnitIOS.framework/', 'Tests/', 'BlocksKit.xcodeproj/', '.gitignore'
if config.ios?
s.frameworks = 'MessageUI'
end
def s.post_install(target)
prefix_header = config.project_pods_root + target.prefix_header_filename
prefix_header.open('a') do |file|
file.puts(%{#ifdef __OBJC__\n#import "BlocksKit.h"\n#endif})
end
end
end
-24
View File
@@ -1,24 +0,0 @@
Pod::Spec.new do |s|
s.name = 'BlocksKit'
s.version = '1.0.6'
s.license = 'MIT'
s.summary = 'The Objective-C block utilities you always wish you had.'
s.homepage = 'https://github.com/zwaldowski/BlocksKit'
s.author = { 'Zachary Waldowski' => 'zwaldowski@gmail.com',
'Alexsander Akers' => 'a2@pandamonia.us' }
s.source = { :git => 'https://github.com/zwaldowski/BlocksKit.git', :tag => 'v1.0.6' }
s.dependency 'A2DynamicDelegate'
s.clean_paths = 'GHUnitIOS.framework/', 'Tests/', 'BlocksKit.xcodeproj/', '.gitignore'
if config.ios?
s.frameworks = 'MessageUI'
s.source_files = 'BlocksKit/*.{h,m}', 'BlocksKit/UIKit/*.{h,m}', 'BlocksKit/MessageUI/*.{h,m}'
else
s.source_files = 'BlocksKit/*.{h,m}'
end
def s.post_install(target)
prefix_header = config.project_pods_root + target.prefix_header_filename
prefix_header.open('a') do |file|
file.puts(%{#ifdef __OBJC__\n#import "BlocksKit.h"\n#endif})
end
end
end
@@ -1,20 +0,0 @@
Pod::Spec.new do |s|
s.name = 'CEPopupPickerView'
s.version = '0.1'
s.license = 'MIT'
s.summary = 'A UIPickerView that pops up, just like the Facebook app.'
s.homepage = 'https://github.com/chriseidhof/CEPopupPickerView'
s.author = { 'Chris Eidhof' => 'chris@eidhof.nl' }
s.source = { :git => 'https://github.com/chriseidhof/CEPopupPickerView.git', :tag => 'v0.1' }
s.platform = :ios
s.requires_arc = true
s.source_files = 'CEPopupPickerView/CEPopupPickerView.{h,m}'
s.clean_paths = '*.xcodeproj', '**/*.lproj', '**/*.plist', '*.xcworkspace',
'*Tests', 'Podfile', '**/*.pch',
"**/CEAppDelegate.*",
"**/CEViewController.{h,m}",
"**/main.m"
end
+629
View File
@@ -0,0 +1,629 @@
# Change Log
## [v3.0.5](https://github.com/Jawbone/JBChartView/tree/v3.0.5) (2016-01-20)
[Full Changelog](https://github.com/Jawbone/JBChartView/compare/v3.0.4...v3.0.5)
## [v3.0.4](https://github.com/Jawbone/JBChartView/tree/v3.0.4) (2016-01-20)
[Full Changelog](https://github.com/Jawbone/JBChartView/compare/v3.0.3...v3.0.4)
## [v3.0.3](https://github.com/Jawbone/JBChartView/tree/v3.0.3) (2016-01-20)
[Full Changelog](https://github.com/Jawbone/JBChartView/compare/v3.0.2...v3.0.3)
**Closed issues:**
- Dot alpha doesn't return after unselection [\#197](https://github.com/Jawbone/JBChartView/issues/197)
## [v3.0.2](https://github.com/Jawbone/JBChartView/tree/v3.0.2) (2016-01-19)
[Full Changelog](https://github.com/Jawbone/JBChartView/compare/v3.0.1...v3.0.2)
**Merged pull requests:**
- Make sure to import dependent framework header explicitly [\#196](https://github.com/Jawbone/JBChartView/pull/196) ([yasuoza](https://github.com/yasuoza))
## [v3.0.1](https://github.com/Jawbone/JBChartView/tree/v3.0.1) (2016-01-16)
[Full Changelog](https://github.com/Jawbone/JBChartView/compare/v3.0.0...v3.0.1)
## [v3.0.0](https://github.com/Jawbone/JBChartView/tree/v3.0.0) (2016-01-14)
[Full Changelog](https://github.com/Jawbone/JBChartView/compare/v2.9.1...v3.0.0)
**Closed issues:**
- Show data above each column [\#194](https://github.com/Jawbone/JBChartView/issues/194)
**Merged pull requests:**
- JBChartView 3.0 [\#195](https://github.com/Jawbone/JBChartView/pull/195) ([terryworona](https://github.com/terryworona))
## [v2.9.1](https://github.com/Jawbone/JBChartView/tree/v2.9.1) (2015-12-17)
[Full Changelog](https://github.com/Jawbone/JBChartView/compare/v2.9.0...v2.9.1)
**Implemented enhancements:**
- Min bars shouldn't animate bars when animating setState [\#192](https://github.com/Jawbone/JBChartView/issues/192)
## [v2.9.0](https://github.com/Jawbone/JBChartView/tree/v2.9.0) (2015-12-04)
[Full Changelog](https://github.com/Jawbone/JBChartView/compare/v2.8.19...v2.9.0)
## [v2.8.19](https://github.com/Jawbone/JBChartView/tree/v2.8.19) (2015-11-23)
[Full Changelog](https://github.com/Jawbone/JBChartView/compare/v2.8.18...v2.8.19)
**Fixed bugs:**
- Straight lines [\#94](https://github.com/Jawbone/JBChartView/issues/94)
## [v2.8.18](https://github.com/Jawbone/JBChartView/tree/v2.8.18) (2015-11-22)
[Full Changelog](https://github.com/Jawbone/JBChartView/compare/v2.8.17...v2.8.18)
**Implemented enhancements:**
- Vertical values should be supplied by the DataSource delegate for LineCharts [\#180](https://github.com/Jawbone/JBChartView/issues/180)
- JBLineChartDotsView reloadData performance issues [\#179](https://github.com/Jawbone/JBChartView/issues/179)
## [v2.8.17](https://github.com/Jawbone/JBChartView/tree/v2.8.17) (2015-11-21)
[Full Changelog](https://github.com/Jawbone/JBChartView/compare/v2.8.16...v2.8.17)
**Implemented enhancements:**
- Disabling/Enabling certain functionality: line chart selection and x-axis values [\#185](https://github.com/Jawbone/JBChartView/issues/185)
- Add ability to set selection permanently. [\#153](https://github.com/Jawbone/JBChartView/issues/153)
- The line fill color doesn't match the bottom of the drawn line [\#146](https://github.com/Jawbone/JBChartView/issues/146)
**Fixed bugs:**
- Bug when quickly tapping a line chart in two different places [\#159](https://github.com/Jawbone/JBChartView/issues/159)
**Closed issues:**
- Show dot only on vertical line selection [\#190](https://github.com/Jawbone/JBChartView/issues/190)
- Needs to support negative values [\#189](https://github.com/Jawbone/JBChartView/issues/189)
## [v2.8.16](https://github.com/Jawbone/JBChartView/tree/v2.8.16) (2015-09-18)
[Full Changelog](https://github.com/Jawbone/JBChartView/compare/v2.8.15...v2.8.16)
**Closed issues:**
- Partially filled bar [\#186](https://github.com/Jawbone/JBChartView/issues/186)
**Merged pull requests:**
- Delegate call to ignore touches on selected lines [\#188](https://github.com/Jawbone/JBChartView/pull/188) ([andrewloyola](https://github.com/andrewloyola))
## [v2.8.15](https://github.com/Jawbone/JBChartView/tree/v2.8.15) (2015-08-12)
[Full Changelog](https://github.com/Jawbone/JBChartView/compare/v2.8.14...v2.8.15)
**Implemented enhancements:**
- Suggestion for the README.md [\#176](https://github.com/Jawbone/JBChartView/issues/176)
**Fixed bugs:**
- Line color overlap issue [\#168](https://github.com/Jawbone/JBChartView/issues/168)
**Closed issues:**
- JBLineChart reloadData problem [\#181](https://github.com/Jawbone/JBChartView/issues/181)
- JBLineChartView: wrong width on iPhone6/6+ [\#177](https://github.com/Jawbone/JBChartView/issues/177)
- Is there anyway to plot two vertical values for one horizontal index in the bar chart? [\#172](https://github.com/Jawbone/JBChartView/issues/172)
- Charts not rendering properly [\#171](https://github.com/Jawbone/JBChartView/issues/171)
- How can you set the bar chart to fill the width of a UIView? [\#170](https://github.com/Jawbone/JBChartView/issues/170)
- Adding X and Y Values [\#169](https://github.com/Jawbone/JBChartView/issues/169)
- Undefined symbols for architecture i386 [\#167](https://github.com/Jawbone/JBChartView/issues/167)
- Not All Data Points Visible in Flexible View [\#166](https://github.com/Jawbone/JBChartView/issues/166)
**Merged pull requests:**
- Return the available height instead of 0 [\#183](https://github.com/Jawbone/JBChartView/pull/183) ([0xPr0xy](https://github.com/0xPr0xy))
- Adds support for gradients to line charts [\#175](https://github.com/Jawbone/JBChartView/pull/175) ([benjaminsnorris](https://github.com/benjaminsnorris))
## [v2.8.14](https://github.com/Jawbone/JBChartView/tree/v2.8.14) (2015-04-30)
[Full Changelog](https://github.com/Jawbone/JBChartView/compare/v2.8.13...v2.8.14)
**Closed issues:**
- Will JBChartView integrated with React Native? [\#164](https://github.com/Jawbone/JBChartView/issues/164)
- white dot+dotted lines sometimes does not appear when touched. [\#161](https://github.com/Jawbone/JBChartView/issues/161)
- Small offset when using a footer for a x-axis [\#160](https://github.com/Jawbone/JBChartView/issues/160)
- gradient for bar chart is lost / sizing problem [\#158](https://github.com/Jawbone/JBChartView/issues/158)
**Merged pull requests:**
- Nil out delegate and datasource on dealloc [\#165](https://github.com/Jawbone/JBChartView/pull/165) ([eventualbuddha](https://github.com/eventualbuddha))
## [v2.8.13](https://github.com/Jawbone/JBChartView/tree/v2.8.13) (2015-04-16)
[Full Changelog](https://github.com/Jawbone/JBChartView/compare/v2.8.12...v2.8.13)
**Fixed bugs:**
- Wrong calculation of the lineIndex [\#157](https://github.com/Jawbone/JBChartView/issues/157)
**Closed issues:**
- Swift round up for respondsToSelector\(\) and sizeWithFont\(\) [\#156](https://github.com/Jawbone/JBChartView/issues/156)
## [v2.8.12](https://github.com/Jawbone/JBChartView/tree/v2.8.12) (2015-04-13)
[Full Changelog](https://github.com/Jawbone/JBChartView/compare/v2.8.11...v2.8.12)
**Fixed bugs:**
- Footer and Header view Swift implementation [\#152](https://github.com/Jawbone/JBChartView/issues/152)
**Closed issues:**
- Problems with selection when JBLineChartView is within UITableView [\#155](https://github.com/Jawbone/JBChartView/issues/155)
- Show chart selection permanently [\#151](https://github.com/Jawbone/JBChartView/issues/151)
- Crash when returning NAN [\#150](https://github.com/Jawbone/JBChartView/issues/150)
**Merged pull requests:**
- Fix warnings when building w/ Xcode 6.3 [\#154](https://github.com/Jawbone/JBChartView/pull/154) ([amro](https://github.com/amro))
## [v2.8.11](https://github.com/Jawbone/JBChartView/tree/v2.8.11) (2015-03-31)
[Full Changelog](https://github.com/Jawbone/JBChartView/compare/v2.8.10...v2.8.11)
**Implemented enhancements:**
- Pass back barView & dot instances on selection [\#118](https://github.com/Jawbone/JBChartView/issues/118)
- Add ability to have the line start or end at any given point [\#115](https://github.com/Jawbone/JBChartView/issues/115)
- Consolidate dot view selection/unselection/color calls [\#101](https://github.com/Jawbone/JBChartView/issues/101)
- Change dot radius to dot diameter [\#99](https://github.com/Jawbone/JBChartView/issues/99)
- need Swift implementation details and example [\#80](https://github.com/Jawbone/JBChartView/issues/80)
- Add bar/line caching for only visible content. [\#61](https://github.com/Jawbone/JBChartView/issues/61)
**Closed issues:**
- Pie Chart support [\#149](https://github.com/Jawbone/JBChartView/issues/149)
- hi is it possible to have x,y value because in example there is no y value and only 2 x value [\#141](https://github.com/Jawbone/JBChartView/issues/141)
- imports without pods [\#140](https://github.com/Jawbone/JBChartView/issues/140)
- How can I group Bars? [\#139](https://github.com/Jawbone/JBChartView/issues/139)
- request: AreaChart - fillColorForLineAtLineIndex - add custom color for a specific X axis range [\#137](https://github.com/Jawbone/JBChartView/issues/137)
- smallest value is shown as a blank bar [\#136](https://github.com/Jawbone/JBChartView/issues/136)
- Is there any way I can use JBBarChartView as horizontal bars? [\#135](https://github.com/Jawbone/JBChartView/issues/135)
- Multiple colors to a line graph [\#134](https://github.com/Jawbone/JBChartView/issues/134)
- Overriding - \(void\)barChartView:\(JBBarChartView \*\)barChartView didSelectBarAtIndex:\(NSUInteger\)index is not showing selection view? [\#133](https://github.com/Jawbone/JBChartView/issues/133)
- Exception thrown on setState: [\#132](https://github.com/Jawbone/JBChartView/issues/132)
- X and Y scale and reference values [\#131](https://github.com/Jawbone/JBChartView/issues/131)
- Determine x-value of a certain point by a number instead of it's index in the input array? [\#130](https://github.com/Jawbone/JBChartView/issues/130)
- How to accomplish similar didUnselectBarChartView [\#129](https://github.com/Jawbone/JBChartView/issues/129)
- Is posible - scroll chart [\#126](https://github.com/Jawbone/JBChartView/issues/126)
- Crash when vertical value for horizontal at index x less than zero [\#125](https://github.com/Jawbone/JBChartView/issues/125)
- JBBarChartView does not display all the bars [\#124](https://github.com/Jawbone/JBChartView/issues/124)
- "automatically normalized across the entire chart" [\#123](https://github.com/Jawbone/JBChartView/issues/123)
- reloadData in viewDidLayoutSubviews does not trigger didDeselectLineInLineChartView on first selection [\#122](https://github.com/Jawbone/JBChartView/issues/122)
- Question [\#121](https://github.com/Jawbone/JBChartView/issues/121)
- Sublayers not properly resized [\#120](https://github.com/Jawbone/JBChartView/issues/120)
- It will be really cool if "while on tap on line charts dots I can get the dot object do some scale animation" or something? [\#119](https://github.com/Jawbone/JBChartView/issues/119)
- Is there any way I can pass new bar view while user selects particular bar? [\#117](https://github.com/Jawbone/JBChartView/issues/117)
- Typo error in README [\#114](https://github.com/Jawbone/JBChartView/issues/114)
- Dynamic/append values [\#113](https://github.com/Jawbone/JBChartView/issues/113)
- It needs better documentation [\#112](https://github.com/Jawbone/JBChartView/issues/112)
**Merged pull requests:**
- Keep tooltip subviews above line subviews [\#144](https://github.com/Jawbone/JBChartView/pull/144) ([vocaro](https://github.com/vocaro))
- Fix crash and warnings that can occur when a chart line has no data [\#143](https://github.com/Jawbone/JBChartView/pull/143) ([vocaro](https://github.com/vocaro))
- Add automatically generated change log file. [\#142](https://github.com/Jawbone/JBChartView/pull/142) ([skywinder](https://github.com/skywinder))
- Update README.md [\#127](https://github.com/Jawbone/JBChartView/pull/127) ([paal123](https://github.com/paal123))
- Add ability to have the line start or end at any given point [\#116](https://github.com/Jawbone/JBChartView/pull/116) ([sebastianreloaded](https://github.com/sebastianreloaded))
## [v2.8.10](https://github.com/Jawbone/JBChartView/tree/v2.8.10) (2014-09-23)
[Full Changelog](https://github.com/Jawbone/JBChartView/compare/v2.8.9...v2.8.10)
## [v2.8.9](https://github.com/Jawbone/JBChartView/tree/v2.8.9) (2014-09-22)
[Full Changelog](https://github.com/Jawbone/JBChartView/compare/v2.8.8...v2.8.9)
**Closed issues:**
- JBLineChartView doesn't resize its subviews [\#111](https://github.com/Jawbone/JBChartView/issues/111)
## [v2.8.8](https://github.com/Jawbone/JBChartView/tree/v2.8.8) (2014-09-20)
[Full Changelog](https://github.com/Jawbone/JBChartView/compare/v2.8.7...v2.8.8)
**Fixed bugs:**
- iOS 8 warnings [\#110](https://github.com/Jawbone/JBChartView/issues/110)
**Closed issues:**
- Noob level tutorial [\#109](https://github.com/Jawbone/JBChartView/issues/109)
- Data points with uneavenly distributed x-values? [\#108](https://github.com/Jawbone/JBChartView/issues/108)
## [v2.8.7](https://github.com/Jawbone/JBChartView/tree/v2.8.7) (2014-09-09)
[Full Changelog](https://github.com/Jawbone/JBChartView/compare/v2.8.6...v2.8.7)
**Implemented enhancements:**
- Add hide custom dot functionality [\#100](https://github.com/Jawbone/JBChartView/issues/100)
- Add footer padding [\#98](https://github.com/Jawbone/JBChartView/issues/98)
- DotView is hidden when inside selected table view cell [\#82](https://github.com/Jawbone/JBChartView/issues/82)
**Closed issues:**
- There should be flexibility to change to touch point to nearest data point so vertical selection view just jumps from one data point to another in JBLineChartView. [\#105](https://github.com/Jawbone/JBChartView/issues/105)
- barWidth Method and barPadding property should be in JBBarChartView header file. [\#104](https://github.com/Jawbone/JBChartView/issues/104)
- Why minimum and maximum should be positive? [\#102](https://github.com/Jawbone/JBChartView/issues/102)
**Merged pull requests:**
- iOS Framework Support [\#107](https://github.com/Jawbone/JBChartView/pull/107) ([thefirstnikhil](https://github.com/thefirstnikhil))
- Only call `numberOfLinesInLineChartView:` once per loop. [\#106](https://github.com/Jawbone/JBChartView/pull/106) ([eventualbuddha](https://github.com/eventualbuddha))
## [v2.8.6](https://github.com/Jawbone/JBChartView/tree/v2.8.6) (2014-08-29)
[Full Changelog](https://github.com/Jawbone/JBChartView/compare/v2.8.5...v2.8.6)
## [v2.8.5](https://github.com/Jawbone/JBChartView/tree/v2.8.5) (2014-08-28)
[Full Changelog](https://github.com/Jawbone/JBChartView/compare/v2.8.4...v2.8.5)
**Implemented enhancements:**
- Invert option for bar charts [\#97](https://github.com/Jawbone/JBChartView/issues/97)
## [v2.8.4](https://github.com/Jawbone/JBChartView/tree/v2.8.4) (2014-08-27)
[Full Changelog](https://github.com/Jawbone/JBChartView/compare/v2.8.3...v2.8.4)
## [v2.8.3](https://github.com/Jawbone/JBChartView/tree/v2.8.3) (2014-08-26)
[Full Changelog](https://github.com/Jawbone/JBChartView/compare/v2.8.2...v2.8.3)
**Implemented enhancements:**
- return type of barPaddingForBarChartView: [\#93](https://github.com/Jawbone/JBChartView/issues/93)
- Custom dot functionality [\#92](https://github.com/Jawbone/JBChartView/issues/92)
## [v2.8.2](https://github.com/Jawbone/JBChartView/tree/v2.8.2) (2014-08-26)
[Full Changelog](https://github.com/Jawbone/JBChartView/compare/v2.8.1...v2.8.2)
**Fixed bugs:**
- Selection view width should equal bar width [\#96](https://github.com/Jawbone/JBChartView/issues/96)
**Closed issues:**
- Changing dot radius in dotRadiusForLineAtLineIndex has no effect [\#95](https://github.com/Jawbone/JBChartView/issues/95)
## [v2.8.1](https://github.com/Jawbone/JBChartView/tree/v2.8.1) (2014-08-23)
[Full Changelog](https://github.com/Jawbone/JBChartView/compare/v2.8.0...v2.8.1)
## [v2.8.0](https://github.com/Jawbone/JBChartView/tree/v2.8.0) (2014-08-15)
[Full Changelog](https://github.com/Jawbone/JBChartView/compare/v2.7.4...v2.8.0)
**Closed issues:**
- Don't bring selection view to front with line view [\#89](https://github.com/Jawbone/JBChartView/issues/89)
**Merged pull requests:**
- Add per-line vertical selection color support. [\#90](https://github.com/Jawbone/JBChartView/pull/90) ([mszaro](https://github.com/mszaro))
## [v2.7.4](https://github.com/Jawbone/JBChartView/tree/v2.7.4) (2014-08-15)
[Full Changelog](https://github.com/Jawbone/JBChartView/compare/v2.7.3...v2.7.4)
**Implemented enhancements:**
- Not able to create Y-Axis labels or background grid [\#20](https://github.com/Jawbone/JBChartView/issues/20)
**Closed issues:**
- \[Enhancement\] Provide an option to disable Y-axis normalization for line graphs [\#88](https://github.com/Jawbone/JBChartView/issues/88)
- Add left padding to the graph for y-axis labels [\#87](https://github.com/Jawbone/JBChartView/issues/87)
- Error Protocol not implemented [\#86](https://github.com/Jawbone/JBChartView/issues/86)
- What if I want to animate the LineChartView progression? [\#85](https://github.com/Jawbone/JBChartView/issues/85)
- Enabling smooth lines in line chart view results in line graph clipping \(Out of bounds\)? [\#83](https://github.com/Jawbone/JBChartView/issues/83)
## [v2.7.3](https://github.com/Jawbone/JBChartView/tree/v2.7.3) (2014-08-07)
[Full Changelog](https://github.com/Jawbone/JBChartView/compare/v2.7.2...v2.7.3)
**Closed issues:**
- Can I animate bar charts? [\#79](https://github.com/Jawbone/JBChartView/issues/79)
- Create generic dataSource and delegate for extensibility. [\#78](https://github.com/Jawbone/JBChartView/issues/78)
## [v2.7.2](https://github.com/Jawbone/JBChartView/tree/v2.7.2) (2014-08-04)
[Full Changelog](https://github.com/Jawbone/JBChartView/compare/v2.7.1...v2.7.2)
## [v2.7.1](https://github.com/Jawbone/JBChartView/tree/v2.7.1) (2014-08-04)
[Full Changelog](https://github.com/Jawbone/JBChartView/compare/v2.7.0...v2.7.1)
**Closed issues:**
- Typo in JBBarChartView.h [\#77](https://github.com/Jawbone/JBChartView/issues/77)
- Refactor datasource and delegate functions [\#76](https://github.com/Jawbone/JBChartView/issues/76)
## [v2.7.0](https://github.com/Jawbone/JBChartView/tree/v2.7.0) (2014-08-02)
[Full Changelog](https://github.com/Jawbone/JBChartView/compare/v2.6.3...v2.7.0)
**Closed issues:**
- Incorrect padding on line widths [\#75](https://github.com/Jawbone/JBChartView/issues/75)
## [v2.6.3](https://github.com/Jawbone/JBChartView/tree/v2.6.3) (2014-07-31)
[Full Changelog](https://github.com/Jawbone/JBChartView/compare/v2.6.2...v2.6.3)
## [v2.6.2](https://github.com/Jawbone/JBChartView/tree/v2.6.2) (2014-07-25)
[Full Changelog](https://github.com/Jawbone/JBChartView/compare/v2.6.1...v2.6.2)
## [v2.6.1](https://github.com/Jawbone/JBChartView/tree/v2.6.1) (2014-07-25)
[Full Changelog](https://github.com/Jawbone/JBChartView/compare/v2.6.0...v2.6.1)
**Merged pull requests:**
- iOS 6 support [\#74](https://github.com/Jawbone/JBChartView/pull/74) ([luosheng](https://github.com/luosheng))
## [v2.6.0](https://github.com/Jawbone/JBChartView/tree/v2.6.0) (2014-07-24)
[Full Changelog](https://github.com/Jawbone/JBChartView/compare/v2.5.5...v2.6.0)
**Closed issues:**
- Allow setting views for lines as well as bars [\#73](https://github.com/Jawbone/JBChartView/issues/73)
- Requires iOS 7 or later [\#72](https://github.com/Jawbone/JBChartView/issues/72)
- How to Know the x,width of each bar [\#70](https://github.com/Jawbone/JBChartView/issues/70)
- Multiple y-axis [\#69](https://github.com/Jawbone/JBChartView/issues/69)
- NSInternalInconsistencyException - JBLineChartView // dataSource must implement [\#68](https://github.com/Jawbone/JBChartView/issues/68)
- Zoom and scrolling? \(Question\) [\#65](https://github.com/Jawbone/JBChartView/issues/65)
- Support for missing data points rather than going to 0? [\#63](https://github.com/Jawbone/JBChartView/issues/63)
- Interesting behavior 'barViewAtIndex' and 'colorForBarViewAtIndex'. [\#62](https://github.com/Jawbone/JBChartView/issues/62)
- In LineChart x-axis, splits into more numbers and not able view x-axis last point [\#60](https://github.com/Jawbone/JBChartView/issues/60)
- Overlay more than 1 chart? [\#59](https://github.com/Jawbone/JBChartView/issues/59)
- Footer Views - Can they be perpendicular to the x-axis [\#58](https://github.com/Jawbone/JBChartView/issues/58)
**Merged pull requests:**
- Fill Color on Line Chart [\#71](https://github.com/Jawbone/JBChartView/pull/71) ([legranddamien](https://github.com/legranddamien))
- Added documentation for usage in a Swift project [\#67](https://github.com/Jawbone/JBChartView/pull/67) ([jonparker](https://github.com/jonparker))
## [v2.5.5](https://github.com/Jawbone/JBChartView/tree/v2.5.5) (2014-05-14)
[Full Changelog](https://github.com/Jawbone/JBChartView/compare/v2.5.4...v2.5.5)
**Implemented enhancements:**
- Ability to draw lines with negative values [\#51](https://github.com/Jawbone/JBChartView/issues/51)
**Closed issues:**
- How to adjust selected bar height for LineChart in demo project [\#56](https://github.com/Jawbone/JBChartView/issues/56)
- Line Chart Collapse Animation Changed? [\#54](https://github.com/Jawbone/JBChartView/issues/54)
**Merged pull requests:**
- Fixed barView's frame. [\#57](https://github.com/Jawbone/JBChartView/pull/57) ([pala](https://github.com/pala))
- Update sample code in readme [\#55](https://github.com/Jawbone/JBChartView/pull/55) ([pala](https://github.com/pala))
## [v2.5.4](https://github.com/Jawbone/JBChartView/tree/v2.5.4) (2014-05-07)
[Full Changelog](https://github.com/Jawbone/JBChartView/compare/v2.5.3...v2.5.4)
**Merged pull requests:**
- Add delegate method barChartView:colorForBarViewAtIndex: to JBBarChartViewDataSource [\#53](https://github.com/Jawbone/JBChartView/pull/53) ([skywinder](https://github.com/skywinder))
- Compiling warrnings and typos [\#52](https://github.com/Jawbone/JBChartView/pull/52) ([skywinder](https://github.com/skywinder))
## [v2.5.3](https://github.com/Jawbone/JBChartView/tree/v2.5.3) (2014-05-06)
[Full Changelog](https://github.com/Jawbone/JBChartView/compare/v2.5.2...v2.5.3)
## [v2.5.2](https://github.com/Jawbone/JBChartView/tree/v2.5.2) (2014-05-06)
[Full Changelog](https://github.com/Jawbone/JBChartView/compare/v2.5.1...v2.5.2)
## [v2.5.1](https://github.com/Jawbone/JBChartView/tree/v2.5.1) (2014-05-05)
[Full Changelog](https://github.com/Jawbone/JBChartView/compare/v2.5.0...v2.5.1)
**Closed issues:**
- non-evenly distributed plots [\#50](https://github.com/Jawbone/JBChartView/issues/50)
- Using minimum of 0 as default [\#48](https://github.com/Jawbone/JBChartView/issues/48)
## [v2.5.0](https://github.com/Jawbone/JBChartView/tree/v2.5.0) (2014-05-04)
[Full Changelog](https://github.com/Jawbone/JBChartView/compare/v2.4.3...v2.5.0)
## [v2.4.3](https://github.com/Jawbone/JBChartView/tree/v2.4.3) (2014-05-04)
[Full Changelog](https://github.com/Jawbone/JBChartView/compare/v2.4.2...v2.4.3)
**Closed issues:**
- Bars not drawn when all have the same height [\#47](https://github.com/Jawbone/JBChartView/issues/47)
- Moving podspec to root [\#46](https://github.com/Jawbone/JBChartView/issues/46)
**Merged pull requests:**
- fixed typo, renamed mininum -\> minimum [\#49](https://github.com/Jawbone/JBChartView/pull/49) ([simonnickel](https://github.com/simonnickel))
## [v2.4.2](https://github.com/Jawbone/JBChartView/tree/v2.4.2) (2014-05-01)
[Full Changelog](https://github.com/Jawbone/JBChartView/compare/v2.4.1...v2.4.2)
## [v2.4.1](https://github.com/Jawbone/JBChartView/tree/v2.4.1) (2014-04-30)
[Full Changelog](https://github.com/Jawbone/JBChartView/compare/v2.4.0...v2.4.1)
**Implemented enhancements:**
- Curved line charts [\#23](https://github.com/Jawbone/JBChartView/issues/23)
**Closed issues:**
- JBChartView demo footerview problem [\#44](https://github.com/Jawbone/JBChartView/issues/44)
**Merged pull requests:**
- Smooth curve fix [\#45](https://github.com/Jawbone/JBChartView/pull/45) ([ktran03](https://github.com/ktran03))
## [v2.4.0](https://github.com/Jawbone/JBChartView/tree/v2.4.0) (2014-04-28)
[Full Changelog](https://github.com/Jawbone/JBChartView/compare/v2.3.0...v2.4.0)
**Closed issues:**
- Aligning X-axis, padding? [\#43](https://github.com/Jawbone/JBChartView/issues/43)
- `JBLineChartFooterView` Value Marks are Inaccurate [\#41](https://github.com/Jawbone/JBChartView/issues/41)
**Merged pull requests:**
- smooth curve using bezierpath [\#39](https://github.com/Jawbone/JBChartView/pull/39) ([ktran03](https://github.com/ktran03))
## [v2.3.0](https://github.com/Jawbone/JBChartView/tree/v2.3.0) (2014-04-18)
[Full Changelog](https://github.com/Jawbone/JBChartView/compare/v2.2.0...v2.3.0)
**Closed issues:**
- Crash, lineChartView "must implement numberOfPointsInLineChartView" ? [\#38](https://github.com/Jawbone/JBChartView/issues/38)
## [v2.2.0](https://github.com/Jawbone/JBChartView/tree/v2.2.0) (2014-04-14)
[Full Changelog](https://github.com/Jawbone/JBChartView/compare/v2.1.6...v2.2.0)
**Closed issues:**
- Typo in readme? [\#36](https://github.com/Jawbone/JBChartView/issues/36)
- Nav bar background remains black [\#35](https://github.com/Jawbone/JBChartView/issues/35)
**Merged pull requests:**
- Added delegate method to configure the width of the vertical selection bar in a line chart. [\#37](https://github.com/Jawbone/JBChartView/pull/37) ([ghost](https://github.com/ghost))
## [v2.1.6](https://github.com/Jawbone/JBChartView/tree/v2.1.6) (2014-04-11)
[Full Changelog](https://github.com/Jawbone/JBChartView/compare/v2.1.5...v2.1.6)
**Closed issues:**
- `showsLineSelection` Does Nothing [\#33](https://github.com/Jawbone/JBChartView/issues/33)
- cocoapods [\#31](https://github.com/Jawbone/JBChartView/issues/31)
## [v2.1.5](https://github.com/Jawbone/JBChartView/tree/v2.1.5) (2014-04-10)
[Full Changelog](https://github.com/Jawbone/JBChartView/compare/v2.1.4...v2.1.5)
**Merged pull requests:**
- JBChartView: needs initWithCoder initializer for inflation from a xib [\#30](https://github.com/Jawbone/JBChartView/pull/30) ([gumbypp](https://github.com/gumbypp))
## [v2.1.4](https://github.com/Jawbone/JBChartView/tree/v2.1.4) (2014-04-10)
[Full Changelog](https://github.com/Jawbone/JBChartView/compare/v2.1.3...v2.1.4)
**Closed issues:**
- Stach bars? [\#29](https://github.com/Jawbone/JBChartView/issues/29)
- Problem with Bar Height [\#28](https://github.com/Jawbone/JBChartView/issues/28)
- Selection does not work without Auto Layout in iPhone 3.5" [\#27](https://github.com/Jawbone/JBChartView/issues/27)
## [v2.1.3](https://github.com/Jawbone/JBChartView/tree/v2.1.3) (2014-04-03)
[Full Changelog](https://github.com/Jawbone/JBChartView/compare/v2.1.2...v2.1.3)
## [v2.1.2](https://github.com/Jawbone/JBChartView/tree/v2.1.2) (2014-04-02)
[Full Changelog](https://github.com/Jawbone/JBChartView/compare/v2.1.1...v2.1.2)
## [v2.1.1](https://github.com/Jawbone/JBChartView/tree/v2.1.1) (2014-04-02)
[Full Changelog](https://github.com/Jawbone/JBChartView/compare/v2.1.0...v2.1.1)
**Closed issues:**
- representing negative values [\#26](https://github.com/Jawbone/JBChartView/issues/26)
- Real time [\#25](https://github.com/Jawbone/JBChartView/issues/25)
## [v2.1.0](https://github.com/Jawbone/JBChartView/tree/v2.1.0) (2014-03-31)
[Full Changelog](https://github.com/Jawbone/JBChartView/compare/v2.0.2...v2.1.0)
## [v2.0.2](https://github.com/Jawbone/JBChartView/tree/v2.0.2) (2014-03-27)
[Full Changelog](https://github.com/Jawbone/JBChartView/compare/v2.0.1...v2.0.2)
**Closed issues:**
- Negative Bars? [\#24](https://github.com/Jawbone/JBChartView/issues/24)
## [v2.0.1](https://github.com/Jawbone/JBChartView/tree/v2.0.1) (2014-03-19)
[Full Changelog](https://github.com/Jawbone/JBChartView/compare/v2.0.0...v2.0.1)
**Closed issues:**
- NSAssert on bar height in JBBarChartView, \> 0 when it should be \>= [\#22](https://github.com/Jawbone/JBChartView/issues/22)
## [v2.0.0](https://github.com/Jawbone/JBChartView/tree/v2.0.0) (2014-03-19)
[Full Changelog](https://github.com/Jawbone/JBChartView/compare/v1.1.6...v2.0.0)
**Implemented enhancements:**
- Multiple Lines on chart [\#6](https://github.com/Jawbone/JBChartView/issues/6)
**Closed issues:**
- JBBarChartView Bar Height Problem With Storyboard/Autolayout [\#19](https://github.com/Jawbone/JBChartView/issues/19)
- blank result [\#18](https://github.com/Jawbone/JBChartView/issues/18)
- Bar Highlight Offset Issue [\#17](https://github.com/Jawbone/JBChartView/issues/17)
- Following the tutorial creates an empty/blank view [\#16](https://github.com/Jawbone/JBChartView/issues/16)
**Merged pull requests:**
- Multiple Line Support & Tooltips [\#21](https://github.com/Jawbone/JBChartView/pull/21) ([terryworona](https://github.com/terryworona))
## [v1.1.6](https://github.com/Jawbone/JBChartView/tree/v1.1.6) (2014-03-03)
[Full Changelog](https://github.com/Jawbone/JBChartView/compare/v1.1.5...v1.1.6)
**Merged pull requests:**
- Added customization for line width [\#15](https://github.com/Jawbone/JBChartView/pull/15) ([kmcbride](https://github.com/kmcbride))
- fix spelling mistake [\#14](https://github.com/Jawbone/JBChartView/pull/14) ([Undo1](https://github.com/Undo1))
## [v1.1.5](https://github.com/Jawbone/JBChartView/tree/v1.1.5) (2014-02-12)
[Full Changelog](https://github.com/Jawbone/JBChartView/compare/v1.1.4...v1.1.5)
## [v1.1.4](https://github.com/Jawbone/JBChartView/tree/v1.1.4) (2014-02-06)
[Full Changelog](https://github.com/Jawbone/JBChartView/compare/v1.1.3...v1.1.4)
**Closed issues:**
- What about ios6 [\#13](https://github.com/Jawbone/JBChartView/issues/13)
- Could the Bar Chart data be nil ? [\#12](https://github.com/Jawbone/JBChartView/issues/12)
## [v1.1.3](https://github.com/Jawbone/JBChartView/tree/v1.1.3) (2014-01-06)
[Full Changelog](https://github.com/Jawbone/JBChartView/compare/v1.1.2...v1.1.3)
**Closed issues:**
- heightForIndex should return CGFloat instead of NSInteger [\#9](https://github.com/Jawbone/JBChartView/issues/9)
**Merged pull requests:**
- Fixes small typos in README [\#11](https://github.com/Jawbone/JBChartView/pull/11) ([sampage](https://github.com/sampage))
## [v1.1.2](https://github.com/Jawbone/JBChartView/tree/v1.1.2) (2014-01-03)
[Full Changelog](https://github.com/Jawbone/JBChartView/compare/v1.1.1...v1.1.2)
## [v1.1.1](https://github.com/Jawbone/JBChartView/tree/v1.1.1) (2014-01-02)
[Full Changelog](https://github.com/Jawbone/JBChartView/compare/v1.1.0...v1.1.1)
**Closed issues:**
- reloadData is not reducing height of other bars [\#7](https://github.com/Jawbone/JBChartView/issues/7)
- Add barViewAtIndex: to datasource [\#5](https://github.com/Jawbone/JBChartView/issues/5)
**Merged pull requests:**
- Reset cached max height on data reload Fixes \#7 [\#8](https://github.com/Jawbone/JBChartView/pull/8) ([l4u](https://github.com/l4u))
## [v1.1.0](https://github.com/Jawbone/JBChartView/tree/v1.1.0) (2013-12-26)
[Full Changelog](https://github.com/Jawbone/JBChartView/compare/v1.0.3...v1.1.0)
## [v1.0.3](https://github.com/Jawbone/JBChartView/tree/v1.0.3) (2013-12-23)
[Full Changelog](https://github.com/Jawbone/JBChartView/compare/v1.0.2...v1.0.3)
**Closed issues:**
- Single press on bar [\#3](https://github.com/Jawbone/JBChartView/issues/3)
## [v1.0.2](https://github.com/Jawbone/JBChartView/tree/v1.0.2) (2013-12-17)
[Full Changelog](https://github.com/Jawbone/JBChartView/compare/v1.0.1...v1.0.2)
## [v1.0.1](https://github.com/Jawbone/JBChartView/tree/v1.0.1) (2013-12-15)
[Full Changelog](https://github.com/Jawbone/JBChartView/compare/v1.0...v1.0.1)
**Merged pull requests:**
- If there is no footer view, bars won't be added to the chart. [\#2](https://github.com/Jawbone/JBChartView/pull/2) ([joelkraut](https://github.com/joelkraut))
## [v1.0](https://github.com/Jawbone/JBChartView/tree/v1.0) (2013-12-11)
[Full Changelog](https://github.com/Jawbone/JBChartView/compare/0.2.0...v1.0)
**Merged pull requests:**
- JBChartViewDemo and JBChartView [\#1](https://github.com/Jawbone/JBChartView/pull/1) ([terryworona](https://github.com/terryworona))
## [0.2.0](https://github.com/Jawbone/JBChartView/tree/0.2.0) (2013-08-20)
[Full Changelog](https://github.com/Jawbone/JBChartView/compare/1.0...0.2.0)
## [1.0](https://github.com/Jawbone/JBChartView/tree/1.0) (2012-04-23)
[Full Changelog](https://github.com/Jawbone/JBChartView/compare/1.0.0...1.0)
## [1.0.0](https://github.com/Jawbone/JBChartView/tree/1.0.0) (2012-04-23)
\* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
-13
View File
@@ -1,13 +0,0 @@
Pod::Spec.new do |s|
s.name = 'CMPopTipView'
s.version = '0.0.1'
s.license = 'MIT'
s.summary = 'Custom UIView for iOS that pops up an animated "bubble" pointing at a button or other view. Useful for popup tips.'
s.homepage = 'https://github.com/chrismiles/CMPopTipView'
s.author = { 'Chris Miles' => 'http://chrismiles.info/' }
s.source = { :git => 'https://github.com/chrismiles/CMPopTipView.git', :commit => '92e85f47c565e25063d95959edcf1fd4db700a34' }
s.platform = :ios
s.source_files = 'CMPopTipView/*.{h,m}'
s.framework = 'UIKit'
s.clean_path = "Demo"
end
@@ -0,0 +1,16 @@
//
// NSMutableArray+JBStack.h
// JBChartViewDemo
//
// Created by Terry Worona on 12/25/15.
// Copyright © 2015 Jawbone. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface NSMutableArray (JBStack)
- (void)jb_push:(id)object;
- (id)jb_pop;
@end
@@ -0,0 +1,34 @@
//
// NSMutableArray+JBStack.m
// JBChartViewDemo
//
// Created by Terry Worona on 12/25/15.
// Copyright © 2015 Jawbone. All rights reserved.
//
#import "NSMutableArray+JBStack.h"
@implementation NSMutableArray (JBStack)
#pragma mark - Operations
- (void)jb_push:(id)object
{
if (object != nil)
{
[self insertObject:object atIndex:0];
}
}
- (id)jb_pop
{
id object = [self firstObject];
if (object != nil)
{
[self removeObjectAtIndex:0];
return object;
}
return nil;
}
@end
+184
View File
@@ -0,0 +1,184 @@
//
// JBBarChartView.h
// JBChartView
//
// Created by Terry Worona on 9/3/13.
// Copyright (c) 2013 Jawbone. All rights reserved.
//
// Views
#import "JBChartView.h"
@class JBBarChartView;
@protocol JBBarChartViewDataSource <JBChartViewDataSource>
@required
/**
* The number of bars in a given bar chart is the number of vertical views shown along the x-axis.
*
* @param barChartView The bar chart object requesting this information.
*
* @return Number of bars in the given chart, displayed horizontally along the chart's x-axis.
*/
- (NSUInteger)numberOfBarsInBarChartView:(JBBarChartView *)barChartView;
@optional
/**
* A UIView subclass representing the bar at a particular index.
*
* Default: solid black UIView.
*
* @param barChartView The bar chart object requesting this information.
* @param index The 0-based index of a given bar (left to right, x-axis).
*
* @return A UIView subclass. The view will automatically be resized by the chart during creation (ie. no need to set the frame).
*/
- (UIView *)barChartView:(JBBarChartView *)barChartView barViewAtIndex:(NSUInteger)index;
@end
@protocol JBBarChartViewDelegate <JBChartViewDelegate>
@required
/**
* Height for a bar at a given index (left to right). There is no ceiling on the the height;
* the chart will automatically normalize all values between the overal min and max heights.
*
* @param barChartView The bar chart object requesting this information.
* @param index The 0-based index of a given bar (left to right, x-axis).
*
* @return The y-axis height of the supplied bar index (x-axis)
*/
- (CGFloat)barChartView:(JBBarChartView *)barChartView heightForBarViewAtIndex:(NSUInteger)index;
@optional
/**
* Occurs when a touch gesture event occurs on a given bar (chart must be expanded).
* and the selection must occur within the bounds of the chart.
*
* @param barChartView A bar chart object informing the delegate about the new selection.
* @param index The 0-based index of a given bar (left to right, x-axis).
* @param touchPoint The touch point in relation to the chart's bounds (excludes footer and header).
*/
- (void)barChartView:(JBBarChartView *)barChartView didSelectBarAtIndex:(NSUInteger)index touchPoint:(CGPoint)touchPoint;
- (void)barChartView:(JBBarChartView *)barChartView didSelectBarAtIndex:(NSUInteger)index;
/**
* Occurs when selection ends by either ending a touch event or selecting an area that is outside the view's bounds.
* For selection start events, see: didSelectBarAtIndex...
*
* @param barChartView A bar chart object informing the delegate about the deselection.
*/
- (void)didDeselectBarChartView:(JBBarChartView *)barChartView;
/**
* If you already implement barChartView:barViewAtIndex: delegate - this method has no effect.
* If a custom UIView isn't supplied, a flat bar will be made automatically (default color black).
*
* Default: black color.
*
* @param barChartView The bar chart object requesting this information.
* @param index The 0-based index of a given bar (left to right, x-axis).
*
* @return The color to be used to color a bar in the chart.
*/
- (UIColor *)barChartView:(JBBarChartView *)barChartView colorForBarViewAtIndex:(NSUInteger)index;
/**
* If you already implement barChartView:barViewAtIndex: delegate - this method has no effect.
* If a custom UIView isn't supplied and barChartView:colorForBarViewAtIndex: isn't implemented, then
* a gradient layer may be supplied to be used across all bars within the chart.
*
* Default: black color.
*
* @param barChartView The bar chart object requesting this information.
*
* @return The gradient layer to be used as a mask over all bars within the chart.
*/
- (CAGradientLayer *)barGradientForBarChartView:(JBBarChartView *)barChartView;
/**
* The selection color to be overlayed on a bar during touch events.
* The color is automatically faded to transparent (vertically). The property showsVerticalSelection
* must be YES for the color to apply.
*
* Default: white color (faded to transparent).
*
* @param barChartView The bar chart object requesting this information.
*
* @return The color to be used on each bar selection.
*/
- (UIColor *)barSelectionColorForBarChartView:(JBBarChartView *)barChartView;
/**
* Horizontal padding between bars.
*
* Default: 'best-guess' algorithm based on the the total number of bars and width of the chart.
*
* @param barChartView The bar chart object requesting this information.
*
* @return Horizontal width (in pixels) between each bar.
*/
- (CGFloat)barPaddingForBarChartView:(JBBarChartView *)barChartView;
@end
@interface JBBarChartView : JBChartView
@property (nonatomic, weak) id<JBBarChartViewDataSource> dataSource;
@property (nonatomic, weak) id<JBBarChartViewDelegate> delegate;
/*
* Bars can be (vertically) positoned top to bottom instead of bottom up.
* If this property is set to YES, both the bar and the selection view will be inverted.
* For the inverted orientation to take effect, reloadData must be called.
*
* Default: NO.
*/
@property (nonatomic, assign, getter=isInverted) BOOL inverted;
/*
* Reloads the bar chart with a custom animation.
* Adding, removing or modifying existing bars will be animated (collapsing, expanding, etc) if animated = YES.
* Reloading (animated) data is thread safe and can be executed any number of times in succession.
*
* Default: a non-animated reload (via reloadData).
*/
- (void)reloadDataAnimated:(BOOL)animated;
/*
* When reloadData or reloadDataAnimated: is called, the reloading bit is turned on.
* State changes during a reload will be ignored. As well, subsequent calls to reloadData:
* or reloadDataAnimated: before any previous reloads are complete, will also be ignored.
* Lastly, all touch events will be ignored until a reload has compeleted.
*
* Note: the above restrictions apply only to animated reloads, as non-animated reloads are synchronous.
*
* Default: NO.
*/
@property (nonatomic, readonly) BOOL reloading;
/**
* Vertical highlight overlayed on bar during touch events.
*
* Default: YES.
*/
@property (nonatomic, assign) BOOL showsVerticalSelection;
/**
* The bar view at a particular index.
*
* Default: nil.
*
* @param index The 0-based index of a given bar (left to right, x-axis).
*
* @return The UIView representing the bar view at a given index or nil if the index is out of range.
*/
- (UIView *)barViewAtIndex:(NSUInteger)index;
@end
+914
View File
@@ -0,0 +1,914 @@
//
// JBBarChartView.m
// Nudge
//
// Created by Terry Worona on 9/3/13.
// Copyright (c) 2013 Jawbone. All rights reserved.
//
#import "JBBarChartView.h"
// Views
#import "JBGradientBarView.h"
// Numerics
static CGFloat const kJBBarChartViewBarBasePaddingMutliplier = 50.0f;
static CGFloat const kJBBarChartViewUndefinedCachedHeight = -1.0f;
static CGFloat const kJBBarChartViewStateAnimationDuration = 0.05f;
static CGFloat const kJBBarChartViewReloadDataAnimationDuration = 0.15f;
static CGFloat const kJBBarChartViewStatePopOffset = 10.0f;
static NSInteger const kJBBarChartViewUndefinedBarIndex = -1;
// Colors (JBChartView)
static UIColor *kJBBarChartViewDefaultBarColor = nil;
@interface JBChartView (Private)
- (BOOL)hasMaximumValue;
- (BOOL)hasMinimumValue;
@end
@interface JBBarChartView () <JBGradientBarViewDataSource>
@property (nonatomic, strong) NSArray *chartData; // index = column, value = height
@property (nonatomic, strong) NSArray *barViews;
@property (nonatomic, strong) NSArray *cachedBarViewHeights;
@property (nonatomic, assign) CGFloat barPadding;
@property (nonatomic, assign) CGFloat cachedMaxHeight;
@property (nonatomic, assign) CGFloat cachedMinHeight;
@property (nonatomic, strong) JBChartVerticalSelectionView *verticalSelectionView;
@property (nonatomic, assign) BOOL verticalSelectionViewVisible;
@property (nonatomic, assign) BOOL reloading;
// Initialization
- (void)construct;
// View quick accessors
- (CGFloat)availableHeight;
- (CGFloat)normalizedHeightForRawHeight:(NSNumber *)rawHeight;
- (CGFloat)barWidth;
// Touch helpers
- (NSInteger)barViewIndexForPoint:(CGPoint)point;
- (UIView *)barViewForForPoint:(CGPoint)point;
- (void)touchesBeganOrMovedWithTouches:(NSSet *)touches;
- (void)touchesEndedOrCancelledWithTouches:(NSSet *)touches;
// Setters
- (void)setVerticalSelectionViewVisible:(BOOL)verticalSelectionViewVisible animated:(BOOL)animated;
// Helpers
- (UIView *)createBarViewForIndex:(NSUInteger)index;
- (void)insertBarView:(UIView *)barView;
@end
@implementation JBBarChartView
@dynamic dataSource;
@dynamic delegate;
#pragma mark - Alloc/Init
+ (void)initialize
{
if (self == [JBBarChartView class])
{
kJBBarChartViewDefaultBarColor = [UIColor blackColor];
}
}
- (id)initWithCoder:(NSCoder *)aDecoder
{
self = [super initWithCoder:aDecoder];
if (self)
{
[self construct];
}
return self;
}
- (id)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self)
{
[self construct];
}
return self;
}
- (id)init
{
self = [super init];
if (self)
{
[self construct];
}
return self;
}
- (void)construct
{
_showsVerticalSelection = YES;
_cachedMinHeight = kJBBarChartViewUndefinedCachedHeight;
_cachedMaxHeight = kJBBarChartViewUndefinedCachedHeight;
}
#pragma mark - Memory Management
- (void)dealloc
{
[NSObject cancelPreviousPerformRequestsWithTarget:self];
}
#pragma mark - Data
- (void)reloadDataAnimated:(BOOL)animated
{
if (self.reloading)
{
return;
}
self.reloading = YES;
// Reset cached max height
self.cachedMinHeight = kJBBarChartViewUndefinedCachedHeight;
self.cachedMaxHeight = kJBBarChartViewUndefinedCachedHeight;
// Animation check
BOOL shouldAnimate = (animated && self.state == JBChartViewStateExpanded);
/*
* Final block to refresh state and turn off reloading bit
*/
dispatch_block_t completionBlock = ^{
self.reloading = NO;
[self setState:self.state animated:NO force:YES callback:nil];
};
/*
* The data collection holds all position information:
* constructed via datasource and delegate functions
*/
dispatch_block_t createDataDictionariesBlock = ^{
// Grab the count
NSAssert([self.dataSource respondsToSelector:@selector(numberOfBarsInBarChartView:)], @"JBBarChartView // datasource must implement - (NSUInteger)numberOfBarsInBarChartView:(JBBarChartView *)barChartView");
NSUInteger dataCount = [self.dataSource numberOfBarsInBarChartView:self];
// Build up the data collection
NSAssert([self.delegate respondsToSelector:@selector(barChartView:heightForBarViewAtIndex:)], @"JBBarChartView // delegate must implement - (CGFloat)barChartView:(JBBarChartView *)barChartView heightForBarViewAtIndex:(NSUInteger)index");
NSMutableArray *mutableChartData = [NSMutableArray array];
for (NSUInteger index=0; index<dataCount; index++)
{
CGFloat height = [self.delegate barChartView:self heightForBarViewAtIndex:index];
NSAssert(height >= 0, @"JBBarChartView // datasource function - (CGFloat)barChartView:(JBBarChartView *)barChartView heightForBarViewAtIndex:(NSUInteger)index must return a CGFloat >= 0");
[mutableChartData addObject:[NSNumber numberWithFloat:height]];
}
self.chartData = [NSArray arrayWithArray:mutableChartData];
};
/*
* Determines the padding between bars as a function of # of bars
*/
dispatch_block_t createBarPaddingBlock = ^{
if ([self.delegate respondsToSelector:@selector(barPaddingForBarChartView:)])
{
self.barPadding = [self.delegate barPaddingForBarChartView:self];
}
else
{
NSUInteger totalBars = [self.chartData count];
self.barPadding = (1/(float)totalBars) * kJBBarChartViewBarBasePaddingMutliplier;
}
};
/*
* Creates a vertical selection view for touch events
*/
dispatch_block_t createSelectionViewBlock = ^{
// Remove old selection bar
if (self.verticalSelectionView)
{
[self.verticalSelectionView removeFromSuperview];
self.verticalSelectionView = nil;
}
CGFloat verticalSelectionViewHeight = self.bounds.size.height - self.headerView.frame.size.height - self.footerView.frame.size.height - self.headerPadding - self.footerPadding;
if ([self.dataSource respondsToSelector:@selector(shouldExtendSelectionViewIntoHeaderPaddingForChartView:)])
{
if ([self.dataSource shouldExtendSelectionViewIntoHeaderPaddingForChartView:self])
{
verticalSelectionViewHeight += self.headerPadding;
}
}
if ([self.dataSource respondsToSelector:@selector(shouldExtendSelectionViewIntoFooterPaddingForChartView:)])
{
if ([self.dataSource shouldExtendSelectionViewIntoFooterPaddingForChartView:self])
{
verticalSelectionViewHeight += self.footerPadding;
}
}
self.verticalSelectionView = [[JBChartVerticalSelectionView alloc] initWithFrame:CGRectMake(0, 0, [self barWidth], verticalSelectionViewHeight)];
self.verticalSelectionView.alpha = 0.0;
self.verticalSelectionView.hidden = !self.showsVerticalSelection;
if ([self.delegate respondsToSelector:@selector(barSelectionColorForBarChartView:)])
{
UIColor *selectionViewBackgroundColor = [self.delegate barSelectionColorForBarChartView:self];
NSAssert(selectionViewBackgroundColor != nil, @"JBBarChartView // delegate function - (UIColor *)barSelectionColorForBarChartView:(JBBarChartView *)barChartView must return a non-nil UIColor");
self.verticalSelectionView.bgColor = selectionViewBackgroundColor;
}
// Add new selection bar
if (self.footerView)
{
[self insertSubview:self.verticalSelectionView belowSubview:self.footerView];
}
else
{
[self addSubview:self.verticalSelectionView];
}
self.verticalSelectionView.transform = self.inverted ? CGAffineTransformMakeScale(1.0, -1.0) : CGAffineTransformIdentity;
};
/*
* Creates a new bar graph view using the previously calculated data model
*/
dispatch_block_t createBarViewsBlock = ^{
__weak JBBarChartView* weakSelf = self;
if (shouldAnimate)
{
self.cachedBarViewHeights = nil;
__block NSUInteger barViewsCount = [self.barViews count];
dispatch_block_t updateExistingBarViewsBlock = ^{
__block CGFloat xOffset = 0;
[weakSelf.chartData enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger index, BOOL * _Nonnull stop) {
CGFloat height = [weakSelf normalizedHeightForRawHeight:(NSNumber *)obj];
if (index < [weakSelf.barViews count])
{
// Update bar
UIView *barView = [weakSelf.barViews objectAtIndex:index];
if (weakSelf.inverted)
{
barView.frame = CGRectMake(xOffset, weakSelf.headerView.frame.size.height + weakSelf.headerPadding, [weakSelf barWidth], height);
}
else
{
barView.frame = CGRectMake(xOffset, weakSelf.bounds.size.height - height - weakSelf.footerView.frame.size.height, [weakSelf barWidth], height);
}
xOffset += ([weakSelf barWidth] + weakSelf.barPadding);
}
}];
};
dispatch_block_t preAddBarViewsBlock = ^{
__block CGFloat xOffset = 0;
[self.chartData enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger index, BOOL * _Nonnull stop) {
if (index >= barViewsCount)
{
// Create bar
UIView *barView = [weakSelf createBarViewForIndex:index];
if (weakSelf.inverted)
{
barView.frame = CGRectMake(xOffset, weakSelf.headerView.frame.size.height + weakSelf.headerPadding, [weakSelf barWidth], 0.0f);
}
else
{
barView.frame = CGRectMake(xOffset, self.bounds.size.height, [weakSelf barWidth], 0.0f);
}
// Update stored view
weakSelf.barViews = [NSArray arrayWithArray:[weakSelf.barViews arrayByAddingObject:barView]];
// Add bar to view
[weakSelf insertBarView:barView];
}
xOffset += ([weakSelf barWidth] + weakSelf.barPadding);
}];
};
dispatch_block_t postAddBarViewsBlock = ^{
[self.chartData enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger index, BOOL * _Nonnull stop) {
if (index >= barViewsCount)
{
CGFloat height = [weakSelf normalizedHeightForRawHeight:(NSNumber *)obj];
UIView *barView = [weakSelf.barViews objectAtIndex:index];
if (weakSelf.inverted)
{
barView.frame = CGRectMake(barView.frame.origin.x, weakSelf.headerView.frame.size.height + weakSelf.headerPadding, [weakSelf barWidth], height);
}
else
{
barView.frame = CGRectMake(barView.frame.origin.x, self.bounds.size.height - height - weakSelf.footerView.frame.size.height, [weakSelf barWidth], height);
}
}
}];
};
dispatch_block_t preRemoveBarViewsBlock = ^{
// Move existing (removed) bars down
for (NSUInteger index=[weakSelf.chartData count]; index<[weakSelf.barViews count]; index++)
{
UIView *barView = [weakSelf.barViews objectAtIndex:index];
if (weakSelf.inverted)
{
barView.frame = CGRectMake(barView.frame.origin.x, weakSelf.headerView.frame.size.height + weakSelf.headerPadding, barView.frame.size.width, 0.0f);
}
else
{
barView.frame = CGRectMake(barView.frame.origin.x, weakSelf.bounds.size.height, barView.frame.size.width, barView.frame.size.height);
}
}
};
dispatch_block_t postRemoveBarViewsBlock = ^{
// Remove existing (removed) bars
for (NSUInteger index=[weakSelf.chartData count]; index<[weakSelf.barViews count]; index++)
{
UIView *barView = [weakSelf.barViews objectAtIndex:index];
[barView removeFromSuperview];
}
// Update bar view collection
NSMutableArray *mutableBarViews = [NSMutableArray arrayWithArray:weakSelf.barViews];
[mutableBarViews removeObjectsInRange:(NSRange){[weakSelf.chartData count], [weakSelf.barViews count] - [weakSelf.chartData count]}];
weakSelf.barViews = [NSArray arrayWithArray:mutableBarViews];
};
dispatch_block_t refreshedCachedBarViewHeightsBlock = ^{
NSMutableArray *mutableCachedBarViewHeights = [NSMutableArray arrayWithArray:weakSelf.cachedBarViewHeights];
for (UIView *barView in weakSelf.barViews)
{
[mutableCachedBarViewHeights addObject:[NSNumber numberWithFloat:barView.frame.size.height]];
}
weakSelf.cachedBarViewHeights = [NSArray arrayWithArray:mutableCachedBarViewHeights];
};
/*
* New data model equal;
* Update existing bars to accomodate new model.
*/
if ([self.chartData count] == [self.barViews count])
{
[UIView animateWithDuration:kJBBarChartViewReloadDataAnimationDuration animations:^{
updateExistingBarViewsBlock();
} completion:^(BOOL finished) {
refreshedCachedBarViewHeightsBlock();
completionBlock();
}];
}
/*
* New data model greater;
* Update existing bars to accomodate new model & add new bars.
*/
else if ([self.chartData count] > [self.barViews count])
{
[UIView animateWithDuration:kJBBarChartViewReloadDataAnimationDuration animations:^{
updateExistingBarViewsBlock();
} completion:^(BOOL finished) {
preAddBarViewsBlock();
[UIView animateWithDuration:kJBBarChartViewReloadDataAnimationDuration delay:0 options:UIViewAnimationOptionTransitionNone animations:^{
postAddBarViewsBlock();
} completion:^(BOOL finished2) {
refreshedCachedBarViewHeightsBlock();
completionBlock();
}];
}];
}
/*
* New data model less;
* Update existing bars to accomodate new model & remove legacy bars.
*/
else if ([self.chartData count] < [self.barViews count])
{
[UIView animateWithDuration:kJBBarChartViewReloadDataAnimationDuration animations:^{
preRemoveBarViewsBlock();
} completion:^(BOOL finished) {
postRemoveBarViewsBlock();
[UIView animateWithDuration:kJBBarChartViewReloadDataAnimationDuration delay:0 options:UIViewAnimationOptionBeginFromCurrentState animations:^{
updateExistingBarViewsBlock();
} completion:^(BOOL finished2) {
refreshedCachedBarViewHeightsBlock();
completionBlock();
}];
}];
}
}
else
{
// Remove old bars
for (UIView *barView in self.barViews)
{
[barView removeFromSuperview];
}
self.cachedBarViewHeights = nil;
__block CGFloat xOffset = 0;
__block NSMutableArray *mutableBarViews = [NSMutableArray array];
__block NSMutableArray *mutableCachedBarViewHeights = [NSMutableArray array];
[self.chartData enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger index, BOOL * _Nonnull stop) {
UIView *barView = [weakSelf createBarViewForIndex:index];
CGFloat height = [weakSelf normalizedHeightForRawHeight:(NSNumber *)obj];
barView.frame = CGRectMake(xOffset, self.bounds.size.height - height - weakSelf.footerView.frame.size.height, [weakSelf barWidth], height);
[mutableBarViews addObject:barView];
[mutableCachedBarViewHeights addObject:[NSNumber numberWithFloat:height]];
[weakSelf insertBarView:barView];
xOffset += ([weakSelf barWidth] + weakSelf.barPadding);
index++;
}];
self.barViews = [NSArray arrayWithArray:mutableBarViews];
self.cachedBarViewHeights = [NSArray arrayWithArray:mutableCachedBarViewHeights];
}
};
dispatch_block_t layoutHeaderAndFooterBlock = ^{
self.headerView.frame = CGRectMake(self.bounds.origin.x, self.bounds.origin.y, self.bounds.size.width, self.headerView.frame.size.height);
self.footerView.frame = CGRectMake(self.bounds.origin.x, self.bounds.size.height - self.footerView.frame.size.height, self.bounds.size.width, self.footerView.frame.size.height);
};
/*
* Reload data is broken down into various smaller units of work:
*
* 1. Create a data model
* 2. Fetch the bar padding
* 3. Create a (vertical) selection view
* 4. Create and position bar view(s)
* 5. Layout header & footer
* 6. Refresh chart state
*
*/
createDataDictionariesBlock();
createBarPaddingBlock();
createSelectionViewBlock();
createBarViewsBlock();
layoutHeaderAndFooterBlock();
if (!shouldAnimate)
{
completionBlock(); // animated versions call this internally
}
}
- (void)reloadData
{
[self reloadDataAnimated:NO];
}
#pragma mark - View Quick Accessors
- (CGFloat)availableHeight
{
return self.bounds.size.height - self.headerView.frame.size.height - self.footerView.frame.size.height - self.headerPadding - self.footerPadding;
}
- (CGFloat)normalizedHeightForRawHeight:(NSNumber *)rawHeight
{
CGFloat minHeight = [self minimumValue];
CGFloat maxHeight = [self maximumValue];
CGFloat value = [rawHeight floatValue];
if ((maxHeight - minHeight) <= 0)
{
return [self availableHeight];
}
return ((value - minHeight) / (maxHeight - minHeight)) * [self availableHeight];
}
- (CGFloat)barWidth
{
NSUInteger barCount = [self.chartData count];
if (barCount > 0)
{
CGFloat totalPadding = (barCount - 1) * self.barPadding;
CGFloat availableWidth = self.bounds.size.width - totalPadding;
return availableWidth / barCount;
}
return 0;
}
#pragma mark - Setters
- (void)setState:(JBChartViewState)state animated:(BOOL)animated force:(BOOL)force callback:(void (^)())callback
{
if (self.reloading)
{
if (callback)
{
callback();
}
return; // ignore state changes when reloading
}
[super setState:state animated:animated force:force callback:callback];
__weak JBBarChartView* weakSelf = self;
void (^updateBarView)(UIView *barView, BOOL popBar);
updateBarView = ^(UIView *barView, BOOL popBar) {
if (weakSelf.inverted)
{
if (weakSelf.state == JBChartViewStateExpanded)
{
if (popBar)
{
barView.frame = CGRectMake(barView.frame.origin.x, weakSelf.headerView.frame.size.height + weakSelf.headerPadding, barView.frame.size.width, [[weakSelf.cachedBarViewHeights objectAtIndex:barView.tag] floatValue] + kJBBarChartViewStatePopOffset);
}
else
{
barView.frame = CGRectMake(barView.frame.origin.x, weakSelf.headerView.frame.size.height + weakSelf.headerPadding, barView.frame.size.width, [[weakSelf.cachedBarViewHeights objectAtIndex:barView.tag] floatValue]);
}
}
else if (weakSelf.state == JBChartViewStateCollapsed)
{
if (popBar)
{
barView.frame = CGRectMake(barView.frame.origin.x, weakSelf.headerView.frame.size.height + weakSelf.headerPadding, barView.frame.size.width, [[weakSelf.cachedBarViewHeights objectAtIndex:barView.tag] floatValue] + kJBBarChartViewStatePopOffset);
}
else
{
barView.frame = CGRectMake(barView.frame.origin.x, weakSelf.headerView.frame.size.height + weakSelf.headerPadding, barView.frame.size.width, 0.0f);
}
}
}
else
{
if (weakSelf.state == JBChartViewStateExpanded)
{
if (popBar)
{
barView.frame = CGRectMake(barView.frame.origin.x, weakSelf.bounds.size.height - weakSelf.footerView.frame.size.height - weakSelf.footerPadding - [[weakSelf.cachedBarViewHeights objectAtIndex:barView.tag] floatValue] - kJBBarChartViewStatePopOffset, barView.frame.size.width, [[weakSelf.cachedBarViewHeights objectAtIndex:barView.tag] floatValue] + kJBBarChartViewStatePopOffset);
}
else
{
barView.frame = CGRectMake(barView.frame.origin.x, weakSelf.bounds.size.height - weakSelf.footerView.frame.size.height - weakSelf.footerPadding - [[weakSelf.cachedBarViewHeights objectAtIndex:barView.tag] floatValue], barView.frame.size.width, [[weakSelf.cachedBarViewHeights objectAtIndex:barView.tag] floatValue]);
}
}
else if (weakSelf.state == JBChartViewStateCollapsed)
{
if (popBar)
{
barView.frame = CGRectMake(barView.frame.origin.x, weakSelf.bounds.size.height - weakSelf.footerView.frame.size.height - weakSelf.footerPadding - [[weakSelf.cachedBarViewHeights objectAtIndex:barView.tag] floatValue] - kJBBarChartViewStatePopOffset, barView.frame.size.width, [[weakSelf.cachedBarViewHeights objectAtIndex:barView.tag] floatValue] + kJBBarChartViewStatePopOffset);
}
else
{
barView.frame = CGRectMake(barView.frame.origin.x, weakSelf.bounds.size.height, barView.frame.size.width, 0.0f);
}
}
}
};
dispatch_block_t callbackCopy = [callback copy];
if ([self.barViews count] > 0)
{
if (animated)
{
dispatch_block_t animationCompletionBlock = ^{
if (callbackCopy)
{
callbackCopy();
}
};
NSUInteger animationDelayIndex = 0;
for (UIView *barView in self.barViews)
{
BOOL lastIndex = ((NSUInteger)barView.tag == [self.barViews count] - 1);
if ([[weakSelf.cachedBarViewHeights objectAtIndex:barView.tag] floatValue] > [self minimumValue])
{
[UIView animateWithDuration:kJBBarChartViewStateAnimationDuration delay:(kJBBarChartViewStateAnimationDuration * 0.5) * animationDelayIndex options:UIViewAnimationOptionBeginFromCurrentState animations:^{
updateBarView(barView, YES);
} completion:^(BOOL finished) {
[UIView animateWithDuration:kJBBarChartViewStateAnimationDuration delay:0.0 options:UIViewAnimationOptionBeginFromCurrentState animations:^{
updateBarView(barView, NO);
} completion:^(BOOL lastBarFinished) {
if (lastIndex)
{
animationCompletionBlock();
}
}];
}];
animationDelayIndex++;
}
else if (lastIndex)
{
animationCompletionBlock();
}
}
}
else
{
for (UIView *barView in self.barViews)
{
updateBarView(barView, NO);
}
if (callbackCopy)
{
callbackCopy();
}
}
}
else
{
if (callbackCopy)
{
callbackCopy();
}
}
}
- (void)setState:(JBChartViewState)state animated:(BOOL)animated callback:(void (^)())callback
{
[self setState:state animated:animated force:NO callback:callback];
}
- (void)setVerticalSelectionViewVisible:(BOOL)verticalSelectionViewVisible animated:(BOOL)animated
{
_verticalSelectionViewVisible = verticalSelectionViewVisible;
if (animated)
{
[UIView animateWithDuration:kJBChartViewDefaultAnimationDuration delay:0.0 options:UIViewAnimationOptionBeginFromCurrentState animations:^{
self.verticalSelectionView.alpha = self.verticalSelectionViewVisible ? 1.0 : 0.0;
} completion:nil];
}
else
{
self.verticalSelectionView.alpha = _verticalSelectionViewVisible ? 1.0 : 0.0;
}
}
- (void)setVerticalSelectionViewVisible:(BOOL)verticalSelectionViewVisible
{
[self setVerticalSelectionViewVisible:verticalSelectionViewVisible animated:NO];
}
- (void)setShowsVerticalSelection:(BOOL)showsVerticalSelection
{
_showsVerticalSelection = showsVerticalSelection;
self.verticalSelectionView.hidden = _showsVerticalSelection ? NO : YES;
}
#pragma mark - Getters
- (CGFloat)cachedMinHeight
{
if(_cachedMinHeight == kJBBarChartViewUndefinedCachedHeight)
{
NSArray *chartValues = [self.chartData sortedArrayUsingSelector:@selector(compare:)];
_cachedMinHeight = [[chartValues firstObject] floatValue];
}
return _cachedMinHeight;
}
- (CGFloat)cachedMaxHeight
{
if (_cachedMaxHeight == kJBBarChartViewUndefinedCachedHeight)
{
NSArray *chartValues = [self.chartData sortedArrayUsingSelector:@selector(compare:)];
_cachedMaxHeight = [[chartValues lastObject] floatValue];
}
return _cachedMaxHeight;
}
- (CGFloat)minimumValue
{
if ([self hasMinimumValue])
{
return fminf(self.cachedMinHeight, [super minimumValue]);
}
return self.cachedMinHeight;
}
- (CGFloat)maximumValue
{
if ([self hasMaximumValue])
{
return fmaxf(self.cachedMaxHeight, [super maximumValue]);
}
return self.cachedMaxHeight;
}
- (UIView *)barViewAtIndex:(NSUInteger)index
{
if (index < [self.barViews count])
{
return [self.barViews objectAtIndex:index];
}
return nil;
}
#pragma mark - Helpers
- (UIView *)createBarViewForIndex:(NSUInteger)index
{
UIView *barView = nil;
{
// Custom bar
if ([self.dataSource respondsToSelector:@selector(barChartView:barViewAtIndex:)])
{
UIView *customBarView = [self.dataSource barChartView:self barViewAtIndex:index];
if (customBarView != nil)
{
barView = customBarView;
}
}
// Color bar
if ([self.delegate respondsToSelector:@selector(barChartView:colorForBarViewAtIndex:)] && barView == nil)
{
UIColor *backgroundColor = [self.delegate barChartView:self colorForBarViewAtIndex:index];
if (backgroundColor != nil)
{
barView = [[UIView alloc] init];
barView.backgroundColor = backgroundColor;
}
}
// Gradient
if ([self.delegate respondsToSelector:@selector(barGradientForBarChartView:)] && barView == nil)
{
CAGradientLayer *gradientLayer = [self.delegate barGradientForBarChartView:self];
if (gradientLayer != nil)
{
barView = [[JBGradientBarView alloc] init];
((JBGradientBarView *)barView).dataSource = self;
((JBGradientBarView *)barView).gradientLayer = gradientLayer;
}
}
// Default
if (barView == nil)
{
barView = [[UIView alloc] init];
barView.backgroundColor = kJBBarChartViewDefaultBarColor;
}
}
barView.tag = index;
return barView;
}
- (void)insertBarView:(UIView *)barView
{
(self.footerView != nil) ? [self insertSubview:barView belowSubview:self.footerView] : [self addSubview:barView];
[self bringSubviewToFront:self.verticalSelectionView];
[self bringSubviewToFront:self.footerView];
}
#pragma mark - Touch Helpers
- (NSInteger)barViewIndexForPoint:(CGPoint)point
{
NSUInteger index = 0;
NSUInteger selectedIndex = kJBBarChartViewUndefinedBarIndex;
if (point.x < 0 || point.x > self.bounds.size.width)
{
return selectedIndex;
}
CGFloat padding = ceil(self.barPadding * 0.5);
for (UIView *barView in self.barViews)
{
CGFloat minX = CGRectGetMinX(barView.frame) - padding;
CGFloat maxX = CGRectGetMaxX(barView.frame) + padding;
if ((point.x >= minX) && (point.x <= maxX))
{
selectedIndex = index;
break;
}
index++;
}
return selectedIndex;
}
- (UIView *)barViewForForPoint:(CGPoint)point
{
UIView *barView = nil;
NSInteger selectedIndex = [self barViewIndexForPoint:point];
if (selectedIndex >= 0)
{
return [self.barViews objectAtIndex:[self barViewIndexForPoint:point]];
}
return barView;
}
- (void)touchesBeganOrMovedWithTouches:(NSSet *)touches
{
if (self.state == JBChartViewStateCollapsed || [self.chartData count] <= 0 || self.reloading)
{
return;
}
UITouch *touch = [touches anyObject];
CGPoint touchPoint = [touch locationInView:self];
UIView *barView = [self barViewForForPoint:touchPoint];
if (barView == nil)
{
[self setVerticalSelectionViewVisible:NO animated:YES];
return;
}
CGRect barViewFrame = barView.frame;
CGRect selectionViewFrame = self.verticalSelectionView.frame;
selectionViewFrame.origin.x = barViewFrame.origin.x;
selectionViewFrame.size.width = barViewFrame.size.width;
if ([self.dataSource respondsToSelector:@selector(shouldExtendSelectionViewIntoHeaderPaddingForChartView:)])
{
if ([self.dataSource shouldExtendSelectionViewIntoHeaderPaddingForChartView:self])
{
selectionViewFrame.origin.y = self.headerView.frame.size.height;
}
else
{
selectionViewFrame.origin.y = self.headerView.frame.size.height + self.headerPadding;
}
}
else
{
selectionViewFrame.origin.y = self.headerView.frame.size.height + self.headerPadding;
}
self.verticalSelectionView.frame = selectionViewFrame;
[self setVerticalSelectionViewVisible:YES animated:YES];
if ([self.delegate respondsToSelector:@selector(barChartView:didSelectBarAtIndex:touchPoint:)])
{
[self.delegate barChartView:self didSelectBarAtIndex:[self barViewIndexForPoint:touchPoint] touchPoint:touchPoint];
}
if ([self.delegate respondsToSelector:@selector(barChartView:didSelectBarAtIndex:)])
{
[self.delegate barChartView:self didSelectBarAtIndex:[self barViewIndexForPoint:touchPoint]];
}
}
- (void)touchesEndedOrCancelledWithTouches:(NSSet *)touches
{
if (self.state == JBChartViewStateCollapsed || [self.chartData count] <= 0 || self.reloading)
{
return;
}
[self setVerticalSelectionViewVisible:NO animated:YES];
if ([self.delegate respondsToSelector:@selector(didDeselectBarChartView:)])
{
[self.delegate didDeselectBarChartView:self];
}
}
#pragma mark - Touches
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
[self setVerticalSelectionViewVisible:NO animated:NO];
[self touchesBeganOrMovedWithTouches:touches];
}
- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
{
[self touchesBeganOrMovedWithTouches:touches];
}
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
{
[self touchesEndedOrCancelledWithTouches:touches];
}
- (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event
{
[self touchesEndedOrCancelledWithTouches:touches];
}
#pragma mark - JBGradientBarViewDataSource
- (CGRect)chartViewBoundsForGradientBarView:(JBGradientBarView *)gradientBarView
{
return self.bounds;
}
@end
+29
View File
@@ -0,0 +1,29 @@
//
// JBGradientBarView.h
// JBChartViewDemo
//
// Created by Terry Worona on 12/25/15.
// Copyright © 2015 Jawbone. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
@class JBGradientBarView;
@protocol JBGradientBarViewDataSource;
@protocol JBGradientBarViewDataSource <NSObject>
@optional
- (CGRect)chartViewBoundsForGradientBarView:(JBGradientBarView *)gradientBarView;
@end
@interface JBGradientBarView: UIView
@property (nonatomic, weak) id<JBGradientBarViewDataSource> dataSource;
@property (nonatomic, strong) CAGradientLayer *gradientLayer;
@end
+80
View File
@@ -0,0 +1,80 @@
//
// JBGradientBarView.m
// JBChartViewDemo
//
// Created by Terry Worona on 12/25/15.
// Copyright © 2015 Jawbone. All rights reserved.
//
#import "JBGradientBarView.h"
@interface JBGradientBarView ()
- (void)construct;
@end
@implementation JBGradientBarView
#pragma mark - Alloc/Init
- (instancetype)init
{
self = [super init];
if (self)
{
[self construct];
}
return self;
}
- (instancetype)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self)
{
[self construct];
}
return self;
}
#pragma mark - Setters
- (void)setGradientLayer:(CAGradientLayer *)gradientLayer
{
if (_gradientLayer != nil)
{
[_gradientLayer removeFromSuperlayer];
_gradientLayer = nil;
}
_gradientLayer = gradientLayer;
_gradientLayer.masksToBounds = YES;
[self.layer insertSublayer:_gradientLayer atIndex:0];
}
#pragma mark - Construction
- (void)construct
{
self.clipsToBounds = YES;
}
#pragma mark - Setters
- (void)setFrame:(CGRect)frame
{
[super setFrame:frame];
if ([self.dataSource respondsToSelector:@selector(chartViewBoundsForGradientBarView:)])
{
_gradientLayer.frame = [self.dataSource chartViewBoundsForGradientBarView:self]; // gradient is as large as the chart
_gradientLayer.frame = CGRectOffset(_gradientLayer.frame, -CGRectGetMinX(frame), 0);
}
else
{
_gradientLayer.frame = self.bounds;
}
}
@end
+170
View File
@@ -0,0 +1,170 @@
//
// JBChartView.h
// JBChartView
//
// Created by Terry Worona on 9/4/13.
// Copyright (c) 2013 Jawbone. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
extern CGFloat const kJBChartViewDefaultAnimationDuration;
@class JBChartView;
/**
* At a minimum, a chart can support two states, along with animations to-and-from.
*/
typedef NS_ENUM(NSInteger, JBChartViewState){
/**
* Expanded state: chart supports touches, interaction, etc.
*/
JBChartViewStateExpanded,
/**
* Collapse state: chart is more-or-less disabled at this point.
*/
JBChartViewStateCollapsed
};
@protocol JBChartViewDataSource <NSObject>
@optional
/**
* Returns whether or not the chart's selection view should extend into the header padding.
*
* Default: NO
*
* @param chartView The chart object requesting this information.
*
* @return Whether or not a chart's selection view should extend into the header padding.
*/
- (BOOL)shouldExtendSelectionViewIntoHeaderPaddingForChartView:(JBChartView *)chartView;
/**
* Returns whether or not the chart's selection view should extend into the footer padding.
*
* Default: NO
*
* @param chartView The chart object requesting this information.
*
* @return Whether or not a chart's selection view should extend into the footer padding.
*/
- (BOOL)shouldExtendSelectionViewIntoFooterPaddingForChartView:(JBChartView *)chartView;
@end
@protocol JBChartViewDelegate <NSObject>
// Extend (via subclass) to add custom functionality
@end
@interface JBChartView : UIView
/*
* Base dataSource and delegate protocols.
*/
@property (nonatomic, weak) id<JBChartViewDataSource> dataSource;
@property (nonatomic, weak) id<JBChartViewDelegate> delegate;
/**
* Header and footer views are shown above and below the chart respectively.
* Each view will be stretched horizontally to fill width of chart.
* Each view's bounds are clipped to support chart state animations.
*/
@property (nonatomic, strong) UIView *footerView;
@property (nonatomic, strong) UIView *headerView;
/**
* The vertical padding between the header and highest chart point (bar, line, etc).
* By default, the selection view will extend into the header padding area. To modify this behaviour,
* implement the dataSource protocol - (BOOL)shouldExtendSelectionViewIntoHeaderPaddingForChartView:(JBChartView *)chartView.
*/
@property (nonatomic, assign) CGFloat headerPadding;
/**
* The vertical padding between the footer and lowest chart point (bar, line, etc).
* By default, the selection view will extend into the footer padding area. To modify this behaviour,
* implement the dataSource protocol - (BOOL)shouldExtendSelectionViewIntoFooterPaddingForChartView:(JBChartView *)chartView.
*/
@property (nonatomic, assign) CGFloat footerPadding;
/**
* The minimum and maxmimum values of the chart.
* If no value(s) are supplied:
*
* minimumValue = chart's data source min value.
* maxmimumValue = chart's data source max value.
*
* If value(s) are supplied, they must be >= 0, otherwise an assertion will be thrown.
* The min/max values are clamped to the ceiling and floor of the actual min/max values of the chart's data source;
* for example, if a maximumValue of 20 is supplied & the chart's actual max is 100, then 100 will be used.
*
* For min/max modifications to take effect, reloadData must be called.
*/
@property (nonatomic, assign) CGFloat minimumValue;
@property (nonatomic, assign) CGFloat maximumValue;
// reset to default (chart's data source min & max value)
- (void)resetMinimumValue;
- (void)resetMaximumValue;
/**
* Charts can either be expanded or contracted.
* By default, a chart should be expanded on initialization.
*/
@property (nonatomic, assign) JBChartViewState state;
/**
* Acts similiar to a UITableView's reloadData function.
* The entire chart will be torn down and re-constructed via datasource and delegate protocls.
* If a chart's frame changes, reloadData must be called directly afterwards for the changes to take effect.
*/
- (void)reloadData;
/**
* State setter.
*
* @param state Either collapse or expanded.
* @param animated Whether or not the state should be animated or not.
* @param force If current state == new state, then setting force to YES will re-configure the chart (default NO).
* @param callback Called once the animation is completed. If animated == NO, then callback is immediate.
*/
- (void)setState:(JBChartViewState)state animated:(BOOL)animated force:(BOOL)force callback:(void (^)())callback;
/**
* State setter.
*
* @param state Either collapse or expanded.
* @param animated Whether or not the state should be animated or not.
* @param callback Called once the animation is completed. If animated == NO, then callback is immediate.
*/
- (void)setState:(JBChartViewState)state animated:(BOOL)animated callback:(void (^)())callback;
/**
* State setter.
*
* @param state Either collapse or expanded.
* @param animated Whether or not the state should be animated or not.
*/
- (void)setState:(JBChartViewState)state animated:(BOOL)animated;
@end
/**
* A simple UIView subclass that fades a base color from current alpha to 0.0 (vertically).
* Used as a vertical selection view in JBChartView subclasses.
*/
@interface JBChartVerticalSelectionView : UIView
/**
* Base selection view color. This color will be faded to transparent vertically.
*
* Default: white color.
*
*/
@property (nonatomic, strong) UIColor *bgColor;
@end
+235
View File
@@ -0,0 +1,235 @@
//
// JBChartView.m
// Nudge
//
// Created by Terry Worona on 9/4/13.
// Copyright (c) 2013 Jawbone. All rights reserved.
//
#import "JBChartView.h"
// Numerics
CGFloat const kJBChartViewDefaultAnimationDuration = 0.25f;
// Color (JBChartSelectionView)
static UIColor *kJBChartVerticalSelectionViewDefaultBgColor = nil;
@interface JBChartView ()
@property (nonatomic, assign) BOOL hasMaximumValue;
@property (nonatomic, assign) BOOL hasMinimumValue;
// Construction
- (void)constructChartView;
// Validation
- (void)validateHeaderAndFooterHeights;
@end
@implementation JBChartView
#pragma mark - Alloc/Init
- (id)initWithCoder:(NSCoder *)aDecoder
{
self = [super initWithCoder:aDecoder];
if (self)
{
[self constructChartView];
}
return self;
}
- (id)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self)
{
[self constructChartView];
}
return self;
}
- (id)init
{
return [self initWithFrame:CGRectZero];
}
#pragma mark - Construction
- (void)constructChartView
{
self.clipsToBounds = YES;
}
#pragma mark - Public
- (void)reloadData
{
// Override
}
#pragma mark - Validation
- (void)validateHeaderAndFooterHeights
{
NSAssert((self.headerView.bounds.size.height + self.footerView.bounds.size.height) <= self.bounds.size.height, @"JBChartView // the combined height of the footer and header can not be greater than the total height of the chart.");
}
#pragma mark - Setters
- (void)setHeaderView:(UIView *)headerView
{
if (_headerView)
{
[_headerView removeFromSuperview];
_headerView = nil;
}
_headerView = headerView;
_headerView.clipsToBounds = YES;
[self validateHeaderAndFooterHeights];
[self addSubview:_headerView];
[self reloadData];
}
- (void)setFooterView:(UIView *)footerView
{
if (_footerView)
{
[_footerView removeFromSuperview];
_footerView = nil;
}
_footerView = footerView;
_footerView.clipsToBounds = YES;
[self validateHeaderAndFooterHeights];
[self addSubview:_footerView];
[self reloadData];
}
- (void)setState:(JBChartViewState)state animated:(BOOL)animated force:(BOOL)force callback:(void (^)())callback
{
if ((_state == state) && !force)
{
return;
}
_state = state;
// Override
}
- (void)setState:(JBChartViewState)state animated:(BOOL)animated callback:(void (^)())callback
{
[self setState:state animated:animated force:NO callback:callback];
}
- (void)setState:(JBChartViewState)state animated:(BOOL)animated
{
[self setState:state animated:animated callback:nil];
}
- (void)setState:(JBChartViewState)state
{
[self setState:state animated:NO];
}
- (void)setMinimumValue:(CGFloat)minimumValue
{
NSAssert(minimumValue >= 0, @"JBChartView // the minimumValue must be >= 0.");
_minimumValue = minimumValue;
_hasMinimumValue = YES;
}
- (void)setMaximumValue:(CGFloat)maximumValue
{
NSAssert(maximumValue >= 0, @"JBChartView // the maximumValue must be >= 0.");
_maximumValue = maximumValue;
_hasMaximumValue = YES;
}
- (void)resetMinimumValue
{
_hasMinimumValue = NO; // clears min
}
- (void)resetMaximumValue
{
_hasMaximumValue = NO; // clears max
}
@end
@implementation JBChartVerticalSelectionView
#pragma mark - Alloc/Init
+ (void)initialize
{
if (self == [JBChartVerticalSelectionView class])
{
kJBChartVerticalSelectionViewDefaultBgColor = [UIColor whiteColor];
}
}
- (id)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self)
{
self.backgroundColor = [UIColor clearColor];
}
return self;
}
#pragma mark - Drawing
- (void)drawRect:(CGRect)rect
{
CGContextRef context = UIGraphicsGetCurrentContext();
[[UIColor clearColor] set];
CGContextFillRect(context, rect);
CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
CGFloat locations[] = { 0.0, 1.0 };
NSArray *colors = nil;
if (self.bgColor != nil)
{
colors = @[(__bridge id)self.bgColor.CGColor, (__bridge id)[self.bgColor colorWithAlphaComponent:0.0].CGColor];
}
else
{
colors = @[(__bridge id)kJBChartVerticalSelectionViewDefaultBgColor.CGColor, (__bridge id)[kJBChartVerticalSelectionViewDefaultBgColor colorWithAlphaComponent:0.0].CGColor];
}
CGGradientRef gradient = CGGradientCreateWithColors(colorSpace, (__bridge CFArrayRef) colors, locations);
CGPoint startPoint = CGPointMake(CGRectGetMidX(rect), CGRectGetMaxY(rect));
CGPoint endPoint = CGPointMake(CGRectGetMidX(rect), CGRectGetMinY(rect));
CGContextSaveGState(context);
{
CGContextAddRect(context, rect);
CGContextClip(context);
CGContextDrawLinearGradient(context, gradient, startPoint, endPoint, 0);
}
CGContextRestoreGState(context);
CGGradientRelease(gradient);
CGColorSpaceRelease(colorSpace);
}
#pragma mark - Setters
- (void)setBgColor:(UIColor *)bgColor
{
_bgColor = bgColor;
[self setNeedsDisplay];
}
@end
+503
View File
@@ -0,0 +1,503 @@
//
// JBLineChartView.h
// JBChartView
//
// Created by Terry Worona on 9/4/13.
// Copyright (c) 2013 Jawbone. All rights reserved.
//
#import "JBChartView.h"
@class JBLineChartView;
/**
* Indicates how a line's main path will be drawn.
*/
typedef NS_ENUM(NSInteger, JBLineChartViewLineStyle){
/**
* Solid line.
*/
JBLineChartViewLineStyleSolid,
/**
* Dashed with a 3:2 phase (3 points dashed, 2 points spaced).
*/
JBLineChartViewLineStyleDashed
};
/**
* Indicates how a line's main path or fill (including selections)
* will be decorated (via color options).
*/
typedef NS_ENUM(NSInteger, JBLineChartViewColorStyle) {
/**
* A solid color (with alpha support via UIColor).
*/
JBLineChartViewColorStyleSolid,
/**
* a gradient (via CAGradientLayer).
*/
JBLineChartViewColorStyleGradient
};
@protocol JBLineChartViewDataSource <JBChartViewDataSource>
@required
/**
* Returns the number of lines for the line chart.
*
* @param lineChartView The line chart object requesting this information.
*
* @return The number of lines in the line chart.
*/
- (NSUInteger)numberOfLinesInLineChartView:(JBLineChartView *)lineChartView;
/**
* Returns the number of vertical values for a particular line at lineIndex within the chart.
*
* @param lineChartView The line chart object requesting this information.
* @param lineIndex An index number identifying a line in the chart.
*
* @return The number of vertical values for a given line in the line chart.
*/
- (NSUInteger)lineChartView:(JBLineChartView *)lineChartView numberOfVerticalValuesAtLineIndex:(NSUInteger)lineIndex;
@optional
/**
* Returns whether or not a line should show a dot for each point.
* Dot size is relative to the line width and not adjustable.
* Dot color is equal to the line color and not adjustable.
*
* Default: NO.
*
* @param lineChartView The line chart object requesting this information.
* @param lineIndex An index number identifying a line in the chart.
*
* @return Whether or not a line should show a dot for each chart point.
*/
- (BOOL)lineChartView:(JBLineChartView *)lineChartView showsDotsForLineAtLineIndex:(NSUInteger)lineIndex;
/**
* Returns whether or not a line should be rendered with curved connections and rounded end caps.
*
* Default: NO.
*
* @param lineChartView The line chart object requesting this information.
* @param lineIndex An index number identifying a line in the chart.
*
* @return Whether or not a line should smooth it's connections and end caps.
*/
- (BOOL)lineChartView:(JBLineChartView *)lineChartView smoothLineAtLineIndex:(NSUInteger)lineIndex;
/**
* Returns the opacity value to be used for dimming the line & fill during selection events.
* This value is applied to the line or fill's opacity anytime it's not selected (but another line is).
* This applies to both solid and gradient color styles.
*
* Default: 0.2.
*
* @param lineChartView The line chart object requesting this information.
* @param lineIndex An index number identifying a line in the chart.
*
* @return A value between 0.0 and 1.0 (will be clamped accordingly).
*/
- (CGFloat)lineChartView:(JBLineChartView *)lineChartView dimmedSelectionOpacityAtLineIndex:(NSUInteger)lineIndex;
/**
* Returns the opacity value to be used for dimming the dots during selection events.
* This value is applied to all dots within a line anytime it's not selected (but another line is).
*
* Default: 0.0.
*
* @param lineChartView The line chart object requesting this information.
* @param lineIndex An index number identifying a line in the chart.
*
* @return A value between 0.0 and 1.0 (will be clamped accordingly).
*/
- (CGFloat)lineChartView:(JBLineChartView *)lineChartView dimmedSelectionDotOpacityAtLineIndex:(NSUInteger)lineIndex;
/**
* Returns a (custom) UIView instance representing a dot (x,y point) within the chart.
* For this value to apply, showsDotsForLineAtLineIndex: must return YES for the line at lineIndex.
* This protocol supercedes colorForDotAtHorizontalIndex: and dotRadiusForDotAtHorizontalIndex:.
* If nil is returned. the original dot protocols will take precedence. During selection events, a custom
* dot view will not be hidden unless lineChartView:shouldHideDotViewOnSelectionAtHorizontalIndex:atLineIndex:
* is implemented.
*
* Default: nil.
*
* @param lineChartView The line chart object requesting this information.
* @param horizontalIndex The 0-based horizontal index of a selection point (left to right, x-axis).
* @param lineIndex An index number identifying a line in the chart.
*
* @return A custom UIView instance representing a dot at a particular horizontal index within a dotted line.
*/
- (UIView *)lineChartView:(JBLineChartView *)lineChartView dotViewAtHorizontalIndex:(NSUInteger)horizontalIndex atLineIndex:(NSUInteger)lineIndex;
/**
* Returns whether or not a (custom) dot view should be hidden on selection events.
*
* Default: NO.
*
* @param lineChartView The line chart object requesting this information.
* @param horizontalIndex The 0-based horizontal index of a selection point (left to right, x-axis).
* @param lineIndex An index number identifying a line in the chart.
*
* @return Whether or not a (custom) dot view should be hidden on selection events.
*/
- (BOOL)lineChartView:(JBLineChartView *)lineChartView shouldHideDotViewOnSelectionAtHorizontalIndex:(NSUInteger)horizontalIndex atLineIndex:(NSUInteger)lineIndex;
@end
@protocol JBLineChartViewDelegate <JBChartViewDelegate>
@required
/**
* Vertical value for a line point at a given index (left to right). There is no ceiling on the the height;
* the chart will automatically normalize all values between the overal min and max heights.
* NAN may able be retuend to indicate missing values. The chart's line will begin at the first non-NAN value and end at the last non-NAN value.
* Furthermore, the line will interopolate any NAN values in between (ie. the line will not be interrupted).
*
* @param lineChartView The line chart object requesting this information.
* @param horizontalIndex The 0-based horizontal index of a selection point (left to right, x-axis).
* @param lineIndex An index number identifying the closest line in the chart to the current touch point.
*
* @return The y-axis value of the supplied line index (x-axis)
*/
- (CGFloat)lineChartView:(JBLineChartView *)lineChartView verticalValueForHorizontalIndex:(NSUInteger)horizontalIndex atLineIndex:(NSUInteger)lineIndex;
@optional
/**
* Occurs whenever there is a touch gesture on the chart (chart must be expanded).
* The horizontal index is the closest index to the touch point & is clamped to it's max/min value if it moves outside of the view's bounds.
* The lineIndex remains constant until the line is deselected and will be highlighted using the (optional) selectionColorForLineAtLineIndex: protocol.
* Futhermore, all other lines that aren't selected will be dimmed to 20% opacity (default) throughout the duration of the touch/move.
* Any dotted line that isn't the primary selection will have it's dots dimmed to hidden (to avoid transparency issues).
*
* @param lineChartView A line chart object informing the delegate about the new selection.
* @param lineIndex An index number identifying the closest line in the chart to the current touch
* @param horizontalIndex The 0-based horizontal index of a selection point (left to right, x-axis).
* @param touchPoint The touch point in relation to the chart's bounds (excludes footer and header).
*/
- (void)lineChartView:(JBLineChartView *)lineChartView didSelectLineAtIndex:(NSUInteger)lineIndex horizontalIndex:(NSUInteger)horizontalIndex touchPoint:(CGPoint)touchPoint;
- (void)lineChartView:(JBLineChartView *)lineChartView didSelectLineAtIndex:(NSUInteger)lineIndex horizontalIndex:(NSUInteger)horizontalIndex;
/**
* Occurs when selection ends by ending a touch event. For selection start events, see: didSelectChartAtIndex:
*
* @param lineChartView A line chart object informing the delegate about the deselection.
*/
- (void)didDeselectLineInLineChartView:(JBLineChartView *)lineChartView;
/**
* Returns whether or not a line at a particular index responds to selection events.
*
* Default: YES
*
* @param lineChartView A line chart object informing the delegate about the new selection.
* @param lineIndex An index number identifying the closest line in the chart to the current touch
*/
- (BOOL)lineChartView:(JBLineChartView *)lineChartView shouldIgnoreSelectionAtLineIndex:(NSUInteger)lineIndex;
/**
* Returns the color of particular line at lineIndex.
* For this to apply, lineChartView:colorStyleForLineAtLineIndex: must return JBLineChartViewColorStyleSolid (default).
*
* Default: black color.
*
* @param lineChartView The line chart object requesting this information.
* @param lineIndex An index number identifying a line in the chart.
*
* @return The color to be used to shade a line in the chart.
*/
- (UIColor *)lineChartView:(JBLineChartView *)lineChartView colorForLineAtLineIndex:(NSUInteger)lineIndex;
/**
* Returns the gradient layer to be used for a particular line at lineIndex within the chart.
* For this to apply, lineChartView:colorStyleForLineAtLineIndex: must return JBLineChartViewColorStyleGradient.
*
* Note: gradients do not support multiple alphas. The alpha of gradient's first color be used throughout.
*
* Default: black to light gray.
*
* @param lineChartView The line chart object requesting this information.
* @param lineIndex An index number identifying a line in the chart.
*
* @return The gradient layer to be used to shade a line in the chart.
*/
- (CAGradientLayer *)lineChartView:(JBLineChartView *)lineChartView gradientForLineAtLineIndex:(NSUInteger)lineIndex;
/**
* Returns the fill color of particular line at lineIndex within the chart.
* For this to apply, lineChartView:fillColorStyleForLineAtLineIndex: must return JBLineChartViewColorStyleSolid (default).
*
* Default: clear color (none).
*
* @param lineChartView The line chart object requesting this information.
* @param lineIndex An index number identifying a line in the chart.
*
* @return The fill color to show under a line in the chart.
*/
- (UIColor *)lineChartView:(JBLineChartView *)lineChartView fillColorForLineAtLineIndex:(NSUInteger)lineIndex;
/**
* Returns the gradient layer to be used for a fill of a particular line at lineIndex within the chart.
* For this to apply, lineChartView:fillColorStyleForLineAtLineIndex: must return JBLineChartViewColorStyleGradient.
*
* Note: gradients do not support multiple alphas. The alpha of gradient's first color be used throughout.
*
* Default: clear gradient (none).
*
* @param lineChartView The line chart object requesting this information.
* @param lineIndex An index number identifying a line in the chart.
*
* @return The fill gradient to show under a line in the chart.
*/
- (CAGradientLayer *)lineChartView:(JBLineChartView *)lineChartView fillGradientForLineAtLineIndex:(NSUInteger)lineIndex;
/**
* Returns the color of a particular dot in a line at lineIndex within the chart.
* For this value to apply, showsDotsForLineAtLineIndex: must return YES for the line at lineIndex.
* Any value can be returned for lineIndex's that don't support dots, as it will never be called.
*
* Default: black color.
*
* @param lineChartView The line chart object requesting this information.
* @param horizontalIndex The 0-based horizontal index of a selection point (left to right, x-axis)
* @param lineIndex An index number identifying a line in the chart.
*
* @return The color to be used to color a dot within a dotted line in the chart.
*/
- (UIColor *)lineChartView:(JBLineChartView *)lineChartView colorForDotAtHorizontalIndex:(NSUInteger)horizontalIndex atLineIndex:(NSUInteger)lineIndex;
/**
* Returns the width of particular line at lineIndex within the chart.
*
* Default: 5 points.
*
* @param lineChartView The line chart object requesting this information.
* @param lineIndex An index number identifying a line in the chart.
*
* @return The width to be used to draw a line in the chart.
*/
- (CGFloat)lineChartView:(JBLineChartView *)lineChartView widthForLineAtLineIndex:(NSUInteger)lineIndex;
/**
* Returns the radius of all dots in a particular line at lineIndex within the chart.
* For this value to apply, showsDotsForLineAtLineIndex: must return YES for the line at lineIndex.
* Any value can be returned for lineIndex's that don't support dots, as it will never be called.
*
* Default: line width x 6.
*
* @param lineChartView The line chart object requesting this information.
* @param horizontalIndex The 0-based horizontal index of a selection point (left to right, x-axis).
* @param lineIndex An index number identifying a line in the chart.
*
* @return The radius of the dots within a dotted line in the chart.
*/
- (CGFloat)lineChartView:(JBLineChartView *)lineChartView dotRadiusForDotAtHorizontalIndex:(NSUInteger)horizontalIndex atLineIndex:(NSUInteger)lineIndex;
/**
* Returns the width of the (vertical) selection view to be overlayed on the chart during touch events.
* The property showsVerticalSelection must be YES for the width to apply. The width is clamped to the
* maxmimum width of the chart's bounds.
*
* Default: 20px.
*
* @param lineChartView The line chart object requesting this information.
*
* @return The width of the selection view used during chart selections.
*/
- (CGFloat)verticalSelectionWidthForLineChartView:(JBLineChartView *)lineChartView;
/**
* Returns the (vertical) selection color to be overlayed on the chart during touch events on a given line.
* The color is automically faded to transparent (vertically). The property showsVerticalSelection
* must be YES for the color to apply.
*
* Default: white color.
*
* @param lineChartView The line chart object requesting this information.
* @param lineIndex An index number identifying a line in the chart.
*
* @return The color of the selection view used during chart selections of the given line.
*/
- (UIColor *)lineChartView:(JBLineChartView *)lineChartView verticalSelectionColorForLineAtLineIndex:(NSUInteger)lineIndex;
/**
* Returns the selection color of a line within the chart during touch events.
* The property showsLineSelection must be YES for the color to apply.
* As well, lineChartView:selectionColorStyleForLineAtLineIndex: must return JBLineChartViewColorStyleSolid (default).
*
* Default: matches lineChartView:colorForLineAtLineIndex:.
*
* @param lineChartView The line chart object requesting this information.
* @param lineIndex An index number identifying a line in the chart.
*
* @return The color to be used to highlight a line during chart selections.
*/
- (UIColor *)lineChartView:(JBLineChartView *)lineChartView selectionColorForLineAtLineIndex:(NSUInteger)lineIndex;
/**
* Returns the selection gradient layer of a line within the chart during touch events.
* The property showsLineSelection must be YES for the color to apply.
* As well, lineChartView:selectionColorStyleForLineAtLineIndex: must return JBLineChartViewColorStyleGradient.
*
* Note: gradients do not support multiple alphas. The alpha of gradient's first color be used throughout.
*
* Default: matches lineChartView:gradientForLineAtLineIndex:.
*
* @param lineChartView The line chart object requesting this information.
* @param lineIndex An index number identifying a line in the chart.
*
* @return The gradient layer to be used to highlight a line during chart selections.
*/
- (CAGradientLayer *)lineChartView:(JBLineChartView *)lineChartView selectionGradientForLineAtLineIndex:(NSUInteger)lineIndex;
/**
* Returns the selection fill color under a line within the chart during touch events.
* The property showsLineSelection must be YES for the color to apply.
* As well, lineChartView:selectionFillColorStyleForLineAtLineIndex: must return JBLineChartViewColorStyleSolid (default).
*
* Default: matches lineChartView:fillColorForLineAtLineIndex:.
*
* @param lineChartView The line chart object requesting this information.
* @param lineIndex An index number identifying a line in the chart.
*
* @return The color to be used to highlight under a line during chart selections.
*/
- (UIColor *)lineChartView:(JBLineChartView *)lineChartView selectionFillColorForLineAtLineIndex:(NSUInteger)lineIndex;
/**
* Returns the selection fill gradient layer under a line within the chart during touch events.
* The property showsLineSelection must be YES for the color to apply.
* As well, lineChartView:selectionFillColorStyleForLineAtLineIndex: must return JBLineChartViewColorStyleGrdient.
*
* Note: gradients do not support multiple alphas. The alpha of gradient's first color be used throughout.
*
* Default: matches lineChartView:fillGradientForLineAtLineIndex.
*
* @param lineChartView The line chart object requesting this information.
* @param lineIndex An index number identifying a line in the chart.
*
* @return The gradient layer to be used to highlight under a line during chart selections.
*/
- (CAGradientLayer *)lineChartView:(JBLineChartView *)lineChartView selectionFillGradientForLineAtLineIndex:(NSUInteger)lineIndex;
/**
* Returns the selection color to be overlayed on a line within the chart during touch events.
* The property showsLineSelection must be YES for the color to apply.
*
* Default: matches lineChartView:colorForDotAtHorizontalIndex:atLineIndex:(NSUInteger)lineIndex.
*
* @param lineChartView The line chart object requesting this information.
* @param horizontalIndex The 0-based horizontal index of a selection point (left to right, x-axis).
* @param lineIndex An index number identifying a line in the chart.
*
* @return The color to be used to highlight a dot within a dotted line during chart selections.
*/
- (UIColor *)lineChartView:(JBLineChartView *)lineChartView selectionColorForDotAtHorizontalIndex:(NSUInteger)horizontalIndex atLineIndex:(NSUInteger)lineIndex;
/**
* Returns the line style of a particular line at lineIndex within the chart.
* See JBLineChartViewLineStyle for line style descriptions.
*
* Default: JBLineChartViewLineStyleSolid.
*
* @param lineChartView The line chart object requesting this information.
* @param lineIndex An index number identifying a line in the chart.
*
* @return The line style to be used to draw a line in the chart.
*/
- (JBLineChartViewLineStyle)lineChartView:(JBLineChartView *)lineChartView lineStyleForLineAtLineIndex:(NSUInteger)lineIndex;
/**
* Returns the line color style of a particular line at lineIndex within the chart.
* The line color style applies to both selected and non-selected scenarios.
* See JBLineChartViewColorStyle for color style descriptions.
*
* Default: JBLineChartViewColorStyleSolid.
*
* @param lineChartView The line chart object requesting this information.
* @param lineIndex An index number identifying a line in the chart.
*
* @return The color style to be used to shade a line in the chart.
*/
- (JBLineChartViewColorStyle)lineChartView:(JBLineChartView *)lineChartView colorStyleForLineAtLineIndex:(NSUInteger)lineIndex;
/**
* Returns the fill color style of a particular line at lineIndex within the chart.
* The fill color style applies to both selected and non-selected scenarios.
* See JBLineChartViewColorStyle for color style descriptions.
*
* Default: JBLineChartViewColorStyleSolid.
*
* @param lineChartView The line chart object requesting this information.
* @param lineIndex An index number identifying a line in the chart.
*
* @return The fill color style to show under a line in the chart.
*/
- (JBLineChartViewColorStyle)lineChartView:(JBLineChartView *)lineChartView fillColorStyleForLineAtLineIndex:(NSUInteger)lineIndex;
@end
@interface JBLineChartView : JBChartView
@property (nonatomic, weak) id<JBLineChartViewDataSource> dataSource;
@property (nonatomic, weak) id<JBLineChartViewDelegate> delegate;
/*
* Reloads the line chart with a custom animation.
* Adding, removing or modifying existing lines or dot views (via growing/shrinking & fading) if animated = YES;
* Reloading (animated) data is thread safe and can be executed any number of times in succession.
*
* Note: fills will not be animated (technical limitation of Apple's CG API).
*
* Default: a non-animated reload (via reloadData).
*/
- (void)reloadDataAnimated:(BOOL)animated;
/*
* When reloadData or reloadDataAnimated: is called, the reloading bit is turned on.
* State changes during a reload will be ignored. As well, subsequent calls to reloadData:
* or reloadDataAnimated: before any previous reloads are complete, will also be ignored.
* Lastly, all touch events will be ignored until a reload has compeleted.
*
* Note: the above restrictions apply only to animated reloads, as non-animated reloads are synchronous.
*
* Default: NO.
*/
@property (nonatomic, readonly) BOOL reloading;
/**
* Vertical highlight overlayed on a line graph during touch events.
*
* Default: YES.
*/
@property (nonatomic, assign) BOOL showsVerticalSelection;
/**
* A highlight shown on a line within the graph during touch events. The highlighted line
* is the closest line to the touch point and corresponds to the lineIndex delegatd back via
* didSelectChartAtHorizontalIndex:atLineIndex: and didUnSlectChartAtHorizontalIndex:atLineIndex:
*
* Default: YES.
*/
@property (nonatomic, assign) BOOL showsLineSelection;
/**
* The dot view within a particular line at a horizontalIndex.
*
* Default: nil.
*
* @param horizontalIndex The 0-based horizontal index of a selection point (left to right, x-axis)
* @param lineIndex An index number identifying a line in the chart.
*
* @return The UIView representing the dot view at a given horizontalIndex within a line or nil if any index is out of range.
*/
- (UIView *)dotViewAtHorizontalIndex:(NSUInteger)horizontalIndex atLineIndex:(NSUInteger)lineIndex;
@end
+1159
View File
File diff suppressed because it is too large Load Diff
+21
View File
@@ -0,0 +1,21 @@
//
// JBGradientLineLayer.h
// JBChartViewDemo
//
// Created by Terry Worona on 12/25/15.
// Copyright © 2015 Jawbone. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
@interface JBGradientLineLayer : CAGradientLayer
- (instancetype)initWithGradientLayer:(CAGradientLayer *)gradientLayer tag:(NSUInteger)tag filled:(BOOL)filled currentPath:(UIBezierPath *)currentPath;
@property (nonatomic, readonly) NSUInteger tag;
@property (nonatomic, readonly) BOOL filled;
@property (nonatomic, strong) UIBezierPath *currentPath;
@property (nonatomic, readonly) CGFloat alpha; // alpha of gradient, based on first color
@end
+47
View File
@@ -0,0 +1,47 @@
//
// JBGradientLineLayer.m
// JBChartViewDemo
//
// Created by Terry Worona on 12/25/15.
// Copyright © 2015 Jawbone. All rights reserved.
//
#import "JBGradientLineLayer.h"
// Numerics
static CGFloat const kJBGradientLineLayerDefaultAlpha = 1.0f;
@implementation JBGradientLineLayer
#pragma mark - Alloc/Init
- (instancetype)initWithGradientLayer:(CAGradientLayer *)gradientLayer tag:(NSUInteger)tag filled:(BOOL)filled currentPath:(UIBezierPath *)currentPath
{
self = [super init];
if (self)
{
self.colors = gradientLayer.colors;
self.locations = gradientLayer.locations;
self.startPoint = gradientLayer.startPoint;
self.endPoint = gradientLayer.endPoint;
self.type = gradientLayer.type;
_tag = tag;
_filled = filled;
_currentPath = [currentPath copy];
}
return self;
}
#pragma mark - Getters
- (CGFloat)alpha
{
if (self.colors.firstObject != nil)
{
return CGColorGetAlpha((CGColorRef)self.colors.firstObject);
}
return kJBGradientLineLayerDefaultAlpha;
}
@end
+22
View File
@@ -0,0 +1,22 @@
//
// JBShapeLineLayer.h
// JBChartViewDemo
//
// Created by Terry Worona on 12/25/15.
// Copyright © 2015 Jawbone. All rights reserved.
//
#import <Foundation/Foundation.h>
// Views
#import "JBLineChartView.h"
@interface JBShapeLineLayer : CAShapeLayer
- (instancetype)initWithTag:(NSUInteger)tag filled:(BOOL)filled smoothedLine:(BOOL)smoothedLine lineStyle:(JBLineChartViewLineStyle)lineStyle currentPath:(UIBezierPath *)currentPath;
@property (nonatomic, readonly) NSUInteger tag;
@property (nonatomic, readonly) BOOL filled;
@property (nonatomic, strong) UIBezierPath *currentPath;
@end
+92
View File
@@ -0,0 +1,92 @@
//
// JBShapeLineLayer.m
// JBChartViewDemo
//
// Created by Terry Worona on 12/25/15.
// Copyright © 2015 Jawbone. All rights reserved.
//
#import "JBShapeLineLayer.h"
// Numerics
static CGFloat const kJBShapeLineLayerDefaultLinePhase = 1.0f;
// Structures
static NSArray *kJBShapeLineLayerDefaultDashPattern = nil;
@implementation JBShapeLineLayer
#pragma mark - Alloc/Init
+ (void)initialize
{
if (self == [JBShapeLineLayer class])
{
kJBShapeLineLayerDefaultDashPattern = @[@(3), @(2)];
}
}
- (instancetype)initWithTag:(NSUInteger)tag filled:(BOOL)filled smoothedLine:(BOOL)smoothedLine lineStyle:(JBLineChartViewLineStyle)lineStyle currentPath:(UIBezierPath *)currentPath
{
self = [super init];
if (self)
{
_tag = tag;
_filled = filled;
_currentPath = [currentPath copy];
// Position
self.zPosition = filled ? 0.0f : 0.1f;
self.fillColor = [UIColor clearColor].CGColor;
// Style
if (lineStyle == JBLineChartViewLineStyleSolid)
{
self.lineDashPhase = 0.0;
self.lineDashPattern = nil;
}
else if (lineStyle == JBLineChartViewLineStyleDashed)
{
self.lineDashPhase = kJBShapeLineLayerDefaultLinePhase;
self.lineDashPattern = kJBShapeLineLayerDefaultDashPattern;
}
// Smoothing
if (smoothedLine)
{
if (filled)
{
self.lineCap = kCALineCapRound;
self.lineJoin = kCALineJoinRound;
}
else
{
if (lineStyle == JBLineChartViewLineStyleDashed)
{
self.lineCap = kCALineCapButt; // smoothed, dashed lines need butt caps
}
else
{
self.lineCap = kCALineCapRound;
}
self.lineJoin = kCALineJoinRound;
}
}
else
{
if (filled)
{
self.lineCap = kCALineCapButt;
self.lineJoin = kCALineJoinMiter;
}
else
{
self.lineCap = kCALineCapButt;
self.lineJoin = kCALineJoinMiter;
}
}
}
return self;
}
@end
+22
View File
@@ -0,0 +1,22 @@
//
// JBLineChartLine.h
// JBChartViewDemo
//
// Created by Terry Worona on 12/25/15.
// Copyright © 2015 Jawbone. All rights reserved.
//
#import <Foundation/Foundation.h>
// Charts
#import "JBLineChartView.h"
@interface JBLineChartLine : NSObject
@property (nonatomic, strong) NSArray *lineChartPoints;
@property (nonatomic, assign) BOOL smoothedLine;
@property (nonatomic, assign) JBLineChartViewLineStyle lineStyle;
@property (nonatomic, assign) JBLineChartViewColorStyle colorStyle;
@property (nonatomic, assign) JBLineChartViewColorStyle fillColorStyle;
@end
+29
View File
@@ -0,0 +1,29 @@
//
// JBLineChartLine.m
// JBChartViewDemo
//
// Created by Terry Worona on 12/25/15.
// Copyright © 2015 Jawbone. All rights reserved.
//
#import "JBLineChartLine.h"
@implementation JBLineChartLine
#pragma mark - Alloc/Init
- (id)init
{
self = [super init];
if (self)
{
_lineChartPoints = [NSArray array];
_smoothedLine = NO;
_lineStyle = JBLineChartViewLineStyleSolid;
_colorStyle = JBLineChartViewColorStyleSolid;
_fillColorStyle = JBLineChartViewColorStyleSolid;
}
return self;
}
@end
+17
View File
@@ -0,0 +1,17 @@
//
// JBLineChartPoint.h
// JBChartViewDemo
//
// Created by Terry Worona on 12/25/15.
// Copyright © 2015 Jawbone. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <CoreGraphics/CoreGraphics.h>
@interface JBLineChartPoint : NSObject
@property (nonatomic, assign) CGPoint position;
@property (nonatomic, assign) BOOL hidden;
@end
+32
View File
@@ -0,0 +1,32 @@
//
// JBLineChartPoint.m
// JBChartViewDemo
//
// Created by Terry Worona on 12/25/15.
// Copyright © 2015 Jawbone. All rights reserved.
//
#import "JBLineChartPoint.h"
@implementation JBLineChartPoint
#pragma mark - Alloc/Init
- (id)init
{
self = [super init];
if (self)
{
_position = CGPointZero;
}
return self;
}
#pragma mark - Compare
- (NSComparisonResult)compare:(JBLineChartPoint *)otherObject
{
return self.position.x > otherObject.position.x;
}
@end
+16
View File
@@ -0,0 +1,16 @@
//
// JBLineChartDotView.h
// JBChartViewDemo
//
// Created by Terry Worona on 12/25/15.
// Copyright © 2015 Jawbone. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
@interface JBLineChartDotView : UIView
- (id)initWithRadius:(CGFloat)radius;
@end
+26
View File
@@ -0,0 +1,26 @@
//
// JBLineChartDotView.m
// JBChartViewDemo
//
// Created by Terry Worona on 12/25/15.
// Copyright © 2015 Jawbone. All rights reserved.
//
#import "JBLineChartDotView.h"
@implementation JBLineChartDotView
#pragma mark - Alloc/Init
- (id)initWithRadius:(CGFloat)radius
{
self = [super initWithFrame:CGRectMake(0, 0, (radius * 2.0f), (radius * 2.0f))];
if (self)
{
self.clipsToBounds = YES;
self.layer.cornerRadius = ((radius * 2.0f) * 0.5f);
}
return self;
}
@end
+47
View File
@@ -0,0 +1,47 @@
//
// JBLineChartDotsView.h
// JBChartViewDemo
//
// Created by Terry Worona on 12/25/15.
// Copyright © 2015 Jawbone. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
// Numerics
extern NSInteger const kJBLineChartDotsViewUnselectedLineIndex;
@protocol JBLineChartDotsViewDataSource;
@interface JBLineChartDotsView : UIView
@property (nonatomic, assign) id<JBLineChartDotsViewDataSource> dataSource;
@property (nonatomic, assign) NSInteger selectedLineIndex;
@property (nonatomic, strong) NSDictionary *dotViewsDict;
// Data
- (void)reloadDataAnimated:(BOOL)animated callback:(void (^)())callback;
- (void)reloadDataAnimated:(BOOL)animated;
- (void)reloadData;
// Setters
- (void)setSelectedLineIndex:(NSInteger)selectedLineIndex animated:(BOOL)animated;
// Getters
- (UIView *)dotViewForHorizontalIndex:(NSUInteger)horizontalIndex atLineIndex:(NSUInteger)lineIndex;
@end
@protocol JBLineChartDotsViewDataSource <NSObject>
- (NSArray *)lineChartLinesForLineChartDotsView:(JBLineChartDotsView*)lineChartDotsView;
- (UIColor *)lineChartDotsView:(JBLineChartDotsView *)lineChartDotsView colorForDotAtHorizontalIndex:(NSUInteger)horizontalIndex atLineIndex:(NSUInteger)lineIndex;
- (UIColor *)lineChartDotsView:(JBLineChartDotsView *)lineChartDotsView selectedColorForDotAtHorizontalIndex:(NSUInteger)horizontalIndex atLineIndex:(NSUInteger)lineIndex;
- (CGFloat)lineChartDotsView:(JBLineChartDotsView *)lineChartDotsView dotRadiusForLineAtHorizontalIndex:(NSUInteger)horizontalIndex atLineIndex:(NSUInteger)lineIndex;
- (UIView *)lineChartDotsView:(JBLineChartDotsView *)lineChartDotsView dotViewAtHorizontalIndex:(NSUInteger)horizontalIndex atLineIndex:(NSUInteger)lineIndex;
- (BOOL)lineChartDotsView:(JBLineChartDotsView *)lineChartDotsView shouldHideDotViewOnSelectionAtHorizontalIndex:(NSUInteger)horizontalIndex atLineIndex:(NSUInteger)lineIndex;
- (BOOL)lineChartDotsView:(JBLineChartDotsView *)lineChartDotsView showsDotsForLineAtLineIndex:(NSUInteger)lineIndex;
- (CGFloat)lineChartDotsView:(JBLineChartDotsView *)lineChartDotsView dimmedSelectionDotOpacityAtLineIndex:(NSUInteger)lineIndex;
@end
+239
View File
@@ -0,0 +1,239 @@
//
// JBLineChartDotsView.m
// JBChartViewDemo
//
// Created by Terry Worona on 12/25/15.
// Copyright © 2015 Jawbone. All rights reserved.
//
#import "JBLineChartDotsView.h"
// Additions
#import "NSMutableArray+JBStack.h"
// Models
#import "JBLineChartLine.h"
#import "JBLineChartPoint.h"
// Views
#import "JBLineChartDotView.h"
#import "JBLineChartView.h"
// Numerics
static CGFloat const kJBLineChartDotsViewReloadDataAnimationDuration = 0.15f;
NSInteger const kJBLineChartDotsViewUnselectedLineIndex = -1;
@implementation JBLineChartDotsView
#pragma mark - Alloc/Init
- (id)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self)
{
self.backgroundColor = [UIColor clearColor];
}
return self;
}
#pragma mark - Data
- (void)reloadDataAnimated:(BOOL)animated callback:(void (^)())callback
{
NSAssert([self.dataSource respondsToSelector:@selector(lineChartLinesForLineChartDotsView:)], @"JBLineChartDotsView // dataSource must implement - (NSArray *)lineChartLinesForLineChartDotsView:(JBLineChartDotsView *)lineChartDotsView");
NSArray *lineChartLines = [self.dataSource lineChartLinesForLineChartDotsView:self];
if (animated)
{
// Reusable dot views
__block NSMutableArray *mutableReusableDotViews = [NSMutableArray array];
for (id key in [[self.dotViewsDict allKeys] sortedArrayUsingSelector:@selector(compare:)])
{
NSArray *dotViews = [self.dotViewsDict objectForKey:key];
[mutableReusableDotViews addObjectsFromArray:dotViews];
}
NSUInteger lineIndex = 0;
for (JBLineChartLine *lineChartLine in lineChartLines)
{
NSAssert([self.dataSource respondsToSelector:@selector(lineChartDotsView:showsDotsForLineAtLineIndex:)], @"JBLineChartDotsView // dataSource must implement - (BOOL)lineChartDotsView:(JBLineChartDotsView *)lineChartDotsView showsDotsForLineAtLineIndex:(NSUInteger)lineIndex");
if ([self.dataSource lineChartDotsView:self showsDotsForLineAtLineIndex:lineIndex]) // line at index contains dots
{
NSArray *sortedLineChartPoints = [lineChartLine.lineChartPoints sortedArrayUsingSelector:@selector(compare:)];
for (NSUInteger horizontalIndex = 0; horizontalIndex < [sortedLineChartPoints count]; horizontalIndex++)
{
JBLineChartPoint *lineChartPoint = [sortedLineChartPoints objectAtIndex:horizontalIndex];
if(lineChartPoint.hidden)
{
continue;
}
__block UIView *dotView = [mutableReusableDotViews jb_pop];
if (dotView != nil)
{
[UIView animateWithDuration:kJBLineChartDotsViewReloadDataAnimationDuration animations:^{
dotView.center = CGPointMake(lineChartPoint.position.x, lineChartPoint.position.y); // animate move
} completion:nil];
}
}
}
lineIndex++;
}
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, kJBLineChartDotsViewReloadDataAnimationDuration * NSEC_PER_SEC), dispatch_get_main_queue(), ^{
if (callback)
{
callback();
}
});
}
else
{
// Remove legacy dots
for (JBLineChartDotView *dotView in self.subviews)
{
[dotView removeFromSuperview];
}
// Create new dots
NSUInteger lineIndex = 0;
NSMutableDictionary *mutableDotViewsDict = [NSMutableDictionary dictionary];
for (JBLineChartLine *lineChartLine in lineChartLines)
{
NSAssert([self.dataSource respondsToSelector:@selector(lineChartDotsView:showsDotsForLineAtLineIndex:)], @"JBLineChartDotsView // dataSource must implement - (BOOL)lineChartDotsView:(JBLineChartDotsView *)lineChartDotsView showsDotsForLineAtLineIndex:(NSUInteger)lineIndex");
if ([self.dataSource lineChartDotsView:self showsDotsForLineAtLineIndex:lineIndex]) // line at index contains dots
{
NSMutableArray *mutableDotViews = [NSMutableArray array];
NSArray *sortedLineChartPoints = [lineChartLine.lineChartPoints sortedArrayUsingSelector:@selector(compare:)];
for (NSUInteger horizontalIndex = 0; horizontalIndex < [sortedLineChartPoints count]; horizontalIndex++)
{
JBLineChartPoint *lineChartPoint = [sortedLineChartPoints objectAtIndex:horizontalIndex];
if(lineChartPoint.hidden)
{
continue;
}
UIView *dotView = [self dotViewForHorizontalIndex:horizontalIndex atLineIndex:lineIndex];
dotView.center = CGPointMake(lineChartPoint.position.x, lineChartPoint.position.y);
[mutableDotViews addObject:dotView];
[self addSubview:dotView];
}
[mutableDotViewsDict setObject:[NSArray arrayWithArray:mutableDotViews] forKey:[NSNumber numberWithInteger:lineIndex]];
}
lineIndex++;
}
self.dotViewsDict = [NSDictionary dictionaryWithDictionary:mutableDotViewsDict];
if (callback)
{
callback();
}
}
}
- (void)reloadDataAnimated:(BOOL)animated
{
[self reloadDataAnimated:animated callback:nil];
}
- (void)reloadData
{
[self reloadDataAnimated:NO];
}
#pragma mark - Setters
- (void)setSelectedLineIndex:(NSInteger)selectedLineIndex animated:(BOOL)animated
{
_selectedLineIndex = selectedLineIndex;
__weak JBLineChartDotsView* weakSelf = self;
dispatch_block_t adjustDots = ^{
[weakSelf.dotViewsDict enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) {
NSUInteger horizontalIndex = 0;
for (UIView *dotView in (NSArray *)obj)
{
if ([key isKindOfClass:[NSNumber class]])
{
NSInteger lineIndex = [((NSNumber *)key) intValue];
// Internal dot
if ([dotView isKindOfClass:[JBLineChartDotView class]])
{
if (weakSelf.selectedLineIndex == lineIndex)
{
NSAssert([self.dataSource respondsToSelector:@selector(lineChartDotsView:selectedColorForDotAtHorizontalIndex:atLineIndex:)], @"JBLineChartDotsView // dataSource must implement - (UIColor *)lineChartDotsView:(JBLineChartDotsView *)lineChartDotsView selectedColorForDotAtHorizontalIndex:(NSUInteger)horizontalIndex atLineIndex:(NSUInteger)lineIndex");
dotView.backgroundColor = [self.dataSource lineChartDotsView:self selectedColorForDotAtHorizontalIndex:horizontalIndex atLineIndex:lineIndex];
}
else
{
NSAssert([self.dataSource respondsToSelector:@selector(lineChartDotsView:colorForDotAtHorizontalIndex:atLineIndex:)], @"JBLineChartDotsView // dataSource must implement - (UIColor *)lineChartDotsView:(JBLineChartDotsView *)lineChartDotsView colorForDotAtHorizontalIndex:(NSUInteger)horizontalIndex atLineIndex:(NSUInteger)lineIndex");
dotView.backgroundColor = [self.dataSource lineChartDotsView:self colorForDotAtHorizontalIndex:horizontalIndex atLineIndex:lineIndex];
NSAssert([self.dataSource respondsToSelector:@selector(lineChartDotsView:dimmedSelectionDotOpacityAtLineIndex:)], @"JBLineChartLinesView // dataSource must implement - (CGFloat)lineChartDotsView:(JBLineChartLinesView *)lineChartLinesView dimmedSelectionDotOpacityAtLineIndex:(NSUInteger)lineIndex");
dotView.alpha = (weakSelf.selectedLineIndex == kJBLineChartDotsViewUnselectedLineIndex) ? 1.0f : [self.dataSource lineChartDotsView:self dimmedSelectionDotOpacityAtLineIndex:lineIndex];
}
}
// Custom dot
else
{
NSAssert([self.dataSource respondsToSelector:@selector(lineChartDotsView:shouldHideDotViewOnSelectionAtHorizontalIndex:atLineIndex:)], @"JBLineChartDotsView // dataSource must implement - (BOOL)lineChartDotsView:(JBLineChartDotsView *)lineChartDotsView shouldHideDotViewOnSelectionAtHorizontalIndex:(NSUInteger)horizontalIndex atLineIndex:(NSUInteger)lineIndex");
BOOL hideDotView = [self.dataSource lineChartDotsView:self shouldHideDotViewOnSelectionAtHorizontalIndex:horizontalIndex atLineIndex:lineIndex];
if (weakSelf.selectedLineIndex == lineIndex)
{
NSAssert([self.dataSource respondsToSelector:@selector(lineChartDotsView:dimmedSelectionDotOpacityAtLineIndex:)], @"JBLineChartLinesView // dataSource must implement - (CGFloat)lineChartDotsView:(JBLineChartLinesView *)lineChartLinesView dimmedSelectionDotOpacityAtLineIndex:(NSUInteger)lineIndex");
dotView.alpha = hideDotView ? [self.dataSource lineChartDotsView:self dimmedSelectionDotOpacityAtLineIndex:lineIndex] : 1.0f;
}
else
{
dotView.alpha = 1.0;
}
}
}
horizontalIndex++;
}
}];
};
if (animated)
{
[UIView animateWithDuration:kJBChartViewDefaultAnimationDuration animations:^{
adjustDots();
}];
}
else
{
adjustDots();
}
}
- (void)setSelectedLineIndex:(NSInteger)selectedLineIndex
{
[self setSelectedLineIndex:selectedLineIndex animated:NO];
}
#pragma mark - Getters
- (UIView *)dotViewForHorizontalIndex:(NSUInteger)horizontalIndex atLineIndex:(NSUInteger)lineIndex
{
NSAssert([self.dataSource respondsToSelector:@selector(lineChartDotsView:dotViewAtHorizontalIndex:atLineIndex:)], @"JBLineChartDotsView // dataSource must implement - (UIView *)lineChartDotsView:(JBLineChartDotsView *)lineChartDotsView dotViewAtHorizontalIndex:(NSUInteger)horizontalIndex atLineIndex:(NSUInteger)lineIndex");
UIView *dotView = [self.dataSource lineChartDotsView:self dotViewAtHorizontalIndex:horizontalIndex atLineIndex:lineIndex];
// System dot
if (dotView == nil)
{
NSAssert([self.dataSource respondsToSelector:@selector(lineChartDotsView:dotRadiusForLineAtHorizontalIndex:atLineIndex:)], @"JBLineChartDotsView // dataSource must implement - (CGFloat)lineChartDotsView:(JBLineChartDotsView *)lineChartDotsView dotRadiusForLineAtHorizontalIndex:(NSUInteger)horizontalIndex atLineIndex:(NSUInteger)lineIndex");
CGFloat dotRadius = [self.dataSource lineChartDotsView:self dotRadiusForLineAtHorizontalIndex:horizontalIndex atLineIndex:lineIndex];
dotView = [[JBLineChartDotView alloc] initWithRadius:dotRadius];
NSAssert([self.dataSource respondsToSelector:@selector(lineChartDotsView:colorForDotAtHorizontalIndex:atLineIndex:)], @"JBLineChartDotsView // dataSource must implement - (UIColor *)lineChartDotsView:(JBLineChartDotsView *)lineChartDotsView colorForDotAtHorizontalIndex:(NSUInteger)horizontalIndex atLineIndex:(NSUInteger)lineIndex");
dotView.backgroundColor = [self.dataSource lineChartDotsView:self colorForDotAtHorizontalIndex:horizontalIndex atLineIndex:lineIndex];
}
return dotView;
}
@end
+49
View File
@@ -0,0 +1,49 @@
//
// JBLineChartLinesView.h
// JBChartViewDemo
//
// Created by Terry Worona on 12/26/15.
// Copyright © 2015 Jawbone. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
// Numerics
extern NSInteger const kJBLineChartLinesViewUnselectedLineIndex;
@protocol JBLineChartLinesViewDataSource;
@interface JBLineChartLinesView : UIView
@property (nonatomic, assign) id<JBLineChartLinesViewDataSource> dataSource;
@property (nonatomic, assign) NSInteger selectedLineIndex; // -1 to unselect
// Data
- (void)reloadDataAnimated:(BOOL)animated callback:(void (^)())callback;
- (void)reloadDataAnimated:(BOOL)animated;
- (void)reloadData;
// Setters
- (void)setSelectedLineIndex:(NSInteger)selectedLineIndex animated:(BOOL)animated;
// Callback helpers
- (void)fireCallback:(void (^)())callback;
@end
@protocol JBLineChartLinesViewDataSource <NSObject>
- (NSArray *)lineChartLinesForLineChartLinesView:(JBLineChartLinesView *)lineChartLinesView;
- (CGFloat)lineChartLinesView:(JBLineChartLinesView *)lineChartLinesView dimmedSelectionOpacityAtLineIndex:(NSUInteger)lineIndex;
- (UIColor *)lineChartLinesView:(JBLineChartLinesView *)lineChartLinesView colorForLineAtLineIndex:(NSUInteger)lineIndex;
- (CAGradientLayer *)lineChartLinesView:(JBLineChartLinesView *)lineChartLinesView gradientForLineAtLineIndex:(NSUInteger)lineIndex;
- (UIColor *)lineChartLinesView:(JBLineChartLinesView *)lineChartLinesView fillColorForLineAtLineIndex:(NSUInteger)lineIndex;
- (CAGradientLayer *)lineChartLinesView:(JBLineChartLinesView *)lineChartLinesView fillGradientForLineAtLineIndex:(NSUInteger)lineIndex;
- (CGFloat)lineChartLinesView:(JBLineChartLinesView *)lineChartLinesView widthForLineAtLineIndex:(NSUInteger)lineIndex;
- (UIColor *)lineChartLinesView:(JBLineChartLinesView *)lineChartLinesView selectionColorForLineAtLineIndex:(NSUInteger)lineIndex;
- (CAGradientLayer *)lineChartLinesView:(JBLineChartLinesView *)lineChartLinesView selectionGradientForLineAtLineIndex:(NSUInteger)lineIndex;
- (UIColor *)lineChartLinesView:(JBLineChartLinesView *)lineChartLinesView selectionFillColorForLineAtLineIndex:(NSUInteger)lineIndex;
- (CAGradientLayer *)lineChartLinesView:(JBLineChartLinesView *)lineChartLinesView selectionFillGradientForLineAtLineIndex:(NSUInteger)lineIndex;
@end
+597
View File
@@ -0,0 +1,597 @@
//
// JBLineChartLinesView.m
// JBChartViewDemo
//
// Created by Terry Worona on 12/26/15.
// Copyright © 2015 Jawbone. All rights reserved.
//
#import "JBLineChartLinesView.h"
// Layers
#import "JBGradientLineLayer.h"
#import "JBShapeLineLayer.h"
// Models
#import "JBLineChartLine.h"
#import "JBLineChartPoint.h"
// Numerics
static CGFloat const kJBLineChartLinesViewMiterLimit = -5.0;
static CGFloat const kJBLineChartLinesViewSmoothThresholdSlope = 0.01f;
static CGFloat const kJBLineChartLinesViewReloadDataAnimationDuration = 0.15f;
static NSInteger const kJBLineChartLinesViewSmoothThresholdVertical = 1;
NSInteger const kJBLineChartLinesViewUnselectedLineIndex = -1;
@interface JBLineChartLinesView ()
@property (nonatomic, assign) BOOL animated; // for reload
// Getters
- (UIBezierPath *)bezierPathForLineChartLine:(JBLineChartLine *)lineChartLine filled:(BOOL)filled;
- (JBShapeLineLayer *)shapeLineLayerForLineIndex:(NSUInteger)lineIndex filled:(BOOL)filled;
- (JBGradientLineLayer *)gradientLineLayerForLineIndex:(NSUInteger)lineIndex filled:(BOOL)filled;
- (CABasicAnimation *)basicPathAnimationFromBezierPath:(UIBezierPath *)fromBezierPath toBezierPath:(UIBezierPath *)toBezierPath;
@end
@implementation JBLineChartLinesView
#pragma mark - Alloc/Init
- (id)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self)
{
self.backgroundColor = [UIColor clearColor];
}
return self;
}
#pragma mark - Memory Management
- (void)dealloc
{
[NSObject cancelPreviousPerformRequestsWithTarget:self];
}
#pragma mark - Drawing
- (void)drawRect:(CGRect)rect
{
[super drawRect:rect];
NSAssert([self.dataSource respondsToSelector:@selector(lineChartLinesForLineChartLinesView:)], @"JBLineChartLinesView // dataSource must implement - (NSArray *)lineChartLinesForLineChartLinesView:(JBLineChartLinesView *)lineChartLinesView");
NSArray *chartData = [self.dataSource lineChartLinesForLineChartLinesView:self];
for (NSUInteger lineIndex=0; lineIndex<[chartData count]; lineIndex++)
{
JBLineChartLine *lineChartLine = [chartData objectAtIndex:lineIndex];
{
UIBezierPath *linePath = [self bezierPathForLineChartLine:lineChartLine filled:NO];
UIBezierPath *fillPath = [self bezierPathForLineChartLine:lineChartLine filled:YES];
if (linePath == nil || fillPath == nil)
{
continue;
}
JBShapeLineLayer *shapeLineLayer = [self shapeLineLayerForLineIndex:lineIndex filled:NO];
if (shapeLineLayer == nil)
{
shapeLineLayer = [[JBShapeLineLayer alloc] initWithTag:lineIndex filled:NO smoothedLine:lineChartLine.smoothedLine lineStyle:lineChartLine.lineStyle currentPath:linePath];
}
JBShapeLineLayer *shapeLineFillLayer = [self shapeLineLayerForLineIndex:lineIndex filled:YES];
if (shapeLineFillLayer == nil)
{
shapeLineFillLayer = [[JBShapeLineLayer alloc] initWithTag:lineIndex filled:YES smoothedLine:lineChartLine.smoothedLine lineStyle:lineChartLine.lineStyle currentPath:nil]; // path not needed for fills (unsupported)
}
// Width
NSAssert([self.dataSource respondsToSelector:@selector(lineChartLinesView:widthForLineAtLineIndex:)], @"JBLineChartLinesView // dataSource must implement - (CGFloat)lineChartLinesView:(JBLineChartLinesView *)lineChartLinesView widthForLineAtLineIndex:(NSUInteger)lineIndex");
shapeLineLayer.lineWidth = [self.dataSource lineChartLinesView:self widthForLineAtLineIndex:lineIndex];
NSAssert([self.dataSource respondsToSelector:@selector(lineChartLinesView:widthForLineAtLineIndex:)], @"JBLineChartLinesView // dataSource must implement - (CGFloat)lineChartLinesView:(JBLineChartLinesView *)lineChartLinesView widthForLineAtLineIndex:(NSUInteger)lineIndex");
shapeLineFillLayer.lineWidth = [self.dataSource lineChartLinesView:self widthForLineAtLineIndex:lineIndex];
// Colors
NSAssert([self.dataSource respondsToSelector:@selector(lineChartLinesView:colorForLineAtLineIndex:)], @"JBLineChartLinesView // dataSource must implement - (UIColor *)lineChartLinesView:(JBLineChartLinesView *)lineChartLinesView colorForLineAtLineIndex:(NSUInteger)lineIndex");
shapeLineLayer.strokeColor = [self.dataSource lineChartLinesView:self colorForLineAtLineIndex:lineIndex].CGColor;
NSAssert([self.dataSource respondsToSelector:@selector(lineChartLinesView:fillColorForLineAtLineIndex:)], @"JBLineChartLinesView // dataSource must implement - (UIColor *)lineChartLinesView:(JBLineChartLinesView *)lineChartLinesView fillColorForLineAtLineIndex:(NSUInteger)lineIndex");
shapeLineFillLayer.fillColor = [self.dataSource lineChartLinesView:self fillColorForLineAtLineIndex:lineIndex].CGColor;
// Bounds
shapeLineLayer.frame = self.bounds;
shapeLineFillLayer.frame = self.bounds;
// Note: fills go first because the lines must go on top
/*
* Solid fill
*/
if (lineChartLine.fillColorStyle == JBLineChartViewColorStyleSolid)
{
shapeLineFillLayer.path = fillPath.CGPath;
[self.layer addSublayer:shapeLineFillLayer];
}
/*
* Gradient fill
*/
else if (lineChartLine.fillColorStyle == JBLineChartViewColorStyleGradient)
{
JBGradientLineLayer *gradientLineFillLayer = [self gradientLineLayerForLineIndex:lineIndex filled:YES];
if (gradientLineFillLayer == nil)
{
NSAssert([self.dataSource respondsToSelector:@selector(lineChartLinesView:fillGradientForLineAtLineIndex:)], @"JBLineChartLinesView // dataSource must implement - (CAGradientLayer *)lineChartLinesView:(JBLineChartLinesView *)lineChartLinesView fillGradientForLineAtLineIndex:(NSUInteger)lineIndex");
gradientLineFillLayer = [[JBGradientLineLayer alloc] initWithGradientLayer:[self.dataSource lineChartLinesView:self fillGradientForLineAtLineIndex:lineIndex] tag:lineIndex filled:YES currentPath:nil];
}
gradientLineFillLayer.frame = shapeLineFillLayer.frame;
shapeLineFillLayer.path = fillPath.CGPath;
CGColorRef shapeLayerStrokeColor = shapeLineLayer.strokeColor;
shapeLineLayer.strokeColor = [UIColor colorWithWhite:1 alpha:[gradientLineFillLayer alpha]].CGColor; // mask uses alpha only
shapeLineFillLayer.fillColor = [UIColor colorWithWhite:1 alpha:[gradientLineFillLayer alpha]].CGColor; // mask uses alpha only
gradientLineFillLayer.mask = shapeLineFillLayer;
[self.layer addSublayer:gradientLineFillLayer];
// Refresh shape layer stroke (used below)
shapeLineLayer.strokeColor = shapeLayerStrokeColor;
}
/*
* Solid line
*/
if (lineChartLine.colorStyle == JBLineChartViewColorStyleSolid)
{
if (self.animated)
{
[shapeLineLayer addAnimation:[self basicPathAnimationFromBezierPath:shapeLineLayer.currentPath toBezierPath:linePath] forKey:@"shapeLayerPathAnimation"];
}
else
{
shapeLineLayer.path = linePath.CGPath;
}
shapeLineLayer.currentPath = [linePath copy];
[self.layer addSublayer:shapeLineLayer];
}
/*
* Gradient line
*/
else if (lineChartLine.colorStyle == JBLineChartViewColorStyleGradient)
{
JBGradientLineLayer *gradientLineLayer = [self gradientLineLayerForLineIndex:lineIndex filled:NO];
if (gradientLineLayer == nil)
{
NSAssert([self.dataSource respondsToSelector:@selector(lineChartLinesView:gradientForLineAtLineIndex:)], @"JBLineChartLinesView // dataSource must implement - (CAGradientLayer *)lineChartLinesView:(JBLineChartLinesView *)lineChartLinesView gradientForLineAtLineIndex:(NSUInteger)lineIndex");
gradientLineLayer = [[JBGradientLineLayer alloc] initWithGradientLayer:[self.dataSource lineChartLinesView:self gradientForLineAtLineIndex:lineIndex] tag:lineIndex filled:NO currentPath:linePath];
}
gradientLineLayer.frame = shapeLineLayer.frame;
if (self.animated)
{
[gradientLineLayer.mask addAnimation:[self basicPathAnimationFromBezierPath:gradientLineLayer.currentPath toBezierPath:linePath] forKey:@"gradientLayerMaskAnimation"];
}
else
{
shapeLineLayer.path = linePath.CGPath;
shapeLineLayer.strokeColor = [UIColor colorWithWhite:1 alpha:[gradientLineLayer alpha]].CGColor; // mask uses alpha only
gradientLineLayer.mask = shapeLineLayer;
}
gradientLineLayer.currentPath = [linePath copy];
[self.layer addSublayer:gradientLineLayer];
}
}
}
self.animated = NO;
}
#pragma mark - Data
- (void)reloadDataAnimated:(BOOL)animated callback:(void (^)())callback
{
NSAssert([self.dataSource respondsToSelector:@selector(lineChartLinesForLineChartLinesView:)], @"JBLineChartLinesView // dataSource must implement - (NSArray *)lineChartLinesForLineChartLinesView:(JBLineChartLinesView *)lineChartLinesView");
NSArray *chartData = [self.dataSource lineChartLinesForLineChartLinesView:self];
NSUInteger lineCount = [chartData count];
__weak JBLineChartLinesView* weakSelf = self;
dispatch_block_t completionBlock = ^{
weakSelf.animated = animated;
[weakSelf setNeedsDisplay]; // re-draw layers
if (callback)
{
callback();
}
};
// Mark layers for animation or removal
NSMutableArray *mutableRemovedLayers = [NSMutableArray array];
for (CALayer *layer in [self.layer sublayers])
{
BOOL removeLayer = NO;
if ([layer isKindOfClass:[JBShapeLineLayer class]])
{
removeLayer = (((JBShapeLineLayer *)layer).tag >= lineCount);
}
else if ([layer isKindOfClass:[JBGradientLineLayer class]])
{
removeLayer = (((JBGradientLineLayer *)layer).tag >= lineCount);
}
if (removeLayer)
{
[mutableRemovedLayers addObject:layer];
}
}
// Remove legacy layers
NSArray *removedLayers = [NSArray arrayWithArray:mutableRemovedLayers];
if ([removedLayers count] > 0)
{
for (NSUInteger index=0; index<[removedLayers count]; index++)
{
CALayer *removedLayer = [removedLayers objectAtIndex:index];
if (animated)
{
[CATransaction begin];
{
CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"opacity"];
animation.fromValue = [NSNumber numberWithFloat:1.0f];
animation.toValue = [NSNumber numberWithFloat:0.0f];
animation.duration = kJBLineChartLinesViewReloadDataAnimationDuration;
animation.timingFunction = [CAMediaTimingFunction functionWithName:@"easeInEaseOut"];
animation.fillMode = kCAFillModeBoth;
animation.removedOnCompletion = NO;
[CATransaction setCompletionBlock:^{
[removedLayer removeFromSuperlayer];
if (index == [removedLayers count]-1)
{
completionBlock();
}
}];
[removedLayer addAnimation:animation forKey:@"removeShapeLayerAnimation"];
}
[CATransaction commit];
}
else
{
[removedLayer removeFromSuperlayer];
if (index == [removedLayers count]-1)
{
completionBlock();
}
}
}
}
else
{
completionBlock();
}
}
- (void)reloadDataAnimated:(BOOL)animated
{
[self reloadDataAnimated:animated callback:nil];
}
- (void)reloadData
{
[self reloadDataAnimated:NO];
}
#pragma mark - Setters
- (void)setSelectedLineIndex:(NSInteger)selectedLineIndex animated:(BOOL)animated
{
_selectedLineIndex = selectedLineIndex;
__weak JBLineChartLinesView* weakSelf = self;
dispatch_block_t adjustLines = ^{
NSMutableArray *layersToReplace = [NSMutableArray array];
NSString * const oldLayerKey = @"oldLayer";
NSString * const newLayerKey = @"newLayer";
for (CALayer *layer in [weakSelf.layer sublayers])
{
/*
* Solid line or fill
*/
if ([layer isKindOfClass:[JBShapeLineLayer class]])
{
JBShapeLineLayer *shapeLineLayer = (JBShapeLineLayer * )layer;
if (shapeLineLayer.filled)
{
// Selected solid fill
if (weakSelf.selectedLineIndex >= 0 && ((unsigned)shapeLineLayer.tag == weakSelf.selectedLineIndex))
{
NSAssert([self.dataSource respondsToSelector:@selector(lineChartLinesView:selectionFillColorForLineAtLineIndex:)], @"JBLineChartLinesView // dataSource must implement - (UIColor *)lineChartLinesView:(JBLineChartLinesView *)lineChartLinesView selectionFillColorForLineAtLineIndex:(NSUInteger)lineIndex");
shapeLineLayer.fillColor = [self.dataSource lineChartLinesView:self selectionFillColorForLineAtLineIndex:shapeLineLayer.tag].CGColor;
shapeLineLayer.opacity = 1.0f;
}
// Unselected solid fill
else
{
NSAssert([self.dataSource respondsToSelector:@selector(lineChartLinesView:fillColorForLineAtLineIndex:)], @"JBLineChartLinesView // dataSource must implement - (UIColor *)lineChartLinesView:(JBLineChartLinesView *)lineChartLinesView fillColorForLineAtLineIndex:(NSUInteger)lineIndex");
shapeLineLayer.fillColor = [self.dataSource lineChartLinesView:self fillColorForLineAtLineIndex:shapeLineLayer.tag].CGColor;
NSAssert([self.dataSource respondsToSelector:@selector(lineChartLinesView:dimmedSelectionOpacityAtLineIndex:)], @"JBLineChartLinesView // dataSource must implement - (CGFloat)lineChartLinesView:(JBLineChartLinesView *)lineChartLinesView dimmedSelectionOpacityAtLineIndex:(NSUInteger)lineIndex");
shapeLineLayer.opacity = (weakSelf.selectedLineIndex == kJBLineChartLinesViewUnselectedLineIndex) ? 1.0f : [self.dataSource lineChartLinesView:self dimmedSelectionOpacityAtLineIndex:shapeLineLayer.tag];
}
}
else
{
// Selected solid line
if (weakSelf.selectedLineIndex >= 0 && ((unsigned)shapeLineLayer.tag == weakSelf.selectedLineIndex))
{
NSAssert([self.dataSource respondsToSelector:@selector(lineChartLinesView:selectionColorForLineAtLineIndex:)], @"JBLineChartLinesView // dataSource must implement - (UIColor *)lineChartLinesView:(JBLineChartLinesView *)lineChartLinesView selectionColorForLineAtLineIndex:(NSUInteger)lineIndex");
shapeLineLayer.strokeColor = [self.dataSource lineChartLinesView:self selectionColorForLineAtLineIndex:shapeLineLayer.tag].CGColor;
shapeLineLayer.opacity = 1.0f;
}
// Unselected solid line
else
{
NSAssert([self.dataSource respondsToSelector:@selector(lineChartLinesView:colorForLineAtLineIndex:)], @"JBLineChartLinesView // dataSource must implement - (UIColor *)lineChartLinesView:(JBLineChartLinesView *)lineChartLinesView colorForLineAtLineIndex:(NSUInteger)lineIndex");
shapeLineLayer.strokeColor = [self.dataSource lineChartLinesView:self colorForLineAtLineIndex:shapeLineLayer.tag].CGColor;
NSAssert([self.dataSource respondsToSelector:@selector(lineChartLinesView:dimmedSelectionOpacityAtLineIndex:)], @"JBLineChartLinesView // dataSource must implement - (CGFloat)lineChartLinesView:(JBLineChartLinesView *)lineChartLinesView dimmedSelectionOpacityAtLineIndex:(NSUInteger)lineIndex");
shapeLineLayer.opacity = (weakSelf.selectedLineIndex == kJBLineChartLinesViewUnselectedLineIndex) ? 1.0f : [self.dataSource lineChartLinesView:self dimmedSelectionOpacityAtLineIndex:shapeLineLayer.tag];
}
}
}
/*
* Gradient line or fill
*/
else if ([layer isKindOfClass:[CAGradientLayer class]])
{
CAGradientLayer *gradientLayer = (CAGradientLayer * )layer;
if ([gradientLayer.mask isKindOfClass:[JBShapeLineLayer class]])
{
JBShapeLineLayer *shapeLineLayer = (JBShapeLineLayer * )gradientLayer.mask;
if (shapeLineLayer.filled)
{
// Selected gradient fill
if (weakSelf.selectedLineIndex >= 0 && ((unsigned)shapeLineLayer.tag == weakSelf.selectedLineIndex))
{
NSAssert([self.dataSource respondsToSelector:@selector(lineChartLinesView:selectionFillGradientForLineAtLineIndex:)], @"JBLineChartLinesView // dataSource must implement - (CAGradientLayer *)lineChartLinesView:(JBLineChartLinesView *)lineChartLinesView selectionFillGradientForLineAtLineIndex:(NSUInteger)lineIndex");
CAGradientLayer *selectedFillGradient = [self.dataSource lineChartLinesView:self selectionFillGradientForLineAtLineIndex:shapeLineLayer.tag];
selectedFillGradient.frame = layer.frame;
selectedFillGradient.mask = layer.mask;
selectedFillGradient.opacity = 1.0f;
[layersToReplace addObject:@{oldLayerKey: layer, newLayerKey: selectedFillGradient}];
}
// Unselected gradient fill
else
{
NSAssert([self.dataSource respondsToSelector:@selector(lineChartLinesView:fillGradientForLineAtLineIndex:)], @"JBLineChartLinesView // dataSource must implement - (CAGradientLayer *)lineChartLinesView:(JBLineChartLinesView *)lineChartLinesView fillGradientForLineAtLineIndex:(NSUInteger)lineIndex");
CAGradientLayer *unselectedFillGradient = [self.dataSource lineChartLinesView:self fillGradientForLineAtLineIndex:shapeLineLayer.tag];
unselectedFillGradient.frame = layer.frame;
unselectedFillGradient.mask = layer.mask;
NSAssert([self.dataSource respondsToSelector:@selector(lineChartLinesView:dimmedSelectionOpacityAtLineIndex:)], @"JBLineChartLinesView // dataSource must implement - (CGFloat)lineChartLinesView:(JBLineChartLinesView *)lineChartLinesView dimmedSelectionOpacityAtLineIndex:(NSUInteger)lineIndex");
unselectedFillGradient.opacity = (weakSelf.selectedLineIndex == kJBLineChartLinesViewUnselectedLineIndex) ? 1.0f : [self.dataSource lineChartLinesView:self dimmedSelectionOpacityAtLineIndex:shapeLineLayer.tag];
[layersToReplace addObject:@{oldLayerKey: layer, newLayerKey: unselectedFillGradient}];
}
}
else
{
// Selected gradient line
if (weakSelf.selectedLineIndex >= 0 && ((unsigned)shapeLineLayer.tag == weakSelf.selectedLineIndex))
{
NSAssert([self.dataSource respondsToSelector:@selector(lineChartLinesView:selectionGradientForLineAtLineIndex:)], @"JBLineChartLinesView // dataSource must implement - (CAGradientLayer *)lineChartLinesView:(JBLineChartLinesView *)lineChartLinesView selectionGradientForLineAtLineIndex:(NSUInteger)lineIndex");
CAGradientLayer *selectedGradient = [self.dataSource lineChartLinesView:self selectionGradientForLineAtLineIndex:shapeLineLayer.tag];
selectedGradient.frame = layer.frame;
selectedGradient.mask = layer.mask;
selectedGradient.opacity = 1.0f;
[layersToReplace addObject:@{oldLayerKey: layer, newLayerKey: selectedGradient}];
}
// Unselected gradient line
else
{
NSAssert([self.dataSource respondsToSelector:@selector(lineChartLinesView:gradientForLineAtLineIndex:)], @"JBLineChartLinesView // dataSource must implement - (CAGradientLayer *)lineChartLinesView:(JBLineChartLinesView *)lineChartLinesView gradientForLineAtLineIndex:(NSUInteger)lineIndex");
CAGradientLayer *unselectedGradient = [self.dataSource lineChartLinesView:self gradientForLineAtLineIndex:shapeLineLayer.tag];
unselectedGradient.frame = layer.frame;
unselectedGradient.mask = layer.mask;
NSAssert([self.dataSource respondsToSelector:@selector(lineChartLinesView:dimmedSelectionOpacityAtLineIndex:)], @"JBLineChartLinesView // dataSource must implement - (CGFloat)lineChartLinesView:(JBLineChartLinesView *)lineChartLinesView dimmedSelectionOpacityAtLineIndex:(NSUInteger)lineIndex");
shapeLineLayer.opacity = (weakSelf.selectedLineIndex == kJBLineChartLinesViewUnselectedLineIndex) ? 1.0f : [self.dataSource lineChartLinesView:self dimmedSelectionOpacityAtLineIndex:shapeLineLayer.tag];
[layersToReplace addObject:@{oldLayerKey: layer, newLayerKey: unselectedGradient}];
}
}
}
}
}
for (NSDictionary *layerPair in layersToReplace)
{
[weakSelf.layer replaceSublayer:layerPair[oldLayerKey] with:layerPair[newLayerKey]];
}
};
if (animated)
{
[UIView animateWithDuration:kJBChartViewDefaultAnimationDuration animations:^{
adjustLines();
}];
}
else
{
adjustLines();
}
}
- (void)setSelectedLineIndex:(NSInteger)selectedLineIndex
{
[self setSelectedLineIndex:selectedLineIndex animated:NO];
}
#pragma mark - Getters
- (UIBezierPath *)bezierPathForLineChartLine:(JBLineChartLine *)lineChartLine filled:(BOOL)filled
{
if ([lineChartLine.lineChartPoints count] > 0)
{
UIBezierPath *bezierPath = [UIBezierPath bezierPath];
bezierPath.miterLimit = kJBLineChartLinesViewMiterLimit;
JBLineChartPoint *previousLineChartPoint = nil;
CGFloat previousSlope = 0.0f;
BOOL visiblePointFound = NO;
NSArray *sortedLineChartPoints = [lineChartLine.lineChartPoints sortedArrayUsingSelector:@selector(compare:)];
CGFloat firstXPosition = 0.0f;
CGFloat firstYPosition = 0.0f;
CGFloat lastXPosition = 0.0f;
CGFloat lastYPosition = 0.0f;
for (NSUInteger index=0; index<[sortedLineChartPoints count]; index++)
{
JBLineChartPoint *lineChartPoint = [sortedLineChartPoints objectAtIndex:index];
if (lineChartPoint.hidden)
{
continue;
}
if (!visiblePointFound)
{
[bezierPath moveToPoint:CGPointMake(lineChartPoint.position.x, lineChartPoint.position.y)];
firstXPosition = lineChartPoint.position.x;
firstYPosition = lineChartPoint.position.y;
visiblePointFound = YES;
}
else
{
JBLineChartPoint *nextLineChartPoint = nil;
if (index != ([lineChartLine.lineChartPoints count] - 1))
{
nextLineChartPoint = [sortedLineChartPoints objectAtIndex:(index + 1)];
}
CGFloat nextSlope = (nextLineChartPoint != nil) ? ((nextLineChartPoint.position.y - lineChartPoint.position.y)) / ((nextLineChartPoint.position.x - lineChartPoint.position.x)) : previousSlope;
CGFloat currentSlope = ((lineChartPoint.position.y - previousLineChartPoint.position.y)) / (lineChartPoint.position.x-previousLineChartPoint.position.x);
BOOL deltaFromNextSlope = ((currentSlope >= (nextSlope + kJBLineChartLinesViewSmoothThresholdSlope)) || (currentSlope <= (nextSlope - kJBLineChartLinesViewSmoothThresholdSlope)));
BOOL deltaFromPreviousSlope = ((currentSlope >= (previousSlope + kJBLineChartLinesViewSmoothThresholdSlope)) || (currentSlope <= (previousSlope - kJBLineChartLinesViewSmoothThresholdSlope)));
BOOL deltaFromPreviousY = (lineChartPoint.position.y >= previousLineChartPoint.position.y + kJBLineChartLinesViewSmoothThresholdVertical) || (lineChartPoint.position.y <= previousLineChartPoint.position.y - kJBLineChartLinesViewSmoothThresholdVertical);
if (lineChartLine.smoothedLine && deltaFromNextSlope && deltaFromPreviousSlope && deltaFromPreviousY)
{
CGFloat deltaX = lineChartPoint.position.x - previousLineChartPoint.position.x;
CGFloat controlPointX = previousLineChartPoint.position.x + (deltaX / 2);
CGPoint controlPoint1 = CGPointMake(controlPointX, previousLineChartPoint.position.y);
CGPoint controlPoint2 = CGPointMake(controlPointX, lineChartPoint.position.y);
[bezierPath addCurveToPoint:CGPointMake(lineChartPoint.position.x, lineChartPoint.position.y) controlPoint1:controlPoint1 controlPoint2:controlPoint2];
}
else
{
[bezierPath addLineToPoint:CGPointMake(lineChartPoint.position.x, lineChartPoint.position.y)];
}
lastXPosition = lineChartPoint.position.x;
lastYPosition = lineChartPoint.position.y;
previousSlope = currentSlope;
}
previousLineChartPoint = lineChartPoint;
}
if (filled)
{
UIBezierPath *filledBezierPath = [bezierPath copy];
if(visiblePointFound)
{
[filledBezierPath addLineToPoint:CGPointMake(lastXPosition, lastYPosition)];
[filledBezierPath addLineToPoint:CGPointMake(lastXPosition, self.bounds.size.height)];
[filledBezierPath addLineToPoint:CGPointMake(firstXPosition, self.bounds.size.height)];
[filledBezierPath addLineToPoint:CGPointMake(firstXPosition, firstYPosition)];
}
return filledBezierPath;
}
else
{
return bezierPath;
}
}
return nil;
}
- (JBShapeLineLayer *)shapeLineLayerForLineIndex:(NSUInteger)lineIndex filled:(BOOL)filled
{
for (CALayer *layer in [self.layer sublayers])
{
if ([layer isKindOfClass:[JBShapeLineLayer class]])
{
if (((JBShapeLineLayer *)layer).tag == lineIndex && ((JBShapeLineLayer *)layer).filled == filled)
{
return (JBShapeLineLayer *)layer;
}
}
}
return nil;
}
- (JBGradientLineLayer *)gradientLineLayerForLineIndex:(NSUInteger)lineIndex filled:(BOOL)filled
{
for (CALayer *layer in [self.layer sublayers])
{
if ([layer isKindOfClass:[JBGradientLineLayer class]])
{
if (((JBGradientLineLayer *)layer).tag == lineIndex && ((JBGradientLineLayer *)layer).filled == filled)
{
return (JBGradientLineLayer *)layer;
}
}
}
return nil;
}
- (CABasicAnimation *)basicPathAnimationFromBezierPath:(UIBezierPath *)fromBezierPath toBezierPath:(UIBezierPath *)toBezierPath
{
CABasicAnimation *basicPathAnimation = [CABasicAnimation animationWithKeyPath:@"path"];
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wcast-qual"
basicPathAnimation.fromValue = (id)fromBezierPath.CGPath;
basicPathAnimation.toValue = (id)toBezierPath.CGPath;
#pragma GCC diagnostic pop
basicPathAnimation.duration = kJBLineChartLinesViewReloadDataAnimationDuration;
basicPathAnimation.timingFunction = [CAMediaTimingFunction functionWithName:@"easeInEaseOut"];
basicPathAnimation.fillMode = kCAFillModeBoth;
basicPathAnimation.removedOnCompletion = NO;
return basicPathAnimation;
}
#pragma mark - Callback Helpers
- (void)fireCallback:(void (^)())callback
{
dispatch_block_t callbackCopy = [callback copy];
if (callbackCopy != nil)
{
callbackCopy();
}
}
@end
@@ -1,27 +0,0 @@
Pod::Spec.new do |s|
s.name = 'CocoaAsyncSocket'
s.version = '0.0.1'
s.license = 'public domain'
s.summary = 'An asynchronous socket networking library for Cocoa.'
s.homepage = 'https://github.com/robbiehanson/CocoaAsyncSocket'
s.authors = 'Dustin Voss', { 'Robbie Hanson' => 'robbiehanson@deusty.com' }
s.source = { :git => 'git://github.com/robbiehanson/CocoaAsyncSocket.git' }
s.description = 'CocoaAsyncSocket supports TCP and UDP. The AsyncSocket class is for TCP, and the AsyncUdpSocket class is for UDP. ' \
'AsyncSocket is a TCP/IP socket networking library that wraps CFSocket and CFStream. It offers asynchronous ' \
'operation, and a native Cocoa class complete with delegate support or use the GCD variant GCDAsyncSocket. ' \
'AsyncUdpSocket is a UDP/IP socket networking library that wraps CFSocket. It works almost exactly like the TCP ' \
'version, but is designed specifically for UDP. This includes queued non-blocking send/receive operations, full ' \
'delegate support, run-loop based, self-contained class, and support for IPv4 and IPv6.'
s.source_files = '{GCD,RunLoop}/*.{h,m}'
s.clean_paths = 'Vendor', 'GCD/Xcode', 'RunLoop/Xcode'
s.requires_arc = true
if config.ios?
s.frameworks = ['CFNetwork', 'Security']
else
s.frameworks = ['CoreServices', 'Security']
end
end
@@ -1,20 +0,0 @@
Pod::Spec.new do |s|
s.name = 'CocoaHTTPServer'
s.version = '2.2.1'
s.license = 'BSD'
s.summary = 'A small, lightweight, embeddable HTTP server for Mac OS X or iOS applications'
s.homepage = 'https://github.com/robbiehanson/CocoaHTTPServer'
s.authors = { 'Robbie Hanson' => 'cocoahttpserver@googlegroups.com' }
s.source = { :git => 'https://github.com/robbiehanson/CocoaHTTPServer.git', :tag => '2.2.1' }
s.source_files = '{Core,Extensions}/**/*.{h,m}'
s.clean_paths = %w{Samples Vendor}
if config.ios?
s.frameworks = 'CFNetwork', 'Security'
else
s.frameworks = 'CoreServices', 'Security'
end
s.library = 'xml2'
s.xcconfig = { 'HEADER_SEARCH_PATHS' => '$(SDKROOT)/usr/include/libxml2' }
s.dependency "CocoaAsyncSocket", "0.0.1"
s.dependency "CocoaLumberjack", "1.3"
end
@@ -1,12 +0,0 @@
Pod::Spec.new do |s|
s.name = 'CocoaLumberjack'
s.version = '1.0.0'
s.license = 'BSD'
s.summary = 'A fast & simple, yet powerful & flexible logging framework for Mac and iOS.'
s.homepage = 'http://code.google.com/p/cocoalumberjack/'
s.author = { 'Robbie Hanson' => 'robbiehanson@deusty.com' }
s.source = { :git => 'https://github.com/robbiehanson/CocoaLumberjack.git',
:tag => '1.0' }
s.source_files = 'Lumberjack'
end
@@ -1,12 +0,0 @@
Pod::Spec.new do |s|
s.name = 'CocoaLumberjack'
s.version = '1.1.0'
s.license = 'BSD'
s.summary = 'A fast & simple, yet powerful & flexible logging framework for Mac and iOS.'
s.homepage = 'http://code.google.com/p/cocoalumberjack/'
s.author = { 'Robbie Hanson' => 'robbiehanson@deusty.com' }
s.source = { :git => 'https://github.com/robbiehanson/CocoaLumberjack.git',
:tag => '1.1' }
s.source_files = 'Lumberjack'
end
@@ -1,18 +0,0 @@
Pod::Spec.new do |s|
s.name = 'CocoaLumberjack'
s.version = '1.2.1'
s.license = 'BSD'
s.summary = 'A fast & simple, yet powerful & flexible logging framework for Mac and iOS.'
s.homepage = 'http://code.google.com/p/cocoalumberjack/'
s.author = { 'Robbie Hanson' => 'robbiehanson@deusty.com' }
s.source = { :git => 'https://github.com/robbiehanson/CocoaLumberjack.git',
:tag => '1.2.1' }
s.description = 'It is similar in concept to other popular logging frameworks such as log4j, ' \
'yet is designed specifically for objective-c, and takes advantage of features ' \
'such as multi-threading, grand central dispatch (if available), lockless ' \
'atomic operations, and the dynamic nature of the objective-c runtime.'
s.source_files = 'Lumberjack'
s.clean_paths = 'Benchmarking', 'Xcode'
end
@@ -1,18 +0,0 @@
Pod::Spec.new do |s|
s.name = 'CocoaLumberjack'
s.version = '1.2.2'
s.license = 'BSD'
s.summary = 'A fast & simple, yet powerful & flexible logging framework for Mac and iOS.'
s.homepage = 'http://code.google.com/p/cocoalumberjack/'
s.author = { 'Robbie Hanson' => 'robbiehanson@deusty.com' }
s.source = { :git => 'https://github.com/robbiehanson/CocoaLumberjack.git',
:tag => '1.2.2' }
s.description = 'It is similar in concept to other popular logging frameworks such as log4j, ' \
'yet is designed specifically for objective-c, and takes advantage of features ' \
'such as multi-threading, grand central dispatch (if available), lockless ' \
'atomic operations, and the dynamic nature of the objective-c runtime.'
s.source_files = 'Lumberjack'
s.clean_paths = 'Benchmarking', 'Xcode'
end
@@ -1,18 +0,0 @@
Pod::Spec.new do |s|
s.name = 'CocoaLumberjack'
s.version = '1.2.3'
s.license = 'BSD'
s.summary = 'A fast & simple, yet powerful & flexible logging framework for Mac and iOS.'
s.homepage = 'http://code.google.com/p/cocoalumberjack/'
s.author = { 'Robbie Hanson' => 'robbiehanson@deusty.com' }
s.source = { :git => 'https://github.com/robbiehanson/CocoaLumberjack.git',
:tag => '1.2.3' }
s.description = 'It is similar in concept to other popular logging frameworks such as log4j, ' \
'yet is designed specifically for objective-c, and takes advantage of features ' \
'such as multi-threading, grand central dispatch (if available), lockless ' \
'atomic operations, and the dynamic nature of the objective-c runtime.'
s.source_files = 'Lumberjack'
s.clean_paths = 'Benchmarking', 'Xcode', 'Lumberjack/Extensions'
end
@@ -1,12 +0,0 @@
Pod::Spec.new do |s|
s.name = 'CocoaLumberjack'
s.version = '1.2.0'
s.license = 'BSD'
s.summary = 'A fast & simple, yet powerful & flexible logging framework for Mac and iOS.'
s.homepage = 'http://code.google.com/p/cocoalumberjack/'
s.author = { 'Robbie Hanson' => 'robbiehanson@deusty.com' }
s.source = { :git => 'https://github.com/robbiehanson/CocoaLumberjack.git',
:tag => '1.2' }
s.source_files = 'Lumberjack'
end
@@ -1,19 +0,0 @@
Pod::Spec.new do |s|
s.name = 'CocoaLumberjack'
s.version = '1.3.1'
s.license = 'BSD'
s.summary = 'A fast & simple, yet powerful & flexible logging framework for Mac and iOS.'
s.homepage = 'https://github.com/robbiehanson/CocoaLumberjack'
s.author = { 'Robbie Hanson' => 'robbiehanson@deusty.com' }
s.source = { :git => 'https://github.com/robbiehanson/CocoaLumberjack.git',
:tag => '1.3.1' }
s.description = 'It is similar in concept to other popular logging frameworks such as log4j, ' \
'yet is designed specifically for objective-c, and takes advantage of features ' \
'such as multi-threading, grand central dispatch (if available), lockless ' \
'atomic operations, and the dynamic nature of the objective-c runtime.'
s.requires_arc = true
s.source_files = 'Lumberjack'
s.clean_paths = 'Benchmarking', 'Xcode', 'Lumberjack/Extensions'
end
@@ -1,19 +0,0 @@
Pod::Spec.new do |s|
s.name = 'CocoaLumberjack'
s.version = '1.3.2'
s.license = 'BSD'
s.summary = 'A fast & simple, yet powerful & flexible logging framework for Mac and iOS.'
s.homepage = 'https://github.com/robbiehanson/CocoaLumberjack'
s.author = { 'Robbie Hanson' => 'robbiehanson@deusty.com' }
s.source = { :git => 'https://github.com/robbiehanson/CocoaLumberjack.git',
:tag => '1.3.2' }
s.description = 'It is similar in concept to other popular logging frameworks such as log4j, ' \
'yet is designed specifically for objective-c, and takes advantage of features ' \
'such as multi-threading, grand central dispatch (if available), lockless ' \
'atomic operations, and the dynamic nature of the objective-c runtime.'
s.requires_arc = true
s.source_files = 'Lumberjack'
s.clean_paths = 'Benchmarking', 'Xcode', 'Lumberjack/Extensions'
end
@@ -1,19 +0,0 @@
Pod::Spec.new do |s|
s.name = 'CocoaLumberjack'
s.version = '1.3'
s.license = 'BSD'
s.summary = 'A fast & simple, yet powerful & flexible logging framework for Mac and iOS.'
s.homepage = 'https://github.com/robbiehanson/CocoaLumberjack'
s.author = { 'Robbie Hanson' => 'robbiehanson@deusty.com' }
s.source = { :git => 'https://github.com/robbiehanson/CocoaLumberjack.git',
:tag => '1.3' }
s.description = 'It is similar in concept to other popular logging frameworks such as log4j, ' \
'yet is designed specifically for objective-c, and takes advantage of features ' \
'such as multi-threading, grand central dispatch (if available), lockless ' \
'atomic operations, and the dynamic nature of the objective-c runtime.'
s.requires_arc = true
s.source_files = 'Lumberjack'
s.clean_paths = 'Benchmarking', 'Xcode', 'Lumberjack/Extensions'
end
-4
View File
@@ -1,4 +0,0 @@
---
:min: "0.6.0rc1"
:last: "0.6.0rc1"
@@ -1,14 +0,0 @@
Pod::Spec.new do |s|
s.name = 'Color-Picker-for-iOS'
s.version = '0.0.1'
s.license = 'BSD'
s.platform = :ios
s.summary = 'ColorPicker for iPhone and iPod touch'
s.homepage = 'https://github.com/hayashi311'
s.author = { 'Ryota Hayashi' => 'hayashi311' }
s.source = { :git => 'https://github.com/hayashi311/Color-Picker-for-iOS.git',
:commit => '711b2981d29f0cfb7f7b258b79783bc650fa980e' }
s.source_files = 'ColorPicker/*.{h,m}'
s.frameworks = 'UIKit' , 'QuartzCore'
s.clean_paths = "Sample", "CHANGE_ja.md" , 'TODO_ja.md'
end
-17
View File
@@ -1,17 +0,0 @@
Pod::Spec.new do |s|
s.name = 'ConciseKit'
s.version = '0.1.0'
s.license = 'MIT'
s.summary = 'A set of Objective-C additions and macros that lets you write code more quickly.'
s.homepage = 'http://github.com/petejkim/ConciseKit'
s.author = { 'Peter Jihoon Kim' => 'raingrove@gmail.com' }
s.source = { :git => 'http://github.com/petejkim/ConciseKit.git', :tag => 'v0.1.0' }
s.source_files = 'src/**/*.{h,m}'
s.clean_paths = 'ConciseKitSpecs'
s.frameworks = 'Foundation'
end
-17
View File
@@ -1,17 +0,0 @@
Pod::Spec.new do |s|
s.name = 'ConciseKit'
s.version = '0.1.1'
s.license = 'MIT'
s.summary = 'A set of Objective-C additions and macros that lets you write code more quickly.'
s.homepage = 'http://github.com/petejkim/ConciseKit'
s.author = { 'Peter Jihoon Kim' => 'raingrove@gmail.com' }
s.source = { :git => 'http://github.com/petejkim/ConciseKit.git', :tag => 'v0.1.1' }
s.source_files = 'src/**/*.{h,m}'
s.clean_paths = 'ConciseKitSpecs'
s.frameworks = 'Foundation'
end
-17
View File
@@ -1,17 +0,0 @@
Pod::Spec.new do |s|
s.name = 'ConciseKit'
s.version = '0.1.2'
s.license = 'MIT'
s.summary = 'A set of Objective-C additions and macros that lets you write code more quickly.'
s.homepage = 'http://github.com/petejkim/ConciseKit'
s.author = { 'Peter Jihoon Kim' => 'raingrove@gmail.com' }
s.source = { :git => 'http://github.com/petejkim/ConciseKit.git', :tag => 'v0.1.2' }
s.source_files = 'src/**/*.{h,m}'
s.clean_paths = 'ConciseKitSpecs'
s.frameworks = 'Foundation'
end
-28
View File
@@ -1,28 +0,0 @@
Pod::Spec.new do |s|
s.name = 'CorePlot'
s.version = '1.0'
s.license = 'BSD'
s.summary = 'Cocoa plotting framework for Mac OS X and iOS.'
s.homepage = 'http://code.google.com/p/core-plot/'
s.authors = { 'Drew McCormack' => 'drewmccormack@mac.com',
'Brad Larson' => 'larson@sunsetlakesoftware.com',
'Eric Skroch' => 'eskroch@mac.com',
'Barry Wark' => 'barrywark@gmail.com' }
s.source = { :hg => 'https://code.google.com/p/core-plot', :revision => 'release_1.0' }
s.description = 'Core Plot is a plotting framework for OS X and iOS. It provides 2D visualization ' \
'of data, and is tightly integrated with Apple technologies like Core Animation, ' \
'Core Data, and Cocoa Bindings.'
files = FileList['framework/TestResources/CorePlotProbes.d', 'framework/Source/*.{h,m}']
files.exclude(/(TestCase|Tests)\.[hm]/)
if config.ios?
files.include('framework/CorePlot-CocoaTouch.h', 'framework/iPhoneOnly/*.{h,m}')
else
files.include('framework/CorePlot.h', 'framework/MacOnly/*.{h,m}')
end
s.source_files = files
s.clean_paths = 'documentation', 'examples', 'scripts', 'QCPlugin', 'framework/*.{xcodeproj,lproj}'
s.framework = 'QuartzCore'
end
@@ -1,11 +0,0 @@
Pod::Spec.new do |s|
s.name = 'CupertinoYankee'
s.version = '0.1.0'
s.license = 'MIT'
s.summary = 'An NSDate Category With Locale-Aware Calculations for Beginning & End of Day, Week, Month, and Year'
s.homepage = 'https://github.com/mattt/CupertinoYankee'
s.authors = {'Mattt Thompson' => 'm@mattt.me'}
s.source = { :git => 'https://github.com/mattt/CupertinoYankee.git', :tag => '0.1.0' }
s.source_files = 'NSDate+CupertinoYankee.{h,m}'
s.clean_paths = ['Example']
end
+219
View File
@@ -0,0 +1,219 @@
## Customization
Both the line and bar charts support a robust set of customization options.
The background of a bar or line chart can be set just like any other view:
self.barChartView.backgroundColor = ...; // UIColor
self.lineChartView.backgroundColor = ...; // UIColor
Any <i>JBChartView</i> subclass supports the use of headers and footers (similiar to that of <i>UITableView</i>):
self.barChartView.footerView = ...; // UIView
self.lineChartView.headerView = ...; // UIView
Lastly, any JBChartView subclass can be collapsed or expanded programmatically via the <i>state</i> property. If you chose to animate state changes, a callback helper can be used to notify you when the animation has completed:
- (void)setState:(JBChartViewState)state animated:(BOOL)animated callback:(void (^)())callback;
#### JBBarChartView
A bar chart can be inverted such that it's orientation is top->down (including the selection view) by setting the following property:
@property (nonatomic, assign, getter=isInverted) BOOL inverted;
By default, a chart's bars will be black and flat. They can be customized by supplying a UIView subclass through the <i>optional</i> protocol:
- (UIView *)barChartView:(JBBarChartView *)barChartView barViewAtIndex:(NSUInteger)index
{
return ...; // color of line in chart
}
If you don't require a custom UIView, simply supply a color for the bar instead:
- (UIColor *)barChartView:(JBBarChartView *)barChartView colorForBarViewAtIndex:(NSUInteger)index;
If a solid color isn't your cup of tea, you can expose a gradient to be applied across the entire chart:
- (CAGradientLayer *)barGradientForBarChartView:(JBBarChartView *)barChartView;
Furthermore, the color of the selection bar (on touch events) can be customized via the <i>optional</i> protocol:
- (UIColor *)barSelectionColorForBarChartView:(JBBarChartView *)barChartView
{
return ...; // color of selection view
}
<b>Note</b>: The delegate will request a custom UIView, followed by a color and lastly a gradient. If nothing is supplied, a plain black bar will be used.
Lastly, a bar chart's selection events are delegated back via:
- (void)barChartView:(JBBarChartView *)barChartView didSelectBarAtIndex:(NSUInteger)index touchPoint:(CGPoint)touchPoint
{
// Update view
}
- (void)didDeselectBarChartView:(JBBarChartView *)barChartView
{
// Update view
}
The <b>touchPoint</b> is especially important as it allows you to add custom elements to your chart during selection events. Refer to the demo project (<b>JBarChartViewController</b>) to see how a tooltip can be used to display additional information during selection events.
#### JBLineChartView
The color, width and style of each line in the chart can be customized via the <i>optional</i> protocol:
- (UIColor *)lineChartView:(JBLineChartView *)lineChartView colorForLineAtLineIndex:(NSUInteger)lineIndex
{
return ...; // color of line in chart
}
- (UIColor *)lineChartView:(JBLineChartView *)lineChartView fillColorForLineAtLineIndex:(NSUInteger)lineIndex
{
return ...; // color of area under line in chart
}
- (CGFloat)lineChartView:(JBLineChartView *)lineChartView widthForLineAtLineIndex:(NSUInteger)lineIndex
{
return ...; // width of line in chart
}
- (JBLineChartViewLineStyle)lineChartView:(JBLineChartView *)lineChartView lineStyleForLineAtLineIndex:(NSUInteger)lineIndex
{
return ...; // style of line in chart (solid or dashed)
}
Additionally, the line and fill color style can be customzized via the <i>optional</i> protocols (below). The line & fill color style apply to both selected and non-selected scenarios, meaning, if your line has a solid style, it's selected style will also be solid.
- (JBLineChartViewColorStyle)lineChartView:(JBLineChartView *)lineChartView colorStyleForLineAtLineIndex:(NSUInteger)lineIndex
{
return ...; // color line style of a line in the chart
}
- (JBLineChartViewColorStyle)lineChartView:(JBLineChartView *)lineChartView fillColorStyleForLineAtLineIndex:(NSUInteger)lineIndex
{
return ...; // color style for the area under a line in the chart
}
If a solid color style is used, the following <i>optional</i> protocols can be implemented:
- (UIColor *)lineChartView:(JBLineChartView *)lineChartView colorForLineAtLineIndex:(NSUInteger)lineIndex;
- (UIColor *)lineChartView:(JBLineChartView *)lineChartView fillColorForLineAtLineIndex:(NSUInteger)lineIndex;
Gradient color styles require a CAGradientLayer to be returned:
- (CAGradientLayer *)lineChartView:(JBLineChartView *)lineChartView gradientForLineAtLineIndex:(NSUInteger)lineIndex;
- (CAGradientLayer *)lineChartView:(JBLineChartView *)lineChartView fillGradientForLineAtLineIndex:(NSUInteger)lineIndex;
**Note**: gradients do not support multiple alphas. The alpha of gradient's first color be used throughout.
Defining a gradient to use is simple and flexible. For example, this would be a horizontal gradient from blue to green:
CAGradientLayer *gradient = [CAGradientLayer new];
gradient.startPoint = CGPointMake(0.0, 0.0);
gradient.endPoint = CGPointMake(1.0, 0.0);
gradient.colors = @[(id)[UIColor blueColor].CGColor, (id)[UIColor greenColor].CGColor];
As mentioned prior, the same color style is duplicated for selection events:
- (UIColor *)lineChartView:(JBLineChartView *)lineChartView selectionColorForLineAtLineIndex:(NSUInteger)lineIndex;
- (UIColor *)lineChartView:(JBLineChartView *)lineChartView selectionFillColorForLineAtLineIndex:(NSUInteger)lineIndex;
- (CAGradientLayer *)lineChartView:(JBLineChartView *)lineChartView selectionGradientForLineAtLineIndex:(NSUInteger)lineIndex;
- (CAGradientLayer *)lineChartView:(JBLineChartView *)lineChartView selectionFillGradientForLineAtLineIndex:(NSUInteger)lineIndex;
The color and width of the selection view along with the color of the selected line can be customized via the <i>optional</i> protocols:
- (UIColor *)lineChartView:(JBLineChartView *)lineChartView verticalSelectionColorForLineAtLineIndex:(NSUInteger)lineIndex
{
return ...; // color of selection view
}
- (CGFloat)verticalSelectionWidthForLineChartView:(JBLineChartView *)lineChartView
{
return ...; // width of selection view
}
- (UIColor *)lineChartView:(JBLineChartView *)lineChartView selectionColorForLineAtLineIndex:(NSUInteger)lineIndex
{
return ...; // color of selected line
}
- (UIColor *)lineChartView:(JBLineChartView *)lineChartView selectionFillColorForLineAtLineIndex:(NSUInteger)lineIndex
{
return ...; // color of area under selected line
}
When using a gradient for the line or fill, a different gradient can provided for selection. If the selection gradient is not provided, it will default to the line and fill gradient provided for the line.
- (CAGradientLayer *)lineChartView:(JBLineChartView *)lineChartView selectionGradientForLineAtLineIndex:(NSUInteger)lineIndex
{
return ...; // gradient for selected line
}
- (CAGradientLayer *)lineChartView:(JBLineChartView *)lineChartView selectionFillGradientForLineAtLineIndex:(NSUInteger)lineIndex
{
return ...; // gradient for area under selected line
}
By default, each line will not show dots for each point. To enable this on a per-line basis:
- (BOOL)lineChartView:(JBLineChartView *)lineChartView showsDotsForLineAtLineIndex:(NSUInteger)lineIndex;
To the radius of each dot (default is 6x the line width, or 3x the diameter), implement:
- (CGFloat)lineChartView:(JBLineChartView *)lineChartView dotRadiusForDotAtHorizontalIndex:(NSUInteger)horizontalIndex atLineIndex:(NSUInteger)lineIndex;
To customize the color of each dot during selection and non-selection events (default is white and black respectively), implement:
- (UIColor *)lineChartView:(JBLineChartView *)lineChartView colorForDotAtHorizontalIndex:(NSUInteger)horizontalIndex atLineIndex:(NSUInteger)lineIndex;
- (UIColor *)lineChartView:(JBLineChartView *)lineChartView selectionColorForDotAtHorizontalIndex:(NSUInteger)horizontalIndex atLineIndex:(NSUInteger)lineIndex;
Alternatively, you can supply your own UIView instead of using the default impelmentation:
- (UIView *)lineChartView:(JBLineChartView *)lineChartView dotViewAtHorizontalIndex:(NSUInteger)horizontalIndex atLineIndex:(NSUInteger)lineIndex;
Custom dot views are automatically shown when selected unless the following is implemented:
- (BOOL)lineChartView:(JBLineChartView *)lineChartView shouldHideDotViewOnSelectionAtHorizontalIndex:(NSUInteger)horizontalIndex atLineIndex:(NSUInteger)lineIndex;
As well, by default, each line will have squared off end caps and connection points. To enable rounded connections and end caps:
- (BOOL)lineChartView:(JBLineChartView *)lineChartView smoothLineAtLineIndex:(NSUInteger)lineIndex;
Furthermore, a line chart's selection events are delegated back via:
- (void)lineChartView:(JBLineChartView *)lineChartView didSelectLineAtIndex:(NSUInteger)lineIndex horizontalIndex:(NSUInteger)horizontalIndex touchPoint:(CGPoint)touchPoint
{
// Update view
}
- (void)didDeselectLineInLineChartView:(JBLineChartView *)lineChartView
{
// Update view
}
Upon selection, all other lines (+ fills) will be dimmed to 20% opacity (default). To change this value, implement:
- (CGFloat)lineChartView:(JBLineChartView *)lineChartView dimmedSelectionOpacityAtLineIndex:(NSUInteger)lineIndex
{
// Return unselected line opacity (0.0 to hide completely, and 1.0 to have no effect)
}
The dot selection opacity (default 0%) can also be modified via:
- (CGFloat)lineChartView:(JBLineChartView *)lineChartView dimmedSelectionDotOpacityAtLineIndex:(NSUInteger)lineIndex
{
// Return unselected dot opacity (0.0 to hide completely and 1.0 to have no effect)
}
If you don't want a line to be selectable:
- (BOOL)lineChartView:(JBLineChartView *)lineChartView shouldIgnoreSelectionAtIndex:(NSUInteger)lineIndex
{
return NO; // Check line index
}
The <b>touchPoint</b> is especially important as it allows you to add custom elements to your chart during selection events. Refer to the demo project (<b>JBLineChartViewController</b>) to see how a tooltip can be used to display additional information during selection events.
-12
View File
@@ -1,12 +0,0 @@
Pod::Spec.new do |s|
s.name = 'DCIntrospect'
s.version = '0.0.1'
s.license = 'MIT'
s.summary = 'Introspect is small set of tools for iOS that aid in debugging user interfaces built with UIKit.'
s.homepage = 'https://github.com/domesticcatsoftware/DCIntrospect'
s.author = { 'Patrick Richards' => 'contact@domesticcat.com.au' }
s.source = { :git => 'git://github.com/domesticcatsoftware/DCIntrospect.git', :commit => "3ef2c10710f007b6d699c2a0b996ce1e3a79bde0" }
s.source_files = 'DCIntrospect'
s.frameworks = 'QuartzCore'
s.clean_paths = 'DCIntrospectDemo'
end
@@ -1,12 +0,0 @@
Pod::Spec.new do |s|
s.name = 'DCTTextFieldValidator'
s.version = '1.0'
s.license = 'BSD'
s.summary = 'Validates an array of UITextFields before allowing an action to take place.'
s.homepage = 'https://github.com/danielctull/DCTTextFieldValidator'
s.author = { 'Daniel Tull' => 'dt@danieltull.co.uk' }
s.source = { :git => 'https://github.com/danielctull/DCTTextFieldValidator.git', :tag => '1.0' }
s.description = 'DCTTextFieldValidator takes an array of UITextFields and switches the return key on the keyboard if the text fields are valid.'
s.source_files = 'DCTTextFieldValidator.h', 'DCTTextFieldValidator.m'
s.requires_arc = true
end
-23
View File
@@ -1,23 +0,0 @@
Pod::Spec.new do |s|
s.name = 'DDPageControl'
s.version = '0.1.0'
s.license = 'MIT'
s.summary = 'An easily customizable alternative to UIKit\'s UIPageControl.'
s.homepage = 'https://github.com/ddeville/DDPageControl'
s.author = { 'Damien DeVille' => 'damien@realmacsoftware.com' }
s.source = { :git => 'git://github.com/ddeville/DDPageControl.git', :tag => '0.1' }
s.description = 'DDPageControl redefines exactly every property and methods available in UIPageControl. Using DDPageControl without customization will actually lead exactly to a UIPageControl. However, the power of DDPageControl is that you can set some additional properties that will affect the way the look and feel of the page controls.'
s.platform = :ios
s.source_files = 'Classes/DDPageControl.{h,m}'
s.clean_path = "Classes/DDPageControlAppDelegate.*",
"Classes/DDPageControlViewController.*",
"*.xib",
"*.pch",
"*.plist",
"*.xcodeproj",
"*.m"
end
@@ -1,12 +0,0 @@
Pod::Spec.new do |s|
s.name = 'DMLocationManager'
s.version = '1.0.0'
s.license = 'Apache License, Version 2.0'
s.summary = 'Convenient CLLocationManager wrapper. Control location caching, cache age and accuracy.'
s.homepage = 'https://github.com/martinstolz/DMLocationManager'
s.author = { 'Martin Stolz' => 'martin.stolz@devmob.de' }
s.description = 'This CLLocationManager wrapper allows you to query for the devices location in a convenient way. Control the caching behaviour by disallowing cache or setting the maximum cache age. Loop the location determination for permanent location updates in a defined interval.'
s.platform = :ios
s.source = { :git => 'https://github.com/martinstolz/DMLocationManager.git', :tag => '1.0.0' }
s.source_files = '*.{h,m}'
end
-27
View File
@@ -1,27 +0,0 @@
Pod::Spec.new do |spec|
spec.name = 'DTCoreText'
spec.version = '1.0.0'
spec.platform = :ios
spec.license = 'BSD'
spec.source = { :git => 'https://github.com/Cocoanetics/DTCoreText.git', :tag => '1.0.0' }
spec.source_files = 'Core/Source/*.{h,m,c}'
spec.clean_paths = 'Core/Test/', 'Core/DTCoreText-Info.plist', 'Core/DTCoreText-Prefix.pch', 'DTCoreText.xcodeproj/', 'Demo/', '.gitignore'
spec.frameworks = 'MediaPlayer', 'QuartzCore', 'CoreText', 'CoreGraphics', 'ImageIO'
spec.requires_arc = true
spec.homepage = 'https://github.com/Cocoanetics/DTCoreText'
spec.summary = 'Methods to allow using HTML code with CoreText.'
spec.author = { 'Oliver Drobnik' => 'oliver@drobnik.com' }
spec.library = 'xml2'
spec.xcconfig = { 'HEADER_SEARCH_PATHS' => '"$(SDKROOT)/usr/include/libxml2"' }
def spec.post_install(target)
prefix_header = config.project_pods_root + target.prefix_header_filename
prefix_header.open('a') do |file|
file.puts(%{#ifdef __OBJC__\n#import <CoreText/CoreText.h>\n#endif\n#define ALLOW_IPHONE_SPECIAL_CASES 1})
end
Dir.chdir(config.project_pods_root + 'DTCoreText/Core/Source/') do
Dir.glob('*.css') do |css_file|
system '/usr/bin/xxd', '-i', css_file, css_file + '.c'
end
end
end
end
-27
View File
@@ -1,27 +0,0 @@
Pod::Spec.new do |spec|
spec.name = 'DTCoreText'
spec.version = '1.0.1'
spec.platform = :ios
spec.license = 'BSD'
spec.source = { :git => 'https://github.com/Cocoanetics/DTCoreText.git', :tag => '1.0.1' }
spec.source_files = 'Core/Source/*.{h,m,c}'
spec.clean_paths = 'Core/Test/', 'Core/DTCoreText-Info.plist', 'Core/DTCoreText-Prefix.pch', 'DTCoreText.xcodeproj/', 'Demo/', '.gitignore'
spec.frameworks = 'MediaPlayer', 'QuartzCore', 'CoreText', 'CoreGraphics', 'ImageIO'
spec.requires_arc = true
spec.homepage = 'https://github.com/Cocoanetics/DTCoreText'
spec.summary = 'Methods to allow using HTML code with CoreText.'
spec.author = { 'Oliver Drobnik' => 'oliver@drobnik.com' }
spec.library = 'xml2'
spec.xcconfig = { 'HEADER_SEARCH_PATHS' => '"$(SDKROOT)/usr/include/libxml2"' }
def spec.post_install(target)
prefix_header = config.project_pods_root + target.prefix_header_filename
prefix_header.open('a') do |file|
file.puts(%{#ifdef __OBJC__\n#import <CoreText/CoreText.h>\n#endif\n#define ALLOW_IPHONE_SPECIAL_CASES 1})
end
Dir.chdir(config.project_pods_root + 'DTCoreText/Core/Source/') do
Dir.glob('*.css') do |css_file|
system '/usr/bin/xxd', '-i', css_file, css_file + '.c'
end
end
end
end
@@ -1,16 +0,0 @@
Pod::Spec.new do |s|
s.name = 'DirectoryWatchdog'
s.version = '1.0.0'
s.license = 'Apache License 2.0'
s.summary = 'A simpe utility class to monitor real time changes in a directory, such as the documents dir for an app with File Sharing enabled.'
s.homepage = 'https://github.com/graetzer/DirectoryWatchdog'
s.author = { 'Simon Grätzer' => 'simon@graetzer.org' }
s.source = { :git => 'https://github.com/graetzer/DirectoryWatchdog.git', :tag => '1.0.0' }
s.description = 'DirectoryWatchdog is a simple utility tool to monitor real time changes in local folders. '\
'Most common use is the monitoring of an applications documents directory in combination'\
' with iTunes file sharing support. This code uses the BSD kqueue API and should work on OSX as well as iOS.'
s.source_files = 'DirectoryWatchdog/lib/*.{h,m}'
end
@@ -1,13 +0,0 @@
Pod::Spec.new do |s|
s.name = 'ECSlidingViewController'
s.version = '0.9.0'
s.license = 'MIT'
s.summary = 'ECSlidingViewController is a view controller container that presents its child view controllers in two layers. It provides functionality for sliding the top view to reveal the views underneath it. This functionality is inspired by the Path 2.0 and Facebook iPhone apps.'
s.homepage = 'https://github.com/edgecase/ecslidingviewcontroller'
s.author = { 'Mike Enriquez' => 'mike@edgecase.com' }
s.source = { :git => 'git://github.com/edgecase/ECSlidingViewController.git', :tag => '0.9.0' }
s.platform = :ios
s.source_files = 'ECSlidingViewController/Vendor/ECSlidingViewController/'
s.clean_paths = 'ECSlidingViewController.xcodeproj'
s.requires_arc = true
end
-12
View File
@@ -1,12 +0,0 @@
Pod::Spec.new do |s|
s.name = 'EGOCache'
s.version = '0.1.0'
s.license = 'MIT'
s.summary = 'Fast Caching for Objective-C (iPhone & Mac Compatible)'
s.homepage = 'https://github.com/enormego/EGOCache'
s.author = 'enormego'
s.source = { :git => 'https://github.com/enormego/EGOCache.git',
:commit => '8b7c7ecfc8fad396b6547ad3fef085713644f794' }
s.source_files = '*.{h,m}'
end
@@ -1,15 +0,0 @@
Pod::Spec.new do |s|
s.name = 'EGOImageLoading'
s.version = '0.0.1'
s.platform = :ios
s.license = 'MIT'
s.summary = 'What if images on the iPhone were as easy as HTML?'
s.homepage = 'https://github.com/enormego/EGOImageLoading'
s.author = 'Shaun Harrison'
s.source = { :git => 'git://github.com/enormego/EGOImageLoading.git',
:commit => '9a3fa6b657c6b8217a24ff87c1fe4f670401f3bd' }
s.source_files = 'EGO*/*.{h,m}'
s.clean_paths = 'Demo'
s.dependency 'EGOCache'
end
@@ -1,16 +0,0 @@
Pod::Spec.new do |s|
s.name = 'EGOTableViewPullRefresh'
s.version = '0.1.0'
s.platform = :ios
s.license = 'MIT'
s.summary = 'A similar control to the pull down to refresh control created by atebits in Tweetie 2.'
s.homepage = 'https://github.com/enormego/EGOTableViewPullRefresh'
s.author = { 'Devin Doty' => 'devin.r.doty@gmail.com' }
s.source = { :git => 'https://github.com/enormego/EGOTableViewPullRefresh.git',
:commit => '743679ffeb6ac02f0afffaac46f318dd2ce6122e' }
s.source_files = 'EGOTableViewPullRefresh/Classes/View/*.{h,m}'
s.resources = 'EGOTableViewPullRefresh/Resources/*.png'
s.clean_paths = 'Demo'
s.framework = 'QuartzCore'
end
-27
View File
@@ -1,27 +0,0 @@
Pod::Spec.new do |s|
s.name = 'Expecta'
s.version = '0.1.0'
s.license = 'MIT'
s.summary = 'A matcher framework for Objective-C & Cocoa'
s.homepage = 'http://github.com/petejkim/expecta'
s.author = { 'Peter Jihoon Kim' => 'raingrove@gmail.com' }
s.source = { :git => 'http://github.com/petejkim/expecta.git', :tag => 'v0.1.0' }
s.description = %{
Expecta is a matcher framework for Objective-C and Cocoa. The main
advantage of using Expecta over other matcher frameworks is that you do not
have to specify the data types. Also, the syntax of Expecta matchers is
much more readable and does not suffer from parenthesitis. If you have used
Jasmine before, you will feel right at home!
}
s.source_files = 'src/**/*.{h,m}'
s.clean_paths = "Rakefile", "RDD.md", "products", "test", "*.xcodeproj"
s.frameworks = 'Foundation'
s.xcconfig = { 'OTHER_LDFLAGS' => '-ObjC' }
end
-27
View File
@@ -1,27 +0,0 @@
Pod::Spec.new do |s|
s.name = 'Expecta'
s.version = '0.1.1'
s.license = 'MIT'
s.summary = 'A matcher framework for Objective-C & Cocoa'
s.homepage = 'http://github.com/petejkim/expecta'
s.author = { 'Peter Jihoon Kim' => 'raingrove@gmail.com' }
s.source = { :git => 'http://github.com/petejkim/expecta.git', :tag => 'v0.1.1' }
s.description = %{
Expecta is a matcher framework for Objective-C and Cocoa. The main
advantage of using Expecta over other matcher frameworks is that you do not
have to specify the data types. Also, the syntax of Expecta matchers is
much more readable and does not suffer from parenthesitis. If you have used
Jasmine before, you will feel right at home!
}
s.source_files = 'src/**/*.{h,m}'
s.clean_paths = "Rakefile", "RDD.md", "products", "test", "*.xcodeproj"
s.frameworks = 'Foundation'
s.xcconfig = { 'OTHER_LDFLAGS' => '-ObjC' }
end
-27
View File
@@ -1,27 +0,0 @@
Pod::Spec.new do |s|
s.name = 'Expecta'
s.version = '0.1.2'
s.license = 'MIT'
s.summary = 'A matcher framework for Objective-C & Cocoa'
s.homepage = 'http://github.com/petejkim/expecta'
s.author = { 'Peter Jihoon Kim' => 'raingrove@gmail.com' }
s.source = { :git => 'http://github.com/petejkim/expecta.git', :tag => 'v0.1.2' }
s.description = %{
Expecta is a matcher framework for Objective-C and Cocoa. The main
advantage of using Expecta over other matcher frameworks is that you do not
have to specify the data types. Also, the syntax of Expecta matchers is
much more readable and does not suffer from parenthesitis. If you have used
Jasmine before, you will feel right at home!
}
s.source_files = 'src/**/*.{h,m}'
s.clean_paths = "Rakefile", "RDD.md", "products", "test", "*.xcodeproj"
s.frameworks = 'Foundation'
s.xcconfig = { 'OTHER_LDFLAGS' => '-ObjC' }
end
-27
View File
@@ -1,27 +0,0 @@
Pod::Spec.new do |s|
s.name = 'Expecta'
s.version = '0.1.3'
s.license = 'MIT'
s.summary = 'A matcher framework for Objective-C & Cocoa'
s.homepage = 'http://github.com/petejkim/expecta'
s.author = { 'Peter Jihoon Kim' => 'raingrove@gmail.com' }
s.source = { :git => 'http://github.com/petejkim/expecta.git', :tag => 'v0.1.3' }
s.description = %{
Expecta is a matcher framework for Objective-C and Cocoa. The main
advantage of using Expecta over other matcher frameworks is that you do not
have to specify the data types. Also, the syntax of Expecta matchers is
much more readable and does not suffer from parenthesitis. If you have used
Jasmine before, you will feel right at home!
}
s.source_files = 'src/**/*.{h,m}'
s.clean_paths = "Rakefile", "RDD.md", "products", "test", "*.xcodeproj"
s.frameworks = 'Foundation'
s.xcconfig = { 'OTHER_LDFLAGS' => '-ObjC' }
end
-12
View File
@@ -1,12 +0,0 @@
Pod::Spec.new do |s|
s.name = 'FMDB'
s.version = '1.5.1'
s.summary = 'A Cocoa / Objective-C wrapper around SQLite.'
s.homepage = 'https://github.com/ccgus/fmdb'
s.author = 'August Mueller'
s.source = { :git => 'https://github.com/ccgus/fmdb.git',
:tag => 'v1.5.1' }
s.source_files = 'src/FM*.*'
s.library = 'sqlite3'
end

Some files were not shown because too many files have changed in this diff Show More