 Rank: Newbie
Groups: Registered
Joined: 3/18/2012(UTC) Posts: 2
|
Hello, I've been working on an older Android application that uses your aiCharts library and I seem to have run into a little problem. The program used an old version of the aiCharts library, which appears to have issues on most devices running Android 3.0 and higher. The obvious solution is for us to simply get a more updated version of the library. This seems to solve the crashing, but it relays an error that says a previously working function no longer exists. Here is the function that worked with the older library: Code:
ChartAxis.LabelFormat customFormat = new ChartAxis.LabelFormat(yaxis) {
@Override
protected String doubleFormat(double value) {
long seconds = (long) (value / 1000);
return DateUtils.formatElapsedTime(seconds);
}
};
yaxis.setFormat(customFormat);
"ChartAxis.LabelFormat" appears to have vanished from the updated library. For some reason I can't seem to locate any documentation on exactly what that function used to do and so it has become very difficult to simulate it so that the program isn't any different. I was hoping that someone here might be able to help out?
|
|
|
|
 Rank: Member
Groups: Registered
Joined: 7/28/2009(UTC) Posts: 447 
|
Hi, In version 1.5 we use system Format class to specify labels formating. Example: Code:chartArea.getDefaultXAxis().setLabelFormat(new Format()
{
@Override
public StringBuffer format(Object object, StringBuffer buffer, FieldPosition field)
{
long seconds = ((Double)object).longValue() / 1000;
buffer.append(DateUtils.formatElapsedTime(seconds));
return buffer;
}
@Override
public Object parseObject(String string, ParsePosition position)
{
return null;
}
});
or use default formaters SimpleDateFormat Best regards, |
Volodymyr Baydalka Andriod development and support team |
|
|
|
 Rank: Newbie
Groups: Registered
Joined: 3/18/2012(UTC) Posts: 2
|
Thank you very much! That is exactly what I was looking for!
|
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.