4

I was wondering how I can change the grid spacing with AndroidPlot. My grid currently has 9 lines for domain and 9 for range and I have no clue where this comes from.

Also if you happen to know how to make the graph-line a bit thicker that would be highly appreciated.

It is the last two points that should get fixed and I have been searching for a while now.

I have pretty much found out how to "make everything else look pretty".

Thank you very much for your help and time.

Nick
  • 8,181
  • 4
  • 38
  • 63
taranaki
  • 778
  • 3
  • 9
  • 28
  • well yes, that is exactly the problem... The androidPlot website has been down for over a month now! That's why I am asking here :) – taranaki May 17 '12 at 13:29

1 Answers1

6

How to change the GRID (two possible ways):

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

How to change the thickness of the graph line: You need to change the LineAndPointFormatter you are using in exactly this way (initializing the Paint with the current Paint of the lineAndPointFormatter is essential, otherwise you get really strange behaviour):

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);
Xieyi
  • 1,316
  • 1
  • 14
  • 19
taranaki
  • 778
  • 3
  • 9
  • 28