0

我有大量数据要添加到 Android 中的 Surface 图表中。图表显示正确。但是,当我尝试将图表类型切换为 IsoSurface 时,应用程序崩溃了。我不确定它为什么会崩溃,因为它似乎在库本身中。我已经包含了崩溃的 LogCat 的输出

E/AndroidRuntime(3719): FATAL EXCEPTION: main
E/AndroidRuntime(3719): java.lang.NullPointerException
E/AndroidRuntime(3719):     at com.steema.teechart.drawing.Graphics3D.calc3DPos(Graphics3D.java:1110)
E/AndroidRuntime(3719):     at com.steema.teechart.styles.IsoSurface.loopLevels(IsoSurface.java:445)
E/AndroidRuntime(3719):     at com.steema.teechart.styles.IsoSurface.drawCell(IsoSurface.java:385)
E/AndroidRuntime(3719):     at com.steema.teechart.styles.Surface.drawAllCells(Surface.java:405)
E/AndroidRuntime(3719):     at com.steema.teechart.styles.Surface.draw(Surface.java:308)
E/AndroidRuntime(3719):     at com.steema.teechart.styles.IsoSurface.draw(IsoSurface.java:113)
E/AndroidRuntime(3719):     at com.steema.teechart.styles.Series.drawSeries(Series.java:2357)
E/AndroidRuntime(3719):     at com.steema.teechart.Chart.drawAllSeries(Chart.java:790)
E/AndroidRuntime(3719):     at com.steema.teechart.Chart.drawAxesSeries(Chart.java:752)
E/AndroidRuntime(3719):     at com.steema.teechart.Chart.internalDraw(Chart.java:732)
E/AndroidRuntime(3719):     at com.steema.teechart.Chart.paint(Chart.java:2080)
E/AndroidRuntime(3719):     at com.steema.teechart.Chart.paint(Chart.java:2096)
E/AndroidRuntime(3719):     at com.steema.teechart.TChart.onDraw(TChart.java:317)
4

1 回答 1

1

我可以做到这一点没有错误:

Surface surf1 = new Surface(tChart1.getChart());
surf1.fillSampleValues();

try {
    Surface.changeType(surf1, IsoSurface.class);
} catch (IllegalArgumentException e) {
    e.printStackTrace();
} catch (InstantiationException e) {
    e.printStackTrace();
} catch (IllegalAccessException e) {
    e.printStackTrace();
} catch (NoSuchMethodException e) {
    e.printStackTrace();
} catch (InvocationTargetException e) {
    e.printStackTrace();
}

请发布一些代码,以便我们可以在这里重现问题。

于 2013-08-01T09:03:50.633 回答