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

how to make Y axis start from 0 no matter what Y value is. Options · View
whitecloud
#1 Posted : Friday, March 12, 2010 7:46:35 PM
Rank: Member

Groups: Registered

Joined: 2/12/2010
Posts: 14
Location: Toronto
Hi guys,

I have a line chart which shows 100 as start in stead of 0, since my lowest value is higher than 100. Well, I still want it to show from 0 (since my lower stripline is on value 90). Could you help to see what change I need to make? Thanks!

By the way I bought this ichart and already got update license on 4th this month. :)

Code:
area = new ChartArea();
area.getDefaultXAxis().setLabelsMode(ChartAxis.LabelsMode.SeriesLabels); 
area.getDefaultXAxis().setFormat("%.0f");
                   
seriesLineType = new ChartSeries( ChartTypes.Line);
seriesLineType.setShowLabel(true);

for(int i = 0; i < recordsArray.length; i++)
{
   ChartPoint point = new ChartPoint(i+1, recordsArray[i]);
   point.setLabel(String.format("%.0f", recordsArray[i]));
   seriesLineType.getPoints().add(point);
}                          
                            
setValueFont(seriesLineType);
// set special color for the stripLine that is equal to normal value
ChartAxisStripLine stripLine1 = createStripLine(LOW_VALUE);
area.getDefaultYAxis().getStripLines().add(stripLine1);
ChartAxisStripLine stripLine2 = createStripLine(HIGH_VALUE);
area.getDefaultYAxis().getStripLines().add(stripLine2);
lineView.getSeries().add( seriesLineType );
lineView.getAreas().add(area);
Baydalka Volodymyr
#2 Posted : Monday, March 15, 2010 9:49:35 AM
Rank: Developers Team


Groups: Registered, Administrators

Joined: 7/28/2009
Posts: 447
You may disable auto-calculation for axis start. You just need to set this value manually.

Code:
area.getDefaultYAxis().getScale().setMinimum(0d);


Best regards,
Volodymyr Baydalka
Andriod development and support team
whitecloud
#3 Posted : Monday, March 15, 2010 4:17:48 PM
Rank: Member

Groups: Registered

Joined: 2/12/2010
Posts: 14
Location: Toronto
Thank you Baydalka. It works.
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.