http://blog.csdn.net/gjd111686/archive/2004/07/07/36245.aspx

解决方案 »

  1.   

    <object id=ChartSpace1 classid=CLSID:0002E500-0000-0000-C000-000000000046 style="width:100%;height:350"></object>
    <br><small><b>Source: </b>Voters Research and Surveys</small><script language=vbs>
    Sub Window_OnLoad()
        Dim categories, values    ' Create a column chart with three series and four categories, showing the 
        'percentage of voters for the 1992 presidential election by race/ethic group.    ' Clear the contents of the chart workspace. This removes
        ' any old charts that may already exist and leaves the chart workspace
        ' completely empty. One chart object is then added.
        ChartSpace1.Clear
        ChartSpace1.Charts.Add
        Set c = ChartSpace1.Constants
        
        ' Set a tab-delimited string to the category data.
        categories = "White" & Chr(9) & "Black" & Chr(9) & "Asian" & Chr(9) & "Latino"    ' Add three series to the chart.
        ChartSpace1.Charts(0).SeriesCollection.Add
        ChartSpace1.Charts(0).SeriesCollection.Add
        ChartSpace1.Charts(0).SeriesCollection.Add
        
        ' Series one contains election data for Perot.
        ' Set the series caption (the text that appears in the legend).
        ChartSpace1.Charts(0).SeriesCollection(0).Caption = "Perot"    ' Set the categories for the first series (this collection is zero-based).
        ChartSpace1.Charts(0).SeriesCollection(0).SetData c.chDimCategories, c.chDataLiteral, categories    ' Set a tab-delimited string to the values for Perot, and then set the series values.
        values = "0.2" & Chr(9) & "0.06" & Chr(9) & "0.17" & Chr(9) & "0.13"
        ChartSpace1.Charts(0).SeriesCollection(0).SetData c.chDimValues, c.chDataLiteral, values
        
        ' Series two contains election data for Clinton.
        ' Update the values string, and then set the chart data.
        values = "0.38" & Chr(9) & "0.82" & Chr(9) & "0.28" & Chr(9) & "0.62"
        ChartSpace1.Charts(0).SeriesCollection(1).Caption = "Clinton"
        ChartSpace1.Charts(0).SeriesCollection(1).SetData c.chDimCategories, c.chDataLiteral, categories
        ChartSpace1.Charts(0).SeriesCollection(1).SetData c.chDimValues, c.chDataLiteral, values
        
        ' Series two contains election data for Bush.
        ' Update the values string, and then set the chart data.
        values = "0.42" & Chr(9) & "0.12" & Chr(9) & "0.55" & Chr(9) & "0.25"
        ChartSpace1.Charts(0).SeriesCollection(2).Caption = "Bush"
        ChartSpace1.Charts(0).SeriesCollection(2).SetData c.chDimCategories, c.chDataLiteral, categories
        ChartSpace1.Charts(0).SeriesCollection(2).SetData c.chDimValues, c.chDataLiteral, values
        
        ' Make the chart legend visible, format the left value axis as percentage, 
        ' and specify that value gridlines are at 10% intervals.
        ChartSpace1.Charts(0).HasLegend = True
        ChartSpace1.Charts(0).Axes(c.chAxisPositionLeft).NumberFormat = "0%"
        ChartSpace1.Charts(0).Axes(c.chAxisPositionLeft).MajorUnit = 0.1
    End Sub
    </script>
      

  2.   

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML>
    <HEAD>
    <TITLE> DSTree </TITLE>
    <META NAME="Author" CONTENT="[email protected]" >
    <style>
    body,td{font:12px verdana}
    #treeBox{background-color:#fffffa;}
    #treeBox .ec{margin:0 5 0 5;}
    #treeBox .hasItems{font-weight:bold;height:20px;padding:3 6 0 6;margin:2px;cursor:hand;color:#555555;border:1px solid #fffffa;}
    #treeBox .Items{height:20px;padding:3 6 0 6;margin:1px;cursor:hand;color:#555555;border:1px solid #fffffa;}
    </style>
    <base href="http://vip.5d.cn/star/dstree/" />
    <script>
    //code by star 20003-4-7
    var HC = "color:#990000;border:1px solid #cccccc";
    var SC = "background-color:#efefef;border:1px solid #cccccc;color:#000000;";
    var IO = null;
    function initTree(){
    var rootn = document.all.menuXML.documentElement;
    var sd = 0;
    document.onselectstart = function(){return false;}
    document.all.treeBox.appendChild(createTree(rootn,sd));
    }
    function createTree(thisn,sd){
    var nodeObj = document.createElement("span");
    var upobj = document.createElement("span");
    with(upobj){
    style.marginLeft = sd*10;
    className = thisn.hasChildNodes()?"hasItems":"Items";
    innerHTML = "<img src=expand.gif class=ec>" + thisn.getAttribute("text") +"";

    onmousedown = function(){
    if(event.button != 1) return;
    if(this.getAttribute("cn")){
    this.setAttribute("open",!this.getAttribute("open"));
    this.cn.style.display = this.getAttribute("open")?"inline":"none";
    this.all.tags("img")[0].src = this.getAttribute("open")?"expand.gif":"contract.gif";
    }
    if(IO){
    IO.runtimeStyle.cssText = "";
    IO.setAttribute("selected",false);
    }
    IO = this;
    this.setAttribute("selected",true);
    this.runtimeStyle.cssText = SC;
    }
    onmouseover = function(){
    if(this.getAttribute("selected"))return;
    this.runtimeStyle.cssText = HC;
    }
    onmouseout = function(){
    if(this.getAttribute("selected"))return;
    this.runtimeStyle.cssText = "";
    }
    oncontextmenu = contextMenuHandle;
    onclick = clickHandle;
    } if(thisn.getAttribute("treeId") != null){
    upobj.setAttribute("treeId",thisn.getAttribute("treeId"));
    }
    if(thisn.getAttribute("href") != null){
    upobj.setAttribute("href",thisn.getAttribute("href"));
    }
    if(thisn.getAttribute("target") != null){
    upobj.setAttribute("target",thisn.getAttribute("target"));
    } nodeObj.appendChild(upobj);
    nodeObj.insertAdjacentHTML("beforeEnd","<br/>") if(thisn.hasChildNodes()){
    var i;
    var nodes = thisn.childNodes;
    var cn = document.createElement("span");
    upobj.setAttribute("cn",cn);
    if(thisn.getAttribute("open") != null){
    upobj.setAttribute("open",(thisn.getAttribute("open")=="true"));
    upobj.getAttribute("cn").style.display = upobj.getAttribute("open")?"inline":"none";
    if( !upobj.getAttribute("open"))upobj.all.tags("img")[0].src ="contract.gif";
    }

    for(i=0;i<nodes.length;cn.appendChild(createTree(nodes[i++],sd+1)));
    nodeObj.appendChild(cn);
    }
    else{
    upobj.all.tags("img")[0].src ="endnode.gif";
    }
    return nodeObj;
    }
    window.onload = initTree;
    </script><script>
    function clickHandle(){
    // your code here 
    }
    function contextMenuHandle(){
    event.returnValue = false;
    var treeId = this.getAttribute("treeId");
    // your code here
    }
    </script>
    </HEAD>
    <BODY>
    <xml id=menuXML>
    <?xml version="1.0" encoding="GB2312"?>
    <DSTreeRoot text="根节点" open="true" href="http://" treeId="123">

    <DSTree text="技术论坛" open="false" treeId="">
    <DSTree text="5DMedia" open="false" href="http://" target="box" treeId="12">
    <DSTree text="网页编码" href="http://" target="box" treeId="4353" />
    <DSTree text="手绘" href="http://" target="box" treeId="543543" />
    <DSTree text="灌水" href="http://" target="box" treeId="543543" />
    </DSTree>
    <DSTree text="BlueIdea" open="false" href="http://" target="box" treeId="213">
    <DSTree text="DreamWeaver &amp; JS" href="http://" target="box" treeId="4353" />
    <DSTree text="FlashActionScript" href="http://" target="box" treeId="543543" />
    </DSTree>
    <DSTree text="CSDN" open="false" href="http://" target="box" treeId="432">
    <DSTree text="JS" href="http://" target="box" treeId="4353" />
    <DSTree text="XML" href="http://" target="box" treeId="543543" />
    </DSTree>
    </DSTree> <DSTree text="资源站点" open="false" treeId="">
    <DSTree text="素材屋" href="http://" target="box" treeId="12" />
    <DSTree text="桌面城市" open="false" href="http://" target="box" treeId="213">
    <DSTree text="壁纸" href="http://" target="box" treeId="4353" />
    <DSTree text="字体" href="http://" target="box" treeId="543543" />
    </DSTree>
    <DSTree text="MSDN" open="false" href="http://" target="box" treeId="432">
    <DSTree text="DHTML" href="http://" target="box" treeId="4353" />
    <DSTree text="HTC" href="http://" target="box" treeId="543543" />
    <DSTree text="XML" href="" target="box" treeId="2312" />
    </DSTree>
    </DSTree></DSTreeRoot>
    </xml>
    <table style="position:absolute;left:100;top:100;">
    <tr><td id=treeBox style="width:400px;height:200px;border:1px solid #cccccc;padding:5 3 3 5;" valign=top></td></tr>
    <tr><td style="font:10px verdana;color:#999999" align=right>by <font color=#660000>sTar</font><br/> 2003-4-8</td></tr>
    </table>
    </BODY>
    </HTML>
      

  3.   

    1  上面的错误
    <html>
    <head>
    <title> 鼠标选取框 </title>
    <script language="JavaScript">
    var x0;
    var y0;
    var select=false;function document.onmousedown()
    {
        x0=document.body.scrollLeft+event.clientX;// 鼠标起始横坐标
        y0=document.body.scrollTop+event.clientY;// 鼠标起始纵坐标
        select=true;
    }function document.onmouseup()
    {
        select=false;
    }function document.onselectstart()
    {
        return false;
    }function document.ondrag()
    {
        return false;
    }function document.onmousemove()
    {
        if (select)
        {
            dd.style.display='';// 如果鼠标已经正确移动,将层设置为可视。
            if(document.body.scrollLeft+event.clientX-x0>0) // 从左向右
            {
                dd.style.left=x0;
                dd.style.width=document.body.scrollLeft+event.clientX-x0;
            }
            else // 从右向左
            {
                dd.style.left=document.body.scrollLeft+event.clientX;
                dd.style.width=x0-(document.body.scrollLeft+event.clientX);
            }
            if (document.body.scrollTop+event.clientY-y0>0)// 从上向下
            {
                dd.style.top=y0;
                dd.style.height=document.body.scrollTop+event.clientY-y0;
            }
            else// 从下向上
            {
                dd.style.top=document.body.scrollTop+event.clientY;
                dd.style.height=y0-(document.body.scrollTop+event.clientY);
            }
        }
    }
    </script>
    </head><body>
    <table id="dd" style="position:absolute; width:0px; height:0px; z-index:99; border:1px black dashed; display:none;"><tr><td></td></tr></table>
    </body>
    </html>
      

  4.   

    使用vml,可以实现各种图形,在网上搜一下,有教学文档,比较简单的.