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

format axis Options · View
uri.m
#1 Posted : Wednesday, July 07, 2010 2:53:30 PM
Rank: Member

Groups: Registered

Joined: 6/20/2010
Posts: 12
I Have x values in the shape of time diffs (long that represent diff in milisecond) i want to display it on the axis in the format of hh:mm:ss. SimpleDateFormat isn't good for me cause it's not a date... Anyone has an idea?
Baydalka Volodymyr
#2 Posted : Wednesday, July 07, 2010 7:26:15 PM
Rank: Developers Team


Groups: Registered, Administrators

Joined: 7/28/2009
Posts: 447
Hi,

You may derive your own format class and set it to ChartAxis.setFormat method.

Code:
area.getDefaultXAxis().setFormat(new Format()
{
    @Override
    public StringBuffer format(Object val, StringBuffer builder,
            FieldPosition pos)
    {
        Number number = (Number)val;
        builder.append(DateUtils.formatElapsedTime(number.longValue() / 1000));                
        return builder;
    }

    @Override
    public Object parseObject(String string, ParsePosition position)
    {
        return null;
    }            
});




Best regards,
Volodymyr Baydalka
Andriod development and support team
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.