首页 > 编程 > .NET > 正文

Office XP charting Examples in asp.net

2024-07-10 12:58:22
字体:
来源:转载
供稿:网友

imports owc.stimgraph.helper

  

private sub page_load(byval sender as system.object, byval e as system.eventargs) handles mybase.load


             'create chartspace/chart

dim ochartspace as new owc10.chartspace()

dim ochart as owc10.chchart

dim oseries as owc10.chseries

  

'get a newly created chart from the chartspace

ochart = ochartspace.charts.add

  

'get a newly created series from the chart

oseries = ochart.seriescollection.add

  

'set the title

ochart.hastitle = true

ochart.title.caption = "dot net charting"

  

'demo hard coded

dim avalues() as double = {1, 2, 4, 8, 16}

dim acat() as string = {"a", "b", "c", "d", "e"}

  

'setup the text on the bottom axis

call ochart.setdata(owc10.chartdimensionsenum.chdimcategories, -1, getchartsafearray(acat))

  

'add the data to the series

call oseries.setdata(owc10.chartdimensionsenum.chdimvalues, -1, getchartsafearray(avalues))

  

'*******************************************************************************

'*** output the chart

'*******************************************************************************

'erase any garbage from response

response.buffer = true

response.clear()

  

'tell browser to expect a gif

response.contenttype = "image/gif"

  

'send the gif binary data

response.binarywrite(ochartspace.getpicture("gif", 300, 300))

  

'stop

response.end()

end sub

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表