Click to See Complete Forum and Search --> : MSChart control in vbscript


thpriya
December 24th, 2003, 12:53 AM
I need to use the MSChart control in a web page and manipulate its values. I'm able to set some of the properties like charttype, columncount etc but not the data.

How can I set the data for the chart?

In the following piece of code, the chart always generates random data. It does not take the data that I set.

Also, how can the control be made static on the webpage?

I do not want it to be dragged around the page.

-----------------------------------------------------------------------

<HTML>
<HEAD>
</HEAD>

<BODY>

<OBJECT id=MSChart1 style="WIDTH: 600px; HEIGHT: 500px"
classid=clsid:3A2B370C-BA0A-11D1-B137-0000F8753F5D
VIEWASTEXT>
</OBJECT>

<SCRIPT LANGUAGE="VBScript">
MsgBox ("Hi There")

MSChart1.RandomFill = False
MSChart1.ShowLegend = True

MSChart1.chartType = 3
MSChart1.ColumnCount = 2
MSChart1.RowCount = 3

MSChart1.Column = 1
MSChart1.Row = 1
MSChart1.Data = 500

MSChart1.Column = 1
MSChart1.Row = 2
MSChart1.Data = 600

MSChart1.Column = 1
MSChart1.Row = 3
MSChart1.Data = 700

MSChart1.Column = 2
MSChart1.Row = 1
MSChart1.Data = 500

MSChart1.Column = 2
MSChart1.Row = 2
MSChart1.Data = 600

MSChart1.Column = 2
MSChart1.Row = 3
MSChart1.Data = 700
</SCRIPT>

</BODY>
</HTML>