Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有两个图表。我想在点击时隐藏一个图表。我知道如何隐藏图表,但是当我隐藏它时,图例仍然可见。如何隐藏它?
要隐藏图表,我使用以下代码行: _graphPlot.bancaOneLinePlot.hidden=YES;
_graphPlot.bancaOneLinePlot.hidden=YES;
要从图例中删除绘图:
[_graph.legend removePlot:_bancaOneLinePlot];
再次添加:
[_graph.legend addPlot:_bancaOneLinePlot];
参考
当您点击图例项时,您可以轻松隐藏绘图。请看下面我的回答。可能这段代码对你有用。
https://stackoverflow.com/a/13950514/1220922