Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove series indicator/plot legend AndroidPlot

I realise AndroidPlot has a forum but it isn't the most active so i'll chance my arm here...

I'm trying to remove the series indicator or plot legend from my XY plot using the AndroidPlot library. I don't want to remove the series from the plot itself, just the legend.

I've seen it done on AndroidPlot examples but with the limited documentation it's difficult to find methods to do the stuff like remove the legen

like image 201
Strokes Avatar asked Nov 16 '12 08:11

Strokes


1 Answers

OK I have the following code to do this. This is not tested on the very latest version but hopefully is still good.

    if (!mKeyOn)
        mDynamicPlot.getLayoutManager()
                .remove(mDynamicPlot.getLegendWidget());
    if (!mDomainLabelOn)
        mDynamicPlot.getLayoutManager().remove(
                mDynamicPlot.getDomainLabelWidget());

Looks like the trick is to get the layoutManager.

like image 55
Ifor Avatar answered Oct 05 '22 11:10

Ifor