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

How to setRange when axis value type is Date? Options · View
n_j
#1 Posted : Monday, November 23, 2009 7:07:48 PM
Rank: Member

Groups: Registered

Joined: 11/19/2009
Posts: 20
Location: Mumbai
ChartAxisScale.setRange(min, max) takes only double values. My x-axis is of type Date with format 'h:mm aa', how to set range in this case? for example, I want the minimum value to be 12:00AM and maximum value 8:00PM.

Please help.

Baydalka Volodymyr
#2 Posted : Monday, November 23, 2009 7:53:04 PM
Rank: Developers Team


Groups: Registered, Administrators

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

In date-time mode one double is equal to one millisecond. Try to use this code

Calendar calendar = Calendar.getInstance();

calendar.set(2010, 8, 1); // some min date
double min = calendar.getTimeInMillis();
calendar.set(2010, 8, 10); // some max date
double max = calendar.getTimeInMillis();

axis.setValueType(ValueType.Date);
axis.getScale().setRange(min, max);

Best regards,
Volodymyr Baydalka
Andriod development and support team
n_j
#3 Posted : Monday, November 23, 2009 7:54:29 PM
Rank: Member

Groups: Registered

Joined: 11/19/2009
Posts: 20
Location: Mumbai
thanks, I will try that.
n_j
#4 Posted : Tuesday, November 24, 2009 9:37:10 AM
Rank: Member

Groups: Registered

Joined: 11/19/2009
Posts: 20
Location: Mumbai
Hi,

I tried to set range using this code,

Calendar calendar = Calendar.getInstance();
calendar.set(2009, 11, 4, 12, 0);
long min = calendar.getTimeInMillis();
calendar.set(2009, 11, 4, 0, 0);
long max = calendar.getTimeInMillis();


The problem is that if I use setRange(min,max) method no values are displayed on x-axis and if I don't set the range, the specific values are displayed.

Please help.

pturchenko
#5 Posted : Thursday, November 26, 2009 5:16:59 PM
Rank: Guest

Groups:

Joined: 7/9/2009
Posts: 3,341
Please make sure you do not receive this offset due to GTM timezome offset. Perhaps your data points falling off the range because of that.
n_j
#6 Posted : Thursday, November 26, 2009 5:40:58 PM
Rank: Member

Groups: Registered

Joined: 11/19/2009
Posts: 20
Location: Mumbai
I am not working with reference to any timezone, I just want the minimum value of to be 12PM and the max value to be midnight. The setRange(min, max) is not working for any date values.
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.