• ASP中OWC的使用


    <%                   
                          
    dim ctype()
                          
    dim values()
                          
    redim ctype(ubound(show_arr,2))
                          
    redim values(ubound(show_arr,2))
                        
    '''中间步骤对数组ctype()和values()进行赋值
                        'set chart=createobject("owc.chart")
                        set chart = server.CreateObject("OWC11.Chartspace"'//office2003
                        chart.clear
                        
    set ochart=chart.charts.add               '添加一个chat类  
                        set oconst=chart.constants                '调用chat的命名常数
                        set oseries=ochart.seriescollection.add   '生成一个series序列

                        
    with oseries
                            .caption
    =FlowYear&"年Q"&FlowQuarter&"机型移动图"
                            .setdata oconst.chdimcategories,oconst.chdataliteral,ctype          
    '赋值横坐标值
                            .setdata oconst.chdimvalues,oconst.chdataliteral,values                '赋纵坐标值
                            .type=19
                            
    with .DataLabelsCollection.Add
                                .HasPercentage 
    = True
                                .hasvalue
    =false
                                .Font.Size 
    = 10
                            
    end with
                        
    end with

                        
    with ochart
                            .hastitle
    =true                                   '使图标有标题
                            .title.caption=FlowYear&"年Q"&FlowQuarter&"机型移动图"
                            .title.font.size
    =12
                            .title.font.bold
    =true
                            .title.font.color 
    = rgb(0,0,155)
                            .WidthRatio 
    = 50 
                            
    ''''if charttype="5" then
                            .haslegend=true                                  '使图表有图例
                            .legend.position=oconst.chlegendpositionright    '设定标注的图表位置(bottom)
                            .legend.font.size = 9
                           
    ''''end if
                        end with

                        sFname
    =server.mappath("../image/report_SaleTrend.gif")
                        vFname
    ="../image/report_SaleTrend.gif"'生成图表的iis虚拟路径名
                        width = 450
                        height 
    = 300
                        chart.exportPicture   sFname,
    "gif",width ,height'将图表到处导服务器的物理路径中
                        set chart=nothing
                        
    set ochart=nothing
                        
    set oconst=nothing
                        
    set oseries=nothing                   
                       
    %>
                        
    <img align="center" border="0" src=<%=vFname %> />     
  • 相关阅读:
    JSONRPC(jsonrpc4j)使用demo
    Java游戏服务器成长之路——感悟篇
    使用Echarts进行可视化的数据线呈现
    vb 获取本机MAC地址
    mysql的索引使用不当速度比没加索引还慢
    创业名言
    网络公司的转变
    用php来读取团购网站的api
    php中全局变量global的使用
    MongoDB被全球最大的分类信息网站Craigslist使用
  • 原文地址:https://www.cnblogs.com/ding0910/p/483324.html
Copyright © 2020-2023  润新知