<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Blogroll Cloud</title>
	<atom:link href="http://rajeev.name/2007/10/16/blogroll-cloud/feed/" rel="self" type="application/rss+xml" />
	<link>http://rajeev.name/2007/10/16/blogroll-cloud/</link>
	<description>technologist defying the peter principle</description>
	<lastBuildDate>Sat, 29 Oct 2011 23:22:38 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: songokuvn</title>
		<link>http://rajeev.name/2007/10/16/blogroll-cloud/comment-page-1/#comment-42507</link>
		<dc:creator>songokuvn</dc:creator>
		<pubDate>Mon, 21 Mar 2011 02:12:34 +0000</pubDate>
		<guid isPermaLink="false">http://rajeev.name/2007/10/16/blogroll-cloud/#comment-42507</guid>
		<description>Hi Master,

I saw your post about at command working with samsung t729? I&#039;m using this phone, but I can a software or at command can control keypad for this phone. If you know what is at command can control keypad for this phone please  help me. I waiting for your help, I really happy when i received your reply!!</description>
		<content:encoded><![CDATA[<p>Hi Master,</p>
<p>I saw your post about at command working with samsung t729? I&#8217;m using this phone, but I can a software or at command can control keypad for this phone. If you know what is at command can control keypad for this phone please  help me. I waiting for your help, I really happy when i received your reply!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Debabrata Biswas</title>
		<link>http://rajeev.name/2007/10/16/blogroll-cloud/comment-page-1/#comment-31777</link>
		<dc:creator>Debabrata Biswas</dc:creator>
		<pubDate>Wed, 28 Jul 2010 06:09:01 +0000</pubDate>
		<guid isPermaLink="false">http://rajeev.name/2007/10/16/blogroll-cloud/#comment-31777</guid>
		<description>Dear Sir,
               I have drawn pie chart using Core Plot library and data from Sqlite database. But I am not able to add label to each slice of pie. I am mentioning my code here. please help me out.. Its very urgent. From database I am fetching two field amount and category, I want to add amount as label of each slice of pie and below of chart I want to mention category name with slice color. How to do it... Thanks in advance.. Below Is my code....
   

#import &quot;PieChart_SampleViewController.h&quot;

static sqlite3 *database = nil;

NSMutableArray *showChart = nil;
NSMutableArray *arrayChart = nil;

double chartCost;
NSString *chartCategory;

NSInteger day1, year1;
NSString *month;

static sqlite3_stmt *todayStmt = nil;
static sqlite3_stmt *monthStmt = nil;
static sqlite3_stmt *yearStmt = nil;



@implementation PieChart_SampleViewController

@synthesize graph,pieData,layerHost;
@synthesize segmentControl;

// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad {
    [super viewDidLoad];
	
	self.view.backgroundColor=[UIColor lightGrayColor];

	SQLAppDelegate *appDelegate = (SQLAppDelegate *)[[UIApplication sharedApplication] delegate];
	NSString *dbPath = [appDelegate getDBPath];
	NSLog(@&quot;%@&quot;,dbPath);
	
	showChart = [[NSMutableArray alloc] init];
	
	NSDate* date = [NSDate date];
	NSDateFormatter* formatter = [[[NSDateFormatter alloc] init] autorelease];
	[formatter setDateFormat:@&quot;yyyy-MMMM-dd-ccc&quot;];
    NSString *datestr = [formatter stringFromDate:date];
	NSArray *date1 = [datestr componentsSeparatedByCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@&quot;-&quot;]];
	
	NSString *year = [date1 objectAtIndex:0];
	month = [[NSString alloc] initWithString:[date1 objectAtIndex:1]];
	NSString *day = [date1 objectAtIndex:2];
	NSString *week_day = [date1 objectAtIndex:3]; 
	
	day1 = [day intValue];
	year1 = [year intValue];
	
	[self Today_Report:day1 tmonth:month tyear:year1];
	[self constructPieChart];
	
	NSLog(@&quot;Current day In Number:::%@&quot;,day);
	NSLog(@&quot;Current day1:::%@&quot;,week_day);
	NSLog(@&quot;Current Month:::%@&quot;,month);
	NSLog(@&quot;Current Year:::%d&quot;,year1);
	
	[self.segmentControl addTarget:self action:@selector(SegmentControlIndexChanged:) forControlEvents:UIControlEventValueChanged];
	
}

-(void)constructPieChart {
	
	
	graph = [[CPXYGraph alloc] initWithFrame: self.view.bounds];
	layerHost.hostedLayer = graph;                                            
	graph.paddingLeft = 10.0;
	graph.paddingTop = 10.0;
	graph.paddingRight = 10.0;
	graph.paddingBottom = 100.0;
	
	CPPieChart *pieChart = [[CPPieChart alloc] init];
	pieChart.dataSource = self;
	pieChart.pieRadius = 100.0;
	pieChart.identifier = @&quot;PieChart&quot;;
	pieChart.startAngle = M_PI_4;
	
	pieChart.sliceDirection = CPPieDirectionClockwise;
    self.pieData = arrayChart;
	CPTheme *theme = [CPTheme themeNamed:kCPSlateTheme];
	[graph applyTheme:theme];
	[graph addPlot:pieChart];
	[pieChart release];
	
	//	For Label on each slice of pie
	int k=-135;
	int j=50;
	
	for (int i=0; i&lt;[arrayChart count];i++) 
	{
		k=k+50;
		k=j+50;
		CPTextLayer *layerdarkgrayotfinalfi=nil;
		if (!layerdarkgrayotfinalfi) 
		{
			NSString *test=[NSString stringWithFormat:@&quot;%@&quot;,[arrayChart objectAtIndex:i]];
			NSLog(@&quot;Label Test:%@&quot;,test);
			layerdarkgrayotfinalfi= [[[CPTextLayer alloc] initWithText:test]autorelease];
			layerdarkgrayotfinalfi.bounds = CGRectMake(0, 0, 20, 10);
			layerdarkgrayotfinalfi.position = CGPointMake(k, j);
			//layerdarkgrayotfinalfi.textStyle=whiteText1;
			[layerHost.hostedLayer addSublayer:layerdarkgrayotfinalfi];
			
		}
		
	}
		
}


- (void)SegmentControlIndexChanged:(id)sender{
	
	switch (self.segmentControl.selectedSegmentIndex) {
		case 0:
			[self Today_Report:day1 tmonth:month tyear:year1];	
			[self constructPieChart];
			break;
		case 1:
			NSLog(@&quot;Hello Week&quot;);
			
			break;
		case 2:
			NSLog(@&quot;Hello Month %@&quot;,month);
			
			[self Monthwise_Report:month Year:year1];
			[self constructPieChart];
			break;
		case 3:
			[self YearWise_Report:year1];
			[self constructPieChart];
			break;
		    default:
			break;
	}
}


- (void)Today_Report:(NSInteger)today tmonth:(NSString *)tmth tyear:(NSInteger)tyr{
	
	//[showReport removeAllObjects];	
	[arrayChart removeAllObjects];
	
	NSInteger tday = today;
	NSString *tmonth = tmth;
	NSInteger tyear = tyr;
	
	NSLog(@&quot;Today :::%d&quot;,tday);
	
	SQLAppDelegate *appDelegate = (SQLAppDelegate *)[[UIApplication sharedApplication] delegate];
	NSString *dbPath = [appDelegate getDBPath];
	NSLog(@&quot;%@&quot;,dbPath);
	
	if(sqlite3_open([dbPath UTF8String], &amp;database) == SQLITE_OK)
	{
		
		
		if (todayStmt == nil)
		{
			
			const char *queryString = &quot;select sum(cost), category from expense where day = ? and month = ? and year = ? group by category&quot;;
			
			int return_value =sqlite3_prepare_v2(database, queryString, -1, &amp;todayStmt, NULL); 
			
			if (return_value == SQLITE_OK) 			
			{
				
				sqlite3_bind_int(todayStmt,1, tday);
				sqlite3_bind_text(todayStmt, 2, [tmonth UTF8String], -1 ,SQLITE_TRANSIENT);
				sqlite3_bind_int(todayStmt, 3, tyear);
				
				arrayChart = [[NSMutableArray alloc] init];
				
				while(sqlite3_step(todayStmt) == SQLITE_ROW) {
					
					showReporttemp = [[Report alloc] init];
					
					showReporttemp.cost = (double)sqlite3_column_double(todayStmt, 0);
					showReporttemp.category = [NSString stringWithUTF8String:(char *)sqlite3_column_text(todayStmt, 1)];
					
					
					NSLog(@&quot;Category name :%@&quot;,showReporttemp.category);
					NSLog(@&quot;Cost %f&quot;,showReporttemp.cost);
					
					
					[showChart addObject:showReporttemp];
					NSLog(@&quot;Object no %d&quot;, [showChart count]);
					chartCost = showReporttemp.cost;
					[arrayChart addObject:[NSNumber numberWithDouble:chartCost]];
					
				}
			}
		}
		else {
			NSAssert1(0, @&quot;Prepare statement failed with message %s&quot;, sqlite3_errmsg(database));
			
		}
		sqlite3_reset(todayStmt);
	}
	
	todayStmt = nil;
	sqlite3_close(database);
	//[tableView reloadData];
	
}

- (void)WeekWise_Report:(NSString *)wdate Catg:(NSString *)cat{
	
	
}



- (void)Monthwise_Report:(NSString *)mon Year:(NSInteger)yr{	
	
	
	//[showReport removeAllObjects];
	[arrayChart removeAllObjects];
	
	NSString *getmonth = mon;
	NSInteger year = yr;
	
	NSLog(@&quot;Current Month and Year %@,%d&quot;,mon,year);
	
	SQLAppDelegate *appDelegate = (SQLAppDelegate *)[[UIApplication sharedApplication] delegate];
	NSString *dbPath = [appDelegate getDBPath];
	NSLog(@&quot;%@&quot;,dbPath);
	
	if(sqlite3_open([dbPath UTF8String], &amp;database) == SQLITE_OK)
	{
		
		if (monthStmt == nil)
		{
			
			const char *queryString = &quot;select sum(cost), category from expense where month = ? and year = ? group by category&quot;;
			
			int return_value =sqlite3_prepare_v2(database, queryString, -1, &amp;monthStmt, NULL); 
			
			if (return_value == SQLITE_OK) 			
			{
				
				sqlite3_bind_text(monthStmt, 1 , [getmonth UTF8String], -1, SQLITE_TRANSIENT);
				sqlite3_bind_int(monthStmt,2, year);
				
				arrayChart = [[NSMutableArray alloc] init];
				
				while(sqlite3_step(monthStmt) == SQLITE_ROW) {
					
					NSLog(@&quot;Fetching Started&quot;);
					showReporttemp = [[Report alloc] init];
					
					
					showReporttemp.cost = (double)sqlite3_column_double(monthStmt, 0);
					showReporttemp.category = [NSString stringWithUTF8String:(char *)sqlite3_column_text(monthStmt, 1)];
					
					
					NSLog(@&quot;Catagory name in chart page :%@&quot;,showReporttemp.category);
					NSLog(@&quot;Cost %.02f&quot;,showReporttemp.cost);
					chartCost = showReporttemp.cost;
					NSLog(@&quot;Chart Cost:%.02f&quot;,chartCost);
					[showChart addObject:showReporttemp];
					NSLog(@&quot;Object no %d&quot;, [showChart count]);
					[arrayChart addObject:[NSNumber numberWithDouble:chartCost]];

				}
			}
		}
		else {
			NSAssert1(0, @&quot;Prepare statement failed with message %s&quot;, sqlite3_errmsg(database));
			
		}
		sqlite3_reset(monthStmt);
	}
	monthStmt = nil;
	sqlite3_close(database);
	//[tableView reloadData];
	
}



- (void)YearWise_Report:(NSInteger)rpyear{
	
	
	//[showReport removeAllObjects];
	[arrayChart removeAllObjects];
	
	NSInteger year = rpyear;
	
	NSLog(@&quot;Current Year:::%d&quot;,year);
	
	SQLAppDelegate *appDelegate = (SQLAppDelegate *)[[UIApplication sharedApplication] delegate];
	NSString *dbPath = [appDelegate getDBPath];
	NSLog(@&quot;%@&quot;,dbPath);
	
	if(sqlite3_open([dbPath UTF8String], &amp;database) == SQLITE_OK)
	{
		
		
		if (yearStmt == nil)
		{
			
			const char *queryString = &quot;select sum(cost), category from expense where year = ? group by category&quot;;
			
			int return_value =sqlite3_prepare_v2(database, queryString, -1, &amp;yearStmt, NULL); 
			
			if (return_value == SQLITE_OK) 			
			{
				NSLog(@&quot;Execution 5 starts from here&quot;);		
				
				sqlite3_bind_int(yearStmt,1, year);
				arrayChart = [[NSMutableArray alloc] init];
				
				while(sqlite3_step(yearStmt) == SQLITE_ROW) {
					
					NSLog(@&quot;Fetching Started&quot;);
					showReporttemp = [[Report alloc] init];
					
					showReporttemp.cost = (double)sqlite3_column_double(yearStmt, 0);
					showReporttemp.category = [NSString stringWithUTF8String:(char *)sqlite3_column_text(yearStmt, 1)];
					
					
					NSLog(@&quot;Category name :%@&quot;,showReporttemp.category);
					NSLog(@&quot;Cost %f&quot;,showReporttemp.cost);
					
					
					[showChart addObject:showReporttemp];
					NSLog(@&quot;Object no %d&quot;, [showChart count]);
					chartCost = showReporttemp.cost;
					[arrayChart addObject:[NSNumber numberWithDouble:chartCost]];

				}
			}
		}
		else {
			NSAssert1(0, @&quot;Prepare statement failed with message %s&quot;, sqlite3_errmsg(database));
			
		}
		sqlite3_reset(yearStmt);
	}
	
	yearStmt = nil;
	sqlite3_close(database);
	//[tableView reloadData];
	
}	




-(NSUInteger)numberOfRecordsForPlot:(CPPlot *)plot
{
    return [self.pieData count];
	
}

-(NSNumber *)numberForPlot:(CPPlot *)plot field:(NSUInteger)fieldEnum recordIndex:(NSUInteger)index 
{
	return [self.pieData objectAtIndex:index];
}


/*
-(CPFill *)sliceFillForPieChart:(CPPieChart *)pieChart recordIndex:(NSUInteger)index {
	
	
	CPFill * fill = [CPFill fillWithGradient:[CPGradient rainbowGradient]];
	return fill;

}*/


- (void)didReceiveMemoryWarning {
	// Releases the view if it doesn&#039;t have a superview.
    [super didReceiveMemoryWarning];
	
	// Release any cached data, images, etc that aren&#039;t in use.
}

/*- (void)viewDidUnload {
	// Release any retained subviews of the main view.
	// e.g. self.myOutlet = nil;
}*/

- (void)dealloc {
	[pieData release];
	[graph release];
	[segmentControl release];
    [super dealloc];
}

@end</description>
		<content:encoded><![CDATA[<p>Dear Sir,<br />
               I have drawn pie chart using Core Plot library and data from Sqlite database. But I am not able to add label to each slice of pie. I am mentioning my code here. please help me out.. Its very urgent. From database I am fetching two field amount and category, I want to add amount as label of each slice of pie and below of chart I want to mention category name with slice color. How to do it&#8230; Thanks in advance.. Below Is my code&#8230;.</p>
<p>#import &#8220;PieChart_SampleViewController.h&#8221;</p>
<p>static sqlite3 *database = nil;</p>
<p>NSMutableArray *showChart = nil;<br />
NSMutableArray *arrayChart = nil;</p>
<p>double chartCost;<br />
NSString *chartCategory;</p>
<p>NSInteger day1, year1;<br />
NSString *month;</p>
<p>static sqlite3_stmt *todayStmt = nil;<br />
static sqlite3_stmt *monthStmt = nil;<br />
static sqlite3_stmt *yearStmt = nil;</p>
<p>@implementation PieChart_SampleViewController</p>
<p>@synthesize graph,pieData,layerHost;<br />
@synthesize segmentControl;</p>
<p>// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.<br />
- (void)viewDidLoad {<br />
    [super viewDidLoad];</p>
<p>	self.view.backgroundColor=[UIColor lightGrayColor];</p>
<p>	SQLAppDelegate *appDelegate = (SQLAppDelegate *)[[UIApplication sharedApplication] delegate];<br />
	NSString *dbPath = [appDelegate getDBPath];<br />
	NSLog(@&#8221;%@&#8221;,dbPath);</p>
<p>	showChart = [[NSMutableArray alloc] init];</p>
<p>	NSDate* date = [NSDate date];<br />
	NSDateFormatter* formatter = [[[NSDateFormatter alloc] init] autorelease];<br />
	[formatter setDateFormat:@"yyyy-MMMM-dd-ccc"];<br />
    NSString *datestr = [formatter stringFromDate:date];<br />
	NSArray *date1 = [datestr componentsSeparatedByCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"-"]];</p>
<p>	NSString *year = [date1 objectAtIndex:0];<br />
	month = [[NSString alloc] initWithString:[date1 objectAtIndex:1]];<br />
	NSString *day = [date1 objectAtIndex:2];<br />
	NSString *week_day = [date1 objectAtIndex:3]; </p>
<p>	day1 = [day intValue];<br />
	year1 = [year intValue];</p>
<p>	[self Today_Report:day1 tmonth:month tyear:year1];<br />
	[self constructPieChart];</p>
<p>	NSLog(@&#8221;Current day In Number:::%@&#8221;,day);<br />
	NSLog(@&#8221;Current day1:::%@&#8221;,week_day);<br />
	NSLog(@&#8221;Current Month:::%@&#8221;,month);<br />
	NSLog(@&#8221;Current Year:::%d&#8221;,year1);</p>
<p>	[self.segmentControl addTarget:self action:@selector(SegmentControlIndexChanged:) forControlEvents:UIControlEventValueChanged];</p>
<p>}</p>
<p>-(void)constructPieChart {</p>
<p>	graph = [[CPXYGraph alloc] initWithFrame: self.view.bounds];<br />
	layerHost.hostedLayer = graph;<br />
	graph.paddingLeft = 10.0;<br />
	graph.paddingTop = 10.0;<br />
	graph.paddingRight = 10.0;<br />
	graph.paddingBottom = 100.0;</p>
<p>	CPPieChart *pieChart = [[CPPieChart alloc] init];<br />
	pieChart.dataSource = self;<br />
	pieChart.pieRadius = 100.0;<br />
	pieChart.identifier = @&#8221;PieChart&#8221;;<br />
	pieChart.startAngle = M_PI_4;</p>
<p>	pieChart.sliceDirection = CPPieDirectionClockwise;<br />
    self.pieData = arrayChart;<br />
	CPTheme *theme = [CPTheme themeNamed:kCPSlateTheme];<br />
	[graph applyTheme:theme];<br />
	[graph addPlot:pieChart];<br />
	[pieChart release];</p>
<p>	//	For Label on each slice of pie<br />
	int k=-135;<br />
	int j=50;</p>
<p>	for (int i=0; i&lt;[arrayChart count];i++)<br />
	{<br />
		k=k+50;<br />
		k=j+50;<br />
		CPTextLayer *layerdarkgrayotfinalfi=nil;<br />
		if (!layerdarkgrayotfinalfi)<br />
		{<br />
			NSString *test=[NSString stringWithFormat:@&quot;%@&quot;,[arrayChart objectAtIndex:i]];<br />
			NSLog(@&quot;Label Test:%@&quot;,test);<br />
			layerdarkgrayotfinalfi= [[[CPTextLayer alloc] initWithText:test]autorelease];<br />
			layerdarkgrayotfinalfi.bounds = CGRectMake(0, 0, 20, 10);<br />
			layerdarkgrayotfinalfi.position = CGPointMake(k, j);<br />
			//layerdarkgrayotfinalfi.textStyle=whiteText1;<br />
			[layerHost.hostedLayer addSublayer:layerdarkgrayotfinalfi];</p>
<p>		}</p>
<p>	}</p>
<p>}</p>
<p>- (void)SegmentControlIndexChanged:(id)sender{</p>
<p>	switch (self.segmentControl.selectedSegmentIndex) {<br />
		case 0:<br />
			[self Today_Report:day1 tmonth:month tyear:year1];<br />
			[self constructPieChart];<br />
			break;<br />
		case 1:<br />
			NSLog(@&quot;Hello Week&quot;);</p>
<p>			break;<br />
		case 2:<br />
			NSLog(@&quot;Hello Month %@&quot;,month);</p>
<p>			[self Monthwise_Report:month Year:year1];<br />
			[self constructPieChart];<br />
			break;<br />
		case 3:<br />
			[self YearWise_Report:year1];<br />
			[self constructPieChart];<br />
			break;<br />
		    default:<br />
			break;<br />
	}<br />
}</p>
<p>- (void)Today_Report:(NSInteger)today tmonth:(NSString *)tmth tyear:(NSInteger)tyr{</p>
<p>	//[showReport removeAllObjects];<br />
	[arrayChart removeAllObjects];</p>
<p>	NSInteger tday = today;<br />
	NSString *tmonth = tmth;<br />
	NSInteger tyear = tyr;</p>
<p>	NSLog(@&quot;Today :::%d&quot;,tday);</p>
<p>	SQLAppDelegate *appDelegate = (SQLAppDelegate *)[[UIApplication sharedApplication] delegate];<br />
	NSString *dbPath = [appDelegate getDBPath];<br />
	NSLog(@&quot;%@&quot;,dbPath);</p>
<p>	if(sqlite3_open([dbPath UTF8String], &amp;database) == SQLITE_OK)<br />
	{</p>
<p>		if (todayStmt == nil)<br />
		{</p>
<p>			const char *queryString = &quot;select sum(cost), category from expense where day = ? and month = ? and year = ? group by category&quot;;</p>
<p>			int return_value =sqlite3_prepare_v2(database, queryString, -1, &amp;todayStmt, NULL); </p>
<p>			if (return_value == SQLITE_OK)<br />
			{</p>
<p>				sqlite3_bind_int(todayStmt,1, tday);<br />
				sqlite3_bind_text(todayStmt, 2, [tmonth UTF8String], -1 ,SQLITE_TRANSIENT);<br />
				sqlite3_bind_int(todayStmt, 3, tyear);</p>
<p>				arrayChart = [[NSMutableArray alloc] init];</p>
<p>				while(sqlite3_step(todayStmt) == SQLITE_ROW) {</p>
<p>					showReporttemp = [[Report alloc] init];</p>
<p>					showReporttemp.cost = (double)sqlite3_column_double(todayStmt, 0);<br />
					showReporttemp.category = [NSString stringWithUTF8String:(char *)sqlite3_column_text(todayStmt, 1)];</p>
<p>					NSLog(@&quot;Category name :%@&quot;,showReporttemp.category);<br />
					NSLog(@&quot;Cost %f&quot;,showReporttemp.cost);</p>
<p>					[showChart addObject:showReporttemp];<br />
					NSLog(@&quot;Object no %d&quot;, [showChart count]);<br />
					chartCost = showReporttemp.cost;<br />
					[arrayChart addObject:[NSNumber numberWithDouble:chartCost]];</p>
<p>				}<br />
			}<br />
		}<br />
		else {<br />
			NSAssert1(0, @&quot;Prepare statement failed with message %s&quot;, sqlite3_errmsg(database));</p>
<p>		}<br />
		sqlite3_reset(todayStmt);<br />
	}</p>
<p>	todayStmt = nil;<br />
	sqlite3_close(database);<br />
	//[tableView reloadData];</p>
<p>}</p>
<p>- (void)WeekWise_Report:(NSString *)wdate Catg:(NSString *)cat{</p>
<p>}</p>
<p>- (void)Monthwise_Report:(NSString *)mon Year:(NSInteger)yr{	</p>
<p>	//[showReport removeAllObjects];<br />
	[arrayChart removeAllObjects];</p>
<p>	NSString *getmonth = mon;<br />
	NSInteger year = yr;</p>
<p>	NSLog(@&quot;Current Month and Year %@,%d&quot;,mon,year);</p>
<p>	SQLAppDelegate *appDelegate = (SQLAppDelegate *)[[UIApplication sharedApplication] delegate];<br />
	NSString *dbPath = [appDelegate getDBPath];<br />
	NSLog(@&quot;%@&quot;,dbPath);</p>
<p>	if(sqlite3_open([dbPath UTF8String], &amp;database) == SQLITE_OK)<br />
	{</p>
<p>		if (monthStmt == nil)<br />
		{</p>
<p>			const char *queryString = &quot;select sum(cost), category from expense where month = ? and year = ? group by category&quot;;</p>
<p>			int return_value =sqlite3_prepare_v2(database, queryString, -1, &amp;monthStmt, NULL); </p>
<p>			if (return_value == SQLITE_OK)<br />
			{</p>
<p>				sqlite3_bind_text(monthStmt, 1 , [getmonth UTF8String], -1, SQLITE_TRANSIENT);<br />
				sqlite3_bind_int(monthStmt,2, year);</p>
<p>				arrayChart = [[NSMutableArray alloc] init];</p>
<p>				while(sqlite3_step(monthStmt) == SQLITE_ROW) {</p>
<p>					NSLog(@&quot;Fetching Started&quot;);<br />
					showReporttemp = [[Report alloc] init];</p>
<p>					showReporttemp.cost = (double)sqlite3_column_double(monthStmt, 0);<br />
					showReporttemp.category = [NSString stringWithUTF8String:(char *)sqlite3_column_text(monthStmt, 1)];</p>
<p>					NSLog(@&quot;Catagory name in chart page :%@&quot;,showReporttemp.category);<br />
					NSLog(@&quot;Cost %.02f&quot;,showReporttemp.cost);<br />
					chartCost = showReporttemp.cost;<br />
					NSLog(@&quot;Chart Cost:%.02f&quot;,chartCost);<br />
					[showChart addObject:showReporttemp];<br />
					NSLog(@&quot;Object no %d&quot;, [showChart count]);<br />
					[arrayChart addObject:[NSNumber numberWithDouble:chartCost]];</p>
<p>				}<br />
			}<br />
		}<br />
		else {<br />
			NSAssert1(0, @&quot;Prepare statement failed with message %s&quot;, sqlite3_errmsg(database));</p>
<p>		}<br />
		sqlite3_reset(monthStmt);<br />
	}<br />
	monthStmt = nil;<br />
	sqlite3_close(database);<br />
	//[tableView reloadData];</p>
<p>}</p>
<p>- (void)YearWise_Report:(NSInteger)rpyear{</p>
<p>	//[showReport removeAllObjects];<br />
	[arrayChart removeAllObjects];</p>
<p>	NSInteger year = rpyear;</p>
<p>	NSLog(@&quot;Current Year:::%d&quot;,year);</p>
<p>	SQLAppDelegate *appDelegate = (SQLAppDelegate *)[[UIApplication sharedApplication] delegate];<br />
	NSString *dbPath = [appDelegate getDBPath];<br />
	NSLog(@&quot;%@&quot;,dbPath);</p>
<p>	if(sqlite3_open([dbPath UTF8String], &amp;database) == SQLITE_OK)<br />
	{</p>
<p>		if (yearStmt == nil)<br />
		{</p>
<p>			const char *queryString = &quot;select sum(cost), category from expense where year = ? group by category&quot;;</p>
<p>			int return_value =sqlite3_prepare_v2(database, queryString, -1, &amp;yearStmt, NULL); </p>
<p>			if (return_value == SQLITE_OK)<br />
			{<br />
				NSLog(@&quot;Execution 5 starts from here&quot;);		</p>
<p>				sqlite3_bind_int(yearStmt,1, year);<br />
				arrayChart = [[NSMutableArray alloc] init];</p>
<p>				while(sqlite3_step(yearStmt) == SQLITE_ROW) {</p>
<p>					NSLog(@&quot;Fetching Started&quot;);<br />
					showReporttemp = [[Report alloc] init];</p>
<p>					showReporttemp.cost = (double)sqlite3_column_double(yearStmt, 0);<br />
					showReporttemp.category = [NSString stringWithUTF8String:(char *)sqlite3_column_text(yearStmt, 1)];</p>
<p>					NSLog(@&quot;Category name :%@&quot;,showReporttemp.category);<br />
					NSLog(@&quot;Cost %f&quot;,showReporttemp.cost);</p>
<p>					[showChart addObject:showReporttemp];<br />
					NSLog(@&quot;Object no %d&quot;, [showChart count]);<br />
					chartCost = showReporttemp.cost;<br />
					[arrayChart addObject:[NSNumber numberWithDouble:chartCost]];</p>
<p>				}<br />
			}<br />
		}<br />
		else {<br />
			NSAssert1(0, @&quot;Prepare statement failed with message %s&quot;, sqlite3_errmsg(database));</p>
<p>		}<br />
		sqlite3_reset(yearStmt);<br />
	}</p>
<p>	yearStmt = nil;<br />
	sqlite3_close(database);<br />
	//[tableView reloadData];</p>
<p>}	</p>
<p>-(NSUInteger)numberOfRecordsForPlot:(CPPlot *)plot<br />
{<br />
    return [self.pieData count];</p>
<p>}</p>
<p>-(NSNumber *)numberForPlot:(CPPlot *)plot field:(NSUInteger)fieldEnum recordIndex:(NSUInteger)index<br />
{<br />
	return [self.pieData objectAtIndex:index];<br />
}</p>
<p>/*<br />
-(CPFill *)sliceFillForPieChart:(CPPieChart *)pieChart recordIndex:(NSUInteger)index {</p>
<p>	CPFill * fill = [CPFill fillWithGradient:[CPGradient rainbowGradient]];<br />
	return fill;</p>
<p>}*/</p>
<p>- (void)didReceiveMemoryWarning {<br />
	// Releases the view if it doesn&#039;t have a superview.<br />
    [super didReceiveMemoryWarning];</p>
<p>	// Release any cached data, images, etc that aren&#039;t in use.<br />
}</p>
<p>/*- (void)viewDidUnload {<br />
	// Release any retained subviews of the main view.<br />
	// e.g. self.myOutlet = nil;<br />
}*/</p>
<p>- (void)dealloc {<br />
	[pieData release];<br />
	[graph release];<br />
	[segmentControl release];<br />
    [super dealloc];<br />
}</p>
<p>@end</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Danniel</title>
		<link>http://rajeev.name/2007/10/16/blogroll-cloud/comment-page-1/#comment-24224</link>
		<dc:creator>Danniel</dc:creator>
		<pubDate>Tue, 05 Jan 2010 04:36:12 +0000</pubDate>
		<guid isPermaLink="false">http://rajeev.name/2007/10/16/blogroll-cloud/#comment-24224</guid>
		<description>Hello, if you can do blogroll cloud, please send me an e-mail. Have a nice day!</description>
		<content:encoded><![CDATA[<p>Hello, if you can do blogroll cloud, please send me an e-mail. Have a nice day!</p>
]]></content:encoded>
	</item>
</channel>
</rss>

