ios - How to show label on Bar at bottom - Core Plot? -


how show label on bar @ bottom?, using below method , setting labeloffset, shows label on top (in image label text "test" displaying in middle of bar, need display bottom).

enter image description here

-(cptlayer *)datalabelforplot:(cptplot *)plot recordindex:(nsuinteger)index {  static cptmutabletextstyle *labeltext = nil;  if ( !labeltext ) {     labeltext       = [[cptmutabletextstyle alloc] init];     labeltext.color = [cptcolor redcolor]; }  nsstring *labelvalue = @"test";  nsdictionary *testsdict = [assmentstestsforgrapharray objectatindex:index]; nsinteger score = [[testsdict valueforkey:@"score"] integervalue];  cpttextlayer *newlayer = [[cpttextlayer alloc] initwithtext:labelvalue style:labeltext];  plot.labeloffset = -score;//0;//-10;   return newlayer; } 

there @ least 3 different ways this:

  1. create second plot (bar plot or scatter plot; doesn't matter) , give same x-values original plot set of y-values equal vertical position of x-axis. label second plot , not first. set second plot doesn't draw except label, i.e., set line styles , fills nil.

  2. use custom axis labels on x-axis rather plot data labels.

  3. create plot space annotations each label instead of plot data labels.


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -