ColorGrid - Data adding problem
Posted: Mon Jan 05, 2009 1:06 pm
I am starting a new thread on this as the previous, similar one did not help and was a bit too old to be revived in a sensible way:
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:
Could anyone please let me in on how this is done? I also tried adding start,mid and end colors as well as adding the data in many other ways, all of them resulting in a ton of exceptions. And as you may know, an exception generally doesnt weigh much
Below are the two typical outputs:
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);
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)