 Rank: Newbie
Groups: Registered
Joined: 2/3/2013(UTC) 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); }
|
|
|
|
 Rank: Newbie
Groups: Registered
Joined: 2/3/2013(UTC) Posts: 2 Location: hagsaf
|
hello do you have answer?
|
|
|
|
 Rank: Member
Groups: Registered
Joined: 7/28/2009(UTC) Posts: 447 
|
Hi,
Try to set area.getDefaultXAxis().getScale().setMargin(0);
Best regards,
|
Volodymyr Baydalka Andriod development and support team |
|
|
|
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.