Domanda

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.

È stato utile?

Soluzione

Add "alpha" (transparency) to the color:

CPTColor *color = [[CPTColor redColor] colorWithAlphaComponent:0.1];
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top