Customize AndroidPlot Grid

I was wondering how I can change the grid spacing with AndroidPlot . My grid currently has 9 rows for the domain and 9 for the range, and I don't know where this comes from.

Also, if you know how to make the graphic line a little thicker, that would be highly appreciated.

These are the last two points that need to be fixed, and I have been looking for some time.

I learned a lot how to "make everything else beautiful."

Thanks so much for your help and time.

+4
source share
1 answer

How to change GRID (two possible ways):

plot.setRangeStep(XYStepMode.INCREMENT_BY_VAL, 125); plot.setDomainStep(XYStepMode.SUBDIVIDE, 16); 

How to change the thickness of the line of the chart: You need to change the LineAndPointFormatter that you use in this way (initializing Paint with the current lineAndPointFormatter paint is important, otherwise you will get really strange behavior):

 LineAndPointFormatter lineAndPointFormatter = new LineAndPointFormatter( Color.rgb(0, 0, 0), null, null); //change the line width Paint paint = lineAndPointFormatter.getLinePaint(); paint.setStrokeWidth(3); lineAndPointFormatter.setLinePaint(paint); // create a series using a temporary formatter, with a transparent fill // applied immediately xyPlot.addSeries(currentConsumptionSeries, lineAndPointFormatter); 
+6
source

Source: https://habr.com/ru/post/1412856/


All Articles