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

StackBar with defined limits Options · View
hagsaf
#1 Posted : Sunday, February 03, 2013 2:27:02 PM
Rank: Newbie

Groups: Registered

Joined: 2/3/2013
Posts: 2
Location: hagsaf
Hello,

I want to draw a vertical progress bar with multiple colors. Therefor I use a StackBar with one stack.
Problem 1:
-if last element cs5.getPoints().addXY(0, 66); hast a big value I get an ungly gap between element and and of widget
-I tried to setRange(0, 100); but it had zero effect

What needs to be done with my code?

Thanks
Zoltan

Quote:
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.mlay);


ChartView chartView = (ChartView) findViewById(R.id.chartViewF);



ChartPalette palette = new ChartPalette(0xff8B0000, 0xffFF0000, 0xffeeee22, 0xff112211, 0xffD3D3D3);
chartView.setPalette(palette);

ChartSeries cs1 = new ChartSeries("", ChartTypes.StackedBar);
ChartSeries cs2 = new ChartSeries("", ChartTypes.StackedBar);
ChartSeries cs3 = new ChartSeries("", ChartTypes.StackedBar);
ChartSeries cs4 = new ChartSeries("", ChartTypes.StackedBar);
ChartSeries cs5 = new ChartSeries("", ChartTypes.StackedBar);


cs1.getPoints().addXY(0, 1);
cs2.getPoints().addXY(0, 2);
cs3.getPoints().addXY(0, 3);
cs4.getPoints().addXY(0, 4);
cs5.getPoints().addXY(0, 66);

chartView.getSeries().add(cs1);
chartView.getSeries().add(cs2);
chartView.getSeries().add(cs3);
chartView.getSeries().add(cs4);
chartView.getSeries().add(cs5);

ChartArea area = new ChartArea();
area.getDefaultXAxis().setVisible(false);
area.getDefaultYAxis().setVisible(false);
area.getDefaultXAxis().getScale().setRange(0, 100);
chartView.getAreas().add(area);
}
Quote:

hagsaf
#2 Posted : Wednesday, February 06, 2013 11:29:20 PM
Rank: Newbie

Groups: Registered

Joined: 2/3/2013
Posts: 2
Location: hagsaf
hello do you have answer?
Baydalka Volodymyr
#3 Posted : Thursday, February 07, 2013 6:00:02 PM
Rank: Developers Team


Groups: Registered, Administrators

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

Try to set area.getDefaultXAxis().getScale().setMargin(0);

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.