Coreplot Tips for use:
// set padding:graph.plotAreaFrame.paddingLeft + =5; graph.plotAreaFrame.paddingTop+ = 5 ; Graph.plotAreaFrame.paddingRight + =5+ =17.5;
[Self setallowpinchscaling:no]; // Suppress Scaling
// set coordinates can only be slid across the x-axis: (Other directions please understand) Plotspace.yrange = [Cptplotrangeplotrangewithlocation:cptdecimalfromint (0 ) Length:cptdecimalfromfloat (1 = [Cptplotrangeplotrangewithlocation:cptdecimalfromint ( 0 ) Length:cptdecimalfromfloat (1 = [Cptplotrangeplotrangewithlocation:cptdecimalfromint (1 ) length:cptdecimalfromfloat (1 = [Cptplotrangeplotrangewithlocation:cptdecimalfromint ( 0 ) Length:cptdecimalfromfloat (2
//Custom axis label:X.axislabels =[Self Buildlabeltitle];x.labelingpolicy= Cptaxislabelingpolicynone;//When this policy is set, both the axis label and the background line tick need to be drawn themselves, otherwise it will be empty, please do not be too alarmedx.minorticklocations=[nssetsetwitharray:locationlabels];-(nsmutableset*) buildlabeltitle{Nsmutableset*newaxislabels =[Nsmutablesetset]; Cptmutabletextstyle*textstyleb =[Cptmutabletextstyletextstyle]; Textstyleb.color= [Cptcolorcolorwithcomponentred:cptfloat (float)0x09/0xFF) Green:cptfloat (float)0x31/0xFF) Blue:cptfloat (float)0x4A/0xFF) Alpha:cptfloat (1.0)]; intn =1; for(Nsuinteger i = -; i >0; i--) {Cptaxislabel*newlabel =[[Cptaxislabelalloc] initwithtext:@ "Here is the content" textstyle:textsty LEB]; Newlabel.ticklocation=cptdecimalfromunsignedinteger (n++); Newlabel.offset=5; [Locationlabels addobject:[nsnumber numberwithfloat: (n-1) -0.25]]; [Locationlabels addobject:[nsnumber numberwithfloat: (n-1) +0.25]]; [Newaxislabels Addobject:newlabel]; [Newlabel release]; } returnnewaxislabels;}
// Refresh the contents of the chart: [[Bar1graph] reloaddata];
Coreplot Learn to use skills