对asp不很熟悉,不知道可不可以用控件来实现

解决方案 »

  1.   

    你这个问题应该在ASP版块里问会好一些。
      

  2.   

    用mschart图表工具,这是个标准的activex控件。把charttype属性 设为14 就是你要得饼图
      

  3.   

    to bixuewei
    你说的mschart图表工具,哪里有下载。
      

  4.   

    友人说:
    用VB做一个Active DLL文件,在ASP中调用。请教。
      

  5.   

    对,可以在VB里用mschart图表工具写一个dll,然后在服务器端注册,就可以调用了。
    不过好象也可以直接用控件吧。(我没试过。。)
      

  6.   

    请问phf(寻梦人):
    具体如何做。
    急急急急急
      

  7.   

    有一个折衷的办法,使用COM部件来产生一个Chart,存为jpg文件(文件名每次都必须为一)。然后把文件名返回给调用者。asp只需动态产生超连接即可。
      

  8.   

    mschart的确不错,你要的话我可以发给你
      

  9.   

    你真是个好人,[email protected]
    急急急急急 
      

  10.   

    I am in shanghai.
    tel: 65710016
    are you in shanghai too?
      

  11.   

    我想用编一个Active DLL.
    请指教思路。
      

  12.   

    开发Active Dll,可以用VB来实现,把Mschart访在DLL中,在给DLL写上入口参数,以后就可以直接
    在ASP中调用了!写在DLL的类接口上.....
      

  13.   

    可以利用mschart控件(vb自带),再将所的结果显示
      

  14.   

    要在asp下画图,最好用asp组件,效率高,我用aspchart,感觉很好,可惜现在停止开发了。不过如果只需要饼图的话,我建议你到http://www.dundas.com/index.asp下载一个组件(只有饼图才免费),其3D效果非常cool,保证老板加你人工。
      

  15.   

    就用mschart,asp可以用activex控件的,但在vb中的方法不能全部用,效果很好的
      

  16.   

    赞成:VCpp(撒旦) 
    用Java Applet作. 
      

  17.   

    用DELPHI或C++BUILDER做的话,非常简单。呵呵
      

  18.   

    可以用vb做一个动态库。首先要安装office2000.因为要用到mschart控件。    
    然后在asp中调用。如果你需要的话,我可以给你一个。动态库也含全部源代码。你可以修改。
    如果用柱状图,可以事先做一条形图,计算各字段占的比例。即可
    [email protected]
    yygwy.yeah.net
      

  19.   

    请coolyangbo(杨波)同我联系:
    如果你在上海,请打[email protected]"开发Active Dll,可以用VB来实现,把Mschart访在DLL中,在给DLL写上入口参数,以后就可以直接在ASP中调用了!写在DLL的类接口上..... "
    请详细描述编写方法。万分感谢。
      

  20.   

    haor(一个好人):我做了以下步骤:
    1、打开VB,新建Active Dll
    2、“工程”-》“部件”中将你发给我的mschart.ocx添加进来。
    3、“确定”后报错:
        Microsoft Chart Control 6.0是单线程部件,不能用于多线程工程。
        请修改工程的线程模式或与代理商联系取得升级版。
    what should I do?
      

  21.   

    其实我用的是PHP但原理应该都差不多,你应该是做一个网上调查之类的东西吧。
    我是这样,把各个观点折合的百分比率乘以一个定值。然后用这个值做为图表柱形的长度值,对于饼图的话完全可以设为其半径,然后嘛,那就是HTML的问题落。
      

  22.   

    to zytang
    从工程属性中把工程改成单线程。
      

  23.   

    there is a better control(for web) in office 2000,you can try it 
      

  24.   

    haor(一个好人):
    我以把mschart添加到控件工具条上了。
    然后怎么办?
      

  25.   

    但是Active DLL是不可见的。
      

  26.   

    为什么我已经
    regsvr32 E:\Study\asp\Example.dll /u
    系统显示成功,"DllUnregistserver in E:\Study\asp\Example.dll succeeded"但不能删除硬盘上的Example.dll,
    出错提示:
    “无法删除Example.dll,共享冲突。源文件或目标文件正在使用。”
      

  27.   

    那个dll已经载入内存了所以不能删,你重起一遍机器应该就可以了
      

  28.   

    你画个圆啊。然后用上色的办法给里面的色彩上值。不就成了一个多色彩的贺*O&
      

  29.   

    再请教问题:
    1、如何将Picture控件中用mousemove画出的线条保存到硬盘上,格式分别为*.bmp*.jpg*.gif
    2、Active DLL除了在ASP中调用,还可以在那里使用,请举例说明。
    3、Active DLL 和 Active exe有什么区别
    4、难道每次修改了Active DLL源代码,要调试时,都要先从新启动计算机,清空内存后,再注册Active DLL,才能运行调试吗?这也太麻烦了。
    谢谢
    zytang
      

  30.   

    两种解决方案:一、写JavaApplet嵌入IE实现饼图。需要自己写JavaApplet
    二、使用ASPImage这个组件很容易就可以画出来。这个组件好像需要注册!
      

  31.   

    to zytang将PICTURE的图片保存可以用 savepicture picture1.image(应该是)保存的是bmp文件,可以用其它的工具转达换成其它格式
    修改ACITVEDLL应该不需要启动计算机吧,也太麻烦了,以前做过,应该不用
      

  32.   

    你看看www.banby.com,下面那个计数器就是用VJ写的JavaApplet,用它实现饼图也很方便。主流浏览器都支持。
      

  33.   

    ndd(我爱VB),您好:
    “savepicture picture1.image(应该是)保存的是bmp文件”的方法只能在用了LOADPICTURE之后才能有效,
    我的意图是“将Picture控件中用mousemove画出的线条保存到硬盘上”
    用以上方法保存的图片是空白的。
      

  34.   

    ndd(我爱VB),您好:
    “修改ACITVEDLL应该不需要启动计算机吧”
    请问你的操作步骤。
      

  35.   

    给你一段代码,对你应该是有帮助的
    <%@ Language=VBScript %>
    <% OPTION EXPLICIT %>
    <html>
    <head>
    <meta NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
    </head>
    <body><!-- #INCLUDE FILE="ExcelChart.inc" --><%
      Dim iStartYear, iEndYear
      Dim strFactory, strRSMode 
      Dim flgRSFromDatabase
      
      '--- read the starting year submitted from the form
      iStartYear = Request.Form( "iYear" )
      if( IsEmpty(iStartYear) or IsNull(iStartYear)) then iStartYear = 1991
      
      '--- compute the ending year based on start year
      iEndYear = CInt(iStartYear)+4
      
      '--- get the factory for which production is to be shown
      strFactory = Request.Form( "strFactory" )
      if( IsEmpty(strFactory) or IsNull(strFactory)) then strFactory = "FACTORY 1"
      
      '--- determine if data is to be picked up from database, recordset mode
      strRSMode = Request.Form( "chbRSMode" )
      
      '--- flgRSFromDatabase = false means build recordset thru scripts without database
      if( not IsEmpty(strRSMode) and not IsNull(strRSMode) and strRSMode = "on" ) then flgRSFromDatabase = False else flgRSFromDatabase = True
    %><%
      Dim oRs
      Dim oConnection
      Dim strQuery
      
      '--- recordset from database
      if( flgRSFromDatabase = true ) then
        '--- create the connection object
        Set oConnection = Server.CreateObject("ADODB.Connection" )
        
        '--- open the connection
        'oConnection.Open "DBQ="+server.mappath("CHARTDATA.mdb")+";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};"
        oConnection.Open "DBQ="+server.mappath("CHARTDATA.mdb")+";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};"  
        '--- build the query string
        strQuery = "SELECT * FROM yearly_production WHERE factory_name='"+strFactory+"' AND production_year BETWEEN "+CStr(iStartYear)+" AND "+CStr(iEndYear)
        
       Set oRs = oConnection.Execute( strQuery )
        
        
        if( oRs.EOF ) then
          Response.Write( "No data available" )
          Response.End 
        end if
      
      else
        
        Set oRs = Server.CreateObject("ADODB.Recordset" )
        
        with oRs
      .CursorLocation = 3 '--- client-side cursor
      with .Fields
        .Append "factory_name", adVarChar
    .Append "production_year",adInteger
    .Append "production_in_tons",adInteger
      end with
      
      .Open '-- open the recordset
      
      '--- add records
      .AddNew Array("factory_name","production_year", "production_in_tons"), Array( strFactory, iStartYear, "50" )
      .AddNew Array("factory_name","production_year", "production_in_tons"), Array( strFactory, iStartYear+1, "160" )
      .AddNew Array("factory_name","production_year", "production_in_tons"), Array( strFactory, iStartYear+2, "90" )
      .AddNew Array("factory_name","production_year", "production_in_tons"), Array( strFactory, iStartYear+3, "120" )
      .AddNew Array("factory_name","production_year", "production_in_tons"), Array( strFactory, iStartYear+4, "200" )

      '--- update
      .Update
        end with
      end if
    %><%
      Dim oExcelChart
      Dim strGIFFileName  
      Set oExcelChart = Server.CreateObject( "ExcelChart.cExcelChart" )
      
      oExcelChart.AddDataSeries oRs, "production_in_tons", "Production", False, True
      
      
      oExcelChart.SetXAxisHeadings oRs, "production_year"
      
      
      oExcelChart.SetChartTitles "Tea production for 5 year period", "Year", "Production"
      
      
      oExcelChart.SetChartOptions xl3DArea, 400, 200 'xl3DColumnClustered  
      oExcelChart.SetBackgroundEffect msoGradientChrome  ' msoGradientCalmWater 
      
      
      strGIFFileName = CStr( Server.MapPath(".") & "\"+ "EXCELCHART.GIF" )
      
      
      oExcelChart.ExportToGif( strGIFFileName )
      
      
      Set oExcelChart = nothing
      Set oRs = nothing
      Set oConnection  = nothing  
    %>
    <img SRC="ExcelChart.GIF">    '在html调用即可<!-- for debugging only -->
    <%
      'oRs.MoveFirst
      'while( not oRs.EOF ) 
      ' Response.Write( "<BR>Year:" + CStr(oRs("production_year")) +  "Factory:" + oRs("factory_name") + "Production:" + CStr(oRs("production_in_tons")))
      ' Factory:'"&oRs("factory_name")+  "'Production:"&oRs("production_in_tons"))
      ' oRs.MoveNext
    ' wend
      
    ' Set oRs = nothing
     'Set oConnection  = nothing  
    %>
    </body>
    </html>