IE7 freezes with large map files.

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
ebiton
Posts: 2
Joined: Wed Jan 14, 2009 11:05 am

IE7 freezes with large map files.

Post by ebiton » Wed Jan 14, 2009 2:21 pm

Hi

I'm creating a time chart that contains few graphs with around 300K entries per graph.
I save the chart as a png file and crate a map file for it.
When loading the html file in IE7 it freezes because it can't process the huge amount of coords.
Below is how I create the png and html file that will load the png with the map and coordinates.

Code: Select all

ChartRenderingInfo info = new ChartRenderingInfo(new StandardEntityCollection());
ChartUtilities.saveChartAsPNG(chkFile, chart, 1250, 500, info);
OutputStream out = new BufferedOutputStream(new FileOutputStream(mapFile));
PrintWriter writer = new PrintWriter(out);
ChartUtilities.writeImageMap(writer, "chart", info, true); 
writer.close();
I decided to divide the chart area to several vertical lines for coordinates.
My problem is that I can’t find how can I get only chart area (without the labels area)?

Appreciate any help.

Thank you,
Udi.

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Post by david.gilbert » Wed Jan 14, 2009 8:55 pm

The ChartRenderingInfo will be able to tell you the data area.

I think the HTML image map is going to be a problem for such a large dataset...you'll have to be more selective about what items you want highlighted by the image map. JFreeChart will blindly write out coordinates for everything, so you are going to have to start modifying the source code...
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

ebiton
Posts: 2
Joined: Wed Jan 14, 2009 11:05 am

Post by ebiton » Fri Jan 16, 2009 1:21 am

Hi David
Thank you very much for your help.

I tried before the chartentity , ChartRenderingInfo, chart object ... and I didn't manage to find how can I get only the graphs rectangle coordinates.
I will look more into it.

Image map with large datasets is a problem, that's why I want to divide the graphs area to vertical time segments with map coordinates, so the first display will be for the entire graph (with tooltips only for the time segments), and when pressing a time segment on graph that portion of the graph will be created with the data info tooltips (some kind of zooming).

Thanks again.

Taqua
JFreeReport Project Leader
Posts: 698
Joined: Fri Mar 14, 2003 3:34 pm
Contact:

Post by Taqua » Fri Jan 16, 2009 12:39 pm

Browsers are notorious to not being able to handle large files. A 300K entries map will very likely result in a very large DOM tree - and each node there eats memory, thanks to a rather inefficient implementation and the need to make the DOM available for JavaScript. So your death-of-the-browser is more likely a OutOfMemory condition in the browser.

In those cases, instead of using a Image-Map, use a JavaScript with onmouseover and onmouseclick events. In the server, instead of generating a imagemap, generate the JavaScript with a large array of rectangles/shapes and then simply test whether the mouse-coordinates from the eventhandler have hit one of the hot-spots, and if so, then you activate the link via good ol' JavaScript.

You will notice that the browser has no problem handling a million entries now.

Locked