├── .gitattributes ├── .gitignore ├── .swift-version ├── .travis.yml ├── CHANGELOG.md ├── Demo ├── iOS-Echarts_OSX │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Assets.xcassets │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ ├── Base.lproj │ │ └── Main.storyboard │ ├── Info.plist │ ├── ViewController.h │ ├── ViewController.m │ ├── iOS-Echarts-OSX-PrefixHeader.pch │ └── main.m └── iOS-Echarts_iOS │ ├── .DS_Store │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Base.lproj │ ├── LaunchScreen.xib │ └── Main.storyboard │ ├── Cell │ ├── EchartsViewCell.h │ ├── EchartsViewCell.m │ └── EchartsViewCell.xib │ ├── Controller │ ├── BarDemoController.h │ ├── BarDemoController.m │ ├── BarDemoController.xib │ ├── CandlestickDemoController.h │ ├── CandlestickDemoController.m │ ├── CandlestickDemoController.xib │ ├── ChordDemoController.h │ ├── ChordDemoController.m │ ├── ChordDemoController.xib │ ├── EventRiverController.h │ ├── EventRiverController.m │ ├── EventRiverController.xib │ ├── ForceDemoController.h │ ├── ForceDemoController.m │ ├── ForceDemoController.xib │ ├── FunnelDemoController.h │ ├── FunnelDemoController.m │ ├── FunnelDemoController.xib │ ├── GaugesDemoController.h │ ├── GaugesDemoController.m │ ├── GaugesDemoController.xib │ ├── LineDemoController.h │ ├── LineDemoController.m │ ├── LineDemoController.xib │ ├── MainController.h │ ├── MainController.m │ ├── MapDemoController.h │ ├── MapDemoController.m │ ├── MapDemoController.xib │ ├── MultiEcharts2Controller.h │ ├── MultiEcharts2Controller.m │ ├── MultiEcharts2Controller.xib │ ├── MultiEchartsController.h │ ├── MultiEchartsController.m │ ├── MultiEchartsController.xib │ ├── OtherDemoController.h │ ├── OtherDemoController.m │ ├── OtherDemoController.xib │ ├── PieDemoController.h │ ├── PieDemoController.m │ ├── PieDemoController.xib │ ├── RadarDemoController.h │ ├── RadarDemoController.m │ ├── RadarDemoController.xib │ ├── ScatterDemoController.h │ ├── ScatterDemoController.m │ ├── ScatterDemoController.xib │ ├── TreeDemoController.h │ ├── TreeDemoController.m │ ├── TreeDemoController.xib │ ├── TreemapDemoController.h │ ├── TreemapDemoController.m │ ├── TreemapDemoController.xib │ ├── VennDemoController.h │ ├── VennDemoController.m │ ├── VennDemoController.xib │ ├── ViewController.h │ ├── ViewController.m │ ├── WKWebViewController.h │ ├── WKWebViewController.m │ ├── WKWebViewController.xib │ ├── WordCloudDemoController.h │ ├── WordCloudDemoController.m │ └── WordCloudDemoController.xib │ ├── Images.xcassets │ ├── AppIcon.appiconset │ │ └── Contents.json │ ├── Contents.json │ └── Image.imageset │ │ └── Contents.json │ ├── Info.plist │ ├── Library │ └── RMMapper │ │ ├── NSObject+RMArchivable.h │ │ ├── NSObject+RMArchivable.m │ │ ├── NSObject+RMCopyable.h │ │ ├── NSObject+RMCopyable.m │ │ ├── NSUserDefaults+RMSaveCustomObject.h │ │ ├── NSUserDefaults+RMSaveCustomObject.m │ │ ├── RMMapper.h │ │ └── RMMapper.m │ ├── iOS-Echarts-PrefixHeader.pch │ └── main.m ├── DemoOptions ├── PYBarDemoOptions.h ├── PYBarDemoOptions.m ├── PYCandlestickDemoOptions.h ├── PYCandlestickDemoOptions.m ├── PYDemoOptions.h ├── PYEventRiverDemoOptions.h ├── PYEventRiverDemoOptions.m ├── PYFunnelDemoOptions.h ├── PYFunnelDemoOptions.m ├── PYGaugesDemoOptions.h ├── PYGaugesDemoOptions.m ├── PYLineDemoOptions.h ├── PYLineDemoOptions.m ├── PYPieDemoOptions.h ├── PYPieDemoOptions.m ├── PYScatterDemoOptions.h ├── PYScatterDemoOptions.m ├── PYTreeDemoOptions.h ├── PYTreeDemoOptions.m ├── PYTreemapDemoOptions.h ├── PYTreemapDemoOptions.m ├── PYVennDemoOptions.h ├── PYVennDemoOptions.m ├── PYWorldCloudDemoOptions.h └── PYWorldCloudDemoOptions.m ├── Doc ├── Demos.gif ├── Demos1.gif └── README.md ├── LICENSE.md ├── README.md ├── iOS-Echarts.podspec ├── iOS-Echarts.xcodeproj ├── .LSOverride ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── iOS-Echarts.xccheckout └── xcshareddata │ └── xcschemes │ └── iOS-Echarts_iOS.xcscheme ├── iOS-Echarts ├── .DS_Store ├── Categories │ ├── NSObject+PYObject.h │ └── NSObject+PYObject.m ├── Model │ ├── .DS_Store │ ├── PYAreaStyle.h │ ├── PYAreaStyle.m │ ├── PYAxis.h │ ├── PYAxis.m │ ├── PYAxisLabel.h │ ├── PYAxisLabel.m │ ├── PYAxisLine.h │ ├── PYAxisLine.m │ ├── PYAxisPointer.h │ ├── PYAxisPointer.m │ ├── PYAxisSplitLine.h │ ├── PYAxisSplitLine.m │ ├── PYAxisTick.h │ ├── PYAxisTick.m │ ├── PYCategories.h │ ├── PYCategories.m │ ├── PYChordStyle.h │ ├── PYChordStyle.m │ ├── PYColor.h │ ├── PYColor.m │ ├── PYDataRange.h │ ├── PYDataRange.m │ ├── PYDataZoom.h │ ├── PYDataZoom.m │ ├── PYGrid.h │ ├── PYGrid.m │ ├── PYItemStyle.h │ ├── PYItemStyle.m │ ├── PYItemStyleProp.h │ ├── PYItemStyleProp.m │ ├── PYLegend.h │ ├── PYLegend.m │ ├── PYLineStyle.h │ ├── PYLineStyle.m │ ├── PYLinkStyle.h │ ├── PYLinkStyle.m │ ├── PYLinks.h │ ├── PYLinks.m │ ├── PYLoadingOption.h │ ├── PYLoadingOption.m │ ├── PYNoDataLoadingOption.h │ ├── PYNoDataLoadingOption.m │ ├── PYNodeStyle.h │ ├── PYNodeStyle.m │ ├── PYNodes.h │ ├── PYNodes.m │ ├── PYOption.h │ ├── PYOption.m │ ├── PYPolar.h │ ├── PYPolar.m │ ├── PYRoamController.h │ ├── PYRoamController.m │ ├── PYSplitArea.h │ ├── PYSplitArea.m │ ├── PYTextStyle.h │ ├── PYTextStyle.m │ ├── PYTimeline.h │ ├── PYTimeline.m │ ├── PYTitle.h │ ├── PYTitle.m │ ├── PYToolbox.h │ ├── PYToolbox.m │ ├── PYToolboxFeature.h │ ├── PYToolboxFeature.m │ ├── PYTooltip.h │ ├── PYTooltip.m │ └── Series │ │ ├── PYCartesianSeries.h │ │ ├── PYCartesianSeries.m │ │ ├── PYChordSeries.h │ │ ├── PYChordSeries.m │ │ ├── PYEventRiverSeries.h │ │ ├── PYEventRiverSeries.m │ │ ├── PYForceSeries.h │ │ ├── PYForceSeries.m │ │ ├── PYFunnelSeries.h │ │ ├── PYFunnelSeries.m │ │ ├── PYGaugeSeries.h │ │ ├── PYGaugeSeries.m │ │ ├── PYHeatmapSeries.h │ │ ├── PYHeatmapSeries.m │ │ ├── PYMapSeries.h │ │ ├── PYMapSeries.m │ │ ├── PYMarkLine.h │ │ ├── PYMarkLine.m │ │ ├── PYMarkPoint.h │ │ ├── PYMarkPoint.m │ │ ├── PYPieSeries.h │ │ ├── PYPieSeries.m │ │ ├── PYRadarSeries.h │ │ ├── PYRadarSeries.m │ │ ├── PYSeries.h │ │ ├── PYSeries.m │ │ ├── PYTreeMapSeries.h │ │ ├── PYTreeMapSeries.m │ │ ├── PYTreeSeries.h │ │ ├── PYTreeSeries.m │ │ ├── PYVennSeries.h │ │ ├── PYVennSeries.m │ │ ├── PYWordCloudSeries.h │ │ └── PYWordCloudSeries.m ├── PYUtilities.h ├── Resources │ ├── echarts.html │ ├── js │ │ └── echarts-all.js │ └── theme │ │ ├── blue.js │ │ ├── dark.js │ │ ├── gray.js │ │ ├── green.js │ │ ├── helianthus.js │ │ ├── infographic.js │ │ ├── macarons.js │ │ ├── macarons2.js │ │ ├── mint.js │ │ ├── red.js │ │ ├── roma.js │ │ ├── sakura.js │ │ └── shine.js ├── Util │ ├── PYJsonUtil.h │ └── PYJsonUtil.m ├── View │ ├── PYEchartsView.h │ ├── PYEchartsView.m │ ├── PYZoomEchartsView.h │ ├── PYZoomEchartsView.m │ ├── WKEchartsView.h │ └── WKEchartsView.m └── iOS-Echarts.h ├── iOS-EchartsTests ├── Info.plist └── iOS_EchartsTests.m └── tools ├── parser.py └── resources └── option.json /.gitattributes: -------------------------------------------------------------------------------- 1 | iOS-Echarts/Resources/* linguist-vendored=true 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## Build generated 6 | build/ 7 | DerivedData/ 8 | 9 | ## Various settings 10 | *.pbxuser 11 | !default.pbxuser 12 | *.mode1v3 13 | !default.mode1v3 14 | *.mode2v3 15 | !default.mode2v3 16 | *.perspectivev3 17 | !default.perspectivev3 18 | xcuserdata/ 19 | 20 | ## Other 21 | *.moved-aside 22 | *.xcuserstate 23 | 24 | ## Obj-C/Swift specific 25 | *.hmap 26 | *.ipa 27 | 28 | # CocoaPods 29 | # 30 | # We recommend against adding the Pods directory to your .gitignore. However 31 | # you should judge for yourself, the pros and cons are mentioned at: 32 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 33 | # 34 | # Pods/ 35 | 36 | # Carthage 37 | # 38 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 39 | # Carthage/Checkouts 40 | 41 | Carthage/Build 42 | 43 | # fastlane 44 | # 45 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 46 | # screenshots whenever they are needed. 47 | # For more information about the recommended setup visit: 48 | # https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md 49 | 50 | fastlane/report.xml 51 | fastlane/screenshots 52 | 53 | .DS_Store 54 | -------------------------------------------------------------------------------- /.swift-version: -------------------------------------------------------------------------------- 1 | 2.3 2 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: objective-c 2 | osx_image: xcode8.1 3 | 4 | env: 5 | matrix: 6 | - TEST_TYPE=iOS 7 | - TEST_TYPE=OSX 8 | 9 | script: 10 | - | 11 | if [ "$TEST_TYPE" = iOS ]; then 12 | xcodebuild clean build -project iOS-Echarts.xcodeproj -target iOS-Echarts_iOS -sdk iphonesimulator10.1 ONLY_ACTIVE_ARCH=NO 13 | elif [ "$TEST_TYPE" = OSX]; then 14 | xcodebuild clean build -project iOS-Echarts.xcodeproj -target iOS-Echarts_OSX -sdk macosx 15 | fi 16 | -------------------------------------------------------------------------------- /Demo/iOS-Echarts_OSX/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // iOS-Echarts_OSX 4 | // 5 | // Created by Pluto Y on 9/2/16. 6 | // Copyright © 2016 pluto-y. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : NSObject 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /Demo/iOS-Echarts_OSX/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // iOS-Echarts_OSX 4 | // 5 | // Created by Pluto Y on 9/2/16. 6 | // Copyright © 2016 pluto-y. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @interface AppDelegate () 12 | 13 | @end 14 | 15 | @implementation AppDelegate 16 | 17 | - (void)applicationDidFinishLaunching:(NSNotification *)aNotification { 18 | // Insert code here to initialize your application 19 | } 20 | 21 | - (void)applicationWillTerminate:(NSNotification *)aNotification { 22 | // Insert code here to tear down your application 23 | } 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /Demo/iOS-Echarts_OSX/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "mac", 5 | "size" : "16x16", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "mac", 10 | "size" : "16x16", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "mac", 15 | "size" : "32x32", 16 | "scale" : "1x" 17 | }, 18 | { 19 | "idiom" : "mac", 20 | "size" : "32x32", 21 | "scale" : "2x" 22 | }, 23 | { 24 | "idiom" : "mac", 25 | "size" : "128x128", 26 | "scale" : "1x" 27 | }, 28 | { 29 | "idiom" : "mac", 30 | "size" : "128x128", 31 | "scale" : "2x" 32 | }, 33 | { 34 | "idiom" : "mac", 35 | "size" : "256x256", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "mac", 40 | "size" : "256x256", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "mac", 45 | "size" : "512x512", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "mac", 50 | "size" : "512x512", 51 | "scale" : "2x" 52 | } 53 | ], 54 | "info" : { 55 | "version" : 1, 56 | "author" : "xcode" 57 | } 58 | } -------------------------------------------------------------------------------- /Demo/iOS-Echarts_OSX/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | LSMinimumSystemVersion 26 | $(MACOSX_DEPLOYMENT_TARGET) 27 | NSHumanReadableCopyright 28 | Copyright © 2016 pluto-y. All rights reserved. 29 | NSMainStoryboardFile 30 | Main 31 | NSPrincipalClass 32 | NSApplication 33 | 34 | 35 | -------------------------------------------------------------------------------- /Demo/iOS-Echarts_OSX/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // iOS-Echarts_OSX 4 | // 5 | // Created by Pluto Y on 9/2/16. 6 | // Copyright © 2016 pluto-y. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : NSViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /Demo/iOS-Echarts_OSX/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // iOS-Echarts_OSX 4 | // 5 | // Created by Pluto Y on 9/2/16. 6 | // Copyright © 2016 pluto-y. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | 11 | @interface ViewController() 12 | 13 | @property (weak) IBOutlet PYEchartsView *echartsView; 14 | 15 | @end 16 | 17 | @implementation ViewController 18 | 19 | - (void)viewDidLoad { 20 | [super viewDidLoad]; 21 | [self initAll]; 22 | } 23 | 24 | - (void)initAll { 25 | [self reloadBtnClick:nil]; 26 | } 27 | 28 | - (IBAction)reloadBtnClick:(id)sender { 29 | NSUInteger randNum = arc4random_uniform(10); 30 | PYOption *option; 31 | switch (randNum) { 32 | case 0: 33 | option = [PYLineDemoOptions standardLineOption]; 34 | break; 35 | case 1: 36 | option = [PYLineDemoOptions stackedLineOption]; 37 | break; 38 | case 2: 39 | option = [PYLineDemoOptions basicLineOption]; 40 | break; 41 | case 3: 42 | option = [PYLineDemoOptions basicAreaOption]; 43 | break; 44 | case 4: 45 | option = [PYLineDemoOptions stackedAreaOption]; 46 | break; 47 | case 5: 48 | option = [PYLineDemoOptions irregularLineOption]; 49 | break; 50 | case 6: 51 | option = [PYLineDemoOptions irregularLine2Option]; 52 | break; 53 | case 7: 54 | option = [PYLineDemoOptions irregularLine2Option]; 55 | break; 56 | case 8: 57 | option = [PYLineDemoOptions lineOption]; 58 | break; 59 | case 9: 60 | option = [PYLineDemoOptions logarithmicOption]; 61 | break; 62 | default: 63 | break; 64 | } 65 | if (option != nil) { 66 | [_echartsView setOption:option]; 67 | [_echartsView loadEcharts]; 68 | } 69 | } 70 | 71 | - (void)setRepresentedObject:(id)representedObject { 72 | [super setRepresentedObject:representedObject]; 73 | } 74 | 75 | @end 76 | -------------------------------------------------------------------------------- /Demo/iOS-Echarts_OSX/iOS-Echarts-OSX-PrefixHeader.pch: -------------------------------------------------------------------------------- 1 | // 2 | // iOS-Echarts-OSX-PrefixHeader.pch 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto Y on 9/3/16. 6 | // Copyright © 2016 pluto-y. All rights reserved. 7 | // 8 | 9 | #ifndef iOS_Echarts_OSX_PrefixHeader_pch 10 | #define iOS_Echarts_OSX_PrefixHeader_pch 11 | 12 | #import "iOS-Echarts.h" 13 | #import "PYDemoOptions.h" 14 | 15 | #endif /* iOS_Echarts_OSX_PrefixHeader_pch */ 16 | -------------------------------------------------------------------------------- /Demo/iOS-Echarts_OSX/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // iOS-Echarts_OSX 4 | // 5 | // Created by Pluto Y on 9/2/16. 6 | // Copyright © 2016 pluto-y. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | int main(int argc, const char * argv[]) { 12 | return NSApplicationMain(argc, argv); 13 | } 14 | -------------------------------------------------------------------------------- /Demo/iOS-Echarts_iOS/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pluto-Y/iOS-Echarts/ba07942435a550a0a6cd008669d8e6685cfccf97/Demo/iOS-Echarts_iOS/.DS_Store -------------------------------------------------------------------------------- /Demo/iOS-Echarts_iOS/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto Y on 15/9/4. 6 | // Copyright (c) 2015年 pluto-y. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /Demo/iOS-Echarts_iOS/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto Y on 15/9/4. 6 | // Copyright (c) 2015年 pluto-y. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | #import "MainController.h" 11 | 12 | @interface AppDelegate () 13 | 14 | @end 15 | 16 | @implementation AppDelegate 17 | 18 | 19 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 20 | // Override point for customization after application launch. 21 | self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; 22 | UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil]; 23 | MainController *mainController = [storyboard instantiateViewControllerWithIdentifier:@"MainController"]; 24 | self.window.rootViewController = mainController; 25 | 26 | self.window.backgroundColor = [UIColor whiteColor]; //背景颜色为白色 27 | [self.window makeKeyAndVisible]; 28 | return YES; 29 | } 30 | 31 | - (void)applicationWillResignActive:(UIApplication *)application { 32 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 33 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 34 | } 35 | 36 | - (void)applicationDidEnterBackground:(UIApplication *)application { 37 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 38 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 39 | } 40 | 41 | - (void)applicationWillEnterForeground:(UIApplication *)application { 42 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 43 | } 44 | 45 | - (void)applicationDidBecomeActive:(UIApplication *)application { 46 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 47 | } 48 | 49 | - (void)applicationWillTerminate:(UIApplication *)application { 50 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 51 | } 52 | 53 | @end 54 | -------------------------------------------------------------------------------- /Demo/iOS-Echarts_iOS/Cell/EchartsViewCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // EchartsViewCell.h 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto Y on 7/28/16. 6 | // Copyright © 2016 pluto-y. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "PYEchartsView.h" 11 | 12 | @interface EchartsViewCell : UITableViewCell 13 | 14 | @property (nonatomic, weak) IBOutlet PYEchartsView *echartView; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Demo/iOS-Echarts_iOS/Cell/EchartsViewCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // EchartsViewCell.m 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto Y on 7/28/16. 6 | // Copyright © 2016 pluto-y. All rights reserved. 7 | // 8 | 9 | #import "EchartsViewCell.h" 10 | 11 | @implementation EchartsViewCell 12 | 13 | - (void)awakeFromNib { 14 | [super awakeFromNib]; 15 | } 16 | 17 | - (void)setSelected:(BOOL)selected animated:(BOOL)animated { 18 | [super setSelected:selected animated:animated]; 19 | 20 | } 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /Demo/iOS-Echarts_iOS/Cell/EchartsViewCell.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /Demo/iOS-Echarts_iOS/Controller/BarDemoController.h: -------------------------------------------------------------------------------- 1 | // 2 | // BarDemoControllerViewController.h 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto-Y on 15/9/27. 6 | // Copyright © 2015年 pluto-y. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "PYEchartsView.h" 11 | 12 | @interface BarDemoController : UIViewController 13 | 14 | @property (nonatomic, weak) IBOutlet PYEchartsView *kEchartView; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Demo/iOS-Echarts_iOS/Controller/CandlestickDemoController.h: -------------------------------------------------------------------------------- 1 | // 2 | // CandlestickDemoController.h 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto-Y on 15/11/23. 6 | // Copyright © 2015年 pluto-y. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "PYEchartsView.h" 11 | 12 | @interface CandlestickDemoController : UIViewController 13 | 14 | @property (nonatomic, weak) IBOutlet PYEchartsView *kEchartView; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Demo/iOS-Echarts_iOS/Controller/CandlestickDemoController.m: -------------------------------------------------------------------------------- 1 | // 2 | // CandlestickDemoController.m 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto-Y on 15/11/23. 6 | // Copyright © 2015年 pluto-y. All rights reserved. 7 | // 8 | 9 | #import "CandlestickDemoController.h" 10 | #import "PYDemoOptions.h" 11 | 12 | typedef NS_ENUM(NSInteger, CandlesticDemoTypeBtnTag) { 13 | CandlesticDemoTypeBtnTag1 = 300001, 14 | CandlesticDemoTypeBtnTag2 = 300002 15 | }; 16 | 17 | @interface CandlestickDemoController () 18 | 19 | @end 20 | 21 | @implementation CandlestickDemoController 22 | 23 | - (void)viewDidLoad { 24 | [super viewDidLoad]; 25 | [self initAll]; 26 | } 27 | 28 | #pragma mark - custom functions 29 | /** 30 | * 初始化 31 | */ 32 | - (void)initAll { 33 | self.title = @"K线图"; 34 | PYOption *option = [PYCandlestickDemoOptions candlestick1Option]; 35 | [_kEchartView setOption:option]; 36 | [_kEchartView loadEcharts]; 37 | } 38 | 39 | /** 40 | * 按钮的点击事件 41 | */ 42 | - (IBAction)kDemosClick:(id)sender { 43 | UIButton *btn = (UIButton *)sender; 44 | PYOption *option; 45 | switch (btn.tag) { 46 | case CandlesticDemoTypeBtnTag1: 47 | option = [PYCandlestickDemoOptions candlestick1Option]; 48 | break; 49 | case CandlesticDemoTypeBtnTag2: 50 | option = [PYCandlestickDemoOptions candlestick2Option]; 51 | break; 52 | } 53 | if (option != nil) { 54 | [_kEchartView setOption:option]; 55 | } 56 | [_kEchartView loadEcharts]; 57 | } 58 | 59 | @end 60 | -------------------------------------------------------------------------------- /Demo/iOS-Echarts_iOS/Controller/ChordDemoController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ChordDemoController.h 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto Y on 8/24/16. 6 | // Copyright © 2016 pluto-y. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ChordDemoController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Demo/iOS-Echarts_iOS/Controller/EventRiverController.h: -------------------------------------------------------------------------------- 1 | // 2 | // EventRiverController.h 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto Y on 8/29/16. 6 | // Copyright © 2016 pluto-y. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface EventRiverController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Demo/iOS-Echarts_iOS/Controller/EventRiverController.m: -------------------------------------------------------------------------------- 1 | // 2 | // EventRiverController.m 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto Y on 8/29/16. 6 | // Copyright © 2016 pluto-y. All rights reserved. 7 | // 8 | 9 | #import "EventRiverController.h" 10 | 11 | typedef NS_ENUM(NSInteger, EventRiverDemoTypeTag) { 12 | EventRiverDemoTypeTag1 = 40001, 13 | EventRiverDemoTypeTag2 = 40002 14 | }; 15 | 16 | @interface EventRiverController () 17 | @property (weak, nonatomic) IBOutlet PYEchartsView *echartsView; 18 | 19 | @end 20 | 21 | @implementation EventRiverController 22 | 23 | - (void)viewDidLoad { 24 | [super viewDidLoad]; 25 | [self initAll]; 26 | } 27 | 28 | - (void)initAll { 29 | self.title = @"事件河流图"; 30 | [_echartsView setOption:[PYEventRiverDemoOptions eventRiver1Option]]; 31 | [_echartsView loadEcharts]; 32 | } 33 | 34 | - (IBAction)demoBtnClick:(id)sender { 35 | UIButton *btn = (UIButton *)sender; 36 | PYOption *option; 37 | switch (btn.tag) { 38 | case EventRiverDemoTypeTag1: 39 | option = [PYEventRiverDemoOptions eventRiver1Option]; 40 | break; 41 | case EventRiverDemoTypeTag2: 42 | option = [PYEventRiverDemoOptions eventRiver2Option]; 43 | break; 44 | } 45 | if (option) { 46 | [_echartsView setOption:option]; 47 | } 48 | [_echartsView loadEcharts]; 49 | } 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /Demo/iOS-Echarts_iOS/Controller/ForceDemoController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ForceDemoController.h 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto Y on 7/22/16. 6 | // Copyright © 2016 pluto-y. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "PYEchartsView.h" 11 | 12 | @interface ForceDemoController : UIViewController 13 | 14 | @property (nonatomic, weak) IBOutlet PYEchartsView *kEchartView; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Demo/iOS-Echarts_iOS/Controller/FunnelDemoController.h: -------------------------------------------------------------------------------- 1 | // 2 | // FunnelDemoController.h 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto Y on 8/22/16. 6 | // Copyright © 2016 pluto-y. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface FunnelDemoController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Demo/iOS-Echarts_iOS/Controller/FunnelDemoController.m: -------------------------------------------------------------------------------- 1 | // 2 | // FunnelDemoController.m 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto Y on 8/22/16. 6 | // Copyright © 2016 pluto-y. All rights reserved. 7 | // 8 | 9 | #import "FunnelDemoController.h" 10 | 11 | typedef NS_ENUM(NSInteger, FunnelDemoTypeTag) { 12 | FunnelDemoTypeTagBasicFunnel1 = 20001, 13 | FunnelDemoTypeTagMultipleFunnel1 = 20002, 14 | FunnelDemoTypeTagMultipleFunnel2 = 20003, 15 | FunnelDemoTypeTagMultipleFunnel3 = 20004, 16 | FunnelDemoTypeTagBasicFunnel2 = 20005 17 | }; 18 | 19 | @interface FunnelDemoController () 20 | 21 | @property (weak, nonatomic) IBOutlet PYEchartsView *echartsView; 22 | 23 | @end 24 | 25 | @implementation FunnelDemoController 26 | 27 | - (void)viewDidLoad { 28 | [super viewDidLoad]; 29 | [self initAll]; 30 | } 31 | 32 | - (void)initAll { 33 | self.title = @"漏斗图"; 34 | [_echartsView setOption:[PYFunnelDemoOptions basicFunnel1Option]]; 35 | [_echartsView loadEcharts]; 36 | } 37 | 38 | - (IBAction)demoBtnClick:(id)sender { 39 | UIButton *btn = (UIButton *)sender; 40 | PYOption *option; 41 | switch (btn.tag) { 42 | case FunnelDemoTypeTagBasicFunnel1: 43 | option = [PYFunnelDemoOptions basicFunnel1Option]; 44 | break; 45 | case FunnelDemoTypeTagMultipleFunnel1: 46 | option = [PYFunnelDemoOptions multipleFunnel1Option]; 47 | break; 48 | case FunnelDemoTypeTagMultipleFunnel2: 49 | option = [PYFunnelDemoOptions multipleFunnel2Option]; 50 | break; 51 | case FunnelDemoTypeTagMultipleFunnel3: 52 | option = [PYFunnelDemoOptions multipleFunnel3Option]; 53 | break; 54 | case FunnelDemoTypeTagBasicFunnel2: 55 | option = [PYFunnelDemoOptions basicFunnel2Option]; 56 | break; 57 | } 58 | if (option != nil) { 59 | [_echartsView setOption:option]; 60 | } 61 | [_echartsView loadEcharts]; 62 | } 63 | 64 | @end 65 | -------------------------------------------------------------------------------- /Demo/iOS-Echarts_iOS/Controller/GaugesDemoController.h: -------------------------------------------------------------------------------- 1 | // 2 | // GaugesDemoController.h 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto Y on 8/18/16. 6 | // Copyright © 2016 pluto-y. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface GaugesDemoController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Demo/iOS-Echarts_iOS/Controller/LineDemoController.h: -------------------------------------------------------------------------------- 1 | // 2 | // LineDemoControllerViewController.h 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto-Y on 15/9/17. 6 | // Copyright (c) 2015年 pluto-y. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "PYEchartsView.h" 11 | #import "PYZoomEchartsView.h" 12 | 13 | @interface LineDemoController : UIViewController 14 | 15 | @property (nonatomic, weak) IBOutlet PYZoomEchartsView *kEchartView; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /Demo/iOS-Echarts_iOS/Controller/LineDemoController.m: -------------------------------------------------------------------------------- 1 | // 2 | // LineDemoControllerViewController.m 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto-Y on 15/9/17. 6 | // Copyright (c) 2015年 pluto-y. All rights reserved. 7 | // 8 | 9 | #import "LineDemoController.h" 10 | 11 | typedef NS_ENUM(NSInteger, LineDemoTypeBtnTag) { 12 | LineDemoTypeBtnTagStandardLine = 10000, 13 | LineDemoTypeBtnTagStackedLine = 10001, 14 | LineDemoTypeBtnTagBasicLine = 10002, 15 | LindDemoTypeBtnTagBasicArea = 10003, 16 | LindDemoTypeBtnTagStackedArea = 10004, 17 | LindDemoTypeBtnTagIrregularLine = 10005, 18 | LineDemoTypeBtnTagIrregularLine2 = 10006, 19 | LineDemoTypeBtnTagLine = 10007, 20 | LineDemoTypeBtnTagLogarithmic = 10008 21 | }; 22 | 23 | @interface LineDemoController () 24 | 25 | @end 26 | 27 | @implementation LineDemoController 28 | 29 | - (void)viewDidLoad { 30 | [super viewDidLoad]; 31 | [self initAll]; 32 | } 33 | 34 | - (void)initAll { 35 | self.title = @"折线图"; 36 | [_kEchartView setOption:[PYLineDemoOptions standardLineOption]]; 37 | [_kEchartView loadEcharts]; 38 | } 39 | 40 | - (IBAction)kDemosClick:(id)sender { 41 | UIButton *btn = (UIButton *)sender; 42 | PYOption *option = nil; 43 | switch (btn.tag) { 44 | case LineDemoTypeBtnTagStandardLine: 45 | option = [PYLineDemoOptions standardLineOption]; 46 | break; 47 | case LineDemoTypeBtnTagStackedLine: 48 | option = [PYLineDemoOptions stackedLineOption]; 49 | break; 50 | case LineDemoTypeBtnTagBasicLine: 51 | option = [PYLineDemoOptions basicLineOption]; 52 | break; 53 | case LindDemoTypeBtnTagBasicArea: 54 | option = [PYLineDemoOptions basicAreaOption]; 55 | break; 56 | case LindDemoTypeBtnTagStackedArea: 57 | option = [PYLineDemoOptions stackedAreaOption]; 58 | break; 59 | case LindDemoTypeBtnTagIrregularLine: 60 | option = [PYLineDemoOptions irregularLineOption]; 61 | break; 62 | case LineDemoTypeBtnTagIrregularLine2: 63 | option = [PYLineDemoOptions irregularLine2Option]; 64 | break; 65 | case LineDemoTypeBtnTagLine: 66 | option = [PYLineDemoOptions lineOption]; 67 | break; 68 | case LineDemoTypeBtnTagLogarithmic: 69 | option = [PYLineDemoOptions logarithmicOption]; 70 | break; 71 | default: 72 | break; 73 | } 74 | if (option != nil) { 75 | [_kEchartView setOption:option]; 76 | } 77 | [_kEchartView loadEcharts]; 78 | } 79 | 80 | - (void)showAreaDemo { 81 | 82 | } 83 | 84 | @end 85 | -------------------------------------------------------------------------------- /Demo/iOS-Echarts_iOS/Controller/MainController.h: -------------------------------------------------------------------------------- 1 | // 2 | // MainControllerViewController.h 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto-Y on 15/10/2. 6 | // Copyright © 2015年 pluto-y. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface MainController : UINavigationController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Demo/iOS-Echarts_iOS/Controller/MainController.m: -------------------------------------------------------------------------------- 1 | // 2 | // MainControllerViewController.m 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto-Y on 15/10/2. 6 | // Copyright © 2015年 pluto-y. All rights reserved. 7 | // 8 | 9 | #import "MainController.h" 10 | 11 | @interface MainController () 12 | 13 | @property (weak, nonatomic) IBOutlet UINavigationBar *kNavigationBar; 14 | 15 | @end 16 | 17 | @implementation MainController 18 | 19 | - (void)viewDidLoad { 20 | [super viewDidLoad]; 21 | [self initAll]; 22 | } 23 | 24 | 25 | #pragma mark -custom functions 26 | /** 27 | * 初始化 28 | */ 29 | - (void)initAll { 30 | _kNavigationBar.backgroundColor = [UIColor orangeColor]; 31 | _kNavigationBar.translucent = NO; 32 | } 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /Demo/iOS-Echarts_iOS/Controller/MapDemoController.h: -------------------------------------------------------------------------------- 1 | // 2 | // MapDemoController.h 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto-Y on 15/12/27. 6 | // Copyright © 2015年 pluto-y. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "PYEchartsView.h" 11 | 12 | /** 13 | * 地图的Demo集合,主要用来封装官网中的Demo 14 | * 用来解释在iOS代码中如何展示该如何使用 15 | */ 16 | @interface MapDemoController : UIViewController 17 | 18 | @property (nonatomic, weak) IBOutlet PYEchartsView *yEchartView; 19 | @property (nonatomic, weak) IBOutlet UITableView *yDemoMenusTb; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /Demo/iOS-Echarts_iOS/Controller/MultiEcharts2Controller.h: -------------------------------------------------------------------------------- 1 | // 2 | // MultiEcharts2Controller.h 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto Y on 22/09/2016. 6 | // Copyright © 2016 pluto-y. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface MultiEcharts2Controller : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Demo/iOS-Echarts_iOS/Controller/MultiEcharts2Controller.m: -------------------------------------------------------------------------------- 1 | // 2 | // MultiEcharts2Controller.m 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto Y on 22/09/2016. 6 | // Copyright © 2016 pluto-y. All rights reserved. 7 | // 8 | 9 | #import "MultiEcharts2Controller.h" 10 | 11 | @interface MultiEcharts2Controller () 12 | 13 | @property (weak, nonatomic) IBOutlet PYEchartsView *echartsView1; 14 | @property (weak, nonatomic) IBOutlet PYEchartsView *echartsView2; 15 | @property (weak, nonatomic) IBOutlet PYEchartsView *echartsView3; 16 | @property (weak, nonatomic) IBOutlet PYEchartsView *echartsView4; 17 | @property (weak, nonatomic) IBOutlet PYEchartsView *echartsView5; 18 | 19 | @property (weak, nonatomic) IBOutlet PYEchartsView *echartsView6; 20 | @property (weak, nonatomic) IBOutlet PYEchartsView *echartsView7; 21 | @property (weak, nonatomic) IBOutlet PYEchartsView *echartsView8; 22 | @property (weak, nonatomic) IBOutlet PYEchartsView *echartsView9; 23 | @property (weak, nonatomic) IBOutlet PYEchartsView *echartsView10; 24 | @end 25 | 26 | @implementation MultiEcharts2Controller 27 | 28 | - (void)viewDidLoad { 29 | [super viewDidLoad]; 30 | [self initAll]; 31 | } 32 | 33 | - (void)initAll { 34 | self.title = @"多图表"; 35 | [_echartsView1 setOption:[PYLineDemoOptions basicLineOption]]; 36 | [_echartsView1 loadEcharts]; 37 | 38 | [_echartsView2 setOption:[PYPieDemoOptions nightingalesRoseDiagramPieOption]]; 39 | [_echartsView2 loadEcharts]; 40 | 41 | [_echartsView3 setOption:[PYBarDemoOptions stackedBarOption]]; 42 | [_echartsView3 loadEcharts]; 43 | 44 | [_echartsView4 setOption:[PYTreemapDemoOptions treemap1Option]]; 45 | [_echartsView4 loadEcharts]; 46 | 47 | [_echartsView5 setOption:[PYEventRiverDemoOptions eventRiver1Option]]; 48 | [_echartsView5 loadEcharts]; 49 | 50 | [_echartsView6 setOption:[PYScatterDemoOptions timeDataOption]]; 51 | [_echartsView6 loadEcharts]; 52 | 53 | [_echartsView7 setOption:[PYTreeDemoOptions tree2Option]]; 54 | [_echartsView7 loadEcharts]; 55 | 56 | [_echartsView8 setOption:[PYVennDemoOptions vennOption]]; 57 | [_echartsView8 loadEcharts]; 58 | 59 | [_echartsView9 setOption:[PYWorldCloudDemoOptions worldCloudOption]]; 60 | [_echartsView9 loadEcharts]; 61 | 62 | [_echartsView10 setOption:[PYCandlestickDemoOptions candlestick2Option]]; 63 | [_echartsView10 loadEcharts]; 64 | } 65 | 66 | @end 67 | -------------------------------------------------------------------------------- /Demo/iOS-Echarts_iOS/Controller/MultiEchartsController.h: -------------------------------------------------------------------------------- 1 | // 2 | // PYMutilEchartsController.h 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto Y on 7/28/16. 6 | // Copyright © 2016 pluto-y. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "PYEchartsView.h" 11 | 12 | @interface MultiEchartsController : UIViewController 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /Demo/iOS-Echarts_iOS/Controller/MultiEchartsController.m: -------------------------------------------------------------------------------- 1 | // 2 | // PYMutilEchartsController.m 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto Y on 7/28/16. 6 | // Copyright © 2016 pluto-y. All rights reserved. 7 | // 8 | 9 | #import "MultiEchartsController.h" 10 | #import "EchartsViewCell.h" 11 | 12 | static NSString *const tableViewIdentifier = @"EchartsViewCell"; 13 | 14 | @interface MultiEchartsController () 15 | 16 | @property (nonatomic, weak) IBOutlet UITableView *tableView; 17 | 18 | @end 19 | 20 | @implementation MultiEchartsController 21 | 22 | - (void)viewDidLoad { 23 | [super viewDidLoad]; 24 | [self initAll]; 25 | } 26 | 27 | - (void)initAll { 28 | self.title = @"多图表"; 29 | [_tableView registerNib:[UINib nibWithNibName:tableViewIdentifier bundle:nil] forCellReuseIdentifier:tableViewIdentifier]; 30 | } 31 | 32 | #pragma mark UITableViewDataSource 33 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 34 | EchartsViewCell *cell = [tableView dequeueReusableCellWithIdentifier:tableViewIdentifier forIndexPath:indexPath]; 35 | PYOption *option; 36 | if (indexPath.row == 0) { 37 | option = [PYLineDemoOptions stackedLineOption]; 38 | } else if (indexPath.row == 1) { 39 | option = [PYBarDemoOptions stackedBarOption]; 40 | } else { 41 | option = [PYFunnelDemoOptions multipleFunnel2Option]; 42 | } 43 | [cell.echartView setOption:option]; 44 | [cell.echartView loadEcharts]; 45 | return cell; 46 | } 47 | 48 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { 49 | return 3; 50 | } 51 | 52 | @end 53 | -------------------------------------------------------------------------------- /Demo/iOS-Echarts_iOS/Controller/MultiEchartsController.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /Demo/iOS-Echarts_iOS/Controller/OtherDemoController.h: -------------------------------------------------------------------------------- 1 | // 2 | // OtherDemoController.h 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto Y on 16/4/15. 6 | // Copyright © 2016年 pluto-y. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "PYEchartsView.h" 11 | 12 | @interface OtherDemoController : UIViewController 13 | 14 | @property (nonatomic, weak) IBOutlet PYEchartsView *yEchartsView; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Demo/iOS-Echarts_iOS/Controller/PieDemoController.h: -------------------------------------------------------------------------------- 1 | // 2 | // PieDemoController.h 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto-Y on 15/10/3. 6 | // Copyright © 2015年 pluto-y. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface PieDemoController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Demo/iOS-Echarts_iOS/Controller/RadarDemoController.h: -------------------------------------------------------------------------------- 1 | // 2 | // RadarDemoControllerViewController.h 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto Y on 15/12/21. 6 | // Copyright © 2015年 pluto-y. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "PYEchartsView.h" 11 | 12 | @interface RadarDemoController : UIViewController 13 | 14 | @property (nonatomic, weak) IBOutlet PYEchartsView *kEchartView; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Demo/iOS-Echarts_iOS/Controller/ScatterDemoController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ScatterDemoController.h 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto-Y on 15/11/23. 6 | // Copyright © 2015年 pluto-y. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "PYEchartsView.h" 11 | 12 | 13 | @interface ScatterDemoController : UIViewController 14 | 15 | @property (nonatomic, weak) IBOutlet PYEchartsView *kEchartView; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /Demo/iOS-Echarts_iOS/Controller/ScatterDemoController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ScatterDemoController.m 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto-Y on 15/11/23. 6 | // Copyright © 2015年 pluto-y. All rights reserved. 7 | // 8 | 9 | #import "ScatterDemoController.h" 10 | 11 | typedef NS_ENUM(NSInteger, ScatterDemoTypeBtnTag) { 12 | ScatterDemoTypeBtnTagBasicScatter = 300001, 13 | ScatterDemoTypeBtnTagBasicBubble = 300002, 14 | ScatterDemoTypeBtnTagLargeScaleScatter = 300003, 15 | ScatterDemoTypeBtnTagCategoryScatter = 300004, 16 | ScatterDemoTypeBtnTagTimeData = 300005, 17 | ScatterDemoTypeBtnTagTimeLine = 300006, 18 | ScatterDemoTypeBtnTagScaleRoaming = 300007, 19 | ScatterDemoTypeBtnTagScatter = 300008 20 | }; 21 | 22 | @interface ScatterDemoController () 23 | 24 | @end 25 | 26 | @implementation ScatterDemoController 27 | 28 | - (void)viewDidLoad { 29 | [super viewDidLoad]; 30 | [self initAll]; 31 | } 32 | 33 | #pragma mark - custom functions 34 | /** 35 | * 初始化 36 | */ 37 | - (void)initAll { 38 | self.title = @"散点图"; 39 | [_kEchartView setOption:[PYScatterDemoOptions basicScatterOption]]; 40 | [_kEchartView loadEcharts]; 41 | } 42 | 43 | /** 44 | * 按钮点击事件 45 | */ 46 | - (IBAction)kDemoBtnClick:(id)sender { 47 | UIButton *btn = (UIButton *)sender; 48 | PYOption *option; 49 | switch (btn.tag) { 50 | case ScatterDemoTypeBtnTagBasicScatter: 51 | option = [PYScatterDemoOptions basicScatterOption]; 52 | break; 53 | case ScatterDemoTypeBtnTagBasicBubble: 54 | option = [PYScatterDemoOptions basicBubbleOption]; 55 | break; 56 | case ScatterDemoTypeBtnTagLargeScaleScatter: 57 | option = [PYScatterDemoOptions largeScaleScatterOption]; 58 | break; 59 | case ScatterDemoTypeBtnTagCategoryScatter: 60 | option = [PYScatterDemoOptions categoryScatterOption]; 61 | break; 62 | case ScatterDemoTypeBtnTagTimeData: 63 | option = [PYScatterDemoOptions timeDataOption]; 64 | break; 65 | case ScatterDemoTypeBtnTagTimeLine: 66 | option = [PYScatterDemoOptions timeLineOption]; 67 | break; 68 | case ScatterDemoTypeBtnTagScaleRoaming: 69 | option = [PYScatterDemoOptions scaleRoamingOption]; 70 | break; 71 | case ScatterDemoTypeBtnTagScatter: 72 | option = [PYScatterDemoOptions scatterOption]; 73 | break; 74 | default: 75 | break; 76 | } 77 | if (option != nil) { 78 | [_kEchartView setOption:option]; 79 | } 80 | [_kEchartView loadEcharts]; 81 | } 82 | 83 | @end 84 | -------------------------------------------------------------------------------- /Demo/iOS-Echarts_iOS/Controller/TreeDemoController.h: -------------------------------------------------------------------------------- 1 | // 2 | // TreeDemoController.h 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto Y on 8/27/16. 6 | // Copyright © 2016 pluto-y. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface TreeDemoController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Demo/iOS-Echarts_iOS/Controller/TreeDemoController.m: -------------------------------------------------------------------------------- 1 | // 2 | // TreeDemoController.m 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto Y on 8/27/16. 6 | // Copyright © 2016 pluto-y. All rights reserved. 7 | // 8 | 9 | #import "TreeDemoController.h" 10 | 11 | typedef NS_ENUM(NSInteger, TreeDemoTypeTag) { 12 | TreeDemoTypeTagTree1 = 40001, 13 | TreeDemoTypeTagTree2 = 40002, 14 | TreeDemoTypeTagTree3 = 40003 15 | }; 16 | 17 | @interface TreeDemoController () 18 | 19 | @property (weak, nonatomic) IBOutlet PYEchartsView *echartsView; 20 | 21 | @end 22 | 23 | @implementation TreeDemoController 24 | 25 | - (void)viewDidLoad { 26 | [super viewDidLoad]; 27 | [self initAll]; 28 | } 29 | 30 | - (void) initAll { 31 | self.title = @"树图"; 32 | [_echartsView setOption:[PYTreeDemoOptions tree1Option]]; 33 | [_echartsView loadEcharts]; 34 | } 35 | 36 | - (IBAction)demoBtnClick:(id)sender { 37 | UIButton *btn = (UIButton *)sender; 38 | PYOption *option; 39 | switch (btn.tag) { 40 | case TreeDemoTypeTagTree1: 41 | option = [PYTreeDemoOptions tree1Option]; 42 | break; 43 | case TreeDemoTypeTagTree2: 44 | option = [PYTreeDemoOptions tree2Option]; 45 | break; 46 | case TreeDemoTypeTagTree3: 47 | option = [PYTreeDemoOptions tree3Option]; 48 | break; 49 | } 50 | if (option != nil) { 51 | [_echartsView setOption:option]; 52 | } 53 | [_echartsView loadEcharts]; 54 | } 55 | 56 | @end 57 | -------------------------------------------------------------------------------- /Demo/iOS-Echarts_iOS/Controller/TreemapDemoController.h: -------------------------------------------------------------------------------- 1 | // 2 | // TreemapDemoController.h 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto Y on 8/15/16. 6 | // Copyright © 2016 pluto-y. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface TreemapDemoController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Demo/iOS-Echarts_iOS/Controller/TreemapDemoController.m: -------------------------------------------------------------------------------- 1 | // 2 | // TreemapDemoController.m 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto Y on 8/15/16. 6 | // Copyright © 2016 pluto-y. All rights reserved. 7 | // 8 | 9 | #import "TreemapDemoController.h" 10 | 11 | typedef NS_ENUM(NSInteger, TreemapDemoTypeTag) { 12 | TreemapDemoTypeTagTreemap1 = 30001, 13 | TreemapDemoTypeTagTreemap2 = 30002, 14 | TreemapDemoTypeTagTreemap3 = 30003 15 | }; 16 | 17 | @interface TreemapDemoController () 18 | 19 | @property (weak, nonatomic) IBOutlet PYEchartsView *echartsView; 20 | 21 | @end 22 | 23 | @implementation TreemapDemoController 24 | 25 | - (void)viewDidLoad { 26 | [super viewDidLoad]; 27 | [self initAll]; 28 | } 29 | 30 | - (void)initAll { 31 | self.title = @"矩形树图"; 32 | PYOption *option = [PYTreemapDemoOptions treemap1Option]; 33 | [_echartsView setOption:option]; 34 | [_echartsView loadEcharts]; 35 | } 36 | 37 | - (IBAction)demoBtnClick:(id)sender { 38 | UIButton *btn = (UIButton *)sender; 39 | PYOption *option; 40 | switch (btn.tag) { 41 | case TreemapDemoTypeTagTreemap1: 42 | option = [PYTreemapDemoOptions treemap1Option]; 43 | break; 44 | case TreemapDemoTypeTagTreemap2: 45 | option = [PYTreemapDemoOptions treemap2Option]; 46 | break; 47 | case TreemapDemoTypeTagTreemap3: 48 | option = [PYTreemapDemoOptions treemap3Option]; 49 | break; 50 | } 51 | if (option != nil) { 52 | [_echartsView setOption:option]; 53 | } 54 | [_echartsView loadEcharts]; 55 | } 56 | 57 | @end 58 | -------------------------------------------------------------------------------- /Demo/iOS-Echarts_iOS/Controller/VennDemoController.h: -------------------------------------------------------------------------------- 1 | // 2 | // VennDemoController.h 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto Y on 8/14/16. 6 | // Copyright © 2016 pluto-y. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface VennDemoController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Demo/iOS-Echarts_iOS/Controller/VennDemoController.m: -------------------------------------------------------------------------------- 1 | // 2 | // VennDemoController.m 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto Y on 8/14/16. 6 | // Copyright © 2016 pluto-y. All rights reserved. 7 | // 8 | 9 | #import "VennDemoController.h" 10 | #import "PYDemoOptions.h" 11 | 12 | @interface VennDemoController () 13 | 14 | @property (weak, nonatomic) IBOutlet PYEchartsView *yEchartView; 15 | 16 | @end 17 | 18 | @implementation VennDemoController 19 | 20 | - (void)viewDidLoad { 21 | [super viewDidLoad]; 22 | [self initAll]; 23 | } 24 | 25 | - (void)initAll { 26 | self.title = @"韦恩图"; 27 | PYOption *option = [PYVennDemoOptions vennOption]; 28 | [_yEchartView setOption:option]; 29 | [_yEchartView loadEcharts]; 30 | } 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /Demo/iOS-Echarts_iOS/Controller/VennDemoController.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /Demo/iOS-Echarts_iOS/Controller/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto Y on 15/9/4. 6 | // Copyright (c) 2015年 Pluto Y. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /Demo/iOS-Echarts_iOS/Controller/WKWebViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // WKWebViewController.h 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto-Y on 30/12/2016. 6 | // Copyright © 2016 pluto-y. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface WKWebViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Demo/iOS-Echarts_iOS/Controller/WordCloudDemoController.h: -------------------------------------------------------------------------------- 1 | // 2 | // WordCloudDemoController.h 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto Y on 8/10/16. 6 | // Copyright © 2016 pluto-y. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface WordCloudDemoController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Demo/iOS-Echarts_iOS/Controller/WordCloudDemoController.m: -------------------------------------------------------------------------------- 1 | // 2 | // WordCloudDemoController.m 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto Y on 8/10/16. 6 | // Copyright © 2016 pluto-y. All rights reserved. 7 | // 8 | 9 | #import "WordCloudDemoController.h" 10 | #import "PYWorldCloudDemoOptions.h" 11 | 12 | @interface WordCloudDemoController () 13 | 14 | @property (weak, nonatomic) IBOutlet PYEchartsView *kEcharts; 15 | 16 | @end 17 | 18 | @implementation WordCloudDemoController 19 | 20 | - (void)viewDidLoad { 21 | [super viewDidLoad]; 22 | [self initAll]; 23 | } 24 | 25 | - (void)initAll { 26 | self.title = @"字符云"; 27 | _kEcharts.eDelegate = self; 28 | PYOption *option = [PYWorldCloudDemoOptions worldCloudOption]; 29 | [_kEcharts setOption:option]; 30 | [_kEcharts loadEcharts]; 31 | } 32 | 33 | #pragma mark PYEchartsViewDelegate 34 | - (BOOL)echartsView:(PYEchartsView *)echartsView didReceivedLinkURL:(NSURL *)url { 35 | [[UIApplication sharedApplication] openURL:url]; 36 | return NO; 37 | } 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /Demo/iOS-Echarts_iOS/Controller/WordCloudDemoController.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /Demo/iOS-Echarts_iOS/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /Demo/iOS-Echarts_iOS/Images.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /Demo/iOS-Echarts_iOS/Images.xcassets/Image.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x" 10 | }, 11 | { 12 | "idiom" : "universal", 13 | "scale" : "3x" 14 | } 15 | ], 16 | "info" : { 17 | "version" : 1, 18 | "author" : "xcode" 19 | } 20 | } -------------------------------------------------------------------------------- /Demo/iOS-Echarts_iOS/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSApplicationCategoryType 24 | 25 | LSRequiresIPhoneOS 26 | 27 | NSAppTransportSecurity 28 | 29 | NSAllowsArbitraryLoads 30 | 31 | 32 | UILaunchStoryboardName 33 | LaunchScreen 34 | UIRequiredDeviceCapabilities 35 | 36 | armv7 37 | 38 | UISupportedInterfaceOrientations 39 | 40 | UIInterfaceOrientationPortrait 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /Demo/iOS-Echarts_iOS/Library/RMMapper/NSObject+RMArchivable.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSObject+TDArchivable.h 3 | // Roomorama 4 | // 5 | // Created by DAO XUAN DUNG on 20/11/12. 6 | // 7 | // 8 | 9 | #import 10 | 11 | @interface NSObject (RMArchivable) 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Demo/iOS-Echarts_iOS/Library/RMMapper/NSObject+RMArchivable.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSObject+TDArchivable.m 3 | // Roomorama 4 | // 5 | // Created by DAO XUAN DUNG on 20/11/12. 6 | // 7 | // 8 | 9 | #import "NSObject+RMArchivable.h" 10 | #import "RMMapper.h" 11 | 12 | 13 | @implementation NSObject (RMArchivable) 14 | 15 | - (void)encodeWithCoder:(NSCoder *)encoder { 16 | //Encode properties, other class variables, etc 17 | NSDictionary* propertyDict = [RMMapper propertiesForClass:[self class]]; 18 | 19 | for (NSString* key in propertyDict) { 20 | id value = [self valueForKey:key]; 21 | [encoder encodeObject:value forKey:key]; 22 | } 23 | } 24 | 25 | - (id)initWithCoder:(NSCoder *)decoder { 26 | if([self init]) { 27 | //decode properties, other class vars 28 | NSDictionary* propertyDict = [RMMapper propertiesForClass:[self class]]; 29 | 30 | for (NSString* key in propertyDict) { 31 | id value = [decoder decodeObjectForKey:key]; 32 | [self setValue:value forKey:key]; 33 | } 34 | } 35 | return self; 36 | } 37 | 38 | @end 39 | -------------------------------------------------------------------------------- /Demo/iOS-Echarts_iOS/Library/RMMapper/NSObject+RMCopyable.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSObject+TDCopy.h 3 | // Roomorama 4 | // 5 | // Created by Roomorama on 27/12/12. 6 | // Copyright (c) 2012 Roomorama. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NSObject (RMCopyable) 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Demo/iOS-Echarts_iOS/Library/RMMapper/NSObject+RMCopyable.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSObject+TDCopy.m 3 | // Roomorama 4 | // 5 | // Created by Roomorama on 27/12/12. 6 | // Copyright (c) 2012 Roomorama. All rights reserved. 7 | // 8 | 9 | #import "NSObject+RMCopyable.h" 10 | #import "RMMapper.h" 11 | 12 | 13 | @implementation NSObject (RMCopyable) 14 | 15 | -(id)copyWithZone:(NSZone *)zone { 16 | typeof(self) copiedObj = [[[self class] allocWithZone:zone] init]; 17 | if (copiedObj) { 18 | NSDictionary* properties = [RMMapper propertiesForClass:[self class]]; 19 | for (NSString* key in properties) { 20 | id val = [self valueForKey:key]; 21 | [copiedObj setValue:val forKey:key]; 22 | } 23 | } 24 | return copiedObj; 25 | } 26 | 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /Demo/iOS-Echarts_iOS/Library/RMMapper/NSUserDefaults+RMSaveCustomObject.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSUserDefaults+RMSaveCustomObject.h 3 | // RMMapper 4 | // 5 | // Created by Roomorama on 28/6/13. 6 | // Copyright (c) 2013 Roomorama. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NSUserDefaults (RMSaveCustomObject) 12 | 13 | 14 | /** Save to NSUserDefaults. The obj must be Archivable. Otherwise it would not be savable. 15 | The easiest way to make object archivable is to import NSObject+RMArchivable.h 16 | 17 | Answer from http://stackoverflow.com/questions/2315948/how-to-store-custom-objects-in-nsuserdefaults/2315972#2315972 18 | */ 19 | -(void) rm_setCustomObject:(id)obj forKey:(NSString*)key; 20 | 21 | 22 | /** Load to NSUserDefaults 23 | */ 24 | -(id) rm_customObjectForKey:(NSString*)key; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /Demo/iOS-Echarts_iOS/Library/RMMapper/NSUserDefaults+RMSaveCustomObject.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSUserDefaults+RMSaveCustomObject.m 3 | // RMMapper 4 | // 5 | // Created by Roomorama on 28/6/13. 6 | // Copyright (c) 2013 Roomorama. All rights reserved. 7 | // 8 | 9 | #import "NSUserDefaults+RMSaveCustomObject.h" 10 | 11 | @implementation NSUserDefaults (RMSaveCustomObject) 12 | 13 | -(void)rm_setCustomObject:(id)obj forKey:(NSString *)key { 14 | if ([obj respondsToSelector:@selector(encodeWithCoder:)] == NO) { 15 | NSLog(@"Error save object to NSUserDefaults. Object must respond to encodeWithCoder: message"); 16 | return; 17 | } 18 | NSData *encodedObject = [NSKeyedArchiver archivedDataWithRootObject:obj]; 19 | NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; 20 | [defaults setObject:encodedObject forKey:key]; 21 | [defaults synchronize]; 22 | } 23 | 24 | -(id)rm_customObjectForKey:(NSString *)key { 25 | NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; 26 | NSData *encodedObject = [defaults objectForKey:key]; 27 | id obj = [NSKeyedUnarchiver unarchiveObjectWithData:encodedObject]; 28 | return obj; 29 | } 30 | 31 | @end -------------------------------------------------------------------------------- /Demo/iOS-Echarts_iOS/Library/RMMapper/RMMapper.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface RMMapper : NSObject 4 | 5 | /** 6 | Answer from http://stackoverflow.com/questions/754824/get-an-object-attributes-list-in-objective-c/13000074#13000074 7 | 8 | Return dictionary of property name and type from a class. 9 | Useful for Key-Value Coding. 10 | */ 11 | + (NSDictionary *)propertiesForClass:(Class)cls; 12 | 13 | /** Populate existing object with values from dictionary 14 | */ 15 | + (id) populateObject:(id)obj fromDictionary:(NSDictionary*)dict; 16 | + (id) populateObject:(id)obj fromDictionary:(NSDictionary*)dict exclude:(NSArray*)excludeArray; 17 | 18 | 19 | /** Create a new object with given class and populate it with value from dictionary 20 | */ 21 | + (id) objectWithClass:(Class)cls fromDictionary:(NSDictionary*)dict; 22 | 23 | /** Convert an object to a dictionary 24 | */ 25 | + (NSDictionary*) dictionaryForObject:(id)obj; 26 | + (NSDictionary*) dictionaryForObject:(id)obj include:(NSArray*)includeArray; 27 | + (NSMutableDictionary*) mutableDictionaryForObject:(id)obj; 28 | + (NSMutableDictionary*) mutableDictionaryForObject:(id)obj include:(NSArray*)includeArray; 29 | 30 | 31 | /** Convert an array of dict to array of object with predefined class 32 | */ 33 | + (NSArray*) arrayOfClass:(Class)cls fromArrayOfDictionary:(NSArray*)array; 34 | +(NSMutableArray *)mutableArrayOfClass:(Class)cls fromArrayOfDictionary:(NSArray *)array exclude:(NSArray *)excludeArray; 35 | + (NSMutableArray*) mutableArrayOfClass:(Class)cls fromArrayOfDictionary:(NSArray*)array; 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /Demo/iOS-Echarts_iOS/iOS-Echarts-PrefixHeader.pch: -------------------------------------------------------------------------------- 1 | // 2 | // iOS-Echarts-PrefixHeader.pch 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto Y on 15/9/4. 6 | // Copyright (c) 2015年 pluto-y. All rights reserved. 7 | // 8 | 9 | #ifndef iOS_Echarts_iOS_Echarts_PrefixHeader_pch 10 | #define iOS_Echarts_iOS_Echarts_PrefixHeader_pch 11 | 12 | // Include any system framework and library headers here that should be included in all compilation units. 13 | 14 | #import 15 | //For the Demo Test. 16 | #import "RMMapper.h" 17 | 18 | // You will also need to set the Prefix Header build setting of one or more of your targets to reference this file. 19 | 20 | #import "iOS-Echarts.h" 21 | #import "PYDemoOptions.h" 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /Demo/iOS-Echarts_iOS/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto Y on 15/9/4. 6 | // Copyright (c) 2015年 pluto-y. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /DemoOptions/PYBarDemoOptions.h: -------------------------------------------------------------------------------- 1 | // 2 | // PYBarDemoOptions.h 3 | // iOS+Echarts 4 | // 5 | // Created by Pluto Y on 9/4/16. 6 | // Copyright © 2016 pluto+y. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "iOS-Echarts.h" 11 | 12 | @interface PYBarDemoOptions : NSObject 13 | 14 | + (PYOption *)basicColumnOption; 15 | + (PYOption *)stackedColumnOption; 16 | + (PYOption *)termometerOption; 17 | + (PYOption *)compositiveWaterfallOption; 18 | + (PYOption *)changeWaterfallOption; 19 | + (PYOption *)stackedAndClusteredColumnOption; 20 | + (PYOption *)basicBarOption; 21 | + (PYOption *)stackedBarOption; 22 | + (PYOption *)stackedFloatingBarOption; 23 | + (PYOption *)tornadoOption; 24 | + (PYOption *)tornado2Option; 25 | + (PYOption *)irrgularBarOption; 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /DemoOptions/PYCandlestickDemoOptions.h: -------------------------------------------------------------------------------- 1 | // 2 | // PYCandlestickDemoOptions.h 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto Y on 9/9/16. 6 | // Copyright © 2016 pluto-y. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "iOS-Echarts.h" 11 | 12 | @interface PYCandlestickDemoOptions : NSObject 13 | 14 | + (PYOption *)candlestick1Option; 15 | + (PYOption *)candlestick2Option; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /DemoOptions/PYDemoOptions.h: -------------------------------------------------------------------------------- 1 | // 2 | // PYDemoOptions.h 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto Y on 9/1/16. 6 | // Copyright © 2016 pluto-y. All rights reserved. 7 | // 8 | 9 | #ifndef PYDemoOptions_h 10 | #define PYDemoOptions_h 11 | 12 | #import "PYLineDemoOptions.h" 13 | #import "PYBarDemoOptions.h" 14 | #import "PYPieDemoOptions.h" 15 | #import "PYWorldCloudDemoOptions.h" 16 | #import "PYCandlestickDemoOptions.h" 17 | #import "PYVennDemoOptions.h" 18 | #import "PYTreemapDemoOptions.h" 19 | #import "PYTreeDemoOptions.h" 20 | #import "PYGaugesDemoOptions.h" 21 | #import "PYFunnelDemoOptions.h" 22 | #import "PYScatterDemoOptions.h" 23 | #import "PYEventRiverDemoOptions.h" 24 | 25 | #endif /* PYDemoOptions_h */ 26 | -------------------------------------------------------------------------------- /DemoOptions/PYEventRiverDemoOptions.h: -------------------------------------------------------------------------------- 1 | // 2 | // PYEventRiverDemoOptions.h 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto Y on 22/09/2016. 6 | // Copyright © 2016 pluto-y. All rights reserved. 7 | // 8 | 9 | #import "iOS-Echarts.h" 10 | 11 | @interface PYEventRiverDemoOptions : NSObject 12 | 13 | + (PYOption *)eventRiver1Option; 14 | + (PYOption *)eventRiver2Option; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /DemoOptions/PYFunnelDemoOptions.h: -------------------------------------------------------------------------------- 1 | // 2 | // PYFunnelDemoOptions.h 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto Y on 9/12/16. 6 | // Copyright © 2016 pluto-y. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "iOS-Echarts.h" 11 | 12 | @interface PYFunnelDemoOptions : NSObject 13 | 14 | + (PYOption *)basicFunnel1Option; 15 | + (PYOption *)multipleFunnel1Option; 16 | + (PYOption *)multipleFunnel2Option; 17 | + (PYOption *)multipleFunnel3Option; 18 | + (PYOption *)basicFunnel2Option; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /DemoOptions/PYGaugesDemoOptions.h: -------------------------------------------------------------------------------- 1 | // 2 | // PYGaugesDemoOptions.h 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto Y on 9/11/16. 6 | // Copyright © 2016 pluto-y. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "iOS-Echarts.h" 11 | 12 | @interface PYGaugesDemoOptions : NSObject 13 | 14 | + (PYOption *)basicAngularGauge1Option; 15 | + (PYOption *)basicAngularGauge2Option; 16 | + (PYOption *)basicAngularGauge3Option; 17 | + (PYOption *)multipleAngularGauges1Option; 18 | + (PYOption *)multipleAngularGauges2Option; 19 | + (PYOption *)basicAngularGauge4Option; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /DemoOptions/PYLineDemoOptions.h: -------------------------------------------------------------------------------- 1 | // 2 | // PYLineDemoOptions.h 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto Y on 9/1/16. 6 | // Copyright © 2016 pluto-y. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "iOS-Echarts.h" 11 | 12 | @interface PYLineDemoOptions : NSObject 13 | 14 | + (PYOption *)standardLineOption; 15 | + (PYOption *)stackedLineOption; 16 | + (PYOption *)basicLineOption; 17 | + (PYOption *)basicAreaOption; 18 | + (PYOption *)stackedAreaOption; 19 | + (PYOption *)irregularLineOption; 20 | + (PYOption *)irregularLine2Option; 21 | + (PYOption *)lineOption; 22 | + (PYOption *)logarithmicOption; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /DemoOptions/PYPieDemoOptions.h: -------------------------------------------------------------------------------- 1 | // 2 | // PYPieDemoOptions.h 3 | // iOS-Echarts 4 | // 5 | // Created by lizhi on 16/9/5. 6 | // Copyright © 2016年 pluto-y. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface PYPieDemoOptions : NSObject 12 | 13 | /** 标准饼图 */ 14 | + (PYOption *)standardPieOption; 15 | /** 标准环形饼图 */ 16 | + (PYOption *)doughnutPieOption; 17 | /** 嵌套饼图 */ 18 | + (PYOption *)nestedPieOption; 19 | /** 南丁格尔玫瑰图 */ 20 | + (PYOption *)nightingalesRoseDiagramPieOption; 21 | /** 环形图2 */ 22 | + (PYOption *)doughnut2PieOption; 23 | /** 环形图3 */ 24 | + (PYOption *)doughnut3PieOption; 25 | /** 时间轴饼图 */ 26 | + (PYOption *)timelinePieOption; 27 | /** 饼图 */ 28 | + (PYOption *)pieDemoOption; 29 | /** 千层饼图 */ 30 | + (PYOption *)multilayerPieOption; 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /DemoOptions/PYScatterDemoOptions.h: -------------------------------------------------------------------------------- 1 | // 2 | // PYScatterDemoOptions.h 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto Y on 9/13/16. 6 | // Copyright © 2016 pluto-y. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "iOS-Echarts.h" 11 | 12 | @interface PYScatterDemoOptions : NSObject 13 | 14 | + (PYOption *)basicScatterOption; 15 | + (PYOption *)basicBubbleOption; 16 | + (PYOption *)largeScaleScatterOption; 17 | + (PYOption *)categoryScatterOption; 18 | + (PYOption *)timeDataOption; 19 | + (PYOption *)timeLineOption; 20 | + (PYOption *)scaleRoamingOption; 21 | + (PYOption *)scatterOption; 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /DemoOptions/PYTreeDemoOptions.h: -------------------------------------------------------------------------------- 1 | // 2 | // PYTreeDemoOptions.h 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto Y on 9/11/16. 6 | // Copyright © 2016 pluto-y. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "iOS-Echarts.h" 11 | 12 | @interface PYTreeDemoOptions : NSObject 13 | 14 | + (PYOption *)tree1Option; 15 | + (PYOption *)tree2Option; 16 | + (PYOption *)tree3Option; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /DemoOptions/PYTreemapDemoOptions.h: -------------------------------------------------------------------------------- 1 | // 2 | // PYTreemapDemoOptions.h 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto Y on 9/9/16. 6 | // Copyright © 2016 pluto-y. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "iOS-Echarts.h" 11 | 12 | @interface PYTreemapDemoOptions : NSObject 13 | 14 | + (PYOption *)treemap1Option; 15 | + (PYOption *)treemap2Option; 16 | + (PYOption *)treemap3Option; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /DemoOptions/PYVennDemoOptions.h: -------------------------------------------------------------------------------- 1 | // 2 | // PYVennDemoOptions.h 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto Y on 9/9/16. 6 | // Copyright © 2016 pluto-y. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "iOS-Echarts.h" 11 | 12 | @interface PYVennDemoOptions : NSObject 13 | 14 | + (PYOption *)vennOption; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /DemoOptions/PYWorldCloudDemoOptions.h: -------------------------------------------------------------------------------- 1 | // 2 | // PYWorldCloudDemoOptions.h 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto Y on 9/8/16. 6 | // Copyright © 2016 pluto-y. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "iOS-Echarts.h" 11 | 12 | @interface PYWorldCloudDemoOptions : NSObject 13 | 14 | + (PYOption *)worldCloudOption; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Doc/Demos.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pluto-Y/iOS-Echarts/ba07942435a550a0a6cd008669d8e6685cfccf97/Doc/Demos.gif -------------------------------------------------------------------------------- /Doc/Demos1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pluto-Y/iOS-Echarts/ba07942435a550a0a6cd008669d8e6685cfccf97/Doc/Demos1.gif -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | This is a custom component for the echarts. 2 | 3 | # iOS- Echarts - 将ECharts封装成iOS控件 4 | 本项目是将百度的ECharts工具封装成对应的iOS的控件,并且将其中javascript的属性封装成对应的对象。方便程序员在编写程序的过程中更加关注OC的代码,避免在使用百度的ECharts工具的过程中过多的关注javascript语法和与javascript之间的交互。 5 | 6 | #Echarts信息 7 | [Echarts Github地址](https://github.com/ecomfe/echarts) 8 | 9 | [Echarts 官网(中文)](http://echarts.baidu.com/index.html) 10 | 11 | [Echarts WebSite(English)](http://echarts.baidu.com/index-en.html) 12 | -------------------------------------------------------------------------------- /iOS-Echarts.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = "iOS-Echarts" 3 | s.version = "1.4.4" 4 | s.summary = "A custom component for the ecomfe's echarts 2." 5 | s.homepage = "https://github.com/Pluto-Y/iOS-Echarts" 6 | s.license = { :type => "MIT", :file => 'LICENSE.md' } 7 | s.author = { "PlutoY" => "kuaileainits@163.com" } 8 | #s.platform = :ios, "7.0" 9 | s.source = { :git => "https://github.com/Pluto-Y/iOS-Echarts.git", :tag => s.version} 10 | s.source_files = "iOS-Echarts/**/*.{h,m}" 11 | s.resource_bundles = { 'iOS-Echarts' => 'iOS-Echarts/Resources/**' } 12 | s.prefix_header_contents = '#import "PYUtilities.h"' 13 | s.requires_arc = true 14 | s.ios.frameworks = 'UIKit' 15 | s.osx.frameworks = 'AppKit', 'WebKit' 16 | 17 | s.ios.deployment_target = '7.0' 18 | s.osx.deployment_target = '10.9' 19 | 20 | end 21 | -------------------------------------------------------------------------------- /iOS-Echarts.xcodeproj/.LSOverride: -------------------------------------------------------------------------------- 1 | /Applications/Xcode.app -------------------------------------------------------------------------------- /iOS-Echarts.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /iOS-Echarts.xcodeproj/project.xcworkspace/xcshareddata/iOS-Echarts.xccheckout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDESourceControlProjectFavoriteDictionaryKey 6 | 7 | IDESourceControlProjectIdentifier 8 | FF88D19D-1C18-4644-B041-D2FBB3556940 9 | IDESourceControlProjectName 10 | project 11 | IDESourceControlProjectOriginsDictionary 12 | 13 | 2D45F86B28BE56E866B445FF58A323D84B99DC01 14 | https://github.com/Pluto-Y/iOS-Echarts.git 15 | 16 | IDESourceControlProjectPath 17 | iOS-Echarts.xcodeproj/project.xcworkspace 18 | IDESourceControlProjectRelativeInstallPathDictionary 19 | 20 | 2D45F86B28BE56E866B445FF58A323D84B99DC01 21 | ../.. 22 | 23 | IDESourceControlProjectURL 24 | https://github.com/Pluto-Y/iOS-Echarts.git 25 | IDESourceControlProjectVersion 26 | 111 27 | IDESourceControlProjectWCCIdentifier 28 | 2D45F86B28BE56E866B445FF58A323D84B99DC01 29 | IDESourceControlProjectWCConfigurations 30 | 31 | 32 | IDESourceControlRepositoryExtensionIdentifierKey 33 | public.vcs.git 34 | IDESourceControlWCCIdentifierKey 35 | 2D45F86B28BE56E866B445FF58A323D84B99DC01 36 | IDESourceControlWCCName 37 | iOS-Echarts 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /iOS-Echarts/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pluto-Y/iOS-Echarts/ba07942435a550a0a6cd008669d8e6685cfccf97/iOS-Echarts/.DS_Store -------------------------------------------------------------------------------- /iOS-Echarts/Categories/NSObject+PYObject.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSObject+PYObject.h 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto Y on 15/9/12. 6 | // Copyright (c) 2015年 pluto-y. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NSObject (PYObject) 12 | 13 | - (void)reloadData; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /iOS-Echarts/Categories/NSObject+PYObject.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSObject+PYObject.m 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto Y on 15/9/12. 6 | // Copyright (c) 2015年 pluto-y. All rights reserved. 7 | // 8 | 9 | #import "NSObject+PYObject.h" 10 | 11 | @implementation NSObject (PYObject) 12 | 13 | - (void)reloadData { 14 | 15 | } 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /iOS-Echarts/Model/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pluto-Y/iOS-Echarts/ba07942435a550a0a6cd008669d8e6685cfccf97/iOS-Echarts/Model/.DS_Store -------------------------------------------------------------------------------- /iOS-Echarts/Model/PYAreaStyle.h: -------------------------------------------------------------------------------- 1 | // 2 | // PYAreaStyle.h 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto Y on 15/9/8. 6 | // Copyright (c) 2015年 pluto-y. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | typedef NSString *PYAreaStyleType; 12 | 13 | FOUNDATION_EXPORT PYAreaStyleType const PYAreaStyleTypeDefault; 14 | 15 | /** 16 | * 17 | * You can goto this website for references: 18 | * http://echarts.baidu.com/echarts2/doc/doc.html#AreaStyle 19 | * 20 | */ 21 | @interface PYAreaStyle : NSObject 22 | 23 | @property (nonatomic, strong) id color; 24 | @property (nonatomic, copy) PYAreaStyleType type; 25 | 26 | PYInitializerTemplate(PYAreaStyle, areaStyle); 27 | 28 | PYPropertyEqualTemplate(PYAreaStyle, id, color); 29 | PYPropertyEqualTemplate(PYAreaStyle, PYAreaStyleType, type); 30 | 31 | @end 32 | 33 | -------------------------------------------------------------------------------- /iOS-Echarts/Model/PYAreaStyle.m: -------------------------------------------------------------------------------- 1 | // 2 | // PYAreaStyle.m 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto Y on 15/9/8. 6 | // Copyright (c) 2015年 pluto-y. All rights reserved. 7 | // 8 | 9 | #import "PYAreaStyle.h" 10 | 11 | PYAreaStyleType const PYAreaStyleTypeDefault = @"default"; 12 | 13 | @implementation PYAreaStyle 14 | 15 | - (instancetype)init 16 | { 17 | self = [super init]; 18 | if (self) { 19 | _type = PYAreaStyleTypeDefault; 20 | } 21 | return self; 22 | } 23 | 24 | - (void)setType:(PYAreaStyleType)type { 25 | if (![type isEqualToString:PYAreaStyleTypeDefault]) { 26 | NSLog(@"ERROR:AreaStyle not support type"); 27 | } 28 | type = PYAreaStyleTypeDefault; 29 | } 30 | 31 | PYInitializerImpTemplate(PYAreaStyle); 32 | 33 | PYPropertyEqualImpTemplate(PYAreaStyle, id, color); 34 | PYPropertyEqualImpTemplate(PYAreaStyle, PYAreaStyleType, type); 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /iOS-Echarts/Model/PYAxisLabel.h: -------------------------------------------------------------------------------- 1 | // 2 | // PYAxisLabel.h 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto Y on 15/9/7. 6 | // Copyright (c) 2015年 pluto-y. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class PYTextStyle; 12 | 13 | /** 14 | * 15 | * You can goto this website for references: 16 | * http://echarts.baidu.com/echarts2/doc/doc.html#AxisAxislabel 17 | * 18 | */ 19 | @interface PYAxisLabel : NSObject 20 | 21 | @property (nonatomic, assign) BOOL show; 22 | @property (nonatomic, strong) id interval; 23 | @property (nonatomic, strong) NSNumber *rotate; 24 | @property (nonatomic, strong) NSNumber *margin; 25 | @property (nonatomic, assign) BOOL clickable; 26 | @property (nonatomic, copy) NSString *formatter; 27 | @property (nonatomic, strong) PYTextStyle *textStyle; 28 | 29 | PYInitializerTemplate(PYAxisLabel, axisLabel); 30 | 31 | PYPropertyEqualTemplate(PYAxisLabel, BOOL, show); 32 | PYPropertyEqualTemplate(PYAxisLabel, id, interval); 33 | PYPropertyEqualTemplate(PYAxisLabel, NSNumber *, rotate); 34 | PYPropertyEqualTemplate(PYAxisLabel, NSNumber *, margin); 35 | PYPropertyEqualTemplate(PYAxisLabel, BOOL, clickable); 36 | PYPropertyEqualTemplate(PYAxisLabel, NSString *, formatter); 37 | PYPropertyEqualTemplate(PYAxisLabel, PYTextStyle *, textStyle); 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /iOS-Echarts/Model/PYAxisLabel.m: -------------------------------------------------------------------------------- 1 | // 2 | // PYAxisLabel.m 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto Y on 15/9/7. 6 | // Copyright (c) 2015年 pluto-y. All rights reserved. 7 | // 8 | 9 | #import "PYAxisLabel.h" 10 | #import "PYTextStyle.h" 11 | 12 | @implementation PYAxisLabel 13 | 14 | - (instancetype)init { 15 | self = [super init]; 16 | if (self) { 17 | _show = YES; 18 | _interval = PYIntervalAuto; 19 | _rotate = @0; 20 | _margin = @8; 21 | _clickable = false; 22 | } 23 | return self; 24 | } 25 | 26 | PYInitializerImpTemplate(PYAxisLabel); 27 | 28 | PYPropertyEqualImpTemplate(PYAxisLabel, BOOL, show); 29 | PYPropertyEqualImpTemplate(PYAxisLabel, id, interval); 30 | PYPropertyEqualImpTemplate(PYAxisLabel, NSNumber *, rotate); 31 | PYPropertyEqualImpTemplate(PYAxisLabel, NSNumber *, margin); 32 | PYPropertyEqualImpTemplate(PYAxisLabel, BOOL, clickable); 33 | PYPropertyEqualImpTemplate(PYAxisLabel, NSString *, formatter); 34 | PYPropertyEqualImpTemplate(PYAxisLabel, PYTextStyle *, textStyle); 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /iOS-Echarts/Model/PYAxisLine.h: -------------------------------------------------------------------------------- 1 | // 2 | // PYAxisLine.h 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto Y on 15/9/7. 6 | // Copyright (c) 2015年 pluto-y. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class PYLineStyle; 12 | 13 | /** 14 | * 15 | * You can goto this website for references: 16 | * http://echarts.baidu.com/echarts2/doc/doc.html#AxisAxisline 17 | * 18 | */ 19 | @interface PYAxisLine : NSObject 20 | 21 | @property (nonatomic, assign) BOOL show; 22 | @property (nonatomic, assign) BOOL onZero; 23 | @property (nonatomic, strong) PYLineStyle *lineStyle; 24 | 25 | PYInitializerTemplate(PYAxisLine, axisLine); 26 | 27 | PYPropertyEqualTemplate(PYAxisLine, BOOL, show); 28 | PYPropertyEqualTemplate(PYAxisLine, BOOL, onZero); 29 | PYPropertyEqualTemplate(PYAxisLine, PYLineStyle *, lineStyle); 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /iOS-Echarts/Model/PYAxisLine.m: -------------------------------------------------------------------------------- 1 | // 2 | // PYAxisLine.m 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto Y on 15/9/7. 6 | // Copyright (c) 2015年 pluto-y. All rights reserved. 7 | // 8 | 9 | #import "PYAxisLine.h" 10 | #import "PYLineStyle.h" 11 | 12 | @implementation PYAxisLine 13 | 14 | - (instancetype)init { 15 | self = [super init]; 16 | if (self) { 17 | _show = YES; 18 | _onZero = YES; 19 | _lineStyle = [[PYLineStyle alloc] init]; 20 | } 21 | return self; 22 | } 23 | 24 | PYInitializerImpTemplate(PYAxisLine); 25 | 26 | PYPropertyEqualImpTemplate(PYAxisLine, BOOL, show); 27 | PYPropertyEqualImpTemplate(PYAxisLine, BOOL, onZero); 28 | PYPropertyEqualImpTemplate(PYAxisLine, PYLineStyle *, lineStyle); 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /iOS-Echarts/Model/PYAxisPointer.h: -------------------------------------------------------------------------------- 1 | // 2 | // PYAxisPointer.h 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto-Y on 15/9/15. 6 | // Copyright (c) 2015年 pluto-y. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class PYLineStyle, PYAreaStyle; 12 | 13 | typedef NSString * PYAxisPointerType; 14 | 15 | FOUNDATION_EXPORT PYAxisPointerType PYAxisPointerTypeLine; 16 | FOUNDATION_EXPORT PYAxisPointerType PYAxisPointerTypeCross; 17 | FOUNDATION_EXPORT PYAxisPointerType PYAxisPointerTypeShadow; 18 | FOUNDATION_EXPORT PYAxisPointerType PYAxisPointerTypeNone; 19 | 20 | /** 21 | * 22 | * You can goto this website for references: 23 | * http://echarts.baidu.com/echarts2/doc/doc.html#AxisAxisline 24 | * 25 | */ 26 | @interface PYAxisPointer : NSObject 27 | 28 | @property (nonatomic, assign) BOOL show; 29 | @property (nonatomic, copy) NSString *type; 30 | @property (nonatomic, strong) PYLineStyle *lineStyle; 31 | @property (nonatomic, strong) PYLineStyle *crossStyle; 32 | @property (nonatomic, strong) PYAreaStyle *shadowStyle; 33 | 34 | PYInitializerTemplate(PYAxisPointer, axisPoint); 35 | 36 | PYPropertyEqualTemplate(PYAxisPointer, BOOL, show); 37 | PYPropertyEqualTemplate(PYAxisPointer, NSString *, type); 38 | PYPropertyEqualTemplate(PYAxisPointer, PYLineStyle *, lineStyle); 39 | PYPropertyEqualTemplate(PYAxisPointer, PYLineStyle *, crossStyle); 40 | PYPropertyEqualTemplate(PYAxisPointer, PYAreaStyle *, shadowStyle); 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /iOS-Echarts/Model/PYAxisPointer.m: -------------------------------------------------------------------------------- 1 | // 2 | // PYAxisPointer.m 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto-Y on 15/9/15. 6 | // Copyright (c) 2015年 pluto-y. All rights reserved. 7 | // 8 | 9 | #import "PYAxisPointer.h" 10 | #import "PYLineStyle.h" 11 | #import "PYAreaStyle.h" 12 | 13 | PYAxisPointerType PYAxisPointerTypeLine = @"line"; 14 | PYAxisPointerType PYAxisPointerTypeCross = @"cross"; 15 | PYAxisPointerType PYAxisPointerTypeShadow = @"shadow"; 16 | PYAxisPointerType PYAxisPointerTypeNone = @"none"; 17 | 18 | static NSArray *axisPointScope; 19 | @interface PYAxisPointer() 20 | 21 | @end 22 | 23 | 24 | @implementation PYAxisPointer 25 | 26 | + (void)initialize 27 | { 28 | if (self == [PYAxisPointer class]) { 29 | axisPointScope = @[PYAxisPointerTypeLine, PYAxisPointerTypeCross, PYAxisPointerTypeShadow, PYAxisPointerTypeNone]; 30 | } 31 | } 32 | 33 | - (instancetype)init 34 | { 35 | self = [super init]; 36 | if (self) { 37 | _type = PYAxisPointerTypeLine; 38 | } 39 | return self; 40 | } 41 | 42 | - (void)setType:(NSString *)type { 43 | if (![axisPointScope containsObject:type]) { 44 | NSLog(@"ERROR: AxisPoint does not support the type --- %@", type); 45 | _type = PYAxisPointerTypeLine; 46 | return; 47 | } 48 | _type = [type copy]; 49 | } 50 | 51 | PYInitializerImpTemplate(PYAxisPointer); 52 | 53 | PYPropertyEqualImpTemplate(PYAxisPointer, BOOL, show); 54 | PYPropertyEqualImpTemplate(PYAxisPointer, NSString *, type); 55 | PYPropertyEqualImpTemplate(PYAxisPointer, PYLineStyle *, lineStyle); 56 | PYPropertyEqualImpTemplate(PYAxisPointer, PYLineStyle *, crossStyle); 57 | PYPropertyEqualImpTemplate(PYAxisPointer, PYAreaStyle *, shadowStyle); 58 | 59 | @end 60 | -------------------------------------------------------------------------------- /iOS-Echarts/Model/PYAxisSplitLine.h: -------------------------------------------------------------------------------- 1 | // 2 | // PYSplitLine.h 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto Y on 15/9/8. 6 | // Copyright (c) 2015年 pluto-y. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class PYLineStyle; 12 | 13 | /** 14 | * 15 | * You can goto this website for references: 16 | * http://echarts.baidu.com/echarts2/doc/doc.html#AxisSplitline 17 | * 18 | */ 19 | @interface PYAxisSplitLine : NSObject 20 | 21 | @property (nonatomic, assign) BOOL show; 22 | @property (nonatomic, assign) BOOL onGap; 23 | @property (nonatomic, strong) PYLineStyle *lineStyle; 24 | 25 | PYInitializerTemplate(PYAxisSplitLine, splitLine); 26 | 27 | PYPropertyEqualTemplate(PYAxisSplitLine, BOOL, show); 28 | PYPropertyEqualTemplate(PYAxisSplitLine, BOOL, onGap); 29 | PYPropertyEqualTemplate(PYAxisSplitLine, PYLineStyle *, lineStyle); 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /iOS-Echarts/Model/PYAxisSplitLine.m: -------------------------------------------------------------------------------- 1 | // 2 | // PYSplitLine.m 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto Y on 15/9/8. 6 | // Copyright (c) 2015年 pluto-y. All rights reserved. 7 | // 8 | 9 | #import "PYAxisSplitLine.h" 10 | #import "PYLineStyle.h" 11 | 12 | @implementation PYAxisSplitLine 13 | 14 | - (instancetype)init 15 | { 16 | self = [super init]; 17 | if (self) { 18 | _show = YES; 19 | _onGap = NO; 20 | _lineStyle = [[PYLineStyle alloc] init]; 21 | } 22 | return self; 23 | } 24 | 25 | PYInitializerImpTemplate(PYAxisSplitLine); 26 | 27 | PYPropertyEqualImpTemplate(PYAxisSplitLine, BOOL, show); 28 | PYPropertyEqualImpTemplate(PYAxisSplitLine, BOOL, onGap); 29 | PYPropertyEqualImpTemplate(PYAxisSplitLine, PYLineStyle *, lineStyle); 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /iOS-Echarts/Model/PYAxisTick.h: -------------------------------------------------------------------------------- 1 | // 2 | // PYAxisTick.h 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto-Y on 15/10/28. 6 | // Copyright © 2015年 pluto-y. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "PYLineStyle.h" 11 | 12 | /** 13 | * 14 | * You can goto this website for references: 15 | * http://echarts.baidu.com/echarts2/doc/doc.html#AxisAxistick 16 | * 17 | */ 18 | @interface PYAxisTick : NSObject 19 | 20 | @property (nonatomic, assign) BOOL show; 21 | @property (nonatomic, strong) id interval; 22 | @property (nonatomic, strong) NSNumber *splitNumber; 23 | @property (nonatomic, assign) BOOL onGap; 24 | @property (nonatomic, assign) BOOL inside; 25 | @property (nonatomic, strong) NSNumber *length; 26 | @property (nonatomic, strong) PYLineStyle *lineStyle; 27 | 28 | PYInitializerTemplate(PYAxisTick, axisTick); 29 | 30 | PYPropertyEqualTemplate(PYAxisTick, BOOL, show); 31 | PYPropertyEqualTemplate(PYAxisTick, id, interval); 32 | PYPropertyEqualTemplate(PYAxisTick, NSNumber *, splitNumber); 33 | PYPropertyEqualTemplate(PYAxisTick, BOOL, onGap); 34 | PYPropertyEqualTemplate(PYAxisTick, BOOL, inside); 35 | PYPropertyEqualTemplate(PYAxisTick, NSNumber *, length); 36 | PYPropertyEqualTemplate(PYAxisTick, PYLineStyle *, lineStyle); 37 | 38 | @end 39 | -------------------------------------------------------------------------------- /iOS-Echarts/Model/PYAxisTick.m: -------------------------------------------------------------------------------- 1 | // 2 | // PYAxisTick.m 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto-Y on 15/10/28. 6 | // Copyright © 2015年 pluto-y. All rights reserved. 7 | // 8 | 9 | #import "PYAxisTick.h" 10 | #import "PYColor.h" 11 | 12 | @implementation PYAxisTick 13 | 14 | - (instancetype)init 15 | { 16 | self = [super init]; 17 | if (self) { 18 | _interval = PYIntervalAuto; 19 | _onGap = NO; 20 | _inside = NO; 21 | _length = @(5); 22 | _lineStyle = [PYLineStyle new]; 23 | _lineStyle.color = PYRGBA(3, 3, 3, 1); 24 | _lineStyle.width = @(1); 25 | } 26 | return self; 27 | } 28 | 29 | PYInitializerImpTemplate(PYAxisTick); 30 | 31 | PYPropertyEqualImpTemplate(PYAxisTick, BOOL, show); 32 | PYPropertyEqualImpTemplate(PYAxisTick, id, interval); 33 | PYPropertyEqualImpTemplate(PYAxisTick, NSNumber *, splitNumber); 34 | PYPropertyEqualImpTemplate(PYAxisTick, BOOL, onGap); 35 | PYPropertyEqualImpTemplate(PYAxisTick, BOOL, inside); 36 | PYPropertyEqualImpTemplate(PYAxisTick, NSNumber *, length); 37 | PYPropertyEqualImpTemplate(PYAxisTick, PYLineStyle *, lineStyle); 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /iOS-Echarts/Model/PYCategories.h: -------------------------------------------------------------------------------- 1 | // 2 | // PYCategries.h 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto Y on 7/22/16. 6 | // Copyright © 2016 pluto-y. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "PYItemStyle.h" 11 | 12 | /** 13 | * 14 | * You can goto this website for references: 15 | * http://echarts.baidu.com/echarts2/doc/doc.html#categories 16 | * 17 | */ 18 | @interface PYCategories : NSObject 19 | 20 | @property (nonatomic, copy) NSString *name; 21 | @property (nonatomic, copy) PYSymbol symbol; 22 | @property (nonatomic, strong) id symbolSize; 23 | @property (nonatomic, strong) PYItemStyle *itemStyle; 24 | 25 | PYInitializerTemplate(PYCategories, categories); 26 | 27 | PYPropertyEqualTemplate(PYCategories, NSString *, name); 28 | PYPropertyEqualTemplate(PYCategories, PYSymbol, symbol); 29 | PYPropertyEqualTemplate(PYCategories, id, symbolSize); 30 | PYPropertyEqualTemplate(PYCategories, PYItemStyle *, itemStyle); 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /iOS-Echarts/Model/PYCategories.m: -------------------------------------------------------------------------------- 1 | // 2 | // PYCategries.m 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto Y on 7/22/16. 6 | // Copyright © 2016 pluto-y. All rights reserved. 7 | // 8 | 9 | #import "PYCategories.h" 10 | 11 | @implementation PYCategories 12 | 13 | - (instancetype)init 14 | { 15 | self = [super init]; 16 | if (self) { 17 | _symbol = PYSymbolCircle; 18 | } 19 | return self; 20 | } 21 | 22 | PYInitializerImpTemplate(PYCategories); 23 | 24 | PYPropertyEqualImpTemplate(PYCategories, NSString *, name); 25 | PYPropertyEqualImpTemplate(PYCategories, PYSymbol, symbol); 26 | PYPropertyEqualImpTemplate(PYCategories, id, symbolSize); 27 | PYPropertyEqualImpTemplate(PYCategories, PYItemStyle *, itemStyle); 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /iOS-Echarts/Model/PYChordStyle.h: -------------------------------------------------------------------------------- 1 | // 2 | // PYChordStyle.h 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto Y on 8/7/16. 6 | // Copyright © 2016 pluto-y. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class PYColor; 12 | 13 | /** 14 | * 15 | * You can goto this website for references: 16 | * http://echarts.baidu.com/echarts2/doc/doc.html#ChordStyle 17 | * 18 | */ 19 | @interface PYChordStyle : NSObject 20 | 21 | @property (nonatomic, strong) NSNumber *width; 22 | @property (nonatomic, strong) PYColor *color; 23 | @property (nonatomic, copy) NSString *borderWidth; 24 | @property (nonatomic, copy) PYColor *borderColor; 25 | 26 | PYInitializerTemplate(PYChordStyle, chordStyle); 27 | 28 | PYPropertyEqualTemplate(PYChordStyle, NSNumber *, width); 29 | PYPropertyEqualTemplate(PYChordStyle, PYColor *, color); 30 | PYPropertyEqualTemplate(PYChordStyle, NSString *, borderWidth); 31 | PYPropertyEqualTemplate(PYChordStyle, PYColor *, borderColor); 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /iOS-Echarts/Model/PYChordStyle.m: -------------------------------------------------------------------------------- 1 | // 2 | // PYChordStyle.m 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto Y on 8/7/16. 6 | // Copyright © 2016 pluto-y. All rights reserved. 7 | // 8 | 9 | #import "PYChordStyle.h" 10 | 11 | @implementation PYChordStyle 12 | 13 | PYInitializerImpTemplate(PYChordStyle); 14 | 15 | PYPropertyEqualImpTemplate(PYChordStyle, NSNumber *, width); 16 | PYPropertyEqualImpTemplate(PYChordStyle, PYColor *, color); 17 | PYPropertyEqualImpTemplate(PYChordStyle, NSString *, borderWidth); 18 | PYPropertyEqualImpTemplate(PYChordStyle, PYColor *, borderColor); 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /iOS-Echarts/Model/PYColor.h: -------------------------------------------------------------------------------- 1 | // 2 | // PYColor.h 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto Y on 15/9/8. 6 | // Copyright (c) 2015年 pluto-y. All rights reserved. 7 | // 8 | 9 | #define PYRGBA(r, g, b, a) [[PYColor alloc] initWithColor:[PY_COLOR colorWithRed:r/255.0 green:g/255.0 blue:b/255.0 alpha:a]] 10 | 11 | /** 12 | * 转换UIColor为对应的RGBA的输出 13 | */ 14 | @interface PYColor : NSObject 15 | 16 | - (instancetype)initWithColor:(PY_COLOR *) pyColor; 17 | 18 | + (PYColor *)colorWithHexString:(NSString *)hexString; 19 | 20 | /** 21 | * 设置颜色 22 | * 23 | * @param uiColor 颜色 24 | */ 25 | - (void)setColor:(PY_COLOR *) pyColor; 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /iOS-Echarts/Model/PYDataRange.m: -------------------------------------------------------------------------------- 1 | // 2 | // PYDataRange.m 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto-Y on 15/11/23. 6 | // Copyright © 2015年 pluto-y. All rights reserved. 7 | // 8 | 9 | #import "PYDataRange.h" 10 | #import "PYColor.h" 11 | #import "PYTextStyle.h" 12 | 13 | @implementation PYDataRange 14 | 15 | - (instancetype)init 16 | { 17 | self = [super init]; 18 | if (self) { 19 | _show = true; 20 | } 21 | return self; 22 | } 23 | 24 | PYInitializerImpTemplate(PYDataRange); 25 | 26 | PYPropertyEqualImpTemplate(PYDataRange, BOOL, show); 27 | PYPropertyEqualImpTemplate(PYDataRange, NSNumber *, zlevel); 28 | PYPropertyEqualImpTemplate(PYDataRange, NSNumber *, z); 29 | PYPropertyEqualImpTemplate(PYDataRange, PYOrient, orient); 30 | PYPropertyEqualImpTemplate(PYDataRange, id, x); 31 | PYPropertyEqualImpTemplate(PYDataRange, id, y); 32 | PYPropertyEqualImpTemplate(PYDataRange, PYColor *, backgroundColor); 33 | PYPropertyEqualImpTemplate(PYDataRange, PYColor *, borderColor); 34 | PYPropertyEqualImpTemplate(PYDataRange, NSNumber *, borderWidth); 35 | PYPropertyEqualImpTemplate(PYDataRange, id, padding); 36 | PYPropertyEqualImpTemplate(PYDataRange, NSNumber *, itemGap); 37 | PYPropertyEqualImpTemplate(PYDataRange, NSNumber *, itemWidth); 38 | PYPropertyEqualImpTemplate(PYDataRange, NSNumber *, itemHeight); 39 | PYPropertyEqualImpTemplate(PYDataRange, NSNumber *, min); 40 | PYPropertyEqualImpTemplate(PYDataRange, NSNumber *, max); 41 | PYPropertyEqualImpTemplate(PYDataRange, NSNumber *, precision); 42 | PYPropertyEqualImpTemplate(PYDataRange, NSNumber *, splitNumber); 43 | PYPropertyEqualImpTemplate(PYDataRange, NSMutableArray *, splitList); 44 | PYPropertyEqualImpTemplate(PYDataRange, NSObject *, range); 45 | PYPropertyEqualImpTemplate(PYDataRange, id, selectedMode); 46 | PYPropertyEqualImpTemplate(PYDataRange, BOOL, calculable); 47 | PYPropertyEqualImpTemplate(PYDataRange, BOOL, hoverLink); 48 | PYPropertyEqualImpTemplate(PYDataRange, BOOL, realtime); 49 | PYPropertyEqualImpTemplate(PYDataRange, NSMutableArray *, color); 50 | PYPropertyEqualImpTemplate(PYDataRange, id, formatter); 51 | PYPropertyEqualImpTemplate(PYDataRange, NSMutableArray *, text); 52 | PYPropertyEqualImpTemplate(PYDataRange, PYTextStyle *, textStyle); 53 | 54 | @end 55 | -------------------------------------------------------------------------------- /iOS-Echarts/Model/PYDataZoom.h: -------------------------------------------------------------------------------- 1 | // 2 | // PYDataZoom.h 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto-Y on 15/9/23. 6 | // Copyright © 2015年 pluto-y. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class PYColor; 12 | 13 | /** 14 | * 15 | * You can goto this website for references: 16 | * http://echarts.baidu.com/echarts2/doc/doc.html#DataZoom 17 | * 18 | */ 19 | @interface PYDataZoom : NSObject 20 | 21 | @property (nonatomic, strong) NSNumber *zlevel; 22 | @property (nonatomic, strong) NSNumber *z; 23 | @property (nonatomic, assign) BOOL show; 24 | @property (nonatomic, copy) PYOrient orient; 25 | @property (nonatomic, strong) NSNumber *x; 26 | @property (nonatomic, strong) NSNumber *y; 27 | @property (nonatomic, strong) NSNumber *width; 28 | @property (nonatomic, strong) NSNumber *height; 29 | @property (nonatomic, strong) PYColor *backgroundColor; 30 | @property (nonatomic, strong) PYColor *dataBackgroundColor; 31 | @property (nonatomic, strong) PYColor *fillerColor; 32 | @property (nonatomic, strong) PYColor *handleColor; 33 | @property (nonatomic, strong) NSNumber *handleSize; 34 | @property (nonatomic, strong) id xAxisIndex; 35 | @property (nonatomic, strong) id yAxisIndex; 36 | @property (nonatomic, strong) NSNumber *start; 37 | @property (nonatomic, strong) NSNumber *end; 38 | @property (nonatomic, assign) BOOL showDetail; 39 | @property (nonatomic, assign) BOOL realtime; 40 | @property (nonatomic, assign) BOOL zoomLock; 41 | 42 | PYInitializerTemplate(PYDataZoom, dataZoom); 43 | 44 | PYPropertyEqualTemplate(PYDataZoom, NSNumber *, zlevel); 45 | PYPropertyEqualTemplate(PYDataZoom, NSNumber *, z); 46 | PYPropertyEqualTemplate(PYDataZoom, BOOL, show); 47 | PYPropertyEqualTemplate(PYDataZoom, PYOrient, orient); 48 | PYPropertyEqualTemplate(PYDataZoom, NSNumber *, x); 49 | PYPropertyEqualTemplate(PYDataZoom, NSNumber *, y); 50 | PYPropertyEqualTemplate(PYDataZoom, NSNumber *, width); 51 | PYPropertyEqualTemplate(PYDataZoom, NSNumber *, height); 52 | PYPropertyEqualTemplate(PYDataZoom, PYColor *, backgroundColor); 53 | PYPropertyEqualTemplate(PYDataZoom, PYColor *, dataBackgroundColor); 54 | PYPropertyEqualTemplate(PYDataZoom, PYColor *, fillerColor); 55 | PYPropertyEqualTemplate(PYDataZoom, PYColor *, handleColor); 56 | PYPropertyEqualTemplate(PYDataZoom, NSNumber *, handleSize); 57 | PYPropertyEqualTemplate(PYDataZoom, id, xAxisIndex); 58 | PYPropertyEqualTemplate(PYDataZoom, id, yAxisIndex); 59 | PYPropertyEqualTemplate(PYDataZoom, NSNumber *, start); 60 | PYPropertyEqualTemplate(PYDataZoom, NSNumber *, end); 61 | PYPropertyEqualTemplate(PYDataZoom, BOOL, showDetail); 62 | PYPropertyEqualTemplate(PYDataZoom, BOOL, realtime); 63 | PYPropertyEqualTemplate(PYDataZoom, BOOL, zoomLock); 64 | 65 | @end 66 | -------------------------------------------------------------------------------- /iOS-Echarts/Model/PYDataZoom.m: -------------------------------------------------------------------------------- 1 | // 2 | // PYDataZoom.m 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto-Y on 15/9/23. 6 | // Copyright © 2015年 pluto-y. All rights reserved. 7 | // 8 | 9 | #import "PYDataZoom.h" 10 | #import "PYColor.h" 11 | 12 | @implementation PYDataZoom 13 | 14 | - (instancetype)init 15 | { 16 | self = [super init]; 17 | if (self) { 18 | _zlevel = @(0); 19 | _z = @(4); 20 | _show = NO; 21 | _orient = PYOrientHorizontal; 22 | _backgroundColor = PYRGBA(0, 0, 0, 0); 23 | _dataBackgroundColor = PYRGBA(14, 14, 14, 1); 24 | _fillerColor = PYRGBA(144, 197, 237, .2); 25 | _handleColor = PYRGBA(70, 130, 180, .8); 26 | _handleSize = @(8); 27 | _start = @(0); 28 | _end = @(100); 29 | _showDetail = YES; 30 | _realtime = NO; 31 | _zoomLock = NO; 32 | } 33 | return self; 34 | } 35 | 36 | PYInitializerImpTemplate(PYDataZoom); 37 | 38 | PYPropertyEqualImpTemplate(PYDataZoom, NSNumber *, zlevel); 39 | PYPropertyEqualImpTemplate(PYDataZoom, NSNumber *, z); 40 | PYPropertyEqualImpTemplate(PYDataZoom, BOOL, show); 41 | PYPropertyEqualImpTemplate(PYDataZoom, PYOrient, orient); 42 | PYPropertyEqualImpTemplate(PYDataZoom, NSNumber *, x); 43 | PYPropertyEqualImpTemplate(PYDataZoom, NSNumber *, y); 44 | PYPropertyEqualImpTemplate(PYDataZoom, NSNumber *, width); 45 | PYPropertyEqualImpTemplate(PYDataZoom, NSNumber *, height); 46 | PYPropertyEqualImpTemplate(PYDataZoom, PYColor *, backgroundColor); 47 | PYPropertyEqualImpTemplate(PYDataZoom, PYColor *, dataBackgroundColor); 48 | PYPropertyEqualImpTemplate(PYDataZoom, PYColor *, fillerColor); 49 | PYPropertyEqualImpTemplate(PYDataZoom, PYColor *, handleColor); 50 | PYPropertyEqualImpTemplate(PYDataZoom, NSNumber *, handleSize); 51 | PYPropertyEqualImpTemplate(PYDataZoom, id, xAxisIndex); 52 | PYPropertyEqualImpTemplate(PYDataZoom, id, yAxisIndex); 53 | PYPropertyEqualImpTemplate(PYDataZoom, NSNumber *, start); 54 | PYPropertyEqualImpTemplate(PYDataZoom, NSNumber *, end); 55 | PYPropertyEqualImpTemplate(PYDataZoom, BOOL, showDetail); 56 | PYPropertyEqualImpTemplate(PYDataZoom, BOOL, realtime); 57 | PYPropertyEqualImpTemplate(PYDataZoom, BOOL, zoomLock); 58 | 59 | @end 60 | -------------------------------------------------------------------------------- /iOS-Echarts/Model/PYGrid.h: -------------------------------------------------------------------------------- 1 | // 2 | // PYGrid.h 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto-Y on 15/9/23. 6 | // Copyright © 2015年 pluto-y. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class PYColor; 12 | 13 | /** 14 | * 15 | * You can goto this website for references: 16 | * http://echarts.baidu.com/echarts2/doc/doc.html#Grid 17 | * 18 | */ 19 | @interface PYGrid : NSObject 20 | 21 | @property (nonatomic, strong) NSNumber *zlevel; 22 | @property (nonatomic, strong) NSNumber *z; 23 | @property (nonatomic, strong) id x; 24 | @property (nonatomic, strong) id y; 25 | @property (nonatomic, strong) id x2; 26 | @property (nonatomic, strong) id y2; 27 | @property (nonatomic, strong) NSNumber *width; 28 | @property (nonatomic, strong) NSNumber *height; 29 | @property (nonatomic, strong) PYColor *backgroundColor; 30 | @property (nonatomic, strong) NSNumber *borderWidth; 31 | @property (nonatomic, strong) PYColor *borderColor; 32 | 33 | PYInitializerTemplate(PYGrid, grid); 34 | 35 | PYPropertyEqualTemplate(PYGrid, NSNumber *, zlevel); 36 | PYPropertyEqualTemplate(PYGrid, NSNumber *, z); 37 | PYPropertyEqualTemplate(PYGrid, id, x); 38 | PYPropertyEqualTemplate(PYGrid, id, y); 39 | PYPropertyEqualTemplate(PYGrid, id, x2); 40 | PYPropertyEqualTemplate(PYGrid, id, y2); 41 | PYPropertyEqualTemplate(PYGrid, NSNumber *, width); 42 | PYPropertyEqualTemplate(PYGrid, NSNumber *, height); 43 | PYPropertyEqualTemplate(PYGrid, PYColor *, backgroundColor); 44 | PYPropertyEqualTemplate(PYGrid, NSNumber *, borderWidth); 45 | PYPropertyEqualTemplate(PYGrid, PYColor *, borderColor); 46 | 47 | @end 48 | -------------------------------------------------------------------------------- /iOS-Echarts/Model/PYGrid.m: -------------------------------------------------------------------------------- 1 | // 2 | // PYGrid.m 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto-Y on 15/9/23. 6 | // Copyright © 2015年 pluto-y. All rights reserved. 7 | // 8 | 9 | #import "PYGrid.h" 10 | #import "PYColor.h" 11 | 12 | @implementation PYGrid 13 | 14 | - (instancetype)init 15 | { 16 | self = [super init]; 17 | if (self) { 18 | _zlevel = @(0); 19 | _z = @(0); 20 | // _x = @(0); 21 | // _y = @(0); 22 | // _x2 = @(0); 23 | // _y2 = @(0); 24 | _backgroundColor = PYRGBA(0, 0, 0, 0); 25 | _borderWidth = @(1); 26 | _borderColor = PYRGBA(12, 12, 12, 1); 27 | } 28 | return self; 29 | } 30 | 31 | PYInitializerImpTemplate(PYGrid); 32 | 33 | PYPropertyEqualImpTemplate(PYGrid, NSNumber *, zlevel); 34 | PYPropertyEqualImpTemplate(PYGrid, NSNumber *, z); 35 | PYPropertyEqualImpTemplate(PYGrid, id, x); 36 | PYPropertyEqualImpTemplate(PYGrid, id, y); 37 | PYPropertyEqualImpTemplate(PYGrid, id, x2); 38 | PYPropertyEqualImpTemplate(PYGrid, id, y2); 39 | PYPropertyEqualImpTemplate(PYGrid, NSNumber *, width); 40 | PYPropertyEqualImpTemplate(PYGrid, NSNumber *, height); 41 | PYPropertyEqualImpTemplate(PYGrid, PYColor *, backgroundColor); 42 | PYPropertyEqualImpTemplate(PYGrid, NSNumber *, borderWidth); 43 | PYPropertyEqualImpTemplate(PYGrid, PYColor *, borderColor); 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /iOS-Echarts/Model/PYItemStyle.h: -------------------------------------------------------------------------------- 1 | // 2 | // PYItemStyle.h 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto Y on 15/9/8. 6 | // Copyright (c) 2015年 pluto-y. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class PYItemStyleProp; 12 | 13 | @interface PYItemStyle : NSObject 14 | 15 | @property (nonatomic, strong) PYItemStyleProp *normal; 16 | @property (nonatomic, strong) PYItemStyleProp *emphasis; 17 | 18 | PYInitializerTemplate(PYItemStyle, itemStyle); 19 | 20 | PYPropertyEqualTemplate(PYItemStyle, PYItemStyleProp *, normal); 21 | PYPropertyEqualTemplate(PYItemStyle, PYItemStyleProp *, emphasis); 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /iOS-Echarts/Model/PYItemStyle.m: -------------------------------------------------------------------------------- 1 | // 2 | // PYItemStyle.m 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto Y on 15/9/8. 6 | // Copyright (c) 2015年 pluto-y. All rights reserved. 7 | // 8 | 9 | #import "PYItemStyle.h" 10 | #import "PYItemStyleProp.h" 11 | 12 | @implementation PYItemStyle 13 | 14 | - (instancetype)init 15 | { 16 | self = [super init]; 17 | if (self) { 18 | _normal = [[PYItemStyleProp alloc] init]; 19 | _emphasis = [[PYItemStyleProp alloc] init]; 20 | } 21 | return self; 22 | } 23 | 24 | PYInitializerImpTemplate(PYItemStyle); 25 | 26 | PYPropertyEqualImpTemplate(PYItemStyle, PYItemStyleProp *, normal); 27 | PYPropertyEqualImpTemplate(PYItemStyle, PYItemStyleProp *, emphasis); 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /iOS-Echarts/Model/PYLegend.h: -------------------------------------------------------------------------------- 1 | // 2 | // PYLegend.h 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto Y on 15/9/8. 6 | // Copyright (c) 2015年 pluto-y. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "PYTextStyle.h" 11 | 12 | /** 13 | * 14 | * You can goto this website for references: 15 | * http://echarts.baidu.com/echarts2/doc/doc.html#Legend 16 | * 17 | */ 18 | @interface PYLegend : NSObject 19 | 20 | @property (nonatomic, assign) BOOL show; 21 | @property (nonatomic, strong) NSNumber *zlevel; 22 | @property (nonatomic, strong) NSNumber *z; 23 | @property (nonatomic, copy) PYOrient orient; 24 | @property (nonatomic, strong) id x; 25 | @property (nonatomic, strong) id y; 26 | @property (nonatomic, strong) PYColor *backgroundColor; 27 | @property (nonatomic, copy) NSString *borderColor; 28 | @property (nonatomic, strong) NSNumber *borderWidth; 29 | @property (nonatomic, strong) id padding; 30 | @property (nonatomic, strong) NSNumber *itemGap; 31 | @property (nonatomic, strong) NSNumber *itemWidth; 32 | @property (nonatomic, strong) NSNumber *itemHeight; 33 | @property (nonatomic, strong) PYTextStyle *textStyle; 34 | @property (nonatomic, strong) id formatter; 35 | @property (nonatomic, strong) id selectedMode; 36 | @property (nonatomic, copy) NSDictionary *selected; 37 | @property (nonatomic, copy) NSArray *data; 38 | 39 | PYInitializerTemplate(PYLegend, legend); 40 | 41 | PYPropertyEqualTemplate(PYLegend, BOOL, show); 42 | PYPropertyEqualTemplate(PYLegend, NSNumber *, zlevel); 43 | PYPropertyEqualTemplate(PYLegend, NSNumber *, z); 44 | PYPropertyEqualTemplate(PYLegend, PYOrient, orient); 45 | PYPropertyEqualTemplate(PYLegend, id, x); 46 | PYPropertyEqualTemplate(PYLegend, id, y); 47 | PYPropertyEqualTemplate(PYLegend, PYColor *, backgroundColor); 48 | PYPropertyEqualTemplate(PYLegend, NSString *, borderColor); 49 | PYPropertyEqualTemplate(PYLegend, NSNumber *, borderWidth); 50 | PYPropertyEqualTemplate(PYLegend, id, padding); 51 | PYPropertyEqualTemplate(PYLegend, NSNumber *, itemGap); 52 | PYPropertyEqualTemplate(PYLegend, NSNumber *, itemWidth); 53 | PYPropertyEqualTemplate(PYLegend, NSNumber *, itemHeight); 54 | PYPropertyEqualTemplate(PYLegend, PYTextStyle *, textStyle); 55 | PYPropertyEqualTemplate(PYLegend, id, formatter); 56 | PYPropertyEqualTemplate(PYLegend, id, selectedMode); 57 | PYPropertyEqualTemplate(PYLegend, NSDictionary *, selected); 58 | PYPropertyEqualTemplate(PYLegend, NSArray *, data); 59 | 60 | @end 61 | -------------------------------------------------------------------------------- /iOS-Echarts/Model/PYLegend.m: -------------------------------------------------------------------------------- 1 | // 2 | // PYLegend.m 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto Y on 15/9/8. 6 | // Copyright (c) 2015年 pluto-y. All rights reserved. 7 | // 8 | 9 | #import "PYLegend.h" 10 | #import "PYColor.h" 11 | 12 | @implementation PYLegend 13 | 14 | - (instancetype)init 15 | { 16 | self = [super init]; 17 | if (self) { 18 | _show = YES; 19 | _zlevel = 0; 20 | _z = @(4); 21 | _orient = PYOrientHorizontal; 22 | _x = PYPositionCenter; 23 | _y = PYPositionTop; 24 | // _backgroundColor = PYRGBA(0, 0, 0, 0); 25 | _borderColor = @"#ccc"; 26 | _borderWidth = 0; 27 | _itemGap = @(10); 28 | _itemWidth = @(20); 29 | _itemHeight = @(14); 30 | _textStyle = [[PYTextStyle alloc] init]; 31 | _selectedMode = @(YES); 32 | _textStyle.color = PYRGBA(3, 3, 3, 1); 33 | _data = @[]; 34 | } 35 | return self; 36 | } 37 | 38 | PYInitializerImpTemplate(PYLegend); 39 | 40 | PYPropertyEqualImpTemplate(PYLegend, BOOL, show); 41 | PYPropertyEqualImpTemplate(PYLegend, NSNumber *, zlevel); 42 | PYPropertyEqualImpTemplate(PYLegend, NSNumber *, z); 43 | PYPropertyEqualImpTemplate(PYLegend, PYOrient, orient); 44 | PYPropertyEqualImpTemplate(PYLegend, id, x); 45 | PYPropertyEqualImpTemplate(PYLegend, id, y); 46 | PYPropertyEqualImpTemplate(PYLegend, PYColor *, backgroundColor); 47 | PYPropertyEqualImpTemplate(PYLegend, NSString *, borderColor); 48 | PYPropertyEqualImpTemplate(PYLegend, NSNumber *, borderWidth); 49 | PYPropertyEqualImpTemplate(PYLegend, id, padding); 50 | PYPropertyEqualImpTemplate(PYLegend, NSNumber *, itemGap); 51 | PYPropertyEqualImpTemplate(PYLegend, NSNumber *, itemWidth); 52 | PYPropertyEqualImpTemplate(PYLegend, NSNumber *, itemHeight); 53 | PYPropertyEqualImpTemplate(PYLegend, PYTextStyle *, textStyle); 54 | PYPropertyEqualImpTemplate(PYLegend, id, formatter); 55 | PYPropertyEqualImpTemplate(PYLegend, id, selectedMode); 56 | PYPropertyEqualImpTemplate(PYLegend, NSDictionary *, selected); 57 | PYPropertyEqualImpTemplate(PYLegend, NSArray *, data); 58 | 59 | @end 60 | -------------------------------------------------------------------------------- /iOS-Echarts/Model/PYLineStyle.h: -------------------------------------------------------------------------------- 1 | // 2 | // PYLineStyle.h 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto Y on 15/9/7. 6 | // Copyright (c) 2015年 pluto-y. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class PYColor; 12 | 13 | typedef NSString *PYLineStyleType; 14 | 15 | FOUNDATION_EXPORT PYLineStyleType const PYLineStyleTypeSolid; 16 | FOUNDATION_EXPORT PYLineStyleType const PYLineStyleTypeDotted; 17 | FOUNDATION_EXPORT PYLineStyleType const PYLineStyleTypeDashed; 18 | FOUNDATION_EXPORT PYLineStyleType const PYLineStyleTypeCurve; 19 | FOUNDATION_EXPORT PYLineStyleType const PYLineStyleTypeBroken; 20 | 21 | /** 22 | * 23 | * You can goto this website for references: 24 | * http://echarts.baidu.com/echarts2/doc/doc.html#LineStyle 25 | * 26 | */ 27 | @interface PYLineStyle : NSObject 28 | 29 | @property (nonatomic, strong) id color; 30 | @property (nonatomic, strong) id color0; 31 | @property (nonatomic, copy) PYLineStyleType type; 32 | @property (nonatomic, strong) NSNumber *width; 33 | @property (nonatomic, strong) PYColor *shadowColor; 34 | @property (nonatomic, strong) NSNumber *shadowBlur; 35 | @property (nonatomic, strong) NSNumber *shadowOffsetX; 36 | @property (nonatomic, strong) NSNumber *shadowOffsetY; 37 | 38 | PYInitializerTemplate(PYLineStyle, lineStyle); 39 | 40 | PYPropertyEqualTemplate(PYLineStyle, id, color); 41 | PYPropertyEqualTemplate(PYLineStyle, id, color0); 42 | PYPropertyEqualTemplate(PYLineStyle, PYLineStyleType, type); 43 | PYPropertyEqualTemplate(PYLineStyle, NSNumber *, width); 44 | PYPropertyEqualTemplate(PYLineStyle, PYColor *, shadowColor); 45 | PYPropertyEqualTemplate(PYLineStyle, NSNumber *, shadowBlur); 46 | PYPropertyEqualTemplate(PYLineStyle, NSNumber *, shadowOffsetX); 47 | PYPropertyEqualTemplate(PYLineStyle, NSNumber *, shadowOffsetY); 48 | 49 | @end 50 | -------------------------------------------------------------------------------- /iOS-Echarts/Model/PYLineStyle.m: -------------------------------------------------------------------------------- 1 | // 2 | // PYLineStyle.m 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto Y on 15/9/7. 6 | // Copyright (c) 2015年 pluto-y. All rights reserved. 7 | // 8 | 9 | #import "PYLineStyle.h" 10 | 11 | PYLineStyleType const PYLineStyleTypeSolid = @"solid"; 12 | PYLineStyleType const PYLineStyleTypeDotted = @"dotted"; 13 | PYLineStyleType const PYLineStyleTypeDashed = @"dashed"; 14 | PYLineStyleType const PYLineStyleTypeCurve = @"curve"; 15 | PYLineStyleType const PYLineStyleTypeBroken = @"broken"; 16 | 17 | static NSArray *lineStyleTypeScope; 18 | @interface PYLineStyle() 19 | 20 | @end 21 | 22 | @implementation PYLineStyle 23 | 24 | + (void)initialize 25 | { 26 | if (self == [PYLineStyle class]) { 27 | lineStyleTypeScope = @[PYLineStyleTypeSolid, PYLineStyleTypeDotted, PYLineStyleTypeDashed, PYLineStyleTypeCurve, PYLineStyleTypeBroken]; 28 | } 29 | } 30 | 31 | -(instancetype)init { 32 | self = [super init]; 33 | if (self) { 34 | _type = PYLineStyleTypeSolid; 35 | // _shadowColor = [[PYColor alloc] init]; 36 | _shadowBlur = @(5); 37 | _shadowOffsetX = @(3); 38 | _shadowOffsetY = @(3); 39 | } 40 | return self; 41 | } 42 | 43 | - (void)setType:(NSString *)type { 44 | if (![lineStyleTypeScope containsObject:type]) { 45 | NSLog(@"ERROR: LineStyle does not support the type --- %@", type); 46 | type = PYLineStyleTypeSolid; 47 | return; 48 | } 49 | _type = [type copy]; 50 | } 51 | 52 | PYInitializerImpTemplate(PYLineStyle); 53 | 54 | PYPropertyEqualImpTemplate(PYLineStyle, id, color); 55 | PYPropertyEqualImpTemplate(PYLineStyle, id, color0); 56 | PYPropertyEqualImpTemplate(PYLineStyle, PYLineStyleType, type); 57 | PYPropertyEqualImpTemplate(PYLineStyle, NSNumber *, width); 58 | PYPropertyEqualImpTemplate(PYLineStyle, PYColor *, shadowColor); 59 | PYPropertyEqualImpTemplate(PYLineStyle, NSNumber *, shadowBlur); 60 | PYPropertyEqualImpTemplate(PYLineStyle, NSNumber *, shadowOffsetX); 61 | PYPropertyEqualImpTemplate(PYLineStyle, NSNumber *, shadowOffsetY); 62 | 63 | @end 64 | -------------------------------------------------------------------------------- /iOS-Echarts/Model/PYLinkStyle.h: -------------------------------------------------------------------------------- 1 | // 2 | // PYLinkStyle.h 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto Y on 7/26/16. 6 | // Copyright © 2016 pluto-y. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class PYColor; 12 | 13 | typedef NSString *PYLinkStyleType; 14 | 15 | FOUNDATION_EXPORT PYLinkStyleType const PYLinkStyleTypeLine; 16 | FOUNDATION_EXPORT PYLinkStyleType const PYLinkStyleTypeCurve; 17 | 18 | /** 19 | * 20 | * You can goto this website for references: 21 | * http://echarts.baidu.com/echarts2/doc/doc.html#LinkStyle 22 | * 23 | */ 24 | @interface PYLinkStyle : NSObject 25 | 26 | @property (nonatomic, copy) PYLinkStyleType type; 27 | @property (nonatomic, strong) PYColor *color; 28 | @property (nonatomic, strong) NSNumber *width; 29 | 30 | PYInitializerTemplate(PYLinkStyle, linkStyle); 31 | 32 | PYPropertyEqualTemplate(PYLinkStyle, PYLinkStyleType, type); 33 | PYPropertyEqualTemplate(PYLinkStyle, PYColor *, color); 34 | PYPropertyEqualTemplate(PYLinkStyle, NSNumber *, width); 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /iOS-Echarts/Model/PYLinkStyle.m: -------------------------------------------------------------------------------- 1 | // 2 | // PYLinkStyle.m 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto Y on 7/26/16. 6 | // Copyright © 2016 pluto-y. All rights reserved. 7 | // 8 | 9 | #import "PYLinkStyle.h" 10 | #import "PYColor.h" 11 | 12 | PYLinkStyleType const PYLinkStyleTypeLine = @"line"; 13 | PYLinkStyleType const PYLinkStyleTypeCurve = @"curve"; 14 | 15 | static NSArray *linkStyleTypeScope; 16 | @implementation PYLinkStyle 17 | 18 | + (void)initialize 19 | { 20 | if (self == [PYLinkStyle class]) { 21 | linkStyleTypeScope = @[PYLinkStyleTypeLine, PYLinkStyleTypeCurve]; 22 | } 23 | } 24 | 25 | - (instancetype)init 26 | { 27 | self = [super init]; 28 | if (self) { 29 | _type = PYLinkStyleTypeLine; 30 | _color = PYRGBA(81, 150, 171, 1.0); 31 | _width = @1; 32 | } 33 | return self; 34 | } 35 | 36 | - (void)setType:(PYLinkStyleType)type { 37 | if (![linkStyleTypeScope containsObject:type]) { 38 | NSLog(@"ERROR: LinkStyle does not support the type --- %@", type); 39 | _type = PYLinkStyleTypeLine; 40 | return; 41 | } 42 | _type = [type copy]; 43 | } 44 | 45 | PYInitializerImpTemplate(PYLinkStyle); 46 | 47 | PYPropertyEqualImpTemplate(PYLinkStyle, PYLinkStyleType, type); 48 | PYPropertyEqualImpTemplate(PYLinkStyle, PYColor *, color); 49 | PYPropertyEqualImpTemplate(PYLinkStyle, NSNumber *, width); 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /iOS-Echarts/Model/PYLinks.h: -------------------------------------------------------------------------------- 1 | // 2 | // PYLinks.h 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto Y on 7/22/16. 6 | // Copyright © 2016 pluto-y. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class PYItemStyle; 12 | 13 | /** 14 | * 15 | * You can goto this website for references: 16 | * http://echarts.baidu.com/echarts2/doc/doc.html#GraphLinks 17 | * 18 | */ 19 | @interface PYLinks : NSObject 20 | 21 | @property (nonatomic, strong) id source; 22 | @property (nonatomic, strong) id target; 23 | @property (nonatomic, strong) NSNumber *weight; 24 | @property (nonatomic, strong) PYItemStyle *itemStyle; 25 | 26 | PYInitializerTemplate(PYLinks, links); 27 | 28 | PYPropertyEqualTemplate(PYLinks, id, source); 29 | PYPropertyEqualTemplate(PYLinks, id, target); 30 | PYPropertyEqualTemplate(PYLinks, NSNumber *, weight); 31 | PYPropertyEqualTemplate(PYLinks, PYItemStyle *, itemStyle); 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /iOS-Echarts/Model/PYLinks.m: -------------------------------------------------------------------------------- 1 | // 2 | // PYLinks.m 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto Y on 7/22/16. 6 | // Copyright © 2016 pluto-y. All rights reserved. 7 | // 8 | 9 | #import "PYLinks.h" 10 | #import "PYItemStyle.h" 11 | 12 | @implementation PYLinks 13 | 14 | - (instancetype)init 15 | { 16 | self = [super init]; 17 | if (self) { 18 | _weight = @(1); 19 | } 20 | return self; 21 | } 22 | 23 | PYInitializerImpTemplate(PYLinks); 24 | 25 | PYPropertyEqualImpTemplate(PYLinks, id, source); 26 | PYPropertyEqualImpTemplate(PYLinks, id, target); 27 | PYPropertyEqualImpTemplate(PYLinks, NSNumber *, weight); 28 | PYPropertyEqualImpTemplate(PYLinks, PYItemStyle *, itemStyle); 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /iOS-Echarts/Model/PYLoadingOption.h: -------------------------------------------------------------------------------- 1 | // 2 | // PYLoadingOption.h 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto Y on 16/4/15. 6 | // Copyright © 2016年 pluto-y. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class PYTextStyle; 12 | 13 | typedef NSString *PYLoadingOptionEffect; 14 | FOUNDATION_EXPORT PYLoadingOptionEffect const PYLoadingOptionEffectSpin; 15 | FOUNDATION_EXPORT PYLoadingOptionEffect const PYLoadingOptionEffectBar; 16 | FOUNDATION_EXPORT PYLoadingOptionEffect const PYLoadingOptionEffectRing; 17 | FOUNDATION_EXPORT PYLoadingOptionEffect const PYLoadingOptionEffectWhirling; 18 | FOUNDATION_EXPORT PYLoadingOptionEffect const PYLoadingOptionEffectDynamicLine; 19 | FOUNDATION_EXPORT PYLoadingOptionEffect const PYLoadingOptionEffectBubble; 20 | 21 | /** 22 | * 23 | * You can goto this website for references: 24 | * http://echarts.baidu.com/echarts2/doc/doc.html#Loadingoption 25 | * 26 | */ 27 | @interface PYLoadingOption : NSObject 28 | 29 | @property (nonatomic, copy) NSString *text; 30 | @property (nonatomic, strong) id x; 31 | @property (nonatomic, strong) id y; 32 | @property (nonatomic, strong) PYTextStyle *textStyle; 33 | @property (nonatomic, strong) id effect; 34 | @property (nonatomic, copy) NSDictionary *effectOption; 35 | @property (nonatomic, strong) NSNumber *progress; 36 | 37 | 38 | PYPropertyEqualTemplate(PYLoadingOption, NSString *, text); 39 | PYPropertyEqualTemplate(PYLoadingOption, id, x); 40 | PYPropertyEqualTemplate(PYLoadingOption, id, y); 41 | PYPropertyEqualTemplate(PYLoadingOption, PYTextStyle *, textStyle); 42 | PYPropertyEqualTemplate(PYLoadingOption, id, effect); 43 | PYPropertyEqualTemplate(PYLoadingOption, NSDictionary *, effectOption); 44 | PYPropertyEqualTemplate(PYLoadingOption, NSNumber *, progress); 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /iOS-Echarts/Model/PYLoadingOption.m: -------------------------------------------------------------------------------- 1 | // 2 | // PYLoadingOption.m 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto Y on 16/4/15. 6 | // Copyright © 2016年 pluto-y. All rights reserved. 7 | // 8 | 9 | #import "PYLoadingOption.h" 10 | #import "PYTextStyle.h" 11 | 12 | PYLoadingOptionEffect const PYLoadingOptionEffectSpin = @"spin"; 13 | PYLoadingOptionEffect const PYLoadingOptionEffectBar = @"bar"; 14 | PYLoadingOptionEffect const PYLoadingOptionEffectRing = @"ring"; 15 | PYLoadingOptionEffect const PYLoadingOptionEffectWhirling = @"whirling"; 16 | PYLoadingOptionEffect const PYLoadingOptionEffectDynamicLine = @"dynamicLine"; 17 | PYLoadingOptionEffect const PYLoadingOptionEffectBubble = @"bubble"; 18 | 19 | @implementation PYLoadingOption 20 | 21 | - (instancetype)init 22 | { 23 | self = [super init]; 24 | if (self) { 25 | _text = @"数据读取中..."; 26 | _x = PYPositionCenter; 27 | _y = PYPositionCenter; 28 | _effect = PYLoadingOptionEffectSpin; 29 | } 30 | return self; 31 | } 32 | 33 | PYPropertyEqualImpTemplate(PYLoadingOption, NSString *, text); 34 | PYPropertyEqualImpTemplate(PYLoadingOption, id, x); 35 | PYPropertyEqualImpTemplate(PYLoadingOption, id, y); 36 | PYPropertyEqualImpTemplate(PYLoadingOption, PYTextStyle *, textStyle); 37 | PYPropertyEqualImpTemplate(PYLoadingOption, id, effect); 38 | PYPropertyEqualImpTemplate(PYLoadingOption, NSDictionary *, effectOption); 39 | PYPropertyEqualImpTemplate(PYLoadingOption, NSNumber *, progress); 40 | 41 | @end 42 | -------------------------------------------------------------------------------- /iOS-Echarts/Model/PYNoDataLoadingOption.h: -------------------------------------------------------------------------------- 1 | // 2 | // PYNoDataLoadingOption.h 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto Y on 4/18/16. 6 | // Copyright © 2016 pluto-y. All rights reserved. 7 | // 8 | 9 | #import "PYLoadingOption.h" 10 | 11 | /** 12 | * 13 | * You can goto this website for references: 14 | * http://echarts.baidu.com/echarts2/doc/doc.html#NoDataLoadingOption 15 | * 16 | */ 17 | @interface PYNoDataLoadingOption : PYLoadingOption 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /iOS-Echarts/Model/PYNoDataLoadingOption.m: -------------------------------------------------------------------------------- 1 | // 2 | // PYNoDataLoadingOption.m 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto Y on 4/18/16. 6 | // Copyright © 2016 pluto-y. All rights reserved. 7 | // 8 | 9 | #import "PYNoDataLoadingOption.h" 10 | #import "PYTextStyle.h" 11 | 12 | @implementation PYNoDataLoadingOption 13 | 14 | - (instancetype)init 15 | { 16 | self = [super init]; 17 | if (self) { 18 | self.text = @"暂无数据"; 19 | self.x = PYPositionCenter; 20 | self.y = PYPositionCenter; 21 | self.effect = PYLoadingOptionEffectBubble; 22 | } 23 | return self; 24 | } 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /iOS-Echarts/Model/PYNodeStyle.h: -------------------------------------------------------------------------------- 1 | // 2 | // PYNodeStyle.h 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto Y on 7/26/16. 6 | // Copyright © 2016 pluto-y. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class PYColor; 12 | 13 | /** 14 | * 15 | * You can goto this website for references: 16 | * http://echarts.baidu.com/echarts2/doc/doc.html#NodeStyle 17 | * 18 | */ 19 | @interface PYNodeStyle : NSObject 20 | 21 | @property (nonatomic, strong) PYColor *color; 22 | @property (nonatomic, strong) PYColor *borderColor; 23 | @property (nonatomic, strong) NSNumber *borderWidth; 24 | 25 | PYInitializerTemplate(PYNodeStyle, nodeStyle); 26 | 27 | 28 | PYPropertyEqualTemplate(PYNodeStyle,PYColor *, color); 29 | PYPropertyEqualTemplate(PYNodeStyle,PYColor *, borderColor); 30 | PYPropertyEqualTemplate(PYNodeStyle,NSNumber *, borderWidth); 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /iOS-Echarts/Model/PYNodeStyle.m: -------------------------------------------------------------------------------- 1 | // 2 | // PYNodeStyle.m 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto Y on 7/26/16. 6 | // Copyright © 2016 pluto-y. All rights reserved. 7 | // 8 | 9 | #import "PYNodeStyle.h" 10 | #import "PYColor.h" 11 | 12 | @implementation PYNodeStyle 13 | 14 | - (instancetype)init 15 | { 16 | self = [super init]; 17 | if (self) { 18 | _color = PYRGBA(240, 140, 46, 1.0); 19 | _borderColor = PYRGBA(81, 130, 171, 1.0); 20 | _borderWidth = @1; 21 | } 22 | return self; 23 | } 24 | 25 | PYInitializerImpTemplate(PYNodeStyle); 26 | 27 | PYPropertyEqualImpTemplate(PYNodeStyle,PYColor *, color); 28 | PYPropertyEqualImpTemplate(PYNodeStyle,PYColor *, borderColor); 29 | PYPropertyEqualImpTemplate(PYNodeStyle,NSNumber *, borderWidth); 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /iOS-Echarts/Model/PYNodes.h: -------------------------------------------------------------------------------- 1 | // 2 | // PYNodes.h 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto Y on 7/22/16. 6 | // Copyright © 2016 pluto-y. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class PYItemStyle; 12 | 13 | /** 14 | * 15 | * You can goto this website for references: 16 | * http://echarts.baidu.com/echarts2/doc/doc.html#nodes(data) 17 | * 18 | */ 19 | @interface PYNodes : NSObject 20 | 21 | @property (nonatomic, copy) NSString *name; 22 | @property (nonatomic, copy) NSString *label; 23 | @property (nonatomic, strong) NSNumber *value; 24 | @property (nonatomic, assign) BOOL ignore; 25 | @property (nonatomic, copy) NSString *symbol; 26 | @property (nonatomic, strong) id symboleSize; 27 | @property (nonatomic, strong) NSNumber *category; 28 | @property (nonatomic, strong) PYItemStyle *itemStyle; 29 | 30 | PYInitializerTemplate(PYNodes, nodes); 31 | 32 | PYPropertyEqualTemplate(PYNodes, NSString *, name); 33 | PYPropertyEqualTemplate(PYNodes, NSString *, label); 34 | PYPropertyEqualTemplate(PYNodes, NSNumber *, value); 35 | PYPropertyEqualTemplate(PYNodes, BOOL, ignore); 36 | PYPropertyEqualTemplate(PYNodes, NSString *, symbol); 37 | PYPropertyEqualTemplate(PYNodes, id, symboleSize); 38 | PYPropertyEqualTemplate(PYNodes, NSNumber *, category); 39 | PYPropertyEqualTemplate(PYNodes, PYItemStyle *, itemStyle); 40 | 41 | @end 42 | -------------------------------------------------------------------------------- /iOS-Echarts/Model/PYNodes.m: -------------------------------------------------------------------------------- 1 | // 2 | // PYNodes.m 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto Y on 7/22/16. 6 | // Copyright © 2016 pluto-y. All rights reserved. 7 | // 8 | 9 | #import "PYNodes.h" 10 | #import "PYItemStyle.h" 11 | 12 | @implementation PYNodes 13 | 14 | - (instancetype)init 15 | { 16 | self = [super init]; 17 | if (self) { 18 | _ignore = NO; 19 | _symbol = PYSymbolCircle; 20 | _category = @(0); 21 | } 22 | return self; 23 | } 24 | 25 | PYInitializerImpTemplate(PYNodes); 26 | 27 | PYPropertyEqualImpTemplate(PYNodes, NSString *, name); 28 | PYPropertyEqualImpTemplate(PYNodes, NSString *, label); 29 | PYPropertyEqualImpTemplate(PYNodes, NSNumber *, value); 30 | PYPropertyEqualImpTemplate(PYNodes, BOOL, ignore); 31 | PYPropertyEqualImpTemplate(PYNodes, NSString *, symbol); 32 | PYPropertyEqualImpTemplate(PYNodes, id, symboleSize); 33 | PYPropertyEqualImpTemplate(PYNodes, NSNumber *, category); 34 | PYPropertyEqualImpTemplate(PYNodes, PYItemStyle *, itemStyle); 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /iOS-Echarts/Model/PYOption.m: -------------------------------------------------------------------------------- 1 | // 2 | // PYOption.m 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto Y on 15/9/9. 6 | // Copyright (c) 2015年 pluto-y. All rights reserved. 7 | // 8 | 9 | #import "PYOption.h" 10 | #import "PYAxis.h" 11 | #import "PYLegend.h" 12 | #import "PYTimeline.h" 13 | #import "PYTitle.h" 14 | #import "PYGrid.h" 15 | #import "PYToolbox.h" 16 | #import "PYDataZoom.h" 17 | #import "PYDataRange.h" 18 | #import "PYPolar.h" 19 | #import "PYRoamController.h" 20 | #import "PYColor.h" 21 | 22 | @implementation PYOption 23 | 24 | - (instancetype)init 25 | { 26 | self = [super init]; 27 | if (self) { 28 | _animation = YES; 29 | } 30 | return self; 31 | } 32 | 33 | PYInitializerImpTemplate(PYOption); 34 | 35 | PYPropertyEqualImpTemplate(PYOption, PYColor *, backgroundColor); 36 | PYPropertyEqualImpTemplate(PYOption, NSArray *, color); 37 | PYPropertyEqualImpTemplate(PYOption, NSMutableArray *, polar); 38 | PYPropertyEqualImpTemplate(PYOption, BOOL, renderAsImage); 39 | PYPropertyEqualImpTemplate(PYOption, BOOL, calculable); 40 | PYPropertyEqualImpTemplate(PYOption, BOOL, animation); 41 | PYPropertyEqualImpTemplate(PYOption, PYTimeline *, timeline); 42 | PYPropertyEqualImpTemplate(PYOption, PYTitle *, title); 43 | PYPropertyEqualImpTemplate(PYOption, PYToolbox *, toolbox); 44 | PYPropertyEqualImpTemplate(PYOption, PYTooltip *, tooltip); 45 | PYPropertyEqualImpTemplate(PYOption, PYLegend *, legend); 46 | PYPropertyEqualImpTemplate(PYOption, PYDataRange *, dataRange); 47 | PYPropertyEqualImpTemplate(PYOption, PYDataZoom *, dataZoom); 48 | PYPropertyEqualImpTemplate(PYOption, PYRoamController *, roamController); 49 | PYPropertyEqualImpTemplate(PYOption, PYGrid *, grid); 50 | PYPropertyEqualImpTemplate(PYOption, NSMutableArray *, xAxis); 51 | PYPropertyEqualImpTemplate(PYOption, NSMutableArray *, yAxis); 52 | PYPropertyEqualImpTemplate(PYOption, NSMutableArray *, series); 53 | PYPropertyEqualImpTemplate(PYOption, NSMutableArray *, options); 54 | 55 | PYAddMethodImpTemplate(PYOption, PYAxis, XAxis, xAxis); 56 | PYAddMethodImpTemplate(PYOption, PYAxis, YAxis, yAxis); 57 | PYAddMethodImpTemplate(PYOption, PYSeries, Series, series); 58 | PYAddMethodImpTemplate(PYOption, PYPolar, Polar, polar); 59 | PYAddMethodImpTemplate(PYOption, PYOption, Options, options); 60 | 61 | @end 62 | -------------------------------------------------------------------------------- /iOS-Echarts/Model/PYPolar.h: -------------------------------------------------------------------------------- 1 | // 2 | // Polar.h 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto Y on 15/12/21. 6 | // Copyright © 2015年 pluto-y. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class PYLineStyle, PYAxisLabel, PYAreaStyle; 12 | 13 | typedef NSString *PYPolarType; 14 | FOUNDATION_EXPORT PYPolarType const PYPolarTypePolygon; 15 | FOUNDATION_EXPORT PYPolarType const PYPolarTypeCircle; 16 | 17 | /** 18 | * 19 | * You can goto this website for references: 20 | * http://echarts.baidu.com/echarts2/doc/doc.html#Polar 21 | * 22 | */ 23 | @interface PYPolar : NSObject 24 | 25 | @property (nonatomic, strong) NSNumber *zlevel; 26 | @property (nonatomic, strong) NSNumber *z; 27 | @property (nonatomic, strong) NSMutableArray *center; 28 | @property (nonatomic, strong) id radius; 29 | @property (nonatomic, strong) NSNumber *startAngle; 30 | @property (nonatomic, strong) NSNumber *splitNumber; 31 | @property (nonatomic, strong) id name; 32 | @property (nonatomic, strong) NSMutableArray *boundaryGap; 33 | @property (nonatomic, assign) BOOL scale; 34 | @property (nonatomic, strong) PYLineStyle *axisLine; 35 | @property (nonatomic, strong) PYAxisLabel *axisLabel; 36 | @property (nonatomic, strong) PYLineStyle *splitLine; 37 | @property (nonatomic, strong) PYAreaStyle *splitArea; 38 | @property (nonatomic, copy) PYPolarType type; 39 | @property (nonatomic, strong) NSMutableArray *indicator; 40 | 41 | PYInitializerTemplate(PYPolar, polar); 42 | 43 | PYPropertyEqualTemplate(PYPolar, NSNumber *, zlevel); 44 | PYPropertyEqualTemplate(PYPolar, NSNumber *, z); 45 | PYPropertyEqualTemplate(PYPolar, NSMutableArray *, center); 46 | PYPropertyEqualTemplate(PYPolar, id, radius); 47 | PYPropertyEqualTemplate(PYPolar, NSNumber *, startAngle); 48 | PYPropertyEqualTemplate(PYPolar, NSNumber *, splitNumber); 49 | PYPropertyEqualTemplate(PYPolar, id, name); 50 | PYPropertyEqualTemplate(PYPolar, NSMutableArray *, boundaryGap); 51 | PYPropertyEqualTemplate(PYPolar, BOOL, scale); 52 | PYPropertyEqualTemplate(PYPolar, PYLineStyle *, axisLine); 53 | PYPropertyEqualTemplate(PYPolar, PYAxisLabel *, axisLabel); 54 | PYPropertyEqualTemplate(PYPolar, PYLineStyle *, splitLine); 55 | PYPropertyEqualTemplate(PYPolar, PYAreaStyle *, splitArea); 56 | PYPropertyEqualTemplate(PYPolar, NSMutableArray *, indicator); 57 | 58 | @end 59 | -------------------------------------------------------------------------------- /iOS-Echarts/Model/PYPolar.m: -------------------------------------------------------------------------------- 1 | // 2 | // Polar.m 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto Y on 15/12/21. 6 | // Copyright © 2015年 pluto-y. All rights reserved. 7 | // 8 | 9 | #import "PYPolar.h" 10 | #import "PYLineStyle.h" 11 | #import "PYAxisLabel.h" 12 | #import "PYAreaStyle.h" 13 | 14 | PYPolarType const PYPolarTypePolygon = @"polygon"; 15 | PYPolarType const PYPolarTypeCircle = @"circle"; 16 | 17 | static NSArray *polarTypeScope; 18 | @implementation PYPolar 19 | 20 | + (void)initialize 21 | { 22 | if (self == [PYPolar class]) { 23 | polarTypeScope = @[PYPolarTypePolygon, PYPolarTypeCircle]; 24 | } 25 | } 26 | 27 | - (instancetype)init 28 | { 29 | self = [super init]; 30 | if (self) { 31 | _center = [[NSMutableArray alloc] initWithArray:@[@"50%", @"50%"]]; 32 | _startAngle = @(90); 33 | _splitNumber = @(5); 34 | _name = @{@"show":@(YES), @"textStyle":@{@"color":@"#333"}}; 35 | _scale = NO; 36 | _type = PYPolarTypePolygon; 37 | 38 | } 39 | return self; 40 | } 41 | 42 | - (void)setStartAngle:(NSNumber *)startAngle { 43 | if (startAngle.floatValue > 180) { 44 | NSLog(@"ERROR: Start Angle is out of limit ---- %.0f", startAngle.floatValue); 45 | _startAngle = @(180); 46 | } else if (startAngle.floatValue < - 180) { 47 | NSLog(@"ERROR: Start Angle is out of limit ---- %.0f", startAngle.floatValue); 48 | _startAngle = @(-180); 49 | } else { 50 | _startAngle = startAngle; 51 | } 52 | } 53 | 54 | -(void)setType:(NSString *)type { 55 | if (![polarTypeScope containsObject:type]) { 56 | NSLog(@"ERROR: Polar does not support the type --- %@", type); 57 | _type = PYPolarTypePolygon; 58 | return; 59 | } 60 | _type = [type copy]; 61 | } 62 | 63 | PYInitializerImpTemplate(PYPolar); 64 | 65 | PYPropertyEqualImpTemplate(PYPolar, NSNumber *, zlevel); 66 | PYPropertyEqualImpTemplate(PYPolar, NSNumber *, z); 67 | PYPropertyEqualImpTemplate(PYPolar, NSMutableArray *, center); 68 | PYPropertyEqualImpTemplate(PYPolar, id, radius); 69 | PYPropertyEqualImpTemplate(PYPolar, NSNumber *, startAngle); 70 | PYPropertyEqualImpTemplate(PYPolar, NSNumber *, splitNumber); 71 | PYPropertyEqualImpTemplate(PYPolar, id, name); 72 | PYPropertyEqualImpTemplate(PYPolar, NSMutableArray *, boundaryGap); 73 | PYPropertyEqualImpTemplate(PYPolar, BOOL, scale); 74 | PYPropertyEqualImpTemplate(PYPolar, PYLineStyle *, axisLine); 75 | PYPropertyEqualImpTemplate(PYPolar, PYAxisLabel *, axisLabel); 76 | PYPropertyEqualImpTemplate(PYPolar, PYLineStyle *, splitLine); 77 | PYPropertyEqualImpTemplate(PYPolar, PYAreaStyle *, splitArea); 78 | PYPropertyEqualImpTemplate(PYPolar, NSMutableArray *, indicator); 79 | 80 | @end 81 | -------------------------------------------------------------------------------- /iOS-Echarts/Model/PYRoamController.h: -------------------------------------------------------------------------------- 1 | // 2 | // PYRoamController.h 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto-Y on 15/12/27. 6 | // Copyright © 2015年 pluto-y. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class PYColor; 12 | 13 | /** 14 | * 15 | * You can goto this website for references: 16 | * http://echarts.baidu.com/echarts2/doc/doc.html#RoamController 17 | * 18 | */ 19 | @interface PYRoamController : NSObject 20 | 21 | @property (nonatomic, assign) BOOL show; 22 | @property (nonatomic, strong) NSNumber *zlevel; 23 | @property (nonatomic, strong) NSNumber *z; 24 | @property (nonatomic, strong) id x; 25 | @property (nonatomic, strong) id y; 26 | @property (nonatomic, strong) NSNumber *width; 27 | @property (nonatomic, strong) NSNumber *height; 28 | @property (nonatomic, strong) PYColor *backgroundColor; 29 | @property (nonatomic, strong) PYColor *borderColor; 30 | @property (nonatomic, strong) NSNumber *borderWidth; 31 | @property (nonatomic, strong) id padding; 32 | @property (nonatomic, strong) PYColor *fillerColor; 33 | @property (nonatomic, strong) PYColor *handleColor; 34 | @property (nonatomic, strong) NSNumber *step; 35 | @property (nonatomic, copy) NSDictionary *mapTypeControl; 36 | 37 | PYInitializerTemplate(PYRoamController, roamController); 38 | 39 | PYPropertyEqualTemplate(PYRoamController, BOOL, show); 40 | PYPropertyEqualTemplate(PYRoamController, NSNumber *, zlevel); 41 | PYPropertyEqualTemplate(PYRoamController, NSNumber *, z); 42 | PYPropertyEqualTemplate(PYRoamController, id, x); 43 | PYPropertyEqualTemplate(PYRoamController, id, y); 44 | PYPropertyEqualTemplate(PYRoamController, NSNumber *, width); 45 | PYPropertyEqualTemplate(PYRoamController, NSNumber *, height); 46 | PYPropertyEqualTemplate(PYRoamController, PYColor *, backgroundColor); 47 | PYPropertyEqualTemplate(PYRoamController, PYColor *, borderColor); 48 | PYPropertyEqualTemplate(PYRoamController, NSNumber *, borderWidth); 49 | PYPropertyEqualTemplate(PYRoamController, id, padding); 50 | PYPropertyEqualTemplate(PYRoamController, PYColor *, fillerColor); 51 | PYPropertyEqualTemplate(PYRoamController, PYColor *, handleColor); 52 | PYPropertyEqualTemplate(PYRoamController, NSNumber *, step); 53 | PYPropertyEqualTemplate(PYRoamController, NSDictionary *, mapTypeControl); 54 | 55 | @end 56 | -------------------------------------------------------------------------------- /iOS-Echarts/Model/PYRoamController.m: -------------------------------------------------------------------------------- 1 | // 2 | // PYRoamController.m 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto Y on 15/12/27. 6 | // Copyright © 2015年 pluto-y. All rights reserved. 7 | // 8 | 9 | #import "PYRoamController.h" 10 | #import "PYColor.h" 11 | 12 | @implementation PYRoamController 13 | 14 | - (instancetype)init { 15 | self = [super init]; 16 | if (self) { 17 | _show = YES; 18 | _zlevel = @0; 19 | _z = @4; 20 | _x = PYPositionLeft; 21 | _y = PYPositionTop; 22 | _width = @80; 23 | _height = @120; 24 | _backgroundColor = PYRGBA(0, 0, 0, 0); 25 | _borderColor = PYRGBA(12, 12, 12, 1); 26 | _borderWidth = @0; 27 | _padding = @5; 28 | _fillerColor = PYRGBA(15, 15, 15, 1); 29 | _handleColor = PYRGBA(100, 149, 237, 1); 30 | _step = @15; 31 | _mapTypeControl = nil; 32 | } 33 | return self; 34 | } 35 | 36 | PYInitializerImpTemplate(PYRoamController); 37 | 38 | PYPropertyEqualImpTemplate(PYRoamController, BOOL, show); 39 | PYPropertyEqualImpTemplate(PYRoamController, NSNumber *, zlevel); 40 | PYPropertyEqualImpTemplate(PYRoamController, NSNumber *, z); 41 | PYPropertyEqualImpTemplate(PYRoamController, id, x); 42 | PYPropertyEqualImpTemplate(PYRoamController, id, y); 43 | PYPropertyEqualImpTemplate(PYRoamController, NSNumber *, width); 44 | PYPropertyEqualImpTemplate(PYRoamController, NSNumber *, height); 45 | PYPropertyEqualImpTemplate(PYRoamController, PYColor *, backgroundColor); 46 | PYPropertyEqualImpTemplate(PYRoamController, PYColor *, borderColor); 47 | PYPropertyEqualImpTemplate(PYRoamController, NSNumber *, borderWidth); 48 | PYPropertyEqualImpTemplate(PYRoamController, id, padding); 49 | PYPropertyEqualImpTemplate(PYRoamController, PYColor *, fillerColor); 50 | PYPropertyEqualImpTemplate(PYRoamController, PYColor *, handleColor); 51 | PYPropertyEqualImpTemplate(PYRoamController, NSNumber *, step); 52 | PYPropertyEqualImpTemplate(PYRoamController, NSDictionary *, mapTypeControl); 53 | 54 | @end 55 | -------------------------------------------------------------------------------- /iOS-Echarts/Model/PYSplitArea.h: -------------------------------------------------------------------------------- 1 | // 2 | // PYSplitArea.h 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto Y on 16/4/12. 6 | // Copyright © 2016年 pluto-y. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class PYAreaStyle; 12 | 13 | /** 14 | * 15 | * You can goto this website for references: 16 | * http://echarts.baidu.com/echarts2/doc/doc.html#AxisSplitarea 17 | * 18 | */ 19 | @interface PYSplitArea : NSObject 20 | 21 | @property (nonatomic, assign) BOOL show; 22 | @property (nonatomic, assign) BOOL onGap; 23 | @property (nonatomic, strong) PYAreaStyle *areaStyle; 24 | 25 | PYInitializerTemplate(PYSplitArea, splitArea); 26 | 27 | PYPropertyEqualTemplate(PYSplitArea, BOOL, show); 28 | PYPropertyEqualTemplate(PYSplitArea, BOOL, onGap); 29 | PYPropertyEqualTemplate(PYSplitArea, PYAreaStyle *, areaStyle); 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /iOS-Echarts/Model/PYSplitArea.m: -------------------------------------------------------------------------------- 1 | // 2 | // PYSplitArea.m 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto Y on 16/4/12. 6 | // Copyright © 2016年 pluto-y. All rights reserved. 7 | // 8 | 9 | #import "PYSplitArea.h" 10 | #import "PYColor.h" 11 | #import "PYAreaStyle.h" 12 | 13 | @implementation PYSplitArea 14 | 15 | - (instancetype)init 16 | { 17 | self = [super init]; 18 | if (self) { 19 | _show = NO; 20 | _areaStyle = [PYAreaStyle new]; 21 | _areaStyle.color = @[PYRGBA(250, 250, 250, 0.3), PYRGBA(200, 200, 200, 0.3)]; 22 | } 23 | return self; 24 | } 25 | 26 | PYInitializerImpTemplate(PYSplitArea); 27 | 28 | PYPropertyEqualImpTemplate(PYSplitArea, BOOL, show); 29 | PYPropertyEqualImpTemplate(PYSplitArea, BOOL, onGap); 30 | PYPropertyEqualImpTemplate(PYSplitArea, PYAreaStyle *, areaStyle); 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /iOS-Echarts/Model/PYTextStyle.h: -------------------------------------------------------------------------------- 1 | // 2 | // PYTextStyle.h 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto Y on 15/9/8. 6 | // Copyright (c) 2015年 pluto-y. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class PYColor; 12 | 13 | typedef NSString *PYTextStyleFontStyle; 14 | typedef NSString *PYTextStyleFontWeight; 15 | 16 | FOUNDATION_EXPORT PYTextStyleFontStyle const PYTextStyleFontStyleNormal; 17 | FOUNDATION_EXPORT PYTextStyleFontStyle const PYTextStyleFontStyleItalic; 18 | FOUNDATION_EXPORT PYTextStyleFontStyle const PYTextStyleFontStyleOblique; 19 | 20 | FOUNDATION_EXPORT PYTextStyleFontWeight const PYTextStyleFontWeightNormal; 21 | FOUNDATION_EXPORT PYTextStyleFontWeight const PYTextStyleFontWeightBold; 22 | FOUNDATION_EXPORT PYTextStyleFontWeight const PYTextStyleFontWeightBolder; 23 | FOUNDATION_EXPORT PYTextStyleFontWeight const PYTextStyleFontWeightLighter; 24 | 25 | /** 26 | * 27 | * You can goto this website for references: 28 | * http://echarts.baidu.com/echarts2/doc/doc.html#TextStyle 29 | * 30 | */ 31 | @interface PYTextStyle : NSObject 32 | 33 | @property (nonatomic, strong) id color; 34 | @property (nonatomic, copy) NSString *decoration; 35 | @property (nonatomic, copy) NSString *align; 36 | @property (nonatomic, copy) NSString *baseLine; 37 | @property (nonatomic, copy) NSString *fontFamily; 38 | @property (nonatomic, strong) NSNumber *fontSize; 39 | @property (nonatomic, copy) PYTextStyleFontStyle fontStyle; 40 | @property (nonatomic, copy) id fontWeight; 41 | @property (nonatomic, strong) id shadowColor; 42 | @property (nonatomic, strong) NSNumber *shadowBlur; 43 | 44 | PYInitializerTemplate(PYTextStyle, textStyle); 45 | 46 | PYPropertyEqualTemplate(PYTextStyle, id, color); 47 | PYPropertyEqualTemplate(PYTextStyle, NSString *, decoration); 48 | PYPropertyEqualTemplate(PYTextStyle, NSString *, align); 49 | PYPropertyEqualTemplate(PYTextStyle, NSString *, baseLine); 50 | PYPropertyEqualTemplate(PYTextStyle, NSString *, fontFamily); 51 | PYPropertyEqualTemplate(PYTextStyle, NSNumber *, fontSize); 52 | PYPropertyEqualTemplate(PYTextStyle, PYTextStyleFontStyle, fontStyle); 53 | PYPropertyEqualTemplate(PYTextStyle, id, fontWeight); 54 | PYPropertyEqualTemplate(PYTextStyle, id, shadowColor); 55 | PYPropertyEqualTemplate(PYTextStyle, NSNumber *, shadowBlur); 56 | 57 | @end 58 | -------------------------------------------------------------------------------- /iOS-Echarts/Model/PYTextStyle.m: -------------------------------------------------------------------------------- 1 | // 2 | // PYTextStyle.m 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto Y on 15/9/8. 6 | // Copyright (c) 2015年 pluto-y. All rights reserved. 7 | // 8 | 9 | #import "PYTextStyle.h" 10 | 11 | PYTextStyleFontStyle const PYTextStyleFontStyleNormal = @"normal"; 12 | PYTextStyleFontStyle const PYTextStyleFontStyleItalic = @"italic"; 13 | PYTextStyleFontStyle const PYTextStyleFontStyleOblique = @"oblique"; 14 | 15 | PYTextStyleFontWeight const PYTextStyleFontWeightNormal = @"normal"; 16 | PYTextStyleFontWeight const PYTextStyleFontWeightBold = @"bold"; 17 | PYTextStyleFontWeight const PYTextStyleFontWeightBolder = @"bolder"; 18 | PYTextStyleFontWeight const PYTextStyleFontWeightLighter = @"lighter"; 19 | 20 | static NSArray *textStyleFontStyle; 21 | @implementation PYTextStyle 22 | 23 | + (void)initialize 24 | { 25 | if (self == [PYTextStyle class]) { 26 | textStyleFontStyle = @[PYTextStyleFontStyleNormal, PYTextStyleFontStyleItalic, PYTextStyleFontStyleOblique]; 27 | } 28 | } 29 | 30 | - (instancetype)init 31 | { 32 | self = [super init]; 33 | if (self) { 34 | _decoration = @"none"; 35 | _fontFamily = @"Arial, Verdana, sans-serif"; 36 | _fontSize = @(12); 37 | _fontStyle = PYTextStyleFontStyleNormal; 38 | _fontWeight = PYTextStyleFontWeightNormal; 39 | } 40 | return self; 41 | } 42 | 43 | - (void)setFontStyle:(PYTextStyleFontStyle)fontStyle { 44 | if (![textStyleFontStyle containsObject:fontStyle]) { 45 | NSLog(@"ERROR: TextStyle does not support the font style --- %@", fontStyle); 46 | _fontStyle = PYTextStyleFontStyleNormal; 47 | return; 48 | } 49 | _fontStyle = [fontStyle copy]; 50 | } 51 | 52 | PYInitializerImpTemplate(PYTextStyle); 53 | 54 | PYPropertyEqualImpTemplate(PYTextStyle, id, color); 55 | PYPropertyEqualImpTemplate(PYTextStyle, NSString *, decoration); 56 | PYPropertyEqualImpTemplate(PYTextStyle, NSString *, align); 57 | PYPropertyEqualImpTemplate(PYTextStyle, NSString *, baseLine); 58 | PYPropertyEqualImpTemplate(PYTextStyle, NSString *, fontFamily); 59 | PYPropertyEqualImpTemplate(PYTextStyle, NSNumber *, fontSize); 60 | PYPropertyEqualImpTemplate(PYTextStyle, PYTextStyleFontStyle, fontStyle); 61 | PYPropertyEqualImpTemplate(PYTextStyle, id, fontWeight); 62 | PYPropertyEqualImpTemplate(PYTextStyle, id, shadowColor); 63 | PYPropertyEqualImpTemplate(PYTextStyle, NSNumber *, shadowBlur); 64 | 65 | @end 66 | -------------------------------------------------------------------------------- /iOS-Echarts/Model/PYTitle.h: -------------------------------------------------------------------------------- 1 | // 2 | // PYTitle.h 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto-Y on 15/9/14. 6 | // Copyright (c) 2015年 pluto-y. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class PYColor, PYTextStyle; 12 | 13 | /** 14 | * 15 | * You can goto this website for references: 16 | * http://echarts.baidu.com/echarts2/doc/doc.html#Title 17 | * 18 | */ 19 | @interface PYTitle : NSObject 20 | 21 | @property (nonatomic, assign) BOOL show; 22 | @property (nonatomic, strong) NSNumber *zlevel; 23 | @property (nonatomic, strong) NSNumber *z; 24 | @property (nonatomic, copy) NSString *text; 25 | @property (nonatomic, copy) NSString *link; 26 | @property (nonatomic, copy) NSString *target; 27 | @property (nonatomic, copy) NSString *subtext; 28 | @property (nonatomic, copy) NSString *sublink; 29 | @property (nonatomic, copy) NSString *subtarget; 30 | @property (nonatomic, strong) id x; 31 | @property (nonatomic, strong) id y; 32 | @property (nonatomic, copy) NSString *textAlign; 33 | @property (nonatomic, strong) PYColor *backgroundColor; 34 | @property (nonatomic, strong) PYColor *borderColor; 35 | @property (nonatomic, strong) NSNumber *borderWidth; 36 | @property (nonatomic, strong) id padding; 37 | @property (nonatomic, strong) NSNumber *itemGap; 38 | @property (nonatomic, strong) PYTextStyle *textStyle; 39 | @property (nonatomic, strong) PYTextStyle *subtextStyle; 40 | 41 | PYInitializerTemplate(PYTitle, title); 42 | 43 | PYPropertyEqualTemplate(PYTitle, BOOL, show); 44 | PYPropertyEqualTemplate(PYTitle, NSNumber *, zlevel); 45 | PYPropertyEqualTemplate(PYTitle, NSNumber *, z); 46 | PYPropertyEqualTemplate(PYTitle, NSString *, text); 47 | PYPropertyEqualTemplate(PYTitle, NSString *, link); 48 | PYPropertyEqualTemplate(PYTitle, NSString *, target); 49 | PYPropertyEqualTemplate(PYTitle, NSString *, subtext); 50 | PYPropertyEqualTemplate(PYTitle, NSString *, sublink); 51 | PYPropertyEqualTemplate(PYTitle, NSString *, subtarget); 52 | PYPropertyEqualTemplate(PYTitle, id, x); 53 | PYPropertyEqualTemplate(PYTitle, id, y); 54 | PYPropertyEqualTemplate(PYTitle, NSString *, textAlign); 55 | PYPropertyEqualTemplate(PYTitle, PYColor *, backgroundColor); 56 | PYPropertyEqualTemplate(PYTitle, PYColor *, borderColor); 57 | PYPropertyEqualTemplate(PYTitle, NSNumber *, borderWidth); 58 | PYPropertyEqualTemplate(PYTitle, id, padding); 59 | PYPropertyEqualTemplate(PYTitle, NSNumber *, itemGap); 60 | PYPropertyEqualTemplate(PYTitle, PYTextStyle *, textStyle); 61 | PYPropertyEqualTemplate(PYTitle, PYTextStyle *, subtextStyle); 62 | 63 | @end 64 | -------------------------------------------------------------------------------- /iOS-Echarts/Model/PYTitle.m: -------------------------------------------------------------------------------- 1 | // 2 | // PYTitle.m 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto-Y on 15/9/14. 6 | // Copyright (c) 2015年 pluto-y. All rights reserved. 7 | // 8 | 9 | #import "PYTitle.h" 10 | #import "PYColor.h" 11 | #import "PYTextStyle.h" 12 | 13 | @implementation PYTitle 14 | 15 | - (instancetype)init 16 | { 17 | self = [super init]; 18 | if (self) { 19 | _show = YES; 20 | _zlevel = @(0); 21 | _z = @(0); 22 | _text = @""; 23 | _link = @""; 24 | _subtext = @""; 25 | _sublink = @""; 26 | _x = PYPositionLeft; 27 | _y = PYPositionTop; 28 | _backgroundColor = PYRGBA(0, 0, 0, 0); 29 | _borderColor = PYRGBA(12, 12, 12, 1); 30 | _borderWidth = @(0); 31 | _padding = @(5); 32 | _itemGap = @(5); 33 | _textStyle = [[PYTextStyle alloc] init]; 34 | _textStyle.fontSize = @(18); 35 | _textStyle.fontWeight = PYTextStyleFontWeightBolder; 36 | _textStyle.color = PYRGBA(3, 3, 3, 1); 37 | _subtextStyle = [[PYTextStyle alloc] init]; 38 | _subtextStyle.color = PYRGBA(10, 10, 10, 1); 39 | } 40 | return self; 41 | } 42 | 43 | PYInitializerImpTemplate(PYTitle); 44 | 45 | PYPropertyEqualImpTemplate(PYTitle, BOOL, show); 46 | PYPropertyEqualImpTemplate(PYTitle, NSNumber *, zlevel); 47 | PYPropertyEqualImpTemplate(PYTitle, NSNumber *, z); 48 | PYPropertyEqualImpTemplate(PYTitle, NSString *, text); 49 | PYPropertyEqualImpTemplate(PYTitle, NSString *, link); 50 | PYPropertyEqualImpTemplate(PYTitle, NSString *, target); 51 | PYPropertyEqualImpTemplate(PYTitle, NSString *, subtext); 52 | PYPropertyEqualImpTemplate(PYTitle, NSString *, sublink); 53 | PYPropertyEqualImpTemplate(PYTitle, NSString *, subtarget); 54 | PYPropertyEqualImpTemplate(PYTitle, id, x); 55 | PYPropertyEqualImpTemplate(PYTitle, id, y); 56 | PYPropertyEqualImpTemplate(PYTitle, NSString *, textAlign); 57 | PYPropertyEqualImpTemplate(PYTitle, PYColor *, backgroundColor); 58 | PYPropertyEqualImpTemplate(PYTitle, PYColor *, borderColor); 59 | PYPropertyEqualImpTemplate(PYTitle, NSNumber *, borderWidth); 60 | PYPropertyEqualImpTemplate(PYTitle, id, padding); 61 | PYPropertyEqualImpTemplate(PYTitle, NSNumber *, itemGap); 62 | PYPropertyEqualImpTemplate(PYTitle, PYTextStyle *, textStyle); 63 | PYPropertyEqualImpTemplate(PYTitle, PYTextStyle *, subtextStyle); 64 | 65 | @end 66 | -------------------------------------------------------------------------------- /iOS-Echarts/Model/PYToolbox.h: -------------------------------------------------------------------------------- 1 | // 2 | // PYToolbox.h 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto-Y on 15/9/16. 6 | // Copyright (c) 2015年 pluto-y. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class PYColor, PYToolboxFeature, PYTextStyle; 12 | 13 | /** 14 | * 15 | * You can goto this website for references: 16 | * http://echarts.baidu.com/echarts2/doc/doc.html#Toolbox 17 | * 18 | */ 19 | @interface PYToolbox : NSObject 20 | 21 | @property (nonatomic, assign) BOOL show; 22 | @property (nonatomic, strong) NSNumber *zlevel; 23 | @property (nonatomic, strong) NSNumber *z; 24 | @property (nonatomic, copy) PYOrient orient; 25 | @property (nonatomic, strong) id x; 26 | @property (nonatomic, strong) id y; 27 | @property (nonatomic, strong) PYColor *backgroundColor; 28 | @property (nonatomic, strong) PYColor *borderColor; 29 | @property (nonatomic, strong) NSNumber *borderWidth; 30 | @property (nonatomic, strong) id padding; 31 | @property (nonatomic, strong) NSNumber *itemGap; 32 | @property (nonatomic, strong) NSNumber *itemSize; 33 | @property (nonatomic, copy) NSArray *color; 34 | @property (nonatomic, strong) PYColor *disableColor; 35 | @property (nonatomic, strong) PYColor *effectiveColor; 36 | @property (nonatomic, assign) BOOL showTitle; 37 | @property (nonatomic, strong) PYTextStyle *textStyle; 38 | @property (nonatomic, strong) PYToolboxFeature *feature; 39 | 40 | PYInitializerTemplate(PYToolbox, toolbox); 41 | 42 | PYPropertyEqualTemplate(PYToolbox, BOOL, show); 43 | PYPropertyEqualTemplate(PYToolbox, NSNumber *, zlevel); 44 | PYPropertyEqualTemplate(PYToolbox, NSNumber *, z); 45 | PYPropertyEqualTemplate(PYToolbox, PYOrient, orient); 46 | PYPropertyEqualTemplate(PYToolbox, id, x); 47 | PYPropertyEqualTemplate(PYToolbox, id, y); 48 | PYPropertyEqualTemplate(PYToolbox, PYColor *, backgroundColor); 49 | PYPropertyEqualTemplate(PYToolbox, PYColor *, borderColor); 50 | PYPropertyEqualTemplate(PYToolbox, NSNumber *, borderWidth); 51 | PYPropertyEqualTemplate(PYToolbox, id, padding); 52 | PYPropertyEqualTemplate(PYToolbox, NSNumber *, itemGap); 53 | PYPropertyEqualTemplate(PYToolbox, NSNumber *, itemSize); 54 | PYPropertyEqualTemplate(PYToolbox, NSArray *, color); 55 | PYPropertyEqualTemplate(PYToolbox, PYColor *, disableColor); 56 | PYPropertyEqualTemplate(PYToolbox, PYColor *, effectiveColor); 57 | PYPropertyEqualTemplate(PYToolbox, BOOL, showTitle); 58 | PYPropertyEqualTemplate(PYToolbox, PYTextStyle *, textStyle); 59 | PYPropertyEqualTemplate(PYToolbox, PYToolboxFeature *, feature); 60 | 61 | @end 62 | -------------------------------------------------------------------------------- /iOS-Echarts/Model/PYToolbox.m: -------------------------------------------------------------------------------- 1 | // 2 | // PYToolbox.m 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto-Y on 15/9/16. 6 | // Copyright (c) 2015年 pluto-y. All rights reserved. 7 | // 8 | 9 | #import "PYToolbox.h" 10 | #import "PYColor.h" 11 | #import "PYToolboxFeature.h" 12 | #import "PYTextStyle.h" 13 | 14 | @implementation PYToolbox 15 | 16 | - (instancetype)init 17 | { 18 | self = [super init]; 19 | if (self) { 20 | _show = NO; 21 | _zlevel = @(0); 22 | _z = @(6); 23 | _orient = PYOrientHorizontal; 24 | _x = PYPositionRight; 25 | _y = PYPositionTop; 26 | _backgroundColor = PYRGBA(0, 0, 0, 0); 27 | _borderColor = PYRGBA(12, 12, 12, 1); 28 | _borderWidth = @(0); 29 | _padding = @(5); 30 | _itemGap = @(10); 31 | _itemSize = @(16); 32 | _color = @[PYRGBA(30, 144, 255, 1), PYRGBA(34, 187, 34, 1), PYRGBA(75, 0, 130, 1), PYRGBA(210, 105, 30, 1)]; 33 | _disableColor = PYRGBA(13, 13, 13, 0); 34 | _effectiveColor = PYRGBA(255, 0, 0, 1); 35 | _showTitle = YES; 36 | _feature = [[PYToolboxFeature alloc] init]; 37 | } 38 | return self; 39 | } 40 | 41 | PYInitializerImpTemplate(PYToolbox); 42 | 43 | PYPropertyEqualImpTemplate(PYToolbox, BOOL, show); 44 | PYPropertyEqualImpTemplate(PYToolbox, NSNumber *, zlevel); 45 | PYPropertyEqualImpTemplate(PYToolbox, NSNumber *, z); 46 | PYPropertyEqualImpTemplate(PYToolbox, PYOrient, orient); 47 | PYPropertyEqualImpTemplate(PYToolbox, id, x); 48 | PYPropertyEqualImpTemplate(PYToolbox, id, y); 49 | PYPropertyEqualImpTemplate(PYToolbox, PYColor *, backgroundColor); 50 | PYPropertyEqualImpTemplate(PYToolbox, PYColor *, borderColor); 51 | PYPropertyEqualImpTemplate(PYToolbox, NSNumber *, borderWidth); 52 | PYPropertyEqualImpTemplate(PYToolbox, id, padding); 53 | PYPropertyEqualImpTemplate(PYToolbox, NSNumber *, itemGap); 54 | PYPropertyEqualImpTemplate(PYToolbox, NSNumber *, itemSize); 55 | PYPropertyEqualImpTemplate(PYToolbox, NSArray *, color); 56 | PYPropertyEqualImpTemplate(PYToolbox, PYColor *, disableColor); 57 | PYPropertyEqualImpTemplate(PYToolbox, PYColor *, effectiveColor); 58 | PYPropertyEqualImpTemplate(PYToolbox, BOOL, showTitle); 59 | PYPropertyEqualImpTemplate(PYToolbox, PYTextStyle *, textStyle); 60 | PYPropertyEqualImpTemplate(PYToolbox, PYToolboxFeature *, feature); 61 | 62 | @end 63 | -------------------------------------------------------------------------------- /iOS-Echarts/Model/PYTooltip.h: -------------------------------------------------------------------------------- 1 | // 2 | // PYTooltip.h 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto-Y on 15/9/14. 6 | // Copyright (c) 2015年 pluto-y. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class PYColor, PYTextStyle, PYAxisPointer; 12 | 13 | typedef NSString *PYTooltipTrigger; 14 | 15 | FOUNDATION_EXPORT PYTooltipTrigger const PYTooltipTriggerItem; 16 | FOUNDATION_EXPORT PYTooltipTrigger const PYTooltipTriggerAxis; 17 | 18 | /** 19 | * 20 | * You can goto this website for references: 21 | * http://echarts.baidu.com/echarts2/doc/doc.html#Tooltip 22 | * 23 | */ 24 | @interface PYTooltip : NSObject 25 | 26 | @property (nonatomic, assign) BOOL show; 27 | @property (nonatomic, strong) NSNumber *zlevel; 28 | @property (nonatomic, strong) NSNumber *z; 29 | @property (nonatomic, assign) BOOL showContent; 30 | @property (nonatomic, copy) PYTooltipTrigger trigger; 31 | @property (nonatomic, strong) id position; 32 | @property (nonatomic, strong) id formatter; 33 | @property (nonatomic, strong) id islandFormmater; 34 | @property (nonatomic, strong) NSNumber *showDelay; 35 | @property (nonatomic, strong) NSNumber *hideDelay; 36 | @property (nonatomic, strong) NSNumber *transitionDuration; 37 | @property (nonatomic, assign) BOOL enterable; 38 | @property (nonatomic, strong) PYColor *backgroundColor; 39 | @property (nonatomic, strong) PYColor *borderColor; 40 | @property (nonatomic, strong) NSNumber *borderRadius; 41 | @property (nonatomic, strong) NSNumber *borderWidth; 42 | @property (nonatomic, strong) id padding; 43 | @property (nonatomic, strong) PYAxisPointer *axisPointer; 44 | @property (nonatomic, strong) PYTextStyle *textStyle; 45 | 46 | PYInitializerTemplate(PYTooltip, tooltip); 47 | 48 | PYPropertyEqualTemplate(PYTooltip, BOOL, show); 49 | PYPropertyEqualTemplate(PYTooltip, NSNumber *, zlevel); 50 | PYPropertyEqualTemplate(PYTooltip, NSNumber *, z); 51 | PYPropertyEqualTemplate(PYTooltip, BOOL, showContent); 52 | PYPropertyEqualTemplate(PYTooltip, PYTooltipTrigger, trigger); 53 | PYPropertyEqualTemplate(PYTooltip, id, position); 54 | PYPropertyEqualTemplate(PYTooltip, id, formatter); 55 | PYPropertyEqualTemplate(PYTooltip, id, islandFormmater); 56 | PYPropertyEqualTemplate(PYTooltip, NSNumber *, showDelay); 57 | PYPropertyEqualTemplate(PYTooltip, NSNumber *, hideDelay); 58 | PYPropertyEqualTemplate(PYTooltip, NSNumber *, transitionDuration); 59 | PYPropertyEqualTemplate(PYTooltip, BOOL, enterable); 60 | PYPropertyEqualTemplate(PYTooltip, PYColor *, backgroundColor); 61 | PYPropertyEqualTemplate(PYTooltip, PYColor *, borderColor); 62 | PYPropertyEqualTemplate(PYTooltip, NSNumber *, borderRadius); 63 | PYPropertyEqualTemplate(PYTooltip, NSNumber *, borderWidth); 64 | PYPropertyEqualTemplate(PYTooltip, id, padding); 65 | PYPropertyEqualTemplate(PYTooltip, PYAxisPointer *, axisPointer); 66 | PYPropertyEqualTemplate(PYTooltip, PYTextStyle *, textStyle); 67 | 68 | @end 69 | -------------------------------------------------------------------------------- /iOS-Echarts/Model/Series/PYCartesianSeries.h: -------------------------------------------------------------------------------- 1 | // 2 | // PYLineSeries.h 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto Y on 15/9/8. 6 | // Copyright (c) 2015年 pluto-y. All rights reserved. 7 | // 8 | 9 | #import "PYSeries.h" 10 | 11 | typedef NSString *PYCartesianSeriesDataFilter; 12 | 13 | FOUNDATION_EXPORT PYCartesianSeriesDataFilter const PYCartesianSeriesDataFilterNearest; 14 | FOUNDATION_EXPORT PYCartesianSeriesDataFilter const PYCartesianSeriesDataFilterMin; 15 | FOUNDATION_EXPORT PYCartesianSeriesDataFilter const PYCartesianSeriesDataFilterMax; 16 | FOUNDATION_EXPORT PYCartesianSeriesDataFilter const PYCartesianSeriesDataFilterAverage; 17 | 18 | /** 19 | * 20 | * You can goto this website for references: 21 | * http://echarts.baidu.com/echarts2/doc/doc.html#SeriesCartesian 22 | * 23 | */ 24 | @interface PYCartesianSeries : PYSeries 25 | 26 | @property (nonatomic, copy) NSString *stack; 27 | @property (nonatomic, strong) NSNumber *xAxisIndex; 28 | @property (nonatomic, strong) NSNumber *yAxisIndex; 29 | @property (nonatomic, copy) NSString *barGap; 30 | @property (nonatomic, copy) NSString *barCategoryGap; 31 | @property (nonatomic, strong) NSNumber *barMinHeight; 32 | @property (nonatomic, strong) NSNumber *barWidth; 33 | @property (nonatomic, strong) NSNumber *barMaxWidth; 34 | @property (nonatomic, copy) PYSymbol symbol; 35 | @property (nonatomic, strong) id symbolSize; 36 | @property (nonatomic, strong) NSNumber *symbolRotate; 37 | @property (nonatomic, assign) BOOL showAllSymbol; 38 | @property (nonatomic, assign) BOOL smooth; 39 | @property (nonatomic, copy) PYCartesianSeriesDataFilter dataFilter; 40 | @property (nonatomic, assign) BOOL large; 41 | @property (nonatomic, strong) NSNumber *largeThreshold; 42 | @property (nonatomic, assign) BOOL legendHoverLink; 43 | 44 | PYInitializerTemplate(PYCartesianSeries, series); 45 | 46 | PYPropertyEqualTemplate(PYCartesianSeries, NSString *, stack); 47 | PYPropertyEqualTemplate(PYCartesianSeries, NSNumber *, xAxisIndex); 48 | PYPropertyEqualTemplate(PYCartesianSeries, NSNumber *, yAxisIndex); 49 | PYPropertyEqualTemplate(PYCartesianSeries, NSString *, barGap); 50 | PYPropertyEqualTemplate(PYCartesianSeries, NSString *, barCategoryGap); 51 | PYPropertyEqualTemplate(PYCartesianSeries, NSNumber *, barMinHeight); 52 | PYPropertyEqualTemplate(PYCartesianSeries, NSNumber *, barWidth); 53 | PYPropertyEqualTemplate(PYCartesianSeries, NSNumber *, barMaxWidth); 54 | PYPropertyEqualTemplate(PYCartesianSeries, PYSymbol, symbol); 55 | PYPropertyEqualTemplate(PYCartesianSeries, id, symbolSize); 56 | PYPropertyEqualTemplate(PYCartesianSeries, NSNumber *, symbolRotate); 57 | PYPropertyEqualTemplate(PYCartesianSeries, BOOL, showAllSymbol); 58 | PYPropertyEqualTemplate(PYCartesianSeries, BOOL, smooth); 59 | PYPropertyEqualTemplate(PYCartesianSeries, PYCartesianSeriesDataFilter, dataFilter); 60 | PYPropertyEqualTemplate(PYCartesianSeries, BOOL, large); 61 | PYPropertyEqualTemplate(PYCartesianSeries, NSNumber *, largeThreshold); 62 | PYPropertyEqualTemplate(PYCartesianSeries, BOOL, legendHoverLink); 63 | 64 | @end 65 | -------------------------------------------------------------------------------- /iOS-Echarts/Model/Series/PYChordSeries.h: -------------------------------------------------------------------------------- 1 | // 2 | // PYChordSeries.h 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto Y on 8/24/16. 6 | // Copyright © 2016 pluto-y. All rights reserved. 7 | // 8 | 9 | #import "PYSeries.h" 10 | 11 | @class PYCategories, PYNodes, PYLinks; 12 | 13 | /** 14 | * 15 | * You can goto this website for references: 16 | * http://echarts.baidu.com/echarts2/doc/doc.html#SeriesChord 17 | * 18 | */ 19 | @interface PYChordSeries : PYSeries 20 | 21 | @property (nonatomic, copy) NSString *insertToSerie; 22 | @property (nonatomic, strong) id radius; 23 | @property (nonatomic, copy) NSMutableArray *categories; 24 | @property (nonatomic, copy) NSMutableArray *nodes; 25 | @property (nonatomic, copy) NSMutableArray *links; 26 | @property (nonatomic, copy) NSArray *matrix; 27 | @property (nonatomic, assign) BOOL ribbonType; 28 | @property (nonatomic, copy) PYSymbol symbol; 29 | @property (nonatomic, strong) NSNumber *symbolSize; 30 | @property (nonatomic, strong) NSNumber *minRadius; 31 | @property (nonatomic, strong) NSNumber *maxRadius; 32 | @property (nonatomic, assign) BOOL showScale; 33 | @property (nonatomic, assign) BOOL showScaleText; 34 | @property (nonatomic, strong) NSNumber *padding; 35 | @property (nonatomic, copy) PYSort sort; 36 | @property (nonatomic, copy) PYSort sortSub; 37 | @property (nonatomic, assign) BOOL clockWise; 38 | 39 | PYInitializerTemplate(PYChordSeries, series); 40 | 41 | PYPropertyEqualTemplate(PYChordSeries, NSString *, insertToSerie); 42 | PYPropertyEqualTemplate(PYChordSeries, id, radius); 43 | PYPropertyEqualTemplate(PYChordSeries, NSMutableArray *, categories); 44 | PYPropertyEqualTemplate(PYChordSeries, NSMutableArray *, nodes); 45 | PYPropertyEqualTemplate(PYChordSeries, NSMutableArray *, links); 46 | PYPropertyEqualTemplate(PYChordSeries, NSArray *, matrix); 47 | PYPropertyEqualTemplate(PYChordSeries, BOOL, ribbonType); 48 | PYPropertyEqualTemplate(PYChordSeries, PYSymbol, symbol); 49 | PYPropertyEqualTemplate(PYChordSeries, NSNumber *, symbolSize); 50 | PYPropertyEqualTemplate(PYChordSeries, NSNumber *, minRadius); 51 | PYPropertyEqualTemplate(PYChordSeries, NSNumber *, maxRadius); 52 | PYPropertyEqualTemplate(PYChordSeries, BOOL, showScale); 53 | PYPropertyEqualTemplate(PYChordSeries, BOOL, showScaleText); 54 | PYPropertyEqualTemplate(PYChordSeries, NSNumber *, padding); 55 | PYPropertyEqualTemplate(PYChordSeries, PYSort, sort); 56 | PYPropertyEqualTemplate(PYChordSeries, PYSort, sortSub); 57 | PYPropertyEqualTemplate(PYChordSeries, BOOL, clockWise); 58 | 59 | PYAddMethodTemplate(PYChordSeries, PYCategories, Categories, categories); 60 | PYAddMethodTemplate(PYChordSeries, PYNodes, Nodes, nodes); 61 | PYAddMethodTemplate(PYChordSeries, PYLinks, Links, links); 62 | 63 | @end 64 | -------------------------------------------------------------------------------- /iOS-Echarts/Model/Series/PYChordSeries.m: -------------------------------------------------------------------------------- 1 | // 2 | // PYChordSeries.m 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto Y on 8/24/16. 6 | // Copyright © 2016 pluto-y. All rights reserved. 7 | // 8 | 9 | #import "PYChordSeries.h" 10 | 11 | @implementation PYChordSeries 12 | 13 | - (instancetype)init 14 | { 15 | self = [super init]; 16 | if (self) { 17 | self.data = nil; 18 | self.type = PYSeriesTypeChord; 19 | _ribbonType = YES; 20 | _symbol = PYSymbolCircle; 21 | _minRadius = @10; 22 | _maxRadius = @20; 23 | _showScale = NO; 24 | _showScaleText = NO; 25 | _padding = @2; 26 | _sort = PYSortNone; 27 | _sortSub = PYSortNone; 28 | _clockWise = NO; 29 | } 30 | return self; 31 | } 32 | 33 | PYInitializerImpTemplate(PYChordSeries); 34 | 35 | PYPropertyEqualImpTemplate(PYChordSeries, NSString *, insertToSerie); 36 | PYPropertyEqualImpTemplate(PYChordSeries, id, radius); 37 | PYPropertyEqualImpTemplate(PYChordSeries, NSMutableArray *, categories); 38 | PYPropertyEqualImpTemplate(PYChordSeries, NSMutableArray *, nodes); 39 | PYPropertyEqualImpTemplate(PYChordSeries, NSMutableArray *, links); 40 | PYPropertyEqualImpTemplate(PYChordSeries, NSArray *, matrix); 41 | PYPropertyEqualImpTemplate(PYChordSeries, BOOL, ribbonType); 42 | PYPropertyEqualImpTemplate(PYChordSeries, PYSymbol, symbol); 43 | PYPropertyEqualImpTemplate(PYChordSeries, NSNumber *, symbolSize); 44 | PYPropertyEqualImpTemplate(PYChordSeries, NSNumber *, minRadius); 45 | PYPropertyEqualImpTemplate(PYChordSeries, NSNumber *, maxRadius); 46 | PYPropertyEqualImpTemplate(PYChordSeries, BOOL, showScale); 47 | PYPropertyEqualImpTemplate(PYChordSeries, BOOL, showScaleText); 48 | PYPropertyEqualImpTemplate(PYChordSeries, NSNumber *, padding); 49 | PYPropertyEqualImpTemplate(PYChordSeries, PYSort, sort); 50 | PYPropertyEqualImpTemplate(PYChordSeries, PYSort, sortSub); 51 | PYPropertyEqualImpTemplate(PYChordSeries, BOOL, clockWise); 52 | 53 | PYAddMethodImpTemplate(PYChordSeries, PYCategories, Categories, categories); 54 | PYAddMethodImpTemplate(PYChordSeries, PYNodes, Nodes, nodes); 55 | PYAddMethodImpTemplate(PYChordSeries, PYLinks, Links, links); 56 | 57 | @end 58 | -------------------------------------------------------------------------------- /iOS-Echarts/Model/Series/PYEventRiverSeries.h: -------------------------------------------------------------------------------- 1 | // 2 | // PYEventRiverSeries.h 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto Y on 4/24/16. 6 | // Copyright © 2016 Pluto-y. All rights reserved. 7 | // 8 | 9 | #import "PYSeries.h" 10 | 11 | /** 12 | * 13 | * You can goto this website for references: 14 | * http://echarts.baidu.com/echarts2/doc/doc.html#SeriesEventRiver 15 | * 16 | */ 17 | @interface PYEventRiverSeries : PYSeries 18 | 19 | @property (nonatomic, strong) NSNumber *xAxisIndex; 20 | @property (nonatomic, strong) NSNumber *weight; 21 | @property (nonatomic, assign) BOOL legendHoverLink; 22 | 23 | PYInitializerTemplate(PYEventRiverSeries, series); 24 | 25 | PYPropertyEqualTemplate(PYEventRiverSeries, NSNumber *, xAxisIndex); 26 | PYPropertyEqualTemplate(PYEventRiverSeries, NSNumber *, weight); 27 | PYPropertyEqualTemplate(PYEventRiverSeries, BOOL, legendHoverLink); 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /iOS-Echarts/Model/Series/PYEventRiverSeries.m: -------------------------------------------------------------------------------- 1 | // 2 | // PYEventRiverSeries.m 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto Y on 4/24/16. 6 | // Copyright © 2016 Pluto-y. All rights reserved. 7 | // 8 | 9 | #import "PYEventRiverSeries.h" 10 | 11 | @implementation PYEventRiverSeries 12 | 13 | - (instancetype)init { 14 | self = [super init]; 15 | if (self) { 16 | self.type = PYSeriesTypeEventRiver; 17 | _xAxisIndex = 0; 18 | _weight = @(1); 19 | _legendHoverLink = YES; 20 | } 21 | return self; 22 | } 23 | 24 | PYInitializerImpTemplate(PYEventRiverSeries); 25 | 26 | PYPropertyEqualImpTemplate(PYEventRiverSeries, NSNumber *, xAxisIndex); 27 | PYPropertyEqualImpTemplate(PYEventRiverSeries, NSNumber *, weight); 28 | PYPropertyEqualImpTemplate(PYEventRiverSeries, BOOL, legendHoverLink); 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /iOS-Echarts/Model/Series/PYFunnelSeries.h: -------------------------------------------------------------------------------- 1 | // 2 | // PYFunnelSeries.h 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto Y on 4/24/16. 6 | // Copyright © 2016 Pluto-y. All rights reserved. 7 | // 8 | 9 | #import "PYSeries.h" 10 | 11 | typedef NSString *PYFunnelSeriesSort __deprecated_msg("Use PYSort instead"); 12 | 13 | FOUNDATION_EXPORT PYFunnelSeriesSort const PYFunnelSeriesSortAscending __deprecated_msg("Use PYSortAscending instead"); 14 | FOUNDATION_EXPORT PYFunnelSeriesSort const PYFunnelSeriesSortDescending __deprecated_msg("Use PYSortDescending instead"); 15 | 16 | /** 17 | * 18 | * You can goto this website for references: 19 | * http://echarts.baidu.com/echarts2/doc/doc.html#SeriesFunnel 20 | * 21 | */ 22 | @interface PYFunnelSeries : PYSeries 23 | 24 | @property (nonatomic, strong) id x; 25 | @property (nonatomic, strong) id y; 26 | @property (nonatomic, strong) id x2; 27 | @property (nonatomic, strong) id y2; 28 | @property (nonatomic, strong) id width; 29 | @property (nonatomic, strong) id height; 30 | @property (nonatomic, copy) NSString *funnelAlign; 31 | @property (nonatomic, strong) NSNumber *min; 32 | @property (nonatomic, strong) NSNumber *max; 33 | @property (nonatomic, copy) NSString *minSize; 34 | @property (nonatomic, copy) NSString *maxSize; 35 | @property (nonatomic, copy) PYSort sort; 36 | @property (nonatomic, strong) NSNumber *gap; 37 | @property (nonatomic, assign) BOOL legendHoverLink; 38 | 39 | PYInitializerTemplate(PYFunnelSeries, series); 40 | 41 | PYPropertyEqualTemplate(PYFunnelSeries, id, x); 42 | PYPropertyEqualTemplate(PYFunnelSeries, id, y); 43 | PYPropertyEqualTemplate(PYFunnelSeries, id, x2); 44 | PYPropertyEqualTemplate(PYFunnelSeries, id, y2); 45 | PYPropertyEqualTemplate(PYFunnelSeries, id, width); 46 | PYPropertyEqualTemplate(PYFunnelSeries, id, height); 47 | PYPropertyEqualTemplate(PYFunnelSeries, NSString *, funnelAlign); 48 | PYPropertyEqualTemplate(PYFunnelSeries, NSNumber *, min); 49 | PYPropertyEqualTemplate(PYFunnelSeries, NSNumber *, max); 50 | PYPropertyEqualTemplate(PYFunnelSeries, NSString *, minSize); 51 | PYPropertyEqualTemplate(PYFunnelSeries, NSString *, maxSize); 52 | PYPropertyEqualTemplate(PYFunnelSeries, PYSort, sort); 53 | PYPropertyEqualTemplate(PYFunnelSeries, NSNumber *, gap); 54 | PYPropertyEqualTemplate(PYFunnelSeries, BOOL, legendHoverLink); 55 | 56 | @end 57 | -------------------------------------------------------------------------------- /iOS-Echarts/Model/Series/PYFunnelSeries.m: -------------------------------------------------------------------------------- 1 | // 2 | // PYFunnelSeries.m 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto Y on 4/24/16. 6 | // Copyright © 2016 Pluto-y. All rights reserved. 7 | // 8 | 9 | #import "PYFunnelSeries.h" 10 | 11 | PYFunnelSeriesSort const PYFunnelSeriesSortAscending = @"ascending"; 12 | PYFunnelSeriesSort const PYFunnelSeriesSortDescending = @"descending"; 13 | 14 | static NSArray *funnelSeriesSortScope; 15 | @implementation PYFunnelSeries 16 | 17 | + (void)initialize 18 | { 19 | if (self == [PYFunnelSeries class]) { 20 | #pragma clang diagnostic push 21 | #pragma clang diagnostic ignored "-Wdeprecated" 22 | funnelSeriesSortScope = @[PYSortNone, PYSortAscending, PYSortDescending, PYFunnelSeriesSortAscending, PYFunnelSeriesSortDescending]; 23 | #pragma clang diagnostic pop 24 | } 25 | } 26 | 27 | - (instancetype)init { 28 | self = [super init]; 29 | if (self) { 30 | self.type = PYSeriesTypeFunnel; 31 | _x = @(80); 32 | _y = @(60); 33 | _x2 = @(80); 34 | _y2 = @(60); 35 | _funnelAlign = PYPositionCenter; 36 | _min = 0; 37 | _max = @(100); 38 | _minSize = @"0%"; 39 | _maxSize = @"100%"; 40 | _sort = PYSortDescending; 41 | _legendHoverLink = YES; 42 | } 43 | return self; 44 | } 45 | 46 | - (void)setSort:(PYSort)sort { 47 | if (![funnelSeriesSortScope containsObject:sort]) { 48 | NSLog(@"ERROR: FunnelSeries does not support the sort --- %@", sort); 49 | _sort = PYSortDescending; 50 | return; 51 | } 52 | _sort = [sort copy]; 53 | } 54 | 55 | PYInitializerImpTemplate(PYFunnelSeries); 56 | 57 | PYPropertyEqualImpTemplate(PYFunnelSeries, id, x); 58 | PYPropertyEqualImpTemplate(PYFunnelSeries, id, y); 59 | PYPropertyEqualImpTemplate(PYFunnelSeries, id, x2); 60 | PYPropertyEqualImpTemplate(PYFunnelSeries, id, y2); 61 | PYPropertyEqualImpTemplate(PYFunnelSeries, id, width); 62 | PYPropertyEqualImpTemplate(PYFunnelSeries, id, height); 63 | PYPropertyEqualImpTemplate(PYFunnelSeries, NSString *, funnelAlign); 64 | PYPropertyEqualImpTemplate(PYFunnelSeries, NSNumber *, min); 65 | PYPropertyEqualImpTemplate(PYFunnelSeries, NSNumber *, max); 66 | PYPropertyEqualImpTemplate(PYFunnelSeries, NSString *, minSize); 67 | PYPropertyEqualImpTemplate(PYFunnelSeries, NSString *, maxSize); 68 | PYPropertyEqualImpTemplate(PYFunnelSeries, PYSort, sort); 69 | PYPropertyEqualImpTemplate(PYFunnelSeries, NSNumber *, gap); 70 | PYPropertyEqualImpTemplate(PYFunnelSeries, BOOL, legendHoverLink); 71 | 72 | @end 73 | -------------------------------------------------------------------------------- /iOS-Echarts/Model/Series/PYHeatmapSeries.h: -------------------------------------------------------------------------------- 1 | // 2 | // PYHeatmapSeries.h 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto Y on 15/12/28. 6 | // Copyright © 2015年 pluto-y. All rights reserved. 7 | // 8 | 9 | #import "PYSeries.h" 10 | 11 | /** 12 | * 13 | * You can goto this website for references: 14 | * http://echarts.baidu.com/doc/doc.html#SeriesMap 15 | * 16 | */ 17 | @interface PYHeatmapSeries : PYSeries 18 | 19 | @property (nonatomic, strong) NSNumber *blurSize; 20 | @property (nonatomic, copy) NSArray *gradientColors; 21 | @property (nonatomic, strong) NSNumber *minAlpha; 22 | @property (nonatomic, strong) NSNumber *valueScale; 23 | @property (nonatomic, strong) NSNumber *opacity; 24 | 25 | PYInitializerTemplate(PYHeatmapSeries, series); 26 | 27 | PYPropertyEqualTemplate(PYHeatmapSeries, NSNumber *, blurSize); 28 | PYPropertyEqualTemplate(PYHeatmapSeries, NSArray *, gradientColors); 29 | PYPropertyEqualTemplate(PYHeatmapSeries, NSNumber *, minAlpha); 30 | PYPropertyEqualTemplate(PYHeatmapSeries, NSNumber *, valueScale); 31 | PYPropertyEqualTemplate(PYHeatmapSeries, NSNumber *, opacity); 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /iOS-Echarts/Model/Series/PYHeatmapSeries.m: -------------------------------------------------------------------------------- 1 | // 2 | // PYHeatmapSeries.m 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto Y on 15/12/28. 6 | // Copyright © 2015年 pluto-y. All rights reserved. 7 | // 8 | 9 | #import "PYHeatmapSeries.h" 10 | 11 | @implementation PYHeatmapSeries 12 | 13 | - (instancetype)init 14 | { 15 | self = [super init]; 16 | if (self) { 17 | self.type = PYSeriesTypeHeatmap; 18 | _blurSize = @30; 19 | _gradientColors = @[@"blue", @"cyan", @"lime", @"yellow", @"red"]; 20 | _minAlpha = @0.05; 21 | _valueScale = @1; 22 | _opacity = @1; 23 | } 24 | return self; 25 | } 26 | 27 | PYInitializerImpTemplate(PYHeatmapSeries); 28 | 29 | PYPropertyEqualImpTemplate(PYHeatmapSeries, NSNumber *, blurSize); 30 | PYPropertyEqualImpTemplate(PYHeatmapSeries, NSArray *, gradientColors); 31 | PYPropertyEqualImpTemplate(PYHeatmapSeries, NSNumber *, minAlpha); 32 | PYPropertyEqualImpTemplate(PYHeatmapSeries, NSNumber *, valueScale); 33 | PYPropertyEqualImpTemplate(PYHeatmapSeries, NSNumber *, opacity); 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /iOS-Echarts/Model/Series/PYMapSeries.h: -------------------------------------------------------------------------------- 1 | // 2 | // PYMapSeries.h 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto Y on 16/2/17. 6 | // Copyright © 2016年 pluto-y. All rights reserved. 7 | // 8 | 9 | #import "PYSeries.h" 10 | 11 | typedef NSString *PYMapSeriesMapValueCalculation; 12 | 13 | FOUNDATION_EXPORT PYMapSeriesMapValueCalculation const PYMapSeriesMapValueCalculationSum; 14 | FOUNDATION_EXPORT PYMapSeriesMapValueCalculation const PYMapSeriesMapValueCalculationAverage; 15 | 16 | /** 17 | * 18 | * You can goto this website for references: 19 | * http://echarts.baidu.com/echarts2/doc/doc.html#SeriesMap 20 | * 21 | */ 22 | @interface PYMapSeries : PYSeries 23 | 24 | @property (nonatomic, strong) id selectedMode; 25 | @property (nonatomic, copy) NSString *mapType; 26 | @property (nonatomic, assign) BOOL hoverable; 27 | @property (nonatomic, assign) BOOL dataRangeHoverLink; 28 | @property (nonatomic, copy) NSDictionary *mapLocation; 29 | @property (nonatomic, copy) PYMapSeriesMapValueCalculation mapValueCalculation; 30 | @property (nonatomic, strong) NSNumber *mapValuePrecision; 31 | @property (nonatomic, assign) BOOL showLegendSymbol; 32 | @property (nonatomic, strong) id roam; 33 | @property (nonatomic, copy) NSDictionary *scaleLimit; 34 | @property (nonatomic, copy) NSDictionary *nameMap; 35 | @property (nonatomic, copy) NSDictionary *textFixed; 36 | @property (nonatomic, copy) NSDictionary *geoCoord; 37 | @property (nonatomic, copy) NSDictionary *heatmap; 38 | 39 | PYInitializerTemplate(PYMapSeries, series); 40 | 41 | PYPropertyEqualTemplate(PYMapSeries, id, selectedMode); 42 | PYPropertyEqualTemplate(PYMapSeries, NSString *, mapType); 43 | PYPropertyEqualTemplate(PYMapSeries, BOOL, hoverable); 44 | PYPropertyEqualTemplate(PYMapSeries, BOOL, dataRangeHoverLink); 45 | PYPropertyEqualTemplate(PYMapSeries, NSDictionary *, mapLocation); 46 | PYPropertyEqualTemplate(PYMapSeries, PYMapSeriesMapValueCalculation, mapValueCalculation); 47 | PYPropertyEqualTemplate(PYMapSeries, NSNumber *, mapValuePrecision); 48 | PYPropertyEqualTemplate(PYMapSeries, BOOL, showLegendSymbol); 49 | PYPropertyEqualTemplate(PYMapSeries, id, roam); 50 | PYPropertyEqualTemplate(PYMapSeries, NSDictionary *, scaleLimit); 51 | PYPropertyEqualTemplate(PYMapSeries, NSDictionary *, nameMap); 52 | PYPropertyEqualTemplate(PYMapSeries, NSDictionary *, textFixed); 53 | PYPropertyEqualTemplate(PYMapSeries, NSDictionary *, geoCoord); 54 | PYPropertyEqualTemplate(PYMapSeries, NSDictionary *, heatmap); 55 | 56 | @end 57 | -------------------------------------------------------------------------------- /iOS-Echarts/Model/Series/PYMapSeries.m: -------------------------------------------------------------------------------- 1 | // 2 | // PYMapSeries.m 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto Y on 16/2/17. 6 | // Copyright © 2016年 pluto-y. All rights reserved. 7 | // 8 | 9 | #import "PYMapSeries.h" 10 | 11 | PYMapSeriesMapValueCalculation const PYMapSeriesMapValueCalculationSum = @"sum"; 12 | PYMapSeriesMapValueCalculation const PYMapSeriesMapValueCalculationAverage = @"average"; 13 | 14 | static NSArray *mapValueCalculationScope; 15 | @implementation PYMapSeries 16 | 17 | + (void)initialize 18 | { 19 | if (self == [PYMapSeries class]) { 20 | mapValueCalculationScope = @[PYMapSeriesMapValueCalculationSum, PYMapSeriesMapValueCalculationAverage]; 21 | } 22 | } 23 | 24 | - (instancetype)init 25 | { 26 | self = [super init]; 27 | if (self) { 28 | self.type = PYSeriesTypeMap; 29 | _mapType = @"China"; 30 | _hoverable = YES; 31 | _dataRangeHoverLink = YES; 32 | _mapLocation = @{@"x":PYPositionCenter, @"y":PYPositionCenter}; 33 | _mapValueCalculation = PYMapSeriesMapValueCalculationSum; 34 | _showLegendSymbol = YES; 35 | _roam = @(NO); 36 | } 37 | return self; 38 | } 39 | 40 | - (void)setMapValueCalculation:(PYMapSeriesMapValueCalculation)mapValueCalculation { 41 | if (![mapValueCalculationScope containsObject:mapValueCalculation]) { 42 | NSLog(@"ERROR: MapSeries does not support the mapValueCalculation --- %@", mapValueCalculation); 43 | _mapValueCalculation = PYMapSeriesMapValueCalculationSum; 44 | return; 45 | } 46 | _mapValueCalculation = [mapValueCalculation copy]; 47 | } 48 | 49 | PYInitializerImpTemplate(PYMapSeries); 50 | 51 | PYPropertyEqualImpTemplate(PYMapSeries, id, selectedMode); 52 | PYPropertyEqualImpTemplate(PYMapSeries, NSString *, mapType); 53 | PYPropertyEqualImpTemplate(PYMapSeries, BOOL, hoverable); 54 | PYPropertyEqualImpTemplate(PYMapSeries, BOOL, dataRangeHoverLink); 55 | PYPropertyEqualImpTemplate(PYMapSeries, NSDictionary *, mapLocation); 56 | PYPropertyEqualImpTemplate(PYMapSeries, PYMapSeriesMapValueCalculation, mapValueCalculation); 57 | PYPropertyEqualImpTemplate(PYMapSeries, NSNumber *, mapValuePrecision); 58 | PYPropertyEqualImpTemplate(PYMapSeries, BOOL, showLegendSymbol); 59 | PYPropertyEqualImpTemplate(PYMapSeries, id, roam); 60 | PYPropertyEqualImpTemplate(PYMapSeries, NSDictionary *, scaleLimit); 61 | PYPropertyEqualImpTemplate(PYMapSeries, NSDictionary *, nameMap); 62 | PYPropertyEqualImpTemplate(PYMapSeries, NSDictionary *, textFixed); 63 | PYPropertyEqualImpTemplate(PYMapSeries, NSDictionary *, geoCoord); 64 | PYPropertyEqualImpTemplate(PYMapSeries, NSDictionary *, heatmap); 65 | 66 | @end 67 | -------------------------------------------------------------------------------- /iOS-Echarts/Model/Series/PYMarkLine.m: -------------------------------------------------------------------------------- 1 | // 2 | // PYMarkLine.m 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto-Y on 15/9/16. 6 | // Copyright (c) 2015年 pluto-y. All rights reserved. 7 | // 8 | 9 | #import "PYMarkLine.h" 10 | #import "PYItemStyle.h" 11 | 12 | @implementation PYBundling 13 | 14 | PYInitializerImpTemplate(PYBundling); 15 | 16 | PYPropertyEqualImpTemplate(PYBundling, BOOL, enable); 17 | PYPropertyEqualImpTemplate(PYBundling, NSNumber *, maxTurningAngle); 18 | 19 | @end 20 | 21 | @implementation PYMarkLineEffect 22 | 23 | PYInitializerImpTemplate(PYMarkLineEffect); 24 | 25 | PYPropertyEqualImpTemplate(PYMarkLineEffect, BOOL, show); 26 | PYPropertyEqualImpTemplate(PYMarkLineEffect, BOOL, loop); 27 | PYPropertyEqualImpTemplate(PYMarkLineEffect, NSNumber *, period); 28 | PYPropertyEqualImpTemplate(PYMarkLineEffect, NSNumber *, scaleSize); 29 | PYPropertyEqualImpTemplate(PYMarkLineEffect, PYColor *, color); 30 | PYPropertyEqualImpTemplate(PYMarkLineEffect, PYColor *, shadowColor); 31 | PYPropertyEqualImpTemplate(PYMarkLineEffect, NSNumber *, shadowBlur); 32 | 33 | @end 34 | 35 | @implementation PYMarkLine 36 | 37 | - (instancetype)init 38 | { 39 | self = [super init]; 40 | if (self) { 41 | _clickable = YES; 42 | _symbol = @[PYSymbolCircle, PYSymbolArrow]; 43 | _symbolSize = @[@(2), @(4)]; 44 | _large = NO; 45 | _smooth = NO; 46 | _smoothness = @(0.2); 47 | _precision = @(2); 48 | _bundling = [[PYBundling alloc] init]; 49 | _bundling.enable = NO; 50 | _bundling.maxTurningAngle = @(45); 51 | _effect = [[PYMarkLineEffect alloc] init]; 52 | _effect.show = NO; 53 | _effect.loop = YES; 54 | _effect.period = @(15); 55 | _effect.scaleSize = @(2); 56 | } 57 | return self; 58 | } 59 | 60 | PYInitializerImpTemplate(PYMarkLine); 61 | 62 | PYPropertyEqualImpTemplate(PYMarkLine, BOOL, clickable); 63 | PYPropertyEqualImpTemplate(PYMarkLine, id, symbol); 64 | PYPropertyEqualImpTemplate(PYMarkLine, id, symbolSize); 65 | PYPropertyEqualImpTemplate(PYMarkLine, id, symbolRotate); 66 | PYPropertyEqualImpTemplate(PYMarkLine, BOOL, large); 67 | PYPropertyEqualImpTemplate(PYMarkLine, BOOL, smooth); 68 | PYPropertyEqualImpTemplate(PYMarkLine, NSNumber *, smoothness); 69 | PYPropertyEqualImpTemplate(PYMarkLine, NSNumber *, precision); 70 | PYPropertyEqualImpTemplate(PYMarkLine, PYBundling *, bundling); 71 | PYPropertyEqualImpTemplate(PYMarkLine, PYMarkLineEffect *, effect); 72 | PYPropertyEqualImpTemplate(PYMarkLine, PYItemStyle *, itemStyle); 73 | PYPropertyEqualImpTemplate(PYMarkLine, NSMutableArray *, data); 74 | 75 | PYAddMethodImpTemplate(PYMarkLine, NSObject, Data, data); 76 | 77 | @end 78 | -------------------------------------------------------------------------------- /iOS-Echarts/Model/Series/PYMarkPoint.h: -------------------------------------------------------------------------------- 1 | // 2 | // PYMarkPoint.h 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto-Y on 15/9/16. 6 | // Copyright (c) 2015年 pluto-y. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class PYColor, PYItemStyle; 12 | 13 | typedef NSString *PYMarkPointEffectType; 14 | 15 | FOUNDATION_EXPORT PYMarkPointEffectType const PYMarkPointEffectTypeScale; 16 | FOUNDATION_EXPORT PYMarkPointEffectType const PYMarkPointEffectTypeBounce; 17 | 18 | @interface PYMarkPointEffect : NSObject 19 | 20 | @property (nonatomic, assign) BOOL show; 21 | @property (nonatomic, copy) PYMarkPointEffectType type; 22 | @property (nonatomic, assign) BOOL loop; 23 | @property (nonatomic, strong) NSNumber *period; 24 | @property (nonatomic, strong) NSNumber *scaleSize; 25 | @property (nonatomic, strong) NSNumber *bounceDistance; 26 | @property (nonatomic, strong) PYColor *color; 27 | @property (nonatomic, strong) PYColor *shadowColor; 28 | @property (nonatomic, strong) NSNumber *shadowBlur; 29 | 30 | PYInitializerTemplate(PYMarkPointEffect, effect); 31 | 32 | PYPropertyEqualTemplate(PYMarkPointEffect, BOOL, show); 33 | PYPropertyEqualTemplate(PYMarkPointEffect, PYMarkPointEffectType, type); 34 | PYPropertyEqualTemplate(PYMarkPointEffect, BOOL, loop); 35 | PYPropertyEqualTemplate(PYMarkPointEffect, NSNumber *, period); 36 | PYPropertyEqualTemplate(PYMarkPointEffect, NSNumber *, scaleSize); 37 | PYPropertyEqualTemplate(PYMarkPointEffect, NSNumber *, bounceDistance); 38 | PYPropertyEqualTemplate(PYMarkPointEffect, PYColor *, color); 39 | PYPropertyEqualTemplate(PYMarkPointEffect, PYColor *, shadowColor); 40 | PYPropertyEqualTemplate(PYMarkPointEffect, NSNumber *, shadowBlur); 41 | 42 | @end 43 | 44 | /** 45 | * 46 | * You can goto this website for references: 47 | * http://echarts.baidu.com/echarts2/doc/doc.html#SeriesMarkPoint 48 | * 49 | */ 50 | @interface PYMarkPoint : NSObject 51 | 52 | @property (nonatomic, assign) BOOL clickable; 53 | @property (nonatomic, strong) id symbol; 54 | @property (nonatomic, strong) id symbolSize; 55 | @property (nonatomic, strong) id symbolRotate; 56 | @property (nonatomic, assign) BOOL large; 57 | @property (nonatomic, strong) PYMarkPointEffect *effect; 58 | @property (nonatomic, strong) PYItemStyle *itemStyle; 59 | @property (nonatomic, copy) NSMutableArray *data; 60 | 61 | PYInitializerTemplate(PYMarkPoint, markPoint); 62 | 63 | PYPropertyEqualTemplate(PYMarkPoint, BOOL, clickable); 64 | PYPropertyEqualTemplate(PYMarkPoint, id, symbol); 65 | PYPropertyEqualTemplate(PYMarkPoint, id, symbolSize); 66 | PYPropertyEqualTemplate(PYMarkPoint, id, symbolRotate); 67 | PYPropertyEqualTemplate(PYMarkPoint, BOOL, large); 68 | PYPropertyEqualTemplate(PYMarkPoint, PYMarkPointEffect *, effect); 69 | PYPropertyEqualTemplate(PYMarkPoint, PYItemStyle *, itemStyle); 70 | PYPropertyEqualTemplate(PYMarkPoint, NSMutableArray *, data); 71 | 72 | PYAddMethodTemplate(PYMarkPoint, NSObject, Data, data); 73 | 74 | @end 75 | -------------------------------------------------------------------------------- /iOS-Echarts/Model/Series/PYMarkPoint.m: -------------------------------------------------------------------------------- 1 | // 2 | // PYMarkPoint.m 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto-Y on 15/9/16. 6 | // Copyright (c) 2015年 pluto-y. All rights reserved. 7 | // 8 | 9 | #import "PYMarkPoint.h" 10 | #import "PYItemStyle.h" 11 | 12 | PYMarkPointEffectType const PYMarkPointEffectTypeScale = @"scale"; 13 | PYMarkPointEffectType const PYMarkPointEffectTypeBounce = @"bounce"; 14 | 15 | static NSArray *markPointEffectTypeScope; 16 | @interface PYMarkPointEffect() 17 | 18 | @end 19 | 20 | @implementation PYMarkPointEffect 21 | 22 | + (void)initialize 23 | { 24 | if (self == [PYMarkPointEffect class]) { 25 | markPointEffectTypeScope = @[PYMarkPointEffectTypeScale, PYMarkPointEffectTypeBounce]; 26 | } 27 | } 28 | 29 | - (void)setType:(PYMarkPointEffectType)type { 30 | if (![markPointEffectTypeScope containsObject:type]) { 31 | NSLog(@"ERROR: MarkPointEffect does not support type --- %@", type); 32 | type = PYMarkPointEffectTypeScale; 33 | return; 34 | } 35 | _type = [type copy]; 36 | } 37 | 38 | PYInitializerImpTemplate(PYMarkPointEffect); 39 | 40 | PYPropertyEqualImpTemplate(PYMarkPointEffect, BOOL, show); 41 | PYPropertyEqualImpTemplate(PYMarkPointEffect, PYMarkPointEffectType, type); 42 | PYPropertyEqualImpTemplate(PYMarkPointEffect, BOOL, loop); 43 | PYPropertyEqualImpTemplate(PYMarkPointEffect, NSNumber *, period); 44 | PYPropertyEqualImpTemplate(PYMarkPointEffect, NSNumber *, scaleSize); 45 | PYPropertyEqualImpTemplate(PYMarkPointEffect, NSNumber *, bounceDistance); 46 | PYPropertyEqualImpTemplate(PYMarkPointEffect, PYColor *, color); 47 | PYPropertyEqualImpTemplate(PYMarkPointEffect, PYColor *, shadowColor); 48 | PYPropertyEqualImpTemplate(PYMarkPointEffect, NSNumber *, shadowBlur); 49 | 50 | @end 51 | 52 | @implementation PYMarkPoint 53 | 54 | - (instancetype)init 55 | { 56 | self = [super init]; 57 | if (self) { 58 | _clickable = YES; 59 | _symbol = PYSymbolPin; 60 | _symbolSize = @(10); 61 | _large = NO; 62 | _effect = [[PYMarkPointEffect alloc] init]; 63 | _effect.show = NO; 64 | _effect.type = PYMarkPointEffectTypeScale; 65 | _effect.period = @(15); 66 | _effect.scaleSize = @(2); 67 | _effect.bounceDistance = @(10); 68 | _effect.shadowBlur = @(0); 69 | } 70 | return self; 71 | } 72 | 73 | PYInitializerImpTemplate(PYMarkPoint); 74 | 75 | PYPropertyEqualImpTemplate(PYMarkPoint, BOOL, clickable); 76 | PYPropertyEqualImpTemplate(PYMarkPoint, id, symbol); 77 | PYPropertyEqualImpTemplate(PYMarkPoint, id, symbolSize); 78 | PYPropertyEqualImpTemplate(PYMarkPoint, id, symbolRotate); 79 | PYPropertyEqualImpTemplate(PYMarkPoint, BOOL, large); 80 | PYPropertyEqualImpTemplate(PYMarkPoint, PYMarkPointEffect *, effect); 81 | PYPropertyEqualImpTemplate(PYMarkPoint, PYItemStyle *, itemStyle); 82 | PYPropertyEqualImpTemplate(PYMarkPoint, NSMutableArray *, data); 83 | 84 | PYAddMethodImpTemplate(PYMarkPoint, NSObject, Data, data); 85 | 86 | @end 87 | -------------------------------------------------------------------------------- /iOS-Echarts/Model/Series/PYPieSeries.h: -------------------------------------------------------------------------------- 1 | // 2 | // PYPieSeries.h 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto-Y on 15/10/3. 6 | // Copyright © 2015年 pluto-y. All rights reserved. 7 | // 8 | 9 | #import "PYSeries.h" 10 | 11 | typedef NSString *PYPieSeriesRoseType; 12 | 13 | FOUNDATION_EXPORT PYPieSeriesRoseType const PYPieSeriesRoseTypeRadius; 14 | FOUNDATION_EXPORT PYPieSeriesRoseType const PYPieSeriesRoseTypeArea; 15 | 16 | /** 17 | * 18 | * You can goto this website for references: 19 | * http://echarts.baidu.com/echarts2/doc/doc.html#SeriesPie 20 | * 21 | */ 22 | @interface PYPieSeries : PYSeries 23 | 24 | @property (nonatomic, copy) NSArray *center; 25 | @property (nonatomic, strong) id radius; 26 | @property (nonatomic, strong) NSNumber *startAngle; 27 | @property (nonatomic, strong) NSNumber *minAngle; 28 | @property (nonatomic, assign) BOOL clockWise; 29 | @property (nonatomic, copy) PYPieSeriesRoseType roseType; 30 | @property (nonatomic, strong) NSNumber *selectedOffset; 31 | @property (nonatomic, strong) id selectedMode; 32 | @property (nonatomic, assign) BOOL legendHoverLink; 33 | 34 | PYInitializerTemplate(PYPieSeries, series); 35 | 36 | PYPropertyEqualTemplate(PYPieSeries, NSArray *, center); 37 | PYPropertyEqualTemplate(PYPieSeries, id, radius); 38 | PYPropertyEqualTemplate(PYPieSeries, NSNumber *, startAngle); 39 | PYPropertyEqualTemplate(PYPieSeries, NSNumber *, minAngle); 40 | PYPropertyEqualTemplate(PYPieSeries, BOOL, clockWise); 41 | PYPropertyEqualTemplate(PYPieSeries, PYPieSeriesRoseType, roseType); 42 | PYPropertyEqualTemplate(PYPieSeries, NSNumber *, selectedOffset); 43 | PYPropertyEqualTemplate(PYPieSeries, id, selectedMode); 44 | PYPropertyEqualTemplate(PYPieSeries, BOOL, legendHoverLink); 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /iOS-Echarts/Model/Series/PYPieSeries.m: -------------------------------------------------------------------------------- 1 | // 2 | // PYPieSeries.m 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto-Y on 15/10/3. 6 | // Copyright © 2015年 pluto-y. All rights reserved. 7 | // 8 | 9 | #import "PYPieSeries.h" 10 | 11 | PYPieSeriesRoseType const PYPieSeriesRoseTypeRadius = @"radius"; 12 | PYPieSeriesRoseType const PYPieSeriesRoseTypeArea = @"area"; 13 | 14 | static NSArray *pieSeriesRoleTypeScope; 15 | @implementation PYPieSeries 16 | 17 | + (void)initialize 18 | { 19 | if (self == [PYPieSeries class]) { 20 | pieSeriesRoleTypeScope = @[PYPieSeriesRoseTypeRadius, PYPieSeriesRoseTypeArea]; 21 | } 22 | } 23 | 24 | - (instancetype)init 25 | { 26 | self = [super init]; 27 | if (self) { 28 | self.type = PYSeriesTypePie; 29 | _center = @[@"50%", @"50%"]; 30 | _radius = @[@"0", @"75%"]; 31 | _startAngle = @(90); 32 | _minAngle = @(0); 33 | _clockWise = YES; 34 | _selectedMode = @(10); 35 | _legendHoverLink = YES; 36 | } 37 | return self; 38 | } 39 | 40 | - (void)setRoseType:(PYPieSeriesRoseType)roseType { 41 | if (roseType != nil && ![pieSeriesRoleTypeScope containsObject:roseType]) { 42 | NSLog(@"ERROR: PYPieSeries does not support roseType --- %@", roseType); 43 | _roseType = nil; 44 | return; 45 | } 46 | _roseType = [roseType copy]; 47 | } 48 | 49 | PYInitializerImpTemplate(PYPieSeries); 50 | 51 | PYPropertyEqualImpTemplate(PYPieSeries, NSArray *, center); 52 | PYPropertyEqualImpTemplate(PYPieSeries, id, radius); 53 | PYPropertyEqualImpTemplate(PYPieSeries, NSNumber *, startAngle); 54 | PYPropertyEqualImpTemplate(PYPieSeries, NSNumber *, minAngle); 55 | PYPropertyEqualImpTemplate(PYPieSeries, BOOL, clockWise); 56 | PYPropertyEqualImpTemplate(PYPieSeries, PYPieSeriesRoseType, roseType); 57 | PYPropertyEqualImpTemplate(PYPieSeries, NSNumber *, selectedOffset); 58 | PYPropertyEqualImpTemplate(PYPieSeries, id, selectedMode); 59 | PYPropertyEqualImpTemplate(PYPieSeries, BOOL, legendHoverLink); 60 | 61 | @end 62 | -------------------------------------------------------------------------------- /iOS-Echarts/Model/Series/PYRadarSeries.h: -------------------------------------------------------------------------------- 1 | // 2 | // PYRadarSeries.h 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto Y on 15/12/21. 6 | // Copyright © 2015年 pluto-y. All rights reserved. 7 | // 8 | 9 | #import "PYSeries.h" 10 | 11 | /** 12 | * 13 | * You can goto this website for references: 14 | * http://echarts.baidu.com/echarts2/doc/doc.html#SeriesRadar 15 | * 16 | */ 17 | @interface PYRadarSeries : PYSeries 18 | 19 | @property (nonatomic, strong) NSNumber *polarIndex; 20 | @property (nonatomic, copy) PYSymbol symbol; 21 | @property (nonatomic, strong) id symbolSize; 22 | @property (nonatomic, strong) NSNumber *symbolRotate; 23 | @property (nonatomic, assign) BOOL legendHoverLink; 24 | 25 | PYInitializerTemplate(PYRadarSeries, series); 26 | 27 | PYPropertyEqualTemplate(PYRadarSeries, NSNumber *, polarIndex); 28 | PYPropertyEqualTemplate(PYRadarSeries, PYSymbol, symbol); 29 | PYPropertyEqualTemplate(PYRadarSeries, id, symbolSize); 30 | PYPropertyEqualTemplate(PYRadarSeries, NSNumber *, symbolRotate); 31 | PYPropertyEqualTemplate(PYRadarSeries, BOOL, legendHoverLink); 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /iOS-Echarts/Model/Series/PYRadarSeries.m: -------------------------------------------------------------------------------- 1 | // 2 | // PYRadarSeries.m 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto Y on 15/12/21. 6 | // Copyright © 2015年 pluto-y. All rights reserved. 7 | // 8 | 9 | #import "PYRadarSeries.h" 10 | 11 | @implementation PYRadarSeries 12 | 13 | - (instancetype)init 14 | { 15 | self = [super init]; 16 | if (self) { 17 | self.type = PYSeriesTypeRadar; 18 | _polarIndex = (0); 19 | _symbolSize = @(2); 20 | _legendHoverLink = YES; 21 | } 22 | return self; 23 | } 24 | 25 | PYInitializerImpTemplate(PYRadarSeries); 26 | 27 | PYPropertyEqualImpTemplate(PYRadarSeries, NSNumber *, polarIndex); 28 | PYPropertyEqualImpTemplate(PYRadarSeries, PYSymbol, symbol); 29 | PYPropertyEqualImpTemplate(PYRadarSeries, id, symbolSize); 30 | PYPropertyEqualImpTemplate(PYRadarSeries, NSNumber *, symbolRotate); 31 | PYPropertyEqualImpTemplate(PYRadarSeries, BOOL, legendHoverLink); 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /iOS-Echarts/Model/Series/PYSeries.h: -------------------------------------------------------------------------------- 1 | // 2 | // PYSeries.h 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto Y on 15/9/8. 6 | // Copyright (c) 2015年 pluto-y. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class PYItemStyle, PYTooltip, PYMarkLine, PYMarkPoint; 12 | 13 | typedef NSString *PYSeriesType; 14 | 15 | FOUNDATION_EXPORT PYSeriesType const PYSeriesTypeLine; 16 | FOUNDATION_EXPORT PYSeriesType const PYSeriesTypeBar; 17 | FOUNDATION_EXPORT PYSeriesType const PYSeriesTypeScatter; 18 | FOUNDATION_EXPORT PYSeriesType const PYSeriesTypeK; 19 | FOUNDATION_EXPORT PYSeriesType const PYSeriesTypePie; 20 | FOUNDATION_EXPORT PYSeriesType const PYSeriesTypeRadar; 21 | FOUNDATION_EXPORT PYSeriesType const PYSeriesTypeChord; 22 | FOUNDATION_EXPORT PYSeriesType const PYSeriesTypeForce; 23 | FOUNDATION_EXPORT PYSeriesType const PYSeriesTypeMap; 24 | FOUNDATION_EXPORT PYSeriesType const PYSeriesTypeWordCloud; 25 | FOUNDATION_EXPORT PYSeriesType const PYSeriesTypeVenn; 26 | FOUNDATION_EXPORT PYSeriesType const PYSeriesTypeTreemap; 27 | FOUNDATION_EXPORT PYSeriesType const PYSeriesTypeGauge; 28 | FOUNDATION_EXPORT PYSeriesType const PYSeriesTypeEventRiver; 29 | FOUNDATION_EXPORT PYSeriesType const PYSeriesTypeFunnel; 30 | FOUNDATION_EXPORT PYSeriesType const PYSeriesTypeHeatmap; 31 | FOUNDATION_EXPORT PYSeriesType const PYSeriesTypeTree; 32 | 33 | /** 34 | * 35 | * You can goto this website for references: 36 | * http://echarts.baidu.com/echarts2/doc/doc.html#Series 37 | * 38 | */ 39 | @interface PYSeries : NSObject 40 | 41 | @property (nonatomic, strong) NSNumber *zlevel; 42 | @property (nonatomic, strong) NSNumber *z; 43 | @property (nonatomic, copy) PYSeriesType type; 44 | @property (nonatomic, copy) NSString *name; 45 | @property (nonatomic, strong) PYTooltip *tooltip; 46 | @property (nonatomic, assign) BOOL clickable; 47 | @property (nonatomic, strong) PYItemStyle *itemStyle; 48 | @property (nonatomic, strong) id data; 49 | @property (nonatomic, strong) PYMarkPoint *markPoint; 50 | @property (nonatomic, strong) PYMarkLine *markLine; 51 | 52 | PYInitializerTemplate(PYSeries, series); 53 | 54 | PYPropertyEqualTemplate(PYSeries, NSNumber *, zlevel); 55 | PYPropertyEqualTemplate(PYSeries, NSNumber *, z); 56 | PYPropertyEqualTemplate(PYSeries, PYSeriesType, type); 57 | PYPropertyEqualTemplate(PYSeries, NSString *, name); 58 | PYPropertyEqualTemplate(PYSeries, PYTooltip *, tooltip); 59 | PYPropertyEqualTemplate(PYSeries, BOOL, clickable); 60 | PYPropertyEqualTemplate(PYSeries, PYItemStyle *, itemStyle); 61 | PYPropertyEqualTemplate(PYSeries, id, data); 62 | PYPropertyEqualTemplate(PYSeries, PYMarkPoint *, markPoint); 63 | PYPropertyEqualTemplate(PYSeries, PYMarkLine *, markLine); 64 | 65 | PYAddMethodTemplate(PYSeries, NSObject, Data, data); 66 | 67 | 68 | @end 69 | -------------------------------------------------------------------------------- /iOS-Echarts/Model/Series/PYTreeMapSeries.h: -------------------------------------------------------------------------------- 1 | // 2 | // PYTreeMapSeries.h 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto Y on 4/24/16. 6 | // Copyright © 2016 Pluto-y. All rights reserved. 7 | // 8 | 9 | #import "PYSeries.h" 10 | 11 | /** 12 | * 13 | * You can goto this website for references: 14 | * http://echarts.baidu.com/echarts2/doc/doc.html#SeriesTreemap 15 | * 16 | */ 17 | @interface PYTreeMapSeries : PYSeries 18 | 19 | @property (nonatomic, copy) NSArray *center; 20 | @property (nonatomic, copy) NSArray *size; 21 | @property (nonatomic, copy) NSString *root; 22 | 23 | PYInitializerTemplate(PYTreeMapSeries, series); 24 | 25 | PYPropertyEqualTemplate(PYTreeMapSeries, NSArray *, center); 26 | PYPropertyEqualTemplate(PYTreeMapSeries, NSArray *, size); 27 | PYPropertyEqualTemplate(PYTreeMapSeries, NSString *, root); 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /iOS-Echarts/Model/Series/PYTreeMapSeries.m: -------------------------------------------------------------------------------- 1 | // 2 | // PYTreeMapSeries.m 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto Y on 4/24/16. 6 | // Copyright © 2016 Pluto-y. All rights reserved. 7 | // 8 | 9 | #import "PYTreeMapSeries.h" 10 | 11 | @implementation PYTreeMapSeries 12 | 13 | - (instancetype)init { 14 | self = [super init]; 15 | if (self) { 16 | self.type = PYSeriesTypeTreemap; 17 | _center = @[@"50%", @"50%"]; 18 | _size = @[@"80%", @"80%"]; 19 | _root = @""; 20 | } 21 | return self; 22 | } 23 | 24 | PYInitializerImpTemplate(PYTreeMapSeries); 25 | 26 | PYPropertyEqualImpTemplate(PYTreeMapSeries, NSArray *, center); 27 | PYPropertyEqualImpTemplate(PYTreeMapSeries, NSArray *, size); 28 | PYPropertyEqualImpTemplate(PYTreeMapSeries, NSString *, root); 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /iOS-Echarts/Model/Series/PYTreeSeries.h: -------------------------------------------------------------------------------- 1 | // 2 | // PYTreeSeries.h 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto Y on 4/22/16. 6 | // Copyright © 2016 Pluto-y. All rights reserved. 7 | // 8 | 9 | #import "PYSeries.h" 10 | 11 | @class PYItemStyle; 12 | 13 | @interface PYTreeSeriesData : NSObject 14 | 15 | @property (nonatomic, copy) NSString *name; 16 | @property (nonatomic, strong) NSNumber *value; 17 | @property (nonatomic, copy) NSString *symbol; 18 | @property (nonatomic, strong) id symbolSize; 19 | @property (nonatomic, copy) NSArray *children; 20 | @property (nonatomic, strong) PYItemStyle *itemStyle; 21 | 22 | PYInitializerTemplate(PYTreeSeriesData, data); 23 | 24 | PYPropertyEqualTemplate(PYTreeSeriesData, NSString *, name); 25 | PYPropertyEqualTemplate(PYTreeSeriesData, NSNumber *, value); 26 | PYPropertyEqualTemplate(PYTreeSeriesData, NSString *, symbol); 27 | PYPropertyEqualTemplate(PYTreeSeriesData, id, symbolSize); 28 | PYPropertyEqualTemplate(PYTreeSeriesData, NSArray *, children); 29 | PYPropertyEqualTemplate(PYTreeSeriesData, PYItemStyle *, itemStyle); 30 | 31 | @end 32 | 33 | /** 34 | * 35 | * You can goto this website for references: 36 | * http://echarts.baidu.com/echarts2/doc/doc.html#SeriesTree 37 | * 38 | */ 39 | @interface PYTreeSeries : PYSeries 40 | 41 | @property (nonatomic, copy) NSDictionary *rootLocation; 42 | @property (nonatomic, strong) NSNumber *layerPadding; 43 | @property (nonatomic, strong) NSNumber *nodePadding; 44 | @property (nonatomic, copy) PYOrient orient; 45 | @property (nonatomic, copy) NSString *direction; 46 | @property (nonatomic, strong) id roam; 47 | @property (nonatomic, copy) PYSymbol symbol; 48 | @property (nonatomic, strong) id symbolSize; 49 | @property (nonatomic, assign) BOOL hoverable; 50 | 51 | PYInitializerTemplate(PYTreeSeries, series); 52 | 53 | PYPropertyEqualTemplate(PYTreeSeries, NSDictionary *, rootLocation); 54 | PYPropertyEqualTemplate(PYTreeSeries, NSNumber *, layerPadding); 55 | PYPropertyEqualTemplate(PYTreeSeries, NSNumber *, nodePadding); 56 | PYPropertyEqualTemplate(PYTreeSeries, PYOrient, orient); 57 | PYPropertyEqualTemplate(PYTreeSeries, NSString *, direction); 58 | PYPropertyEqualTemplate(PYTreeSeries, id, roam); 59 | PYPropertyEqualTemplate(PYTreeSeries, PYSymbol, symbol); 60 | PYPropertyEqualTemplate(PYTreeSeries, id, symbolSize); 61 | PYPropertyEqualTemplate(PYTreeSeries, BOOL, hoverable); 62 | 63 | @end 64 | -------------------------------------------------------------------------------- /iOS-Echarts/Model/Series/PYTreeSeries.m: -------------------------------------------------------------------------------- 1 | // 2 | // PYTreeSeries.m 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto Y on 4/22/16. 6 | // Copyright © 2016 Pluto-y. All rights reserved. 7 | // 8 | 9 | #import "PYTreeSeries.h" 10 | 11 | @implementation PYTreeSeriesData 12 | 13 | PYInitializerImpTemplate(PYTreeSeriesData); 14 | 15 | PYPropertyEqualImpTemplate(PYTreeSeriesData, NSString *, name); 16 | PYPropertyEqualImpTemplate(PYTreeSeriesData, NSNumber *, value); 17 | PYPropertyEqualImpTemplate(PYTreeSeriesData, NSString *, symbol); 18 | PYPropertyEqualImpTemplate(PYTreeSeriesData, id, symbolSize); 19 | PYPropertyEqualImpTemplate(PYTreeSeriesData, NSArray *, children); 20 | PYPropertyEqualImpTemplate(PYTreeSeriesData, PYItemStyle *, itemStyle); 21 | 22 | @end 23 | 24 | @implementation PYTreeSeries 25 | 26 | - (instancetype)init 27 | { 28 | self = [super init]; 29 | if (self) { 30 | self.type = PYSeriesTypeTree; 31 | _layerPadding = @100; 32 | _nodePadding = @30; 33 | _orient = PYOrientVertical; 34 | _roam = @NO; 35 | _symbol = PYSymbolCircle; 36 | _symbolSize = @20; 37 | } 38 | return self; 39 | } 40 | 41 | PYInitializerImpTemplate(PYTreeSeries); 42 | 43 | PYPropertyEqualImpTemplate(PYTreeSeries, NSDictionary *, rootLocation); 44 | PYPropertyEqualImpTemplate(PYTreeSeries, NSNumber *, layerPadding); 45 | PYPropertyEqualImpTemplate(PYTreeSeries, NSNumber *, nodePadding); 46 | PYPropertyEqualImpTemplate(PYTreeSeries, PYOrient, orient); 47 | PYPropertyEqualImpTemplate(PYTreeSeries, NSString *, direction); 48 | PYPropertyEqualImpTemplate(PYTreeSeries, id, roam); 49 | PYPropertyEqualImpTemplate(PYTreeSeries, PYSymbol, symbol); 50 | PYPropertyEqualImpTemplate(PYTreeSeries, id, symbolSize); 51 | PYPropertyEqualImpTemplate(PYTreeSeries, BOOL, hoverable); 52 | 53 | @end 54 | -------------------------------------------------------------------------------- /iOS-Echarts/Model/Series/PYVennSeries.h: -------------------------------------------------------------------------------- 1 | // 2 | // PYVennSeries.h 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto Y on 4/21/16. 6 | // Copyright © 2016 Pluto-y. All rights reserved. 7 | // 8 | 9 | #import "PYSeries.h" 10 | 11 | @class PYItemStyle; 12 | 13 | @interface PYVennSeriesData : NSObject 14 | 15 | @property (nonatomic, copy) NSString *name; 16 | @property (nonatomic, strong) NSNumber *value; 17 | @property (nonatomic, strong) PYItemStyle *itemStyle; 18 | 19 | PYInitializerTemplate(PYVennSeriesData, data); 20 | 21 | PYPropertyEqualTemplate(PYVennSeriesData, NSString *, name); 22 | PYPropertyEqualTemplate(PYVennSeriesData, NSNumber *, value); 23 | PYPropertyEqualTemplate(PYVennSeriesData, PYItemStyle *, itemStyle); 24 | 25 | @end 26 | 27 | /** 28 | * 29 | * You can goto this website for references: 30 | * http://echarts.baidu.com/echarts2/doc/doc.html#SeriesVenn 31 | * 32 | */ 33 | @interface PYVennSeries : PYSeries 34 | 35 | PYInitializerTemplate(PYVennSeries, series); 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /iOS-Echarts/Model/Series/PYVennSeries.m: -------------------------------------------------------------------------------- 1 | // 2 | // PYVennSeries.m 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto Y on 4/21/16. 6 | // Copyright © 2016 Pluto-y. All rights reserved. 7 | // 8 | 9 | #import "PYVennSeries.h" 10 | 11 | @implementation PYVennSeriesData 12 | 13 | PYInitializerImpTemplate(PYVennSeriesData); 14 | 15 | PYPropertyEqualImpTemplate(PYVennSeriesData, NSString *, name); 16 | PYPropertyEqualImpTemplate(PYVennSeriesData, NSNumber *, value); 17 | PYPropertyEqualImpTemplate(PYVennSeriesData, PYItemStyle *, itemStyle); 18 | 19 | @end 20 | 21 | @implementation PYVennSeries 22 | 23 | - (instancetype)init 24 | { 25 | self = [super init]; 26 | if (self) { 27 | self.type = PYSeriesTypeVenn; 28 | } 29 | return self; 30 | } 31 | 32 | PYInitializerImpTemplate(PYVennSeries); 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /iOS-Echarts/Model/Series/PYWordCloudSeries.h: -------------------------------------------------------------------------------- 1 | // 2 | // PYWordCloundSeries.h 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto Y on 4/21/16. 6 | // Copyright © 2016 Pluto-y. All rights reserved. 7 | // 8 | 9 | #import "PYSeries.h" 10 | 11 | /** 12 | * 13 | * You can goto this website for references: 14 | * http://echarts.baidu.com/echarts2/doc/doc.html#SeriesWordCloud 15 | * 16 | */ 17 | @interface PYWordCloudSeries : PYSeries 18 | 19 | @property (nonatomic, copy) NSArray *center; 20 | @property (nonatomic, copy) NSArray *size; 21 | @property (nonatomic, copy) NSArray *textRotation; 22 | @property (nonatomic, copy) NSDictionary *autoSize; 23 | @property (nonatomic, strong) NSNumber *textPadding; 24 | 25 | PYInitializerTemplate(PYWordCloudSeries, series); 26 | 27 | PYPropertyEqualTemplate(PYWordCloudSeries, NSArray *, center); 28 | PYPropertyEqualTemplate(PYWordCloudSeries, NSArray *, size); 29 | PYPropertyEqualTemplate(PYWordCloudSeries, NSArray *, textRotation); 30 | PYPropertyEqualTemplate(PYWordCloudSeries, NSDictionary *, autoSize); 31 | PYPropertyEqualTemplate(PYWordCloudSeries, NSNumber *, textPadding); 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /iOS-Echarts/Model/Series/PYWordCloudSeries.m: -------------------------------------------------------------------------------- 1 | // 2 | // PYWordCloundSeries.m 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto Y on 4/21/16. 6 | // Copyright © 2016 Pluto-y. All rights reserved. 7 | // 8 | 9 | #import "PYWordCloudSeries.h" 10 | 11 | @implementation PYWordCloudSeries 12 | 13 | - (instancetype)init 14 | { 15 | self = [super init]; 16 | if (self) { 17 | self.type = PYSeriesTypeWordCloud; 18 | } 19 | return self; 20 | } 21 | 22 | PYInitializerImpTemplate(PYWordCloudSeries); 23 | 24 | PYPropertyEqualImpTemplate(PYWordCloudSeries, NSArray *, center); 25 | PYPropertyEqualImpTemplate(PYWordCloudSeries, NSArray *, size); 26 | PYPropertyEqualImpTemplate(PYWordCloudSeries, NSArray *, textRotation); 27 | PYPropertyEqualImpTemplate(PYWordCloudSeries, NSDictionary *, autoSize); 28 | PYPropertyEqualImpTemplate(PYWordCloudSeries, NSNumber *, textPadding); 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /iOS-Echarts/Util/PYJsonUtil.h: -------------------------------------------------------------------------------- 1 | // 2 | // JsonUtil.h 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto Y on 15/9/8. 6 | // Copyright (c) 2015年 pluto-y. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface PYJsonUtil : NSObject 12 | 13 | 14 | /** 15 | * NSObject转json 16 | * 17 | * @param obj 带信息的NSObject对象 18 | * 19 | * @return 转换后的Json 20 | */ 21 | + (NSString *)getJSONString:(id)obj; 22 | 23 | /** 24 | * NSObject转json 25 | * 26 | * @param obj 带信息的NSObject对象 27 | * 28 | * @return 转换后的包含Json的NSData 29 | */ 30 | + (NSData*)getJSONData:(id)obj; 31 | 32 | 33 | /** 34 | * 将指定对象转换成NSDirectory 35 | * 36 | * @param obj 需要转换的对象 37 | * 38 | * @return 转换后的NSDictionary对象 39 | */ 40 | + (NSDictionary*)getObjectData:(id)obj; 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /iOS-Echarts/View/PYZoomEchartsView.h: -------------------------------------------------------------------------------- 1 | // 2 | // PYZoomEchartsView.h 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto Y on 16/4/5. 6 | // Copyright © 2016年 pluto-y. All rights reserved. 7 | // 8 | 9 | #import "PYEchartsView.h" 10 | 11 | @interface PYZoomEchartsView : PYEchartsView 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /iOS-Echarts/iOS-Echarts.h: -------------------------------------------------------------------------------- 1 | // 2 | // iOS-Echarts.h 3 | // iOS-Echarts 4 | // 5 | // Created by Pluto Y on 8/2/16. 6 | // Copyright © 2016 pluto-y. All rights reserved. 7 | // 8 | 9 | #import "PYUtilities.h" 10 | 11 | #import "PYEchartsView.h" 12 | #import "PYZoomEchartsView.h" 13 | #import "WKEchartsView.h" 14 | 15 | #import "PYOption.h" 16 | #import "PYColor.h" 17 | 18 | #import "PYLoadingOption.h" 19 | #import "PYNoDataLoadingOption.h" 20 | 21 | #import "PYCartesianSeries.h" 22 | #import "PYPieSeries.h" 23 | #import "PYEventRiverSeries.h" 24 | #import "PYForceSeries.h" 25 | #import "PYFunnelSeries.h" 26 | #import "PYGaugeSeries.h" 27 | #import "PYWordCloudSeries.h" 28 | #import "PYHeatmapSeries.h" 29 | #import "PYMapSeries.h" 30 | #import "PYPieSeries.h" 31 | #import "PYRadarSeries.h" 32 | #import "PYTreeMapSeries.h" 33 | #import "PYTreeSeries.h" 34 | #import "PYVennSeries.h" 35 | #import "PYWordCloudSeries.h" 36 | #import "PYChordSeries.h" 37 | #import "PYAxisPointer.h" 38 | #import "PYNodes.h" 39 | #import "PYCategories.h" 40 | #import "PYLinks.h" 41 | #import "PYAxisSplitLine.h" 42 | #import "PYItemStyleProp.h" 43 | #import "PYTitle.h" 44 | #import "PYLegend.h" 45 | #import "PYGrid.h" 46 | #import "PYAxis.h" 47 | #import "PYToolbox.h" 48 | #import "PYAreaStyle.h" 49 | #import "PYDataZoom.h" 50 | #import "PYDataRange.h" 51 | #import "PYToolboxFeature.h" 52 | #import "PYLineStyle.h" 53 | #import "PYAxisLine.h" 54 | #import "PYAxisLabel.h" 55 | #import "PYAxisTick.h" 56 | #import "PYTooltip.h" 57 | #import "PYMarkLine.h" 58 | #import "PYMarkPoint.h" 59 | #import "PYTimeline.h" 60 | #import "PYSplitArea.h" 61 | #import "PYNodeStyle.h" 62 | #import "PYLinkStyle.h" 63 | #import "PYPolar.h" 64 | #import "PYChordStyle.h" 65 | -------------------------------------------------------------------------------- /iOS-EchartsTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /iOS-EchartsTests/iOS_EchartsTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // iOS_EchartsTests.m 3 | // iOS-EchartsTests 4 | // 5 | // Created by Pluto Y on 15/9/4. 6 | // Copyright (c) 2015年 pluto-y. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface iOS_EchartsTests : XCTestCase 13 | 14 | @end 15 | 16 | @implementation iOS_EchartsTests 17 | 18 | - (void)setUp { 19 | [super setUp]; 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | } 22 | 23 | - (void)tearDown { 24 | // Put teardown code here. This method is called after the invocation of each test method in the class. 25 | [super tearDown]; 26 | } 27 | 28 | - (void)testExample { 29 | // This is an example of a functional test case. 30 | XCTAssert(YES, @"Pass"); 31 | } 32 | 33 | - (void)testPerformanceExample { 34 | // This is an example of a performance test case. 35 | [self measureBlock:^{ 36 | // Put the code you want to measure the time of here. 37 | }]; 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /tools/parser.py: -------------------------------------------------------------------------------- 1 | # !/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | import json 4 | 5 | resultObjNames = set() 6 | exceptedObjNams = ['normal', 'emphasis'] 7 | resultObjs = [] 8 | 9 | def isEchartsObj(dic, name): 10 | if not isinstance(dic, dict): return False 11 | if dic.has_key('type'): 12 | if dic['type'] == 'Object': 13 | return not name in exceptedObjNams 14 | elif isinstance(dic['type'], list): 15 | arr = dic['type'] 16 | if len(arr) == 1 and arr[0] == 'Object': 17 | return not name in exceptedObjNams 18 | return False 19 | 20 | 21 | def iterateArray(arr): 22 | for obj in arr: 23 | if isinstance(obj, list): 24 | iterateArray(obj) 25 | elif isinstance(obj, dict): 26 | iterateDic(obj) 27 | 28 | def iterateDicForName(dic, name): 29 | if not isinstance(dic, dict): return 30 | if isEchartsObj(dic, name): 31 | resultObjNames.add(name) 32 | iterateDic(dic) 33 | 34 | def iterateDic(dic): 35 | if not isinstance(dic, dict): return 36 | for key in dic: 37 | value = dic[key] 38 | if isinstance(value, list): 39 | iterateArray(value) 40 | elif isinstance(value, dict): 41 | iterateDicForName(value, key) 42 | else: 43 | print("The key and value %s = %s\n" % (key, value)) 44 | 45 | if __name__ == '__main__': 46 | with open ('./resources/option.json') as json_data: 47 | json_dic = json.load(json_data) 48 | if json_dic.has_key('option'): 49 | option_dic = json_dic['option'] 50 | iterateDicForName(option_dic, 'option') 51 | print('all object names: %s', resultObjNames) 52 | 53 | 54 | --------------------------------------------------------------------------------