0

I want to implement 3 vertical SeekBar in a page so that it looks like a bar chart. When user drags any one of the SeekBar the value corresponding to the y axis should be retrieved for that. Other SeekBar should remain in their original state.

Our idea is to implement interactive bar chart with dragging feature. Since that is not possible in open library, we decided to use seek bar instead by increasing the width.

Any sample app with this will be helpful.

Andriy M
  • 76,112
  • 17
  • 94
  • 154
Ramya
  • 1
  • 2
  • @KrupaPatel: Please [do not add "Thank you" to posts](http://meta.stackexchange.com/questions/2950/should-hi-thanks-taglines-and-salutations-be-removed-from-posts "Should 'Hi', 'thanks,' taglines, and salutations be removed from posts?"). – Andriy M Jul 18 '14 at 12:31

1 Answers1

0

Image showing output
public class multiverticleseek extends Activity {

/** Called when the activity is first created. */


 TextView textView3,textView2,textView1;

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.multiseek);

    textView1 = (TextView)findViewById(R.id.textView1);
    textView2 = (TextView)findViewById(R.id.textView2);
    textView3 = (TextView)findViewById(R.id.textView3);

     bar1=(VerticalSeekBar)findViewById(R.id.seekBar1);
     bar2=(VerticalSeekBar)findViewById(R.id.seekBar2);
     bar3=(VerticalSeekBar)findViewById(R.id.seekBar3);

    bar1.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {


    public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser){


        textView1.setText(Integer.toString(progress)+"%");

    }

    public void onStartTrackingTouch(SeekBar seekBar) {


    }

    public void onStopTrackingTouch(SeekBar seekBar) {

    }
  });

    bar2.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {


        public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser){


            textView2.setText(Integer.toString(progress)+"%");

        }

        public void onStartTrackingTouch(SeekBar seekBar) {


        }

        public void onStopTrackingTouch(SeekBar seekBar) {

        }
    });

    bar3.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {


        public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser){


            textView3.setText(Integer.toString(progress)+"%");

        }

        public void onStartTrackingTouch(SeekBar seekBar) {


        }

        public void onStopTrackingTouch(SeekBar seekBar) {

        }
    });

}
Jaffer Wilson
  • 7,029
  • 10
  • 62
  • 139