How to draw tens of thousands of data in seconds

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
kaifan
Posts: 4
Joined: Wed Nov 27, 2019 8:04 am
antibot: No, of course not.

How to draw tens of thousands of data in seconds

Post by kaifan » Thu Nov 28, 2019 1:16 am

I need to load a file and display at least 15000 up to 25000 data in a chart.
The java gui used is swt.

I currently use XYLineAndShapeRenderer
It takes about 10 seconds to open the file and load the data, and lagging occurs when you zoom in or resize the chart.

There was a few thousand garbage data and I discarded it and drew a chart, but there was no significant speedup.
There has been a performance improvement using fastscatterplot, but I want a chart with lines.

1) Can I draw lines using fastscatterplot?

2) Can writing threads be a quick way to load and process data when drawing a chart?

3) Below is my code. Is there anything that is algorithmically wrong?

When my code routine confirms that the file is loaded into the listner, it extracts the data and sets up a new chart via createdata and createchart.

private JFreeChart createChart(XYDataset dataset){
JFreeChart chart = ChartFactory.createXYLineChart(
"", "x", "y", dataset,
PlotOrientation.VERTICAL, true, true, false);

XYPlot plot = chart.getXYPlot();

XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer(true, false);
renderer.setSeriesPaint(0, Color.RED);

int seriesCount = plot.getSeriesCount();
System.out.println("seriesCount:"+seriesCount);
for (int i = 0; i < seriesCount; i++) {
plot.getRenderer().setSeriesStroke(i, new BasicStroke(1));
}

plot.setRenderer(renderer);
plot.setBackgroundPaint(Color.white);

chart.getLegend().setFrame(BlockBorder.NONE);

return chart;
}

Locked