A piece of code that uses MSChart to paint

Source: Internet
Author: User
Chart <!--Here we are calling the LPK file. This LPK file
is 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>


<--is where we are actually "instantiating"
ActiveX control. I downloaded the file Mschart5.cab from
Microsoft ' s 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, let ' s set the chart properties ...!!!

' This sets the chart-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 pixels.
MSChart1.Plot.SeriesCollection (1). Pen.VtColor.Set 0,0,0
MSChart1.Plot.SeriesCollection (1). Pen.Width = 50


' This sets the chart's 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 is sets the # of rows in the chart
Mschart1.rowcount = 5;

' This sets the # 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 the current row we are editing
Mschart1.row = X

' This sets the row ' s 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>



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.