09-08-2010 6:27 PM
Hi,
Using report GRAPHICS_IGS_CHART_TEST, I have managed to create some code that returns an image of a chart. This is wonderful. I also see an example where I can set a hotspot on the title so that when the user clicks on that hotspot it will launch a URL. This seems pretty straight forward. The code is as follows:
lv_line-groupid = 'Polymers'.
lv_line-x = 'Apr'.
* lv_line-color = 54.
lv_line-y = '20`'.
* lv_line-datalabel = '2 Mil'.
lv_line-extension = 'href="http://www.ibm.com"'.
append lv_line to xyt_data.
lv_line-groupid = 'Refinery'.
lv_line-x = 'Apr'.
* lv_line-color = 54.
lv_line-y = 10.
* lv_line-datalabel = '1 Mil'.
lv_line-extension = 'href="http://www.cnn.com"'.
append lv_line to xyt_data.
data: ext_line type igs_ext,
extension type igs_ext_tab.
* set some extensions
ext_line-token = 'TITLE'.
ext_line-value = 'href="http://www.cnn.com"'.
append ext_line to extension.
* create chart object
create object igs_chart.
* set chart type
igs_chart->type = cl_igs_chart=>co_type_area_stacked_3d.
igs_chart->data = xyt_data.
igs_chart->title = 'My Title'.
igs_chart->extension = extension.
data : lt_mime type w3mimetabtype,
lv_content_type type w3param-cont_type,
lv_content_length type i.
call method igs_chart->send
importing
content_type = lv_content_type
content_length = lv_content_length
content = lt_mime
imagemap = yt_imagemap
exceptions
rfc_communication_error = 1
rfc_system_error = 2
internal_error = 3
others = 4.
However, what I want to achieve is a little different. My chart is being display in HTML via IE. I want to create an imageMap so that when the user clicks on one of the columns of the chart, it will load the appropriate URL. However, I am unsure how to specify this. Is there a way to get the imageMap parameter to contain hotspots for each of the columns?
An example would be greatly appreciated.
Alon
09-09-2010 10:05 PM
Hi Alon,
when you look at the report you refer to (GRAPHICS_IGSCHART_TEST) you will see that somewhen the call igs_chart->execute is done returning the image map in a table structure. Looping over this table you will get the desired information.
If you have not yet started I would recommend to base on the XMLCHART interpreter where you find an example in report GRAPHICS_IGS_CE_TEST. In that report you also see how the imagemap is retrieved.
Best regards
Matthias