1

I am trying to implement Androidplot and I am getting the following error:

The constructor LineAndPointFormatter(Integer, Integer, Integer) is deprecated

Can any one tell me what LineAndPointFormatter has been replaced with and how to implement it.

Many thanks.

A--C
  • 36,351
  • 10
  • 106
  • 92
Herb
  • 345
  • 1
  • 17

1 Answers1

4

Based on the new documentation, this class hasn't been replaced with anything. A deprecated constructor merely indicates you're supposed to use a different constructor.

The javadoc for the the deprecated constructor says this:

Deprecated. As of 0.5.1: Use LineAndPointFormatter(Integer, Integer, Integer, PointLabelFormatter) instead. Set corresponding parameter to null to disable the drawing of lines, vertexes or fill. Uses a default of FillDirection.BOTTOM.

As for implementation, I can't say, as I haven't worked with this API, however the extra parameter (PointLabelFormatter) seems like a simple class, so if you can work with the previous constructor, this should be largely the same.

A--C
  • 36,351
  • 10
  • 106
  • 92
  • 1
    Yes it seems that LineAndPointFormatter is of no use now or in the previous version. I have solved my problem using BarFormatter(int, int) – Herb Feb 11 '13 at 21:17
  • 2
    Regarding LineAndPointFormatter being of no use: not true. LineAndPointFormatter was and still is the most widely used Formatter as it's corresponding renderer LineAndPointRenderer requires it. The new 4th parameter is actually the PointLabelFormatter instance, which when not null allows the developer to render text above each point. – Nick Feb 12 '13 at 01:11
  • @Nick, How about LineAndPointFormatter(Context ctx, int xmlCfgId)? This method doesn't seem to be working...I'm using 0.5.2 and I keep getting crashes saying it can't find the resource id...I created a question here: http://stackoverflow.com/questions/16551799/androidplot-lineandpointformatter-causing-crash-when-passing-in-context-and-col – whyoz May 14 '13 at 21:12