android - Androidplot background, start, end values and ranges -


i trying create custom xyplot androidplot can't seem configure it.

this code:

    xyseries series = new simplexyseries(arrays.aslist(dates), arrays.aslist(times), "time on level");      // create formatter use drawing series using lineandpointrenderer:     lineandpointformatter formatter = new lineandpointformatter(color.rgb(0, 100, 0), color.rgb(0, 100, 0), null, new pointlabelformatter(color.blue));     totaltimeplot.setrangevalueformat(new decimalformat("#.#"));      totaltimeplot.setgridpadding(0, 0, 0, 200);     totaltimeplot.setbackgroundcolor(color.white);     totaltimeplot.getgraphwidget().getbackgroundpaint().setcolor(color.white);     totaltimeplot.getgraphwidget().getgridbackgroundpaint().setcolor(color.white);     totaltimeplot.getgraphwidget().getdomainoriginlinepaint().setcolor(color.black);     totaltimeplot.getgraphwidget().getrangeoriginlinepaint().setcolor(color.black);      totaltimeplot.setticksperdomainlabel(1);     totaltimeplot.setrangestepvalue(10);     totaltimeplot.getgraphwidget().setdomainlabelorientation(-90);     totaltimeplot.setmarkupenabled(false);     totaltimeplot.setborderstyle(plot.borderstyle.square, null, null);      totaltimeplot.setdomainvalueformat(new format() {         simpledateformat sdf = new simpledateformat("eee(mm.dd)-hh:mm:ss");          @override         public stringbuffer format(object object, stringbuffer buffer, fieldposition field) {             long timestamp = ((number) object).longvalue();             date date = new date(timestamp);             return sdf.format(date, buffer, field);         }          @override         public object parseobject(string string, parseposition position) {             return null;         }     });      totaltimeplot.getgraphwidget().setpaddingleft(4);     totaltimeplot.addseries(series, formatter); 

and end result:

enter image description here

as can see ugly. can me @ least configure range labels displayed. know how make background white have first , last "ticks" visible.

thank you.

edit:

i managed include first , last value setting boundaries. other problems remain.

agreed it's pretty ugly :-) easier give suggestions if list few specific items you'd improve. having said that, here's few things start with:

  • use demoapp's simplexyplotactivity xml style starting point. should fix margin issues , improve overall appearance.
  • simplify date/time format domain labels. maybe day/month hour:minute. don't know exact use case maybe require format you're using.
  • get rid of dark background frames plot.
  • consider using catmullrominterpolator draw smooth line.

Comments

Popular posts from this blog

Delphi XE2 Indy10 udp client-server interchange using SendBuffer-ReceiveBuffer -

Qt ActiveX WMI QAxBase::dynamicCallHelper: ItemIndex(int): No such property in -

Enable autocomplete or intellisense in Atom editor for PHP -