I have two graphs. I want to hide one graph on click. I know how to hide graph but when i hide it the legend is still visible. How to hide it?
To hide the graph i use the following line of code: _graphPlot.bancaOneLinePlot.hidden=YES;
_graphPlot.bancaOneLinePlot.hidden=YES;
To remove plot from legend:
[_graph.legend removePlot:_bancaOneLinePlot];
To add again:
[_graph.legend addPlot:_bancaOneLinePlot];
Reference
You can easily hide the plot when you tap the legend item. Please see my answer below. Probably this code will be usefull for you.
https://stackoverflow.com/a/13950514/1220922