
#import "VankeFloorDetailBoardPhoto_iPhone.h"
#import "VankeProjectListAPI.h"


#pragma mark -

@implementation VankeFloorDetailBoardPhoto_iPhone

SUPPORT_AUTOMATIC_LAYOUT( YES );
SUPPORT_RESOURCE_LOADING( YES );

DEF_OUTLET(BeeUIImageView, imgPhoto)
DEF_OUTLET(BeeUILabel, lblName)
DEF_OUTLET(BeeUILabel, lblOpenDate)

- (void)dataDidChanged
{
	ProjectCategory * prj = self.data;
	if ( prj )
	{
		$(self.imgPhoto).DATA([prj getPictureUrlOrDefault]);
        $(self.lblName).DATA(prj.projectName);
        $(self.lblOpenDate).DATA(prj.foundingDate);
	}
}

ON_CREATE_VIEWS( signal )
{
//    NSArray *items = @[[PNPieChartDataItem dataItemWithValue:10 color:PNRed],
//                       [PNPieChartDataItem dataItemWithValue:20 color:PNBlue description:@"WWDC"],
//                       [PNPieChartDataItem dataItemWithValue:40 color:PNGreen description:@"GOOL I/O"],
//                       ];
//    PNPieChart *pieChart = [[PNPieChart alloc] initWithFrame:CGRectMake(40.0, 155.0, 240.0, 240.0) items:items];
//    pieChart.descriptionTextColor = [UIColor whiteColor];
//    pieChart.descriptionTextFont  = [UIFont fontWithName:@"Avenir-Medium" size:14.0];
//    [pieChart strokeChart];
}

//- (void)userClickedOnBarAtIndex:(NSInteger)barIndex
//{
//    
//    NSLog(@"Click on bar %@", @(barIndex));
//    
//    PNBar * bar = [self.barChart.bars objectAtIndex:barIndex];
//    
//    CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"transform.scale"];
//    
//    animation.fromValue = @1.0;
//    animation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
//    animation.toValue = @1.1;
//    animation.duration = 0.2;
//    animation.repeatCount = 0;
//    animation.autoreverses = YES;
//    animation.removedOnCompletion = YES;
//    animation.fillMode = kCAFillModeForwards;
//    
//    [bar.layer addAnimation:animation forKey:@"Float"];
//}

//- (IBAction)rightSwitchChanged:(id)sender {
//    if ([self.title isEqualToString:@"Pie Chart"]){
//        UISwitch *showLabels = (UISwitch*) sender;
//        if (showLabels.on) {
//            self.pieChart.showOnlyValues = NO;
//        }else{
//            self.pieChart.showOnlyValues = YES;
//        }
//        [self.pieChart strokeChart];
//    }
//    if ([self.title isEqualToString:@"Radar Chart"]){
//        UISwitch *showLabels = (UISwitch*) sender;
//        if (showLabels.on) {
//            self.radarChart.isShowGraduation = NO;
//        }else{
//            self.radarChart.isShowGraduation = YES;
//        }
//        [self.radarChart strokeChart];
//    }
//}
//
//- (IBAction)centerSwitchChanged:(id)sender
//{
//    if (self.pieChart)
//    {
//        [self.pieChart setEnableMultipleSelection:self.centerSwitch.on];
//        [self.pieChart strokeChart];
//    }
//}
//
//- (IBAction)leftSwitchChanged:(id)sender {
//    if ([self.title isEqualToString:@"Pie Chart"]){
//        UISwitch *showRelative = (UISwitch*) sender;
//        if (showRelative.on) {
//            self.pieChart.showAbsoluteValues = NO;
//        }else{
//            self.pieChart.showAbsoluteValues = YES;
//        }
//        [self.pieChart strokeChart];
//    }
//    if ([self.title isEqualToString:@"Radar Chart"]){
//        UISwitch *showRelative = (UISwitch*) sender;
//        if (showRelative.on) {
//            self.radarChart.labelStyle = PNRadarChartLabelStyleHorizontal;
//        }else{
//            self.radarChart.labelStyle = PNRadarChartLabelStyleCircle;
//        }
//        [self.radarChart strokeChart];
//    }
//}

@end
