|
BaseChart.getHTMLImageMap Coordinate Mismatch issue |
Posted by Mike Cotrone on Nov-24-2015 11:15 |
|
Hello,
I am noticing a variation in coordinate mappings that are generated using the
BaseChart.getHTMLImageMap from an Area chart vs. the same exact graph that is a line
chart. The plotting points are identical, however the coordinates that are mapped are not
the same.
Is there a difference between how the getHtmlImageMap handles Area charts vs. Line
Charts?
Thank you in advance!
Mike
// FROM Area Chart that Coordinates work perfect:
<area shape="poly" coords="292,199,292,230,341,230,341,205"
x=3&xLabel=4.0&dataSet=0&dataSetName=&value=13.6 href="areaGraph?
x=3&xLabel=4.0&dataSet=0&dataSetName=&value=13.6" />
<area shape="poly" coords="193,123,193,230,242,230,291,230,291,199,242,193"
x=2&xLabel=3.0&dataSet=0&dataSetName=&value=13.9 href="areaGraph?
x=2&xLabel=3.0&dataSet=0&dataSetName=&value=13.9" />
<area shape="poly" coords="94,63,94,230,143,230,192,230,192,123,143,53"
x=1&xLabel=2.0&dataSet=0&dataSetName=&value=17.3 href="areaGraph?
x=1&xLabel=2.0&dataSet=0&dataSetName=&value=17.3" />
<area shape="poly" coords="44,73,44,230,93,230,93,63"
x=0&xLabel=1.0&dataSet=0&dataSetName=&value=16.8 href="areaGraph?
x=0&xLabel=1.0&dataSet=0&dataSetName=&value=16.8" />
// FROM Line Chart that Coordinates are off:
<area shape="poly" coords="345,211,347,201,292,194,290,204"
x=3&xLabel=4.0&dataSet=0&dataSetName=&value=13.6 href="lineGraph?
x=3&xLabel=4.0&dataSet=0&dataSetName=&value=13.6" />
<area shape="poly" coords="188,126,239,198,290,204,292,194,245,188,196,120"
x=2&xLabel=3.0&dataSet=0&dataSetName=&value=13.9 href="lineGraph?
x=2&xLabel=3.0&dataSet=0&dataSetName=&value=13.9" />
<area shape="poly" coords="92,58,145,47,196,120,188,126,141,59,94,68"
x=1&xLabel=2.0&dataSet=0&dataSetName=&value=17.3 href="lineGraph?
x=1&xLabel=2.0&dataSet=0&dataSetName=&value=17.3" />
<area shape="poly" coords="38,69,40,79,94,68,92,58"
x=0&xLabel=1.0&dataSet=0&dataSetName=&value=16.8 href="lineGraph?
x=0&xLabel=1.0&dataSet=0&dataSetName=&value=16.8" /> |
Re: BaseChart.getHTMLImageMap Coordinate Mismatch issue |
Posted by Mike Cotrone on Nov-24-2015 12:08 |
|
Attached are the two screen captures showing my graphing intent.
|
Re: BaseChart.getHTMLImageMap Coordinate Mismatch issue |
Posted by Peter Kwan on Nov-25-2015 00:31 |
|
Hi Mike,
The image maps for the area chart and the line chart are different. In the area chart, the
image map is for the "area". In a line chart, the image map is for the "line". I have attached
two images that shows the image map region for the data point at x = 3.0 for the area
chart and for the line chart.
Note that for the line chart, because the line is thin, it is hard to click exactly on the line.
So the area map is a polygon around the line segment as if the line is very thick. The image
map thickness can be configured using LineLayer.setImageMapWidth.
If you are creating an area chart, but what to use the image map of the line chart, you can
disable the image map for the area layer (using Layer.setHTMLImageMap), then add a
Transparent line layer. In this way, the area layer will not produce the image map, but the
invisible line layer will.
If you want an image that just includes of the data points (rectangles or squares around
the data points), you may add a scatter layer (which can be transparent). The image map
produced by the scatter layer will be rectangles enclosing the scatter symbols, so the
clickable region can be configured by using the symbol size.
Regards
Peter Kwan
|
Re: BaseChart.getHTMLImageMap Coordinate Mismatch issue |
Posted by Mike Cotrone on Nov-25-2015 02:00 |
|
Peter thank you so much for your detailed reply. That was spot on and gave me the
perfect idea to achieve my goal. Thank you and I will let you know.
Mike |
|