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! To enable all features please Login or Register.

Notification

Icon
Error

Options
View
Go to last post Go to first unread
aazwork  
#1 Posted : Thursday, October 7, 2010 3:59:16 PM(UTC)
aazwork
Rank: Member

Groups: Registered
Joined: 6/10/2010(UTC)
Posts: 28
Location: Belarus

Code:
ChartAxisScale axisScaleY = area.getDefaultYAxis().getScale();
double min = axisScaleY.getVisibleMinimum();
double max = axisScaleY.getVisibleMaximum();
Some time getVisibleMinimum() and getVisibleMaximum() functions return incorrect values.
At this moment the correct (actual) values I can get only by the following algorithm:
Code:
double max = 0;
double min = 9999;
for (ChartPoint chartPoint : getSeries().get(0).getPoints()) {
    final double inPosition = chartPoint.getX();
    if (xRangeBegin <= inPosition && inPosition <= xRangeEnd) {
        final double pointY[] = chartPoint.getY();
        if (pointY[1] < min) min = pointY[1];  
        if (pointY[0] >= max) max = pointY[0];
    }
}


The problem (inequality of values) appears in the following cases:
1) Chart doesn't updated yet, so getVisibleMinimum() will be equal NaN.

2) I replaced ChartPointSeries by another one (something like showed below)
Code:
ChartSeries chartSeries = getSeries().get(0);
setSeriesType(chartSeries, chartType);
chartSeries.getPoints().clear();
{... fill by new points series ...}
In this case getVisibleMinimum() returns (may return) previous value.
regards
Baydalka Volodymyr  
#2 Posted : Thursday, October 7, 2010 5:41:44 PM(UTC)
Baydalka Volodymyr
Rank: Member

Groups: Registered
Joined: 7/28/2009(UTC)
Posts: 447
Man

Hi,

getVisibleMinimum() method returns minimal value of axis range including margins, zooming etc. Mostly Chart updates this value before rendering. You may want to update this value manually with method ChartArea.refresh();

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-2017 ArtfulBits. All rights reserved.