android - MPAndroidChart OnClickListener is not working for PieChart -


i use mpandroidchart in project. there 4 graphs,displays information. want show detailed information user when clicks on specific chart. have used view.setonclicklistener(); not working. there other method listen click events chart. found onvalueselected(); method in mpchart documentation not useful me,because want id of chart clicked.

i have used following

chart = (piechart) findviewbyid(r.id.chart); chart.setonclicklistener(mainactivity.this); chart.settouchenabled(true);   public void onclick(view v) {         toast.maketext(mainactivity.this,"clicked",toast.length_short).show();  } 

also other way is

    chart.setonclicklistener(new view.onclicklistener() {        @override        public void onclick(view v) {           toast.maketext(mainactivity.this,"clicked",toast.length_short).show();        }     }); 

but no luck.

i have tried onclicklistener it's not working use following code comes library itself.

mchart.setonchartgesturelistener(new onchartgesturelistener() {              @override             public void oncharttranslate(motionevent me, float dx, float dy) {                 // todo auto-generated method stub              }              @override             public void onchartsingletapped(motionevent me) {                 // todo auto-generated method stub               }              @override             public void onchartscale(motionevent me, float scalex, float scaley) {                 // todo auto-generated method stub              }              @override             public void onchartlongpressed(motionevent me) {                 // todo auto-generated method stub              }              @override             public void onchartfling(motionevent me1, motionevent me2,                     float velocityx, float velocityy) {                 // todo auto-generated method stub              }              @override             public void onchartdoubletapped(motionevent me) {                 // todo auto-generated method stub              }         }); 

Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -