<head>
<title>SCADA</title>
<HTA:APPLICATION ID="oHTA"
BORDER="none"
INNERBORDER="no"
SHOWINTASKBAR="no"
WINDOWSTATE="maximize"
SCROLL="No"
APPLICATIONNAME="HTA Verification"
NAVIGABLE="yes">
<style type="text/css">
TD {font-size:8pt}
input {font-size:8pt}
H5 {font-size:8pt;}
</style>
</head>
<BODY STYLE="font:14pt arial; color:red;
filter:progid:DXImageTransform.Microsoft.Gradient
(GradientType=370371, StartColorStr='#800000', EndColorStr='#DB7093')">
<script language="VBscript">
On error resume Next
Sub ChangeIFrame
MyFrame.Document.Body.InnerHTML="<iframe width='100%' height='100%' src='pliki/5.htm'></iframe>"
End Sub
Sub ChangeIFrame2
MyFrame.Document.Body.InnerHTML="<object id=ChartSpace1 classid=CLSID:0002E55D-0000-0000-C000-000000000046 style='width:100%;height:350'></object>"
Dim categories(3)
Dim values(3)
Dim chConstants
' Create an array of strings representing the categories.
' The first category has a leading tic mark - without a character
' of some sort in one of the category values, the chart will not display
' The chart object cannot handle a string in the format xx:yy
categories(0) = "12"
categories(1) = "13"
categories(2) = "14"
categories(3) = "15"
' Clear the contents of the chart workspace. This removes
' any old charts that may already exist and leaves the chart workspace
' completely empty. One chart object is then added.
ChartSpace1.Clear
ChartSpace1.Charts.Add
Set chConstants = ChartSpace1.Constants
ChartSpace1.Charts(0).Type = chConstants.chChartTypeSmoothLine
' Add one series to the chart.
ChartSpace1.Charts(0).SeriesCollection.Add
' Series one contains sales growth data for 1998.
' Set the series caption (the text that appears in the legend).
ChartSpace1.Charts(0).SeriesCollection(0).Caption = "10-Jun-1998"
' Set the categories for the first series (this collection is zero-based)
ChartSpace1.Charts(0).SeriesCollection(0).SetData chConstants.chDimCategories, chConstants.chDataLiteral, categories
values(0) = 0.2
values(1) = 0.6
values(2) = 0.1
values(3) = 0.4
ChartSpace1.Charts(0).SeriesCollection(0).SetData chConstants.chDimValues, chConstants.chDataLiteral, values
' Make the chart legend visible, format the left value axis as percentage,
' and specify that value gridlines are at 10% intervals.
ChartSpace1.Charts(0).HasLegend = True
ChartSpace1.Charts(0).Axes(chConstants.chAxisPositionLeft).NumberFormat = "0%"
ChartSpace1.Charts(0).Axes(chConstants.chAxisPositionLeft).MajorUnit = 0.1
End Sub
</script>
<table border="0" width="100%" height="100%" id="tabela">
<tr>
<td height="37">
<Input ID="Close" ACCESSKEY="C" onclick="ChangeIFrame2()" type="button" value="Graph">
<Input ID="Close" ACCESSKEY="C" onclick="self.close()" type="button" value="Close">
--== SCADA 2006 K&K Kapica Karpiak Technika Grzewcza i Sanitarna ==--
<hr />
</td>
</tr>
<tr>
<td>
<iframe id=MyFrame width="100%" height="100%" onload="ChangeIFrame"></iframe>
</td>
</tr>
</table>
It's look like this i would like to have a chart when i press on button but I have got only error message :
There is no ChartSpace1, any ideas how to solve that think?
I know that i can put:
<object id=ChartSpace1 classid=CLSID:0002E55D-0000-0000-C000-000000000046 style="width:100%;height:350"></object>
in body of table and it's works, but i want to have graph only when i press the button.
//EDIT: added code TAGS
<message edited by Snipah on Friday, September 22, 2006 8:39 PM>