I have implemented graphs using this tutorial
http://www.raywenderlich.com/13271/how-to-draw-graphs-with-core-plot-part-2
now i want to add a title which will be the calculated percentage of each graph bar at the top of each graph bar, i am trying it like this
int i =0;
for (CPTBarPlot *plot in plots) {
plot.dataSource = self;
plot.delegate = self;
plot.barWidth = CPTDecimalFromDouble(CPDBarWidth * 2);
plot.barOffset = CPTDecimalFromDouble(barX);
plot.lineStyle = barLineStyle;
NSString *plotname = [plottiltes objectAtIndex:i];
plot.title = plotname;
NSLog(@"%@",plotname);
i++;
[graph addPlot:plot toPlotSpace:graph.defaultPlotSpace];
barX += CPDBarWidth * 4;
}
but not succeding till yet, plz. guide me. Regards Saad
The
titleproperty is the description of the plot that shows up in the legend. Use data labels to label the bars. If the values that you’re displaying aren’t the plotted values, you’ll need to use custom data labels. Implement the following datasource method and make custom labels. You can use aCPTTextLayerto display a text string or any otherCPTLayerif you need to get fancy.