I am having difficulties seeing why this code snippet would cause a world of NullPointerExceptions. What in this way of adding data is it that does not work? All is sorted, the grid is regular and the values are all integers in Double format:
Code: Select all
ArrayList<Double> x = new ArrayList<Double>();
ArrayList<Double> y = new ArrayList<Double>();
ArrayList<Double> z = new ArrayList<Double>();
x.add(0.0);
x.add(1.0);
x.add(2.0);
y.add(0.0);
y.add(1.0);
y.add(2.0);
z.add(0.0);
z.add(1.0);
z.add(2.0);
ColorGrid grid = new ColorGrid(getPlotPanel().getTChart().getChart().chart);
grid.add(x,y,z);
![Wink ;)](./images/smilies/icon_wink.gif)
Below are the two typical outputs:
Code: Select all
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at com.steema.teechart.styles.ColorGrid.fillBitmap(ColorGrid.java:297)
at com.steema.teechart.styles.ColorGrid.draw(ColorGrid.java:252)
at com.steema.teechart.styles.Series.drawSeries(Series.java:2222)
Code: Select all
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at com.steema.teechart.styles.ValueList.calcStats(ValueList.java:307)
at com.steema.teechart.styles.ValueList.getRange(ValueList.java:340)
at com.steema.teechart.styles.Custom3DPalette.createDefaultPalette(Custom3DPalette.java:498)
at com.steema.teechart.styles.Custom3DPalette.checkPaletteEmpty(Custom3DPalette.java:841)
at com.steema.teechart.styles.Custom3DPalette.doBeforeDrawChart(Custom3DPalette.java:847)
at com.steema.teechart.styles.Custom3DGrid.doBeforeDrawChart(Custom3DGrid.java:275)