ios - CorePlot horizontal gradient on axis -
i'm trying create horizontal gradient on y axis in coreplot:
cptgradient *axisgradient = [cptgradient gradientwithbeginningcolor:[cptcolor redcolor] endingcolor:[cptcolor yellowcolor]]; axisgradient.angle = 180.f; cptmutablelinestyle *axisstyle = [y.axislinestyle mutablecopy]; axisstyle.linewidth = 6.f; axisstyle.linegradient = axisgradient; y.axislinestyle = axisstyle; no matter set gradient angle gradient vertical. have ideas?
core plot draws gradient line fills along line path. if want tall, skinny rectangle filled gradient fades 1 color @ top @ bottom, use plot space annotation. create cptborderedlayer annotation content , give gradient fill ([cptfill fillwithgradient:axisgradient]).
Comments
Post a Comment