我正在使用GraphView Library来渲染图表。我在图表下方放置了一个复选框,以便用户可以在图表中显示/隐藏图例。当用户单击此按钮时,我需要刷新GraphView。
我尝试了redrawAll(),但Android Studio说它"无法解析符号"。
以下是代码:
chart = (GraphView) chartView.findViewById(R.id.chart);
// Some code goes here
chart.redrawAll();
还有哪些方法可以重绘图表?
答案 0 :(得分:0)
我找到了一种刷新图表的方法,使用下面的代码:
chart.onDataChange(true, true);