ios - X axis label formatting in Shinobi charts -


i have chart of name versus age, name on x axis , value on y axis. problem names getting overlapped on x axis not good.

i not find formatting showing truncated name values on x axis , complete zoom in.

is there way show names ellipses or other formatting names not overlap?

the altertickmark: method on schartdelegate allows modify tickmark (and corresponding ticklabel) before added axis.

you potentially check axisrange in step, , decide if range.span small enough display labels truncated or in full.

e.g.

-(void)schart:(shinobichart *)chart altertickmark:(scharttickmark *)tickmark beforeaddingtoaxis:(schartaxis *)axis {     if (!axis.isxaxis)         return;      if ([axis.axisrange.span doublevalue] > 5)     {         nsstring *shorttext = [tickmark.ticklabel.text substringtoindex:3];         tickmark.ticklabel.text = [nsstring stringwithformat:@"%@...", shorttext];          //resize, maintain centering         cgpoint center = tickmark.ticklabel.center;         [tickmark.ticklabel sizetofit];         tickmark.ticklabel.center = center;     } } 

as full disclosure, work shinobicontrols.


Comments

Popular posts from this blog

javascript - jquery or ashx not working -

opencv - DataType<cv::detail::deriv_type>::depth what is it used for -

python 3.x - Mapping specific letters onto a list of words -