Android GraphView 多个系列 show/hide 触摸时的特定线图

Android GraphView multiple series show/hide particular linegraph on touch

我正在使用 GraphView for Android 和多个系列来显示 2 个图表。 是否有可能 show/hide 触摸其中一个图表,因为我在网站上找不到任何文档?

这里是源代码:

graph = (GraphView) findViewById(R.id.graph);
LineGraphSeries<DataPoint> series = new LineGraphSeries<>(new DataPoint[] {
    new DataPoint(0, 1),
    new DataPoint(1, 5),
    new DataPoint(2, 3),
    new DataPoint(3, 2),
    new DataPoint(4, 6)
});
graph.addSeries(series);

LineGraphSeries<DataPoint> series2 = new LineGraphSeries<>(new DataPoint[] {
    new DataPoint(0, 3),
    new DataPoint(1, 3),
    new DataPoint(2, 6),
    new DataPoint(3, 2),
    new DataPoint(4, 5)
});
graph.addSeries(series2);

想出了办法,如果有人偶然发现了这个问题。 创建了使用 graph.removeSeries()/graph.addSeries() 的自定义 toggle/button,这应该可以解决问题