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

setValueType(ValueType.Date) method crashes! Options · View
mguerra88
#1 Posted : Tuesday, February 01, 2011 3:18:18 PM
Rank: Newbie

Groups: Registered

Joined: 11/30/2010
Posts: 1
Location: Lisbon
Hi everyone,

I'm using aiCharts to represent a real time chart and I want to show the current time (HH:mm) in the X axis labels. However when I set the X axis value type to Date my Activity shows a blank screen and crashes... If I comment this line of code no error occurs but the date is shown in long values...

I'm using Realtime sample as my source code. Here's some example code:

Code:
ChartView chartView = (ChartView)findViewById(R.id.chartView);
        
ChartSeries series = new ChartSeries("FastLineSeries", ChartTypes.FastLine);
        
chartView.getSeries().add(series);
ChartArea area = new ChartArea();

area.getDefaultXAxis().getScale().setMargin(ChartAxisScale.MARGIN_NONE);
area.getDefaultXAxis().setValueType(ValueType.Date);
chartView.getAreas().add(area);

// Because java's Timer class behaves incorrectly,
// using following workaround.
m_handler.postDelayed(new AddPointTask(series), 0);

(...)

public void run()
{
            
  //ChartPoint point = new ChartPoint(m_pointsCounter++,
  //        m_randomValuesGenerator.nextInt(100));

  Date xDate = GregorianCalendar.getInstance().getTime();
  m_targetCollection.addDate(xDate, m_randomValuesGenerator.nextInt(100));

  if(m_pointsCounter > m_maxPoints)
  {
    m_targetCollection.removeAt(0);
  }

  m_handler.postDelayed(this, m_dellay);
}


If someone can help me I would appreciate it.
Thank you.
Baydalka Volodymyr
#2 Posted : Tuesday, February 01, 2011 6:00:01 PM
Rank: Developers Team


Groups: Registered, Administrators

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

Thank you for bug report. aiCharts can't compute labels interval. Try to set it manually. Example :

Code:
area.getDefaultXAxis().getScale().setInterval(1d, IntervalType.Minutes);


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.