문제

I'm having trouble positioning and aligning the domain values in AndroidPlot. I've attached a screenshot of what I have so far.

Problem 1 (Positioning): Since I'm formatting Unix timestamp as MMM-yy and setting the domain label orientation to -90 degrees, the labels tends to overlap the graph area (as shown below). Is there a way to move the domain labels? I prefer not to use setDomainLabelVerticalOffset() as the XYGraphWidget doesn't re-size itself to accommodate the changes from offsetting.

Problem 2 (Aligning): The domain labels seem to be aligned from bottom. This is very clear if you look at "Jul-07" and "May-09" labels in the screenshot below. Is is possible to align the labels from top?

Screenshot

도움이 되었습니까?

해결책

One thing you can do is set the justification of the labels being drawn. If memory serves, the default is center justified and what you probably want is right justified:

plot.getGraphWidget().getDomainLabelPaint().setTextAlign(Paint.Align.RIGHT);

Nick

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top