Could somebody please explain me what I have to do so that my plot shows me at least any kind of axis caption? The horrible androidplot documentation explains less than nothing.
Code:
Date day1 = getDate(28, MAY, 2016);
Date day2 = getDate(29, MAY, 2016);
Date day3 = getDate(30, MAY, 2016);
Date day4 = getDate(31, MAY, 2016);
Date day5 = getDate(1, JUNE, 2016);
Number[] quotes = new Float[]{4.23f, 5.13f, 5.73f, 6.12f, 4.23f};
Number[] dates = new Long[]{day1.getTime(), day2.getTime(), day3.getTime(), day4.getTime(), day5.getTime(),};
XYSeries series = new SimpleXYSeries(Arrays.asList(dates), Arrays.asList(quotes), "History 5 days");
LineAndPointFormatter formatter = new LineAndPointFormatter();
formatter.setPointLabelFormatter(new PointLabelFormatter());
formatter.configure(this, R.xml.line_point_formatter_with_labels);
plot.setDomainStep(XYStepMode.SUBDIVIDE, 5);
plot.setRangeStep(XYStepMode.SUBDIVIDE, 5);
plot.setDomainValueFormat(new Format()
{
private SimpleDateFormat dateFormat = new SimpleDateFormat("dd.MM.");
@Override
public StringBuffer format(Object object, StringBuffer buffer, FieldPosition field)
{
long millis = ((Number) object).longValue();
Date date = new Date(millis);
return dateFormat.format(date, buffer, field);
}
@Override
public Object parseObject(String string, ParsePosition position)
{
return null;
}
});
plot.addSeries(series, formatter);
Plot xml:
<com.androidplot.xy.XYPlot
android:id="@+id/plot"
android:layout_width="match_parent"
android:layout_height="200dp"
android:layout_marginTop="10dp"
app:domainLabel="domain label"
app:label="A simple plot"
app:rangeLabel="range label" />
There couldn´t be less caption:
at the left side I would like to have numbers like 4.0, 5.0, 6.0 and at the bottom the date
