Image map size is Huge for large datasets

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
indio
Posts: 17
Joined: Thu Mar 27, 2008 4:14 pm

Image map size is Huge for large datasets

Post by indio » Thu Jun 05, 2008 1:01 pm

Hello jfree people,

I am using jfree in a JSP project. The image maps are of particular interest to me. I have noticed that each point on the map is a poly, with a LOT of points.

example:

Code: Select all

coords="97,204,96,206,94,207,92,206,91,204,92,202,94,201,96,202,97,204,97,204" shape="poly"
Imagine this multiplied for a thousand datapoints. Suddenly the html document explodes.

Doesn't it make more sense to have simple type of shape representing a point on the image? Like a rectangle instead of this polygon-converging-to-circle-because-of-infinite-corners?

How could we override the default behaviour?[/code]

indio
Posts: 17
Joined: Thu Mar 27, 2008 4:14 pm

Post by indio » Tue Jun 10, 2008 3:12 pm

Hello community,

This issue is really causing us a lot of pain. Big datasets crash every known browser.

If coord number was smaller, it should be less stuff to render for the browser.

Any way to make it work with less poly points?

indio
Posts: 17
Joined: Thu Mar 27, 2008 4:14 pm

Post by indio » Tue Jun 10, 2008 3:40 pm

I'm also coming to realize that I cannot choose which datasets of a e.g timeseries chart I want to appear in the image map.

For example, I have the sample dataseries that is usually large, and a series of "events" that is usually very small. I want to have image map coordinates drawn only for the "events" series. That looks impossible. If you set one tooltip generator and ask for imagemaps, you get more than you (tried to) ask.

Is that true?

HalogenLB
Posts: 2
Joined: Tue Jun 10, 2008 4:36 pm

Post by HalogenLB » Tue Jun 10, 2008 5:33 pm

Have you considered writing your own ImageMapUtilities? In the method getImageMap, the area tags are returned from entity.getImageMapAreaTag for every entity. You could write your method so it's only called if the entity matches the series you want.

indio
Posts: 17
Joined: Thu Mar 27, 2008 4:14 pm

Post by indio » Wed Jun 11, 2008 11:59 am

Any insight on how to get the link between an entity and the dataset it belongs to?

HalogenLB
Posts: 2
Joined: Tue Jun 10, 2008 4:36 pm

Post by HalogenLB » Wed Jun 11, 2008 5:09 pm

Not particularly, I've never had to do this before. If you work with the entities you need as the right type, I guess XYItemEntity if you're creating a time series, then you could use the appropriate method on the object to ask for the series index, or dataset, etc.

skunk
Posts: 1087
Joined: Thu Jun 02, 2005 10:14 pm
Location: Brisbane, Australia

Post by skunk » Wed Jun 11, 2008 6:01 pm

indio wrote:Any insight on how to get the link between an entity and the dataset it belongs to?
org.jfree.chart.entity.XYItemEntity has this method

Code: Select all

public XYDataset getDataset()

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 Jun 11, 2008 9:22 pm

I'm following this thread - I think it would be good to at least provide an option for smaller area tags in image maps.

Note that you can suppress the creation of chart entities for a particular series by calling this method in any renderer:

Code: Select all

public void setSeriesCreateEntities(int series, Boolean create);
Of course, no entity means no tooltips for that series.
David Gilbert
JFreeChart Project Leader

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

indio
Posts: 17
Joined: Thu Mar 27, 2008 4:14 pm

Post by indio » Thu Jun 12, 2008 8:19 am

Aha! That is a good piece of advice. I was trying to decode what entity really means, I had the impression that it was the object that wraps together any kind of "thing" drawn on a chart. But you say its only for making image maps.

I discovered yesterday that you *can make maps only of one series of many that exist on a graph, by using the CustomXYToolTipGenerator. You feed a List of tooltips to the series you want with addToolTipSeries() and an empty (or null?) list to the others. Haven't tested it myself, but I am told it works.

But the setSeriesCreateEntities() method looks easier to use and requires less change to existing code. Off to netbeans!

PS:As for the tooltip coords, I 'm surprizes that a circle was not used. Its so much less verbose, just 2 ints!

Locked