jmathplot icon indicating copy to clipboard operation
jmathplot copied to clipboard

Histogram constantly redraws, using 100% CPU

Open GoogleCodeExporter opened this issue 10 years ago • 2 comments

What steps will reproduce the problem?
1. Run the histogram example from the wiki
2. Notice that it is consuming an entire CPU core...

What is the expected output? What do you see instead?
It shouldn't be constantly redrawing

What version of the product are you using? On what operating system?
Latest code from SVN 

Please provide any additional information below.

It looks like the problem is that HistogramPlot2D.plot() calls:

draw.canvas.includeInBounds(bottomLeft[0]);
draw.canvas.includeInBounds(topRight[XY.length - 1]);

..which in turn call repaint() and force a redraw of the chart, hence looping 
infinitely.

Skim-reading the code, I guess the same applies to ClodPlot2D and 3D too.


Original issue reported on code.google.com by [email protected] on 8 Aug 2010 at 10:21

GoogleCodeExporter avatar Mar 14 '15 13:03 GoogleCodeExporter

Patch to stop includeInBounds() methods always redrawing.

Original comment by [email protected] on 8 Aug 2010 at 10:40

Attachments:

GoogleCodeExporter avatar Mar 14 '15 13:03 GoogleCodeExporter

That patch worked beautifully for me.  Thanks!

Original comment by [email protected] on 27 Oct 2011 at 1:20

GoogleCodeExporter avatar Mar 14 '15 13:03 GoogleCodeExporter