Pchan82465 / afreechart

Automatically exported from code.google.com/p/afreechart
0 stars 0 forks source link

Tick units and Number Axis optimisation problem. #7

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Creating a new XYPlot is very slow. Actually creation of plot is much slower 
then drawing graph itself. Reason of this problem is createStandardTickUnits 
method. It actually creates object adds to list and sort whole list. This is 
repeated for every object. 

Because both classes NumberTickUnits and TickUnits contain private fields, and 
contains no getter maybe we could make fileds in this classes final and in fact 
make this classes immutable? 

If we did it, we could speedup initialisation of TickunitsSource in NumberAxis.
Because we do a lot of creating and sorting objects there we could create all 
objects once at first use put them on list and sort them. Then we would put 
them in a source form list. We avoid lot of create/sorts. 
This solution works for me. I'm able to move and resize plots with touching 
screen, every time reploting whole graph. 

Original issue reported on code.google.com by kur...@gmail.com on 7 Apr 2012 at 11:59