문제

So I have a graph with x axis that goes from 0-5. I need to have 0-3 background colors in red and then 3-5 in green. I am trying to do this by using:

axisSet.xAxis.alternatingBandFills = [NSArray arrayWithObjects:[CPTColor redColor], 
                                                               [CPTColor redColor], 
                                                               [CPTColor redColor], 
                                                               [CPTColor greenColor], 
                                                               [CPTColor greenColor], 
                                                               nil];

It does work but color is very bright, I am trying to make the opacity very lower so you can barely see the colors but able to tell what the colors are. The solid red and green is too much.

도움이 되었습니까?

해결책

Add "alpha" (transparency) to the color:

CPTColor *color = [[CPTColor redColor] colorWithAlphaComponent:0.1];
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top