2525import android .widget .RemoteViews ;
2626import com .androidplot .demos .R ;
2727import com .androidplot .ui .*;
28+ import com .androidplot .util .PixelUtils ;
29+ import com .androidplot .xy .XYGraphWidget ;
2830import com .androidplot .xy .XYSeries ;
2931import com .androidplot .xy .LineAndPointFormatter ;
3032import com .androidplot .xy .SimpleXYSeries ;
@@ -43,10 +45,6 @@ public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] a
4345
4446 plot .getGraph ().setMargins (0 , 0 , 0 , 0 );
4547 plot .getGraph ().setPadding (0 , 0 , 0 , 0 );
46- // plot.getGraphWidget().getDomainLineLabelPaint().setTextSize(PixelUtils.spToPix(10));
47- // plot.getGraphWidget().getRangeLineLabelPaint().setTextSize(PixelUtils.spToPix(10));
48- // plot.getGraphWidget().getDomainOriginLineLabelPaint().setTextSize(PixelUtils.spToPix(10));
49- // plot.getGraphWidget().getRangeOriginLineLabelPaint().setTextSize(PixelUtils.spToPix(10));
5048
5149 plot .getGraph ().position (0 , HorizontalPositioning .ABSOLUTE_FROM_LEFT , 0 ,
5250 VerticalPositioning .ABSOLUTE_FROM_TOP , Anchor .LEFT_TOP );
@@ -55,6 +53,15 @@ public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] a
5553
5654 plot .getLayoutManager ().moveToTop (plot .getTitle ());
5755
56+ plot .getGraph ().setLineLabelEdges (XYGraphWidget .Edge .LEFT , XYGraphWidget .Edge .BOTTOM );
57+ plot .getGraph ().getLineLabelInsets ().setLeft (PixelUtils .dpToPix (16 ));
58+ plot .getGraph ().getLineLabelInsets ().setBottom (PixelUtils .dpToPix (4 ));
59+ plot .getGraph ().getLineLabelStyle (XYGraphWidget .Edge .LEFT ).getPaint ().setColor (Color .RED );
60+ plot .getGraph ().getGridInsets ().setTop (PixelUtils .dpToPix (12 ));
61+ plot .getGraph ().getGridInsets ().setRight (PixelUtils .dpToPix (12 ));
62+ plot .getGraph ().getGridInsets ().setLeft (PixelUtils .dpToPix (36 ));
63+ plot .getGraph ().getGridInsets ().setBottom (PixelUtils .dpToPix (16 ));
64+
5865 plot .measure (w , h );
5966 plot .layout (0 , 0 , w , h );
6067
0 commit comments