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

axisScaleY.getVisibleMinimum() returns incorrect values Options · View
aazwork
#1 Posted : Thursday, October 07, 2010 1:59:16 PM
Rank: Member


Groups: Registered

Joined: 6/10/2010
Posts: 29
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 07, 2010 3:41:44 PM
Rank: Developers Team


Groups: Registered, Administrators

Joined: 7/28/2009
Posts: 447
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-2016 ArtfulBits. All rights reserved.