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

AI Charts causes Out of Memory error in EPAD tablet Options · View
Ivan
#1 Posted : Monday, April 18, 2011 4:48:19 PM
Rank: Member

Groups: Registered

Joined: 3/7/2011
Posts: 25
Location: Albis
Hi Support,

I have been testing my new application which uses the new AICharts from you. Up to now it works like a charm everywhere I have tested it.

These days I got a client who wants to use the EPAD tablet. This one is a cheap tablet with the following specifications (see screenshot) as per the box (cannot confirm if true):

- Arm ZT-180 1 Ghz
- 512 RAM DDR II
- 4 Gb Flash NAND

The fact is that when the app run on this app... it will crash. The reason OUT OF MEMORY ERROR... I really find it hard to believe... I dont have the impression that AICHARTS is so heavy weight..

Please check the attachments for the debug output.


My Question to you is:
Is there ANYTHING THAT YOU OR I can do to make the Charting Library work on this device? Maybe there is something I can do... like increase the heap size or something but if yes maybe you can give me some advice on what to do...

I will be more than grateful for your experienced help.
Thanks
Ivan
File Attachment(s):
output.txt (21kb) downloaded 5 time(s).
Ivan attached the following image(s):
deviceInfo.png (35kb) downloaded 71 time(s).
Baydalka Volodymyr
#2 Posted : Monday, April 18, 2011 5:06:21 PM
Rank: Developers Team


Groups: Registered, Administrators

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

Look like aiCharts had created too many labels for axis. Maybe axis label interval is zero or invalid. Do you change it?

Best regards,
Volodymyr Baydalka
Andriod development and support team
Ivan
#3 Posted : Monday, April 18, 2011 5:30:15 PM
Rank: Member

Groups: Registered

Joined: 3/7/2011
Posts: 25
Location: Albis
Hi Bay,

I will check that point and let you know as soon as possible how it goes

Thanks
Ivan
Ivan
#4 Posted : Monday, April 18, 2011 5:39:09 PM
Rank: Member

Groups: Registered

Joined: 3/7/2011
Posts: 25
Location: Albis
Hi Bay,

you are right... I have axis y Interval "null" what shall I pass if I want AI charts to auto create the axis y label interval?

Ivan
Ivan
#5 Posted : Monday, April 18, 2011 5:46:34 PM
Rank: Member

Groups: Registered

Joined: 3/7/2011
Posts: 25
Location: Albis
Hi Bay,

OK

here is this snippet code

Quote:
public void setupAxis(ChartAxis axis, int titleColor, int labelColor, int lineColor, int labelSize, float lineSize, double min, double max, Double interval, String title)
{
// prepare the title of the axes
axis.setTitle(title);
axis.getTitlePaint().setColor(titleColor);

// prepare the line of the axis
axis.getLinePaint().setColor(lineColor);
axis.getLinePaint().setStrokeWidth(lineSize);

// prepare the labels that will be drawn in the axis
axis.getLabelPaint().setColor(labelColor);
axis.getLabelPaint().setTextSize(labelSize);

// grid visible?
axis.setGridVisible(false);

// prepare the intervals and min max sizes
axis.getScale().setMargin(0);
axis.getScale().setInterval(interval, IntervalType.Days);
axis.getScale().setMinimum(min);
axis.getScale().setMaximum(max);
}



where axis.getScale().setInterval(interval, IntervalType.Days); ... I am passing NULL for the Y axis and a value for the X axis (like for example 6.0)....

I dont really care if IntevalType is days or not... but I am using DAYS FOR EVERYTHING... shall I change that?

I tried to set for testing the Y interval type to something like 5.0 and still I get the same crash... any ideas?

thanks for the help
Ivan
Baydalka Volodymyr
#6 Posted : Monday, April 18, 2011 5:47:42 PM
Rank: Developers Team


Groups: Registered, Administrators

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

No, it's default value. "null" value means that interval will be computed automatically. Also it look like there is problem with X axis, not Y axis.

Best regards,
Volodymyr Baydalka
Andriod development and support team
Ivan
#7 Posted : Monday, April 18, 2011 5:58:55 PM
Rank: Member

Groups: Registered

Joined: 3/7/2011
Posts: 25
Location: Albis
Hi...

Ok here is what I am doing with X:

I set the X Interval to 1.0 ... then I create a ghost (only for the label) ChartSeries (seriesLabel) and add a TEXT label to each defined interval point.



Quote:
setChartSettings(chartTitle, "", yLabel, -0.5, 6.5, 1.0, 0, maxYChart, null, axesColor, 12, labelsColor, backgroundColor);

// convert Labels to text
aiChartUtil.addAxisLabels(seriesLabel, 0, ChartLabeling.monday);
aiChartUtil.addAxisLabels(seriesLabel, 1, ChartLabeling.tuesday);
aiChartUtil.addAxisLabels(seriesLabel, 2, ChartLabeling.wednesday);
aiChartUtil.addAxisLabels(seriesLabel, 3, ChartLabeling.thursday);
aiChartUtil.addAxisLabels(seriesLabel, 4, ChartLabeling.friday);
aiChartUtil.addAxisLabels(seriesLabel, 5, ChartLabeling.saturday);
aiChartUtil.addAxisLabels(seriesLabel, 6, ChartLabeling.sunday);

// indicate the charting to use series labels
area.getDefaultXAxis().setLabelsMode(LabelsMode.SeriesLabels);

//add series
mChartView.getSeries().add(seriesLabel);
mChartView.getSeries().add(categorySeriesHT);
mChartView.getSeries().add(categorySeriesNT);


addAxisLabel looks like this:

Quote:
public void addAxisLabels(ChartSeries series, int position, String label)
{

ChartPoint point = new ChartPoint(position, 0);
point.setAxisLabel(label);

series.getPoints().add(point);
}



I dont have this problem on other devices... so I am not sure what is going on...

Your help is very much appreciated

Ivan
Ivan
#8 Posted : Monday, April 18, 2011 6:05:03 PM
Rank: Member

Groups: Registered

Joined: 3/7/2011
Posts: 25
Location: Albis
Another thing:

here is how I setup the series including "seriesLabel"

Quote:
public void setupSeries(ChartSeries series, int backColor, int borderColor, String type, int textColor, float textSize, Integer lineWidth, Drawable linePoint )
{
series.setBackColor(backColor);
series.setBorderColor(borderColor);

series.setShowLabel(false);
series.setLabelFormat("{YVALUE0,#.###} "+type);
series.setHLabelAlignment(Alignment.Center);
series.setVLabelAlignment(Alignment.Near);

series.getTextPaint().setColor(textColor);
series.getTextPaint().setTextSize(textSize);
series.getTextPaint().setAntiAlias(true);

// if we set the line to more than 0 then we set the width
if (lineWidth.compareTo(0) > 0)
{
series.setLineWidth(lineWidth);
}

if (linePoint != null)
{
series.setMarkerDrawable(linePoint);
}

}


Ivan
Ivan
#9 Posted : Tuesday, April 19, 2011 10:34:58 AM
Rank: Member

Groups: Registered

Joined: 3/7/2011
Posts: 25
Location: Albis
Hi Vlad,

is there anything you can do to help me some more? ...I have set both AXIS to null and I still get this CRASH behaviour...

Thank you for your support
Ivan
Baydalka Volodymyr
#10 Posted : Tuesday, April 19, 2011 4:07:34 PM
Rank: Developers Team


Groups: Registered, Administrators

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

Unfortunately I can't reproduce that issue. Try to figure out which axis is crashing. Try to disable labels for each one (code : ChartAxis.setLabelsMode(LabelsMode.NoLabels)).

Best regards,
Volodymyr Baydalka
Andriod development and support team
Ivan
#11 Posted : Wednesday, April 20, 2011 11:03:33 AM
Rank: Member

Groups: Registered

Joined: 3/7/2011
Posts: 25
Location: Albis
Hi Vlad,

I am looking to track this issue,,, a question for you... when does the rendering of the chart happens?

I ask because if I comment this line out of the code:
chartLayout.addView(aiChartView, new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));

then obviously the chart is not loaded but the app DOES NOT CRASH....

Ivan
Baydalka Volodymyr
#12 Posted : Wednesday, April 20, 2011 2:07:56 PM
Rank: Developers Team


Groups: Registered, Administrators

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

Chart renders on ChartView.onDraw method, like other views.

Quote:
I ask because if I comment this line out of the code:
chartLayout.addView(aiChartView, new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));

Look like you just remove chart from your screen.

Best regards,
Volodymyr Baydalka
Andriod development and support team
Ivan
#13 Posted : Wednesday, April 20, 2011 2:43:14 PM
Rank: Member

Groups: Registered

Joined: 3/7/2011
Posts: 25
Location: Albis
Hi Vlad,

I have found the problem....

the culprit were 2 things

1. this line of code, this for some strange reason dont let me load the charts when everything seems to look ok...
axis.getScale().setMargin(0);

so I removed that line of code and everything worked fine.. BUT... once I ran into a chart where no data was available then a second issue arised:

axis.getScale().setMinimum(min);
axis.getScale().setMaximum(max);

WHEN min and max are both 0 ... the app crashed again..

so in the end I commented out the MARGIN line of code and made sure that when there is no data at all that max is at least 1.

things are working again....
Thanks for the help and support
Ivan

Baydalka Volodymyr
#14 Posted : Wednesday, April 20, 2011 2:59:09 PM
Rank: Developers Team


Groups: Registered, Administrators

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

1) axis.getScale().setMargin(0) - do not affect while you are using setMinimum/setMaximum methods
2) Do not set the same value for setMinimum and setMaximum. Chart engine expects thats Min value always less then Max value and never will be equal.

Best regards,
Volodymyr Baydalka
Andriod development and support team
Users browsing this topic
Guest (2)
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.