pChart 2.x forum
http://wiki.pchart.net/forum/

Putting an Image Map on top of a Chart
http://wiki.pchart.net/forum/viewtopic.php?f=3&t=305
Page 1 of 1

Author:  cwbuege [ Tue Mar 01, 2011 6:46 pm ]
Post subject:  Putting an Image Map on top of a Chart

Hey there all -

I'm really liking pChart, but I have been asked to do something that may be beyond the scope of pChart, but I thought I'd throw this out there anyway.

I'm generating these charts that are coming off of an AS/400-DB2 data source, but I've now been asked that the users have the ability to 'drill-down' into the chart. I'm taking this to mean that if they see that column 1 has a value of 10, they want to find out what '10' widgets are, so they want to click on the column. What I want to do is create an image map on top of the chart, so I'm wondering if I can have the chart get generated, then generate the exact same chart, but instead of displaying the chart this second time, get returned to me the locations in the chart (X,Y coordinates I'd presume) of where each of the columns/slices/etc. are. I'm guessing this data is being generated, but I am just not sure where to go to get that data back. If I can get that data back, I should be able to dynamically generate an image map from that with links to a page 'details.php?Column=1' or some such.

Any suggestions anyone?

Thanks,
Charles

Author:  jean-damien [ Wed Mar 23, 2011 11:39 am ]
Post subject:  Re: Putting an Image Map on top of a Chart

Hi,

This isn't possible yet. This functionality would require the use of JS and a recoding of the chart drawing function.

Hopefuly, this whish has already been registered and I'll work on it.

Kind regards,
JD.

Author:  cwbuege [ Wed Mar 23, 2011 1:37 pm ]
Post subject:  Re: Putting an Image Map on top of a Chart

Actually, I've gotten this to work for both bar charts and for line charts.

What I've done is taken the graph, and, right before the image is actually drawn, commented that line of code out, then take the data out of the class/array and used that to build my image map. If I get the chance, I'll post some sample code in the next couple of weeks, but right now, I'm trying to figure out if I want to make my own set of classes calling the existing ones, if I want to make a set of functions and do it that way, or what, but I do have it going.

Thanks!!!

Author:  gonzojm [ Wed Jul 27, 2011 6:31 pm ]
Post subject:  Re: Putting an Image Map on top of a Chart

Something like this would be perfect.

What do you mean when you say you commented out the line of code where the image is drawn?
I'm would like to be able to have a link per color in a stacked bar chart. Is that similar to what you ended up doing?

Thanks

Author:  jean-damien [ Fri Aug 05, 2011 8:41 am ]
Post subject:  Re: Putting an Image Map on top of a Chart

The 2.1.2 version has been published yesterday and is now available for download at http://www.pchart.net/download.

JD.

Page 1 of 1 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/