android - MarkerView goes out of the chart for the last point on the chart -


i using markerview class show markerviews in chart. markerview layout have created contains 2 textview, 1 below other.

the problem facing markerview last point on chart half within chart , half outside chart. 2 images below state problem :

the first image shows markerview point in center of chart shows without problem :

enter image description here

the second image, shown below, shows markerview last point of chart, half within chart.

enter image description here

how markerview adjust shows within chart area.

the wiki not state customizations markerview. there more customizations?

also, in case of multiple line chart, if click on 1 of line points, markerview comes without problem. if click markerview on point on other line, application fails. idea why happens.

the code markerview class given below :

public class tooltipview extends markerview {  private basegraphmetadata mbasegraphmetadata;  private textview mtooltipdate, mtooltipvalue;  public tooltipview(context context, int layoutresource, basegraphmetadata basegraphmetadata) {     super(context, layoutresource);     mtooltipdate = (textview)findviewbyid(r.id.tooltip_date);     mtooltipvalue = (textview)findviewbyid(r.id.tooltip_value);     mbasegraphmetadata = basegraphmetadata; }  @override public void refreshcontent(entry entry, int i) {     list<drilldowninfo> drilldowninfolist = (list<drilldowninfo>) entry.getdata();     drilldowninfo drilldowninfo = drilldowninfolist.get(i);     map<string, string> group = drilldowninfo.getgroupbynamevsgroupbyvalue();     iterator iterator = group.entryset().iterator();     while (iterator.hasnext()) {         map.entry pair = (map.entry)iterator.next();         if(pair.getkey()!=null && pair.getvalue()!=null) {             string key = (string) pair.getkey();             key = key.touppercase();             double value = double.parsedouble((string) pair.getvalue());             string formattedvalue = mbasegraphmetadata.getdataformatter().getformattedvalue(value);             mtooltipdate.settext(key + " : " + formattedvalue);         }         iterator.remove();     }     mtooltipvalue.settext(string.valueof("value : "+entry.getval())); }  @override public int getxoffset() {     return -(getwidth() / 2); }  @override public int getyoffset() {     return -getheight(); } } 

just put logic in markerview. if last value highlighted, getxoffset() method should return different.

what returned, calculated int refreshcontent(...) method.

also, can take @ following xml properties:

android:clipchildren="false" android:cliptopadding="false" 

which should set chart-view.


Comments

Popular posts from this blog

IF statement in MySQL trigger -

c++ - What does MSC in "// appease MSC" comments mean? -

javascript - Blogger related post gadget image Resize s72-c [ Need Expert Help ] -