gpt4 book ai didi

java - IsoSurface 空指针异常

转载 作者:行者123 更新时间:2023-12-01 14:17:37 26 4
gpt4 key购买 nike

我有大量数据要添加到 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)

最佳答案

我可以毫无错误地执行此操作:

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();
}

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

关于java - IsoSurface 空指针异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17978147/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com