whitespace COMPANY whitespace SERVICES whitespace PRODUCTS whitespace PURCHASE whitespace SUPPORT whitespace CONTACTS whitespace Home whitespace Contact Us whitespace Site Map whitespace
whitespace
SUPPORT
whitespace
FORUM
whitespace
FAQS
whitespace
SUBSCRIPTION
whitespace
REQUEST ON-LINE
whitespace
whitespace

Technical Support Forum

Welcome Guest Search | Active Topics | Log In | Register

ChartAxis.LabelFormat Options · View
programmer425
#1 Posted : Sunday, March 18, 2012 5:52:51 AM
Rank: Newbie

Groups: Registered

Joined: 3/18/2012
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?
Baydalka Volodymyr
#2 Posted : Monday, March 19, 2012 12:56:21 PM
Rank: Developers Team


Groups: Registered, Administrators

Joined: 7/28/2009
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
programmer425
#3 Posted : Monday, March 19, 2012 6:37:38 PM
Rank: Newbie

Groups: Registered

Joined: 3/18/2012
Posts: 2
Thank you very much! That is exactly what I was looking for!
Users browsing this topic
Guest
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.

Company | Services | Practices | Technologies | Career | Contacts | Privacy
© 2005-2016 ArtfulBits. All rights reserved.