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

setDateRange() does not work properly Options · View
smartposter
#1 Posted : Tuesday, September 18, 2012 4:48:34 PM
Rank: Member

Groups: Registered

Joined: 9/11/2012
Posts: 11
Location: beijing
in a line chart, I want to set the x axis as date and the span of x axis is 50 seconds.
so in onCreate() i set the start value as now and the end value is now+50s.
onCreate(){
area.getDefaultXAxis().setLabelFormat(new SimpleDateFormat("HH:MM:SS"));
area.getDefaultXAxis().setValueType(ChartAxis.ValueType.Date);
long now=System.currentTimeMillis();
Date xDateStart=new Date(now);
Date xDateEnd = new Date(now + 50000);
area.getDefaultXAxis().getScale().setDateRange(xDateStart,xDateEnd);
}

the maximum points is 50 and the update frequency is one point every seconds. When the points reach maximum number, i want to move the scale of x axis accordingly.

long now=System.currentTimeMillis();
Date xDateEnd=new Date(now);
m_targetCollection.addDate(xDateEnd,value);
if(m_pointsCounter > m_maxPoints)
{
//when reach maximum points, move the start date to end date - 50 seconds
Date xDateStart = new Date(now - 50000);

chartView.getAreas().get("spo").getDefaultXAxis().getScale().setDateRange(xDateStart,xDateEnd);
}

but the UI display is as attached picture. The x axis is always display 13:09:00 and never update.
smartposter attached the following image(s):
linechart.png (44kb) downloaded 9 time(s).
smartposter
#2 Posted : Wednesday, September 19, 2012 4:36:22 AM
Rank: Member

Groups: Registered

Joined: 9/11/2012
Posts: 11
Location: beijing
anybody can help?
Users browsing this topic
Guest (4)
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.