Change color of bars/columns


What is the best practice to set the color of specific bars/columns. Currently I am doing this but I feel that its hacky. 

   if ([key isEqualToString:g]) { = [UIColor colorWithRed:0.922 green:0.502 blue:0.149 alpha:1.0];        

    } else { = [UIColorcolorWithRed:0.569green:0.196blue:0.133alpha:1.0];




If you want to clean up your code in this area, you could create an NSDictionary of “keys” to UIColour objects. Then do something like: = [seriesColourDictionary objectForKey:key];