Reputation: 351
I have a graph with a lot of data (>100) or (>1000). Here's how JFreeChart prints the graph now.
There are only 11 data points, and each person's name should appear on the x axis, but there are ellipses in place. Is there an ideal way to print large numbers of data like this?
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();
}
Upvotes: 1
Views: 291