How do I make an AndroidPlot XYPlot legend icon clickable?

66 Views Asked by At

I would like to be able to click/tap on a specific legend icon to change how the XYPlot is displayed. I'm aware of plot.getLegend(), but I don't see any member functions for accessing individual icons within the legend.I also checked out plot.getLayoutManager() and didn't see anything there either. Does anyone have any ideas?

1

There are 1 best solutions below

0
Ifor On

There is nothing built in but the Ledgend layout is well defined so it's not impossible to put your own touch listener together and calculate which bit of the Ledgend has been touched. I have the Ledgend full width at the bottom so I just have to divide the width by the number of items to get the size of each.