Core-Plotで色々書いているので備忘録を
Drawing Pie Charts using iPhone SDK · the occasional blog
魚拓
http://rajeev.name/2009/01/18/drawing-pie-charts-using-iphone-sdk/ - 2011年3月7日 11:25 - ウェブ魚拓
以下の条件に達すると制限にかかってしまいます。
http://4sqwalker.com/whats4sq/381.html
1日のチェックイン回数の限界 | 4SQの。{foursquareのバッジを解除する}
知らなかったとは情けない...
TwitterやFacebook連携に"ShareKit"が良さそうです。
後日実際に入れてみます。
備忘録
ShareKitを使ってiPhoneアプリのTwitter連携にトライ - Tomute’s Notes
ShareKit : Drop-in Share Features for all iOS Apps
試しにiPadで書いてみました。
// // GraphViewController.h // #import <UIKit/UIKit.h> #import "S7GraphView.h" @interface GraphViewController : UIViewController<S7GraphViewDataSource> { @private S7GraphView* graphView_; } @property (nonatomic, retain) IBOutlet S7GraphView* graphView; @end // // GraphViewController.c // #import "GraphViewController.h" @implementation GraphViewController @synthesize graphView = graphView_; #pragma mark - #pragma mark Private Methods - (void)createYFormatter { NSNumberFormatter *numberFormatter = [[NSNumberFormatter new] autorelease]; [numberFormatter setNumberStyle:NSNumberFormatterDecimalStyle]; [numberFormatter setMinimumFractionDigits:0]; [numberFormatter setMaximumFractionDigits:0]; self.graphView.yValuesFormatter = numberFormatter; } - (void)createXFormatter { NSNumberFormatter *numberFormatter = [[NSNumberFormatter new] autorelease]; [numberFormatter setNumberStyle:NSNumberFormatterDecimalStyle]; [numberFormatter setMinimumFractionDigits:0]; [numberFormatter setMaximumFractionDigits:0]; self.graphView.xValuesFormatter = numberFormatter; } - (void)initGraphView { self.graphView.backgroundColor = [UIColor blackColor]; self.graphView.drawAxisX = YES; self.graphView.drawAxisY = YES; self.graphView.drawGridX = YES; self.graphView.drawGridY = YES; self.graphView.xValuesColor = [UIColor whiteColor]; self.graphView.yValuesColor = [UIColor whiteColor]; self.graphView.gridXColor = [UIColor whiteColor]; self.graphView.gridYColor = [UIColor whiteColor]; self.graphView.drawInfo = NO; self.graphView.info = @"Load"; self.graphView.infoColor = [UIColor whiteColor]; } #pragma mark - #pragma mark Inherit Methods - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; if (self) { // Custom initialization. } return self; } - (id)init { return self = [super initWithNibName:nil bundle:nil]; } - (void)loadView { [super loadView]; self.graphView.dataSource = self; } - (void)viewDidLoad { [super viewDidLoad]; [self createYFormatter]; [self createXFormatter]; [self initGraphView]; } - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return YES; } - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; } - (void)viewDidUnload { [super viewDidUnload]; } - (void)dealloc { self.view = nil; self.graphView = nil; [super dealloc]; } #pragma mark - #pragma mark protocol S7GraphViewDataSource - (NSUInteger)graphViewNumberOfPlots:(S7GraphView *)graphView { return 1; } - (NSArray *)graphViewXValues:(S7GraphView *)graphView { NSMutableArray *array = [NSMutableArray arrayWithCapacity:101]; for (int i = -50; i <= 50; i++) { [array addObject:[NSNumber numberWithInt:i]]; } return array; } - (NSArray *)graphView:(S7GraphView *)graphView yValuesForPlot:(NSUInteger)plotIndex { NSMutableArray *array = [NSMutableArray arrayWithCapacity:101]; switch (plotIndex) { case 0: for (int i = -50; i <= 50; i++) { [array addObject:[NSNumber numberWithInt:-i]]; // y = -x } break; } return array; } - (BOOL)graphView:(S7GraphView *)graphView shouldFillPlot:(NSUInteger)plotIndex { return NO; } @end
Y軸のマイナス値が表示されておりません。
設定がおかしいのか、もしくは制限事項か判らない状況です...
どなたかご教示願います。
一先ず備忘録
まずは、s7graphview
iPhone用の高度なグラフライブラリ·s7graphview MOONGIFT
http://macisv.jp/blog/?p=485
個人的メモ
http://code.google.com/p/s7graphview/
続いて、core-plot
http://www.switchonthecode.com/tutorials/using-core-plot-in-an-iphone-application
iPhoneアプリ超基礎開発備忘録 iPhoneでCore-Plotを使ってグラフを書いてみる
【アメーバ】core-plot その一|フレンチのブログ
【アメーバ】core-plot その二|フレンチのブログ
【アメーバ】core-plot その三|フレンチのブログ
【アメーバ】core-plot その四|フレンチのブログ
Google Code Archive - Long-term storage for Google Code Project Hosting.
http://www.switchonthecode.com/tutorials/using-core-plot-in-an-iphone-application
MacBook Air 11インチ欲しい!
といふものがありましたので、応募してみます。
当たるとかなり嬉しいです。
MacBook Air 11インチ欲しい!とは - はてなキーワード
明日1/25までだそうです。
構築ができましたので、簡単な手順を
尚、gitはインストール済みであることを想定して書きます。
1.から3.はサーバ上で行います。
1. リポジトリアクセス用のユーザ(git)を作成
[root@server ~]$ useradd -m -U git [root@server ~]$ passwd {anypassword}
2. パスの設定
export PATH="/home/gituser/bin:$PATH"
setenv PATH "/home/gituser/bin:$PATH"
3. gitoliteのインストール
[git@server ~]$ mkdir -p $HOME/bin $HOME/gitolite/conf $HOME/gitolite/hooks
[git@server ~]$ git clone git://github.com/sitaramc/gitolite gitolite-source
[git@server ~]$ ssh-keygen -t rsa -f ./admin -P "adminpassword"
[git@server ~]$ ./gitolite-sourcesrc/gl-system-install $HOME/bin $HOME/gitolite/conf $HOME/gitolite/hooks [git@server ~]$ gl-setup $HOME/admin.pub
export GL_RC=~/.gitolite.rc export GL_ADMINDIR=~/.gitolite export GL_BINDIR=~/bin export GL_REPO=gitolite-admin export GL_USER=git export GL_TS=”$y-$m-$d.$h:$min:$s” export GL_REPO_BASE_ABS=repositories # ここは~/.gitolite.rcの$REPO_BASEに合わせる
4. gitoliteの設定
1.から3.とは異なり、ここでの作業はローカルマシンで行います。
[user@local ~]$ git clone git@gitserver.domain:gitolite-admin 注意) ローカルマシンに3.で作った秘密鍵をインポートするなど、ローカルからサーバにはSSHで繋げられるようにしておくこと!
[user@local ~]$ ssh-keygen -t rsa -f ./user -P "userpassword"
[user@local ~]$ cp ./user.pub ./gitolite-admin/keydir
repo gitolite-admin RW+ = admin repo testing RW+ = @all # この様に追記・修正 repo myrepo RW+ = admin R = user
R: 読み込みのみ、RW: 読み込み/書き込み、RW+: 読み込み/書き込み/rewind
[user@local ~]$ cd ./gitolite-admin [user@local ~]$ git add ./keydir/user.pub [user@local ~]$ git commit -a -m "any comment Please!" [user@local ~]$ git push
コミット後に、レポジトリ myrepo が作成されます。
追加ユーザの動作確認は、対象ユーザに秘密鍵(user)をインポートして貰い、以下のコマンドを実行します。
[another@machine ~]$ ssh git@gitserver.domain PTY allocation request failed on channel 0 hello ogino, the gitolite version here is v1.5.8-17-gc8b1d8c the gitolite config gives you the following access: R myrepo @R_ @W_ testing Connection to gitserver.domain closed.
ユーザのグループ化も可能です。
gitolite-admin/conf/gitolite.conf を以下の様に設定すると
@group = aaron jacques hans roberto repo repo RW+ = @group
ユーザ aaron、jacques、hans、robertoは、レポジトリ repoに「読み込み/書き込み/rewind」ができます。