我有一个包含大量数据(> 100)或(> 1000)的图表。以下是JFreeChart现在如何打印图表。
只有11个数据点,每个人的名字应该出现在x轴上,但是有椭圆形。是否有理想的方式来打印这样的大量数据?
public void barchartResults(ArrayList<Person> results, String testName) {
int i;
setLayout(new FlowLayout(FlowLayout.LEFT, 20, 20));
DefaultCategoryDataset dataset = new DefaultCategoryDataset();
String test = results.get(0).getTrait();
for (i = 0; i < results.size(); i ++) { // Iterate until the end of the results array
dataset.setValue(results.get(i).getScore(), results.get(i).getTrait(), results.get(i).getName());
}
JFreeChart chart = ChartFactory.createBarChart3D( testName + ": " + test,
"Examinees", "Score", dataset, PlotOrientation.VERTICAL, true, true, false );
ChartPanel chartPanel = new ChartPanel(chart, W, H, W, H, W, H, false, true, true, true, true, true);
chart.setBorderVisible(true);
chartPanel.setSpaceBetweenGroupsOfBars(1);
this.add(chartPanel);
revalidate();
repaint();
}