我在我的android應用程序中使用jjoe64 Graph View。 我試圖在圖中顯示動態值,但第一次它不包含任何值,但圖不出現。 給我解決方案。 http://www.android-graphview.org/如何顯示空圖
https://github.com/jjoe64/GraphView
我在我的android應用程序中使用jjoe64 Graph View。 我試圖在圖中顯示動態值,但第一次它不包含任何值,但圖不出現。 給我解決方案。 http://www.android-graphview.org/如何顯示空圖
https://github.com/jjoe64/GraphView
你能告訴我們你的代碼? 您是否嘗試過類似
graph = (GraphView) findViewById(R.id.graph);
LineGraphSeries<DataPoint> series = new LineGraphSeries<DataPoint>();
graph.addSeries(series);
graph.getViewport().setXAxisBoundsManual(true);
graph.getViewport().setYAxisBoundsManual(true);
graph.getViewport().setMinX(0);
graph.getViewport().setMaxX(0);
graph.getViewport().setMinY(0);
graph.getViewport().setMaxY(4);
graph.onDataChanged(true, true);
有這個一個bug report logged,並出現問題將在下一版本(4.0.1)。反正,我只是圍繞這一問題進行編碼,通過顯示一些文本,表明在這一點上沒有數據,例如。
// If there is no data, let the user know, else blank the textBox.
TextView fragmentText = (TextView) v.findViewById(R.id.history_text);
if (xLabels.size() < 2){
fragmentText.setTextSize(24);
fragmentText.setText(getString(R.string.history_graph_no_data));
} else {
// Remove the "No Data" text
fragmentText.setText("");
LinearLayout layout = (LinearLayout) v.findViewById(R.id.history_graph);
addGraphToLayout(layout);
}
'給我解決方案.'給我2K $。 – 2015-02-10 09:42:08