欢迎光临
我们一直在努力

利用MSCHART画图的一段代码

建站超值云服务器,限时71元/月

<!– here we are calling the lpk file. this lpk file

was created using the same method explained in the article–>

<object classid="clsid:5220cb21-c88d-11cf-b347-00aa00a28331"

id="microsoft_licensed_class_manager_1_0">

<param name="lpkpath" value="mschart5.lpk">

</object>

<– here is where we are actually "instantiating" the

activex control. i downloaded the file mschart5.cab from

microsofts website. it has been digitally signed. –>

<object id="mschart1" width=100% height=95%

classid="clsid:31291e80-728c-11cf-93d5-0020af99504a"

codebase="mschart5.cab">

</object>

<script language="vbscript">

now, lets set the chart properties…!!!

this sets the chart to a line graph…

mschart1.charttype = 3

set the color and width of the line

this sets the pen color to black (0,0,0)

and width to 50 pixels.

mschart1.plot.seriescollection(1).pen.vtcolor.set 0,0,0

mschart1.plot.seriescollection(1).pen.width = 50

this sets the charts labels to various formats,

fonts, and sizes.

for i = 1 to mschart1.plot.axis(1).labels.count

format the chart labels to currency

mschart1.plot.axis(1).labels(i).format = "$0,###"

set the font to tahoma

mschart1.plot.axis(1).labels(i).vtfont.name = "tahoma"

set the font size to 10pt

mschart1.plot.axis(1).labels(i).vtfont.size = 10

next

this sets the # of rows in the chart

mschart1.rowcount = 5;

this sets the number of columns per row.

mschart1.columncount = 2

this indicates to show the label

mschart1.showlegend = true

for x = 1 to 5 the number of rows we have

this sets what current row we are editing

mschart1.row = x

this sets the rows label

mschart1.rowlabel = "row " & x

this plots the points for both columns (1 and 2)

for the current row (x). the value being

plotted is x*5 and x*10

call mschart1.datagrid.setdata(x, 1, x*5,nullflag)

call mschart1.datagrid.setdata(x, 2, x*10,nullflag)

next

</script>

赞(0)
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » 利用MSCHART画图的一段代码
分享到: 更多 (0)