I have sequential time data- each point could have up to 17 different things 'wrong' with it. Each one of these problems should receive a different colour- and I do this by setting up a series of vectors (for each of the 17 problems), create a new series, and add them to the data set.
Now for the data that didn't have any problems with it I'd like to display them with simple circles and colors. They all are of the same data set (and there's up to 5 of these types of 'good' data).
The vector approach is ugly, to me, but it's very fast- worst case scenario I have 30K points (for this iteration of code) but it takes less than 30ms to sort it. Acceptable performance. But figuring out how to color code 10 different types of data is driving me bonkers- that's what I get for being yanked off this project for a few years...
Suggestions very much welcome.
Code: Select all
JFreeChart chart = createChart(dataset);
ChartPanel chartPanel = new ChartPanel(chart);
XYItemRenderer renderer = chart.getXYPlot().getRenderer();
renderer.setSeriesPaint(0, Color.GRAY);
renderer.setShape(new Ellipse2D.Double(0,0,2,2));
//renderer.setOutlinePaint(new Paint(Paint.TRANSLUCENT));
renderer.setSeriesPaint(1, Color.BLACK);
chartPanel.setVerticalAxisTrace(true);
chartPanel.setHorizontalAxisTrace(true);
// popup menu conflicts with axis trace
chartPanel.setPopupMenu(null);
chartPanel.setDomainZoomable(true);
chartPanel.setRangeZoomable(true);
return chartPanel;