Had a Few Things to Look at in the BKGraphs
A few days ago, I got an email from the manager of this web site saying that he was starting to use the dual-Y-axis line graphs in BKit for the first time, and he was having a problem. I knew I had them working, but I checked my test case applets anyway. Sure enough, they worked fine on several systems in browsers and in the Java appletviewer. I sent back an email saying I couldn't reproduce the problem.
He got back to me saying it was the version of VantagePoint that seemed to be the issue. If he used the older version I used in my tests (4.6.4) then it worked as well. But if he used the newest version (4.6.6) then he got the following exception:
Exception caught on Viewer[hash=07207493]'s render thread. java.lang.RuntimeException: Not implemented. Use TwoDimVectorDataSet or TwoDimTimeSeriesVectorDataSet at com.visualizeinc.vantagepoint.jdk12.jfc.CommonDataSet.getColumn at com.visualizeinc.vantagepoint.jdk12.jfc.TwoDimLineChartViewer.getIsOnSecondary at com.visualizeinc.vantagepoint.jdk12.jfc.TwoDimPointViewer.bp at com.visualizeinc.vantagepoint.jdk12.jfc.TwoDimGraphViewer.b at com.visualizeinc.vantagepoint.jdk12.jfc.TwoDimPointViewer.e at com.visualizeinc.vantagepoint.jdk12.jfc.TwoDimLineChartViewer.e at com.visualizeinc.vantagepoint.jdk12.jfc.VisualViewer.p at com.visualizeinc.vantagepoint.jdk12.jfc.VisualViewer.b at com.visualizeinc.vantagepoint.jdk12.jfc.VisualViewer.run at java.lang.Thread.run(Thread.java:613)
I sent off an email to the VantagePoint technical support guys and didn't hear from them for a day or so, so this morning I decided to see if I could fix it by changing my use of the TwoDimDataSet to the mentioned TwoDimVectorDataSet.
So I started by making that change and recompiling. I then ran through all the graph types I had to make sure they all worked. The first problem I ran into was with the Heat graph. It was all red. I had to track it down to a few lines in the creation of the Heat graph:
case HEAT:
g = new TwoDimGridViewer(getData(), true);
if (g == null) {
error = true;
throw new BKDebugException("BKBaseGraph.switchGraphType(int) - a VantagePoint
TwoDimGridViewer could not be created on this dataset. This is a serious
problem as nothing can be changed.");
} else {
// make sure that the graph knows to color pts & labels
g.setOption(VisualViewer.oiColorStatus, true);
g.setOption(VisualViewer.oiColorStatusLabel, true);
}
break;
It turned out to be lines 9-11 which had been put there to make sure that the default color of labels and points was red. This works fine with the other graph types, but for the Heat graph, it makes all the squares that color. The solution is to not call those methods and I decided to add in the color smoothing in it's place:
case HEAT: g = new TwoDimGridViewer(getData(), true); if (g == null) { error = true; throw new BKDebugException("BKBaseGraph.switchGraphType(int) - a VantagePoint TwoDimGridViewer could not be created on this dataset. This is a serious problem as nothing can be changed."); } else { // smooth the colors from one square to the next g.setOption(TwoDimGridViewer.gtSmoothColorGradient, true); } break;
At this point, I have a nice Heat map again:
But when I tried to change from using the TwoDimDataSet to the TwoDimVectorDataSet I got a different exception:
Exception caught on Viewer[hash=03840954]'s render thread. java.lang.NullPointerException at com.visualizeinc.vantagepoint.jdk12.jfc.TwoDimLineChartViewer.getIsOnSecondary at com.visualizeinc.vantagepoint.jdk12.jfc.TwoDimPointViewer.bp at com.visualizeinc.vantagepoint.jdk12.jfc.TwoDimGraphViewer.b at com.visualizeinc.vantagepoint.jdk12.jfc.TwoDimPointViewer.e at com.visualizeinc.vantagepoint.jdk12.jfc.TwoDimLineChartViewer.e at com.visualizeinc.vantagepoint.jdk12.jfc.VisualViewer.p at com.visualizeinc.vantagepoint.jdk12.jfc.VisualViewer.b at com.visualizeinc.vantagepoint.jdk12.jfc.VisualViewer.run at java.lang.Thread.run(Thread.java:613)
which is saying that it's trying to call CommonDataSet.getColumn but it's getting a NullPointerException. I'm guessing that this is something to do with the way the TwoDimVectorDataSet is used. Interestingly, all the graphs I've checked work fine with the TwoDimVectorDataSet instead of the TwoDimDataSet. So I'm thinking I'm using it properly, it's just something in their code.
I've gone directly to their web site and put in a support request saying all the data I have on this and asking them to please help me. New version... new code... something that will give me back the double-Y axes on a graph like was (is) available in 4.6.4.