Search code examples
androidannotationsachartengine

AchartEngine annotations


everywhere i look, the only information I can find says to add them via the following code

series.addAnnotation("Hello!!", 1, 1);

However, When I try it in my code (with the proper series name) I get an error message that says addAnnotation is not supported. Can someone please clear this up for me? thanks!


Solution

  • You must download a recent version of the library. For example, get the night build from here.

    In your code, replace the last line (the one where you return the chart view) with:

    XYMultipleSeriesDataset dataset = buildBarDataset(titles, values);
    XYSeries series = dataset.getSeriesAt(0);
    series.addAnnotation("Vacation", 6, 30);
    return ChartFactory.getBarChartView(context, dataset, renderer, Type.STACKED);