选择鼠标范围不起作用即10

时间:2013-10-08 10:28:56

标签: jsp

<img id="chartImg" oncopy="handleCopyEvent();" border=0 width=1425 height=660 alt="chart" src="<%=imagePath %>" onDblClick="mouseClickHandler(event.type);" onClick="mouseClickHandler(event.type);" usemap="#main">
    <map id="main" name="main">
        <!--Create Map -->
        <script type="text/javascript">
        var chartRotate = <%=chartRotate%>;
        var start = <%=startX%>;
        var startY = <%=startY%>;
        var drawVol = <%=drawVol%>;
        if(chartRotate)
        {
            start -= 40;
        }
        var min = <%=min%>;
        var max = <%=max%>;
        var unitX = <%=unitX%>;
        var unitY = <%=unitY%>;
        var h = <%=h%>;
        var panes = <%=panes%>;
        var x1 = start;
        var x2;
        var len = jsArray.length;
        var markDataLen = jsMarkArray.length;
        var areaId;
        var zoomRange = "<%=zoomRange%>";
        //var zoomRange="zoomRange";
        if (markDataLen == 0)
        {
            for (var i=0;i<len;i++)
            {
                x2 = start+Math.round((i+1)*unitX);
                areaId = "area"+i;
                if (chartRotate)
                {
                    document.writeln("<area id=\""+areaId+"\"shape=rect coords=\"1,"+x1+","+h+","+x2+"\"onMouseOver=\'showTip(\""+areaId+"\",\""+zoomRange+"\");if (window.setData) { setData("+i+");}\' >");
                }
                else
                {
                    document.writeln("<area id=\""+areaId+"\"shape=rect coords=\""+x1+",1,"+x2+","+h+"\"onMouseOver=\'showTip(\""+areaId+"\",\""+zoomRange+"\");if (window.setData) { setData("+i+");}\' >");
                }
                x1 = x2;
            }
        }
        else
        {
            var coords, eventCoords, y1, y2, prices, price, temp1="", temp2="";
            for (var i=0;i<len;i++)
            {
                x2 = start+Math.round((i+1)*unitX);
                if (x1 < 0)
                    x1 = 0;
                prices = jsArray [i].split(";");
                for (var j=0; j<prices.length; j++)
                {
                    if (prices[j] == "Close")
                    {
                        price = parseFloat (prices[j+1]);
                        break;
                    }
                }
                //y2 = ((h * 0.667) / parseFloat (max - min)) * (max - price);
                //y1 = y2 - 30;
                //if (y1 < 0)
                //y1 == 0;
                areaId = "area"+i;
                if (chartRotate)
                {
                    coords = "\"1,"+x1+","+h+","+x2+"\"";
                }
                else
                {
                    coords = "\""+x1+",1,"+x2+","+h+"\"";
                }
                if(jsMarkArray[i] == 'null')
                {
                    document.writeln("<area id=\""+areaId+"\"shape=rect coords="+coords+" onMouseOver=\'showTip(\""+areaId+"\");if (window.setData) { setData("+i+");updateLayer(\""+jsMarkArray[i]+"\","+x1+");}\' >");
                }
                else
                {
                    //var line = "<area id=\""+areaId+"\" class=\"Ink\"shape=rect coords="+coords+" onMouseOver=\'showTip(\""+areaId+"\");if (window.setData){setData("+i+");updateLayer(\""+jsMarkArray[i]+"\","+x1+");}\' >");
                    var line = "<area id=\""+areaId+"\" class=\"Ink\" shape=rect coords="+coords; line += " onMouseOver=\'showTip(\""+areaId+"\");if (window.setData) {setData("+i+");updateLayer(\""+jsMarkArray[i]+"\","+x1+");}\' >";
                    document.writeln(line);
                }
                x1=x2;
            }
        }
    </script>
</map>

0 个答案:

没有答案