【发布时间】:2011-02-07 19:17:06
【问题描述】:
我正在使用 Microsoft Chart 控件在网页上放置几个图表。如果渲染 2 个图表,生成的 HTML 是这样的(表格是我的,img 和地图来自 MS 图表):
<table id="chart">
<tr>
<td id="rolling">
<img src="/ChartImg.axd?i=chart_45ec7063132a47d9bf08ce377f4d6030_0.png&g=d82064ecb0cf459dbda23039ae0c3f70" alt="" usemap="#ImageMap" style="height:200px;width:250px;border-width:0px;" />
<map name="ImageMap" id="ImageMap">
<area shape="rect" coords="190,112,242,132" title="$321.01" alt="" />
<area shape="rect" coords="59,69,111,132" title="$1,017.92" alt="" />
<area shape="rect" coords="138,104,190,132" title="$449.04" alt="" />
<area shape="rect" coords="7,25,59,132" title="$1,714.59" alt="" />
</map>
</td>
<td id="highrisk">
<img src="/ChartImg.axd?i=chart_45ec7063132a47d9bf08ce377f4d6030_1.png&g=6f876c9016cd4b72b5ba60609b9d05ec" alt="" usemap="#ImageMap" style="height:200px;width:250px;border-width:0px;" />
<map name="ImageMap" id="ImageMap">
<area shape="rect" coords="190,128,242,132" title="41" alt="" />
<area shape="rect" coords="59,131,111,132" title="6" alt="" />
<area shape="rect" coords="138,25,190,132" title="922" alt="" />
<area shape="rect" coords="7,121,59,132" title="100" alt="" />
</map>
</td>
</tr>
</table>
请注意,两个图表对每个图表的图像映射使用相同的名称 - “ImageMap” - 并且它在后续图表中使用第一个图表的坐标,即使它在每个元素上放置了不同的标题。
我在尝试在一页上呈现 2 个图表时做错了吗?有解决办法吗?
【问题讨论】: