Change color of bars/columns


#1

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]) {

        series.style.areaColor = [UIColor colorWithRed:0.922 green:0.502 blue:0.149 alpha:1.0];        

    } else {

        series.style.areaColor = [UIColorcolorWithRed:0.569green:0.196blue:0.133alpha:1.0];

   }


#2

Hey,

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:

series.style.areaColor = [seriesColourDictionary objectForKey:key];

Thanks,
Jan