Get points in ASP page

TeeChart for ActiveX, COM and ASP
Post Reply
Geff
Newbie
Newbie
Posts: 3
Joined: Fri Nov 15, 2002 12:00 am

Get points in ASP page

Post by Geff » Wed Nov 26, 2003 12:04 pm

Hi

I want to be able to click on a chart and have the nearest value displayed in a text box. I am using ASP / VB Script and a .tee file loaded into the activex control.

Thanks

Geoff

Christopher
Site Admin
Site Admin
Posts: 1349
Joined: Thu Jan 01, 1970 12:00 am
Location: Riudellots de la Selva, Catalonia
Contact:

Post by Christopher » Mon Dec 01, 2003 8:01 am

Hi Geoff,
I want to be able to click on a chart and have the nearest value displayed in a text box. I am using ASP / VB Script and a .tee file loaded into the activex control.
OK. Please find following a simple example:
CallExportChart.htm:

Code: Select all

<HTML>
<SCRIPT language=VBScript>

Sub Window_Onload()
 ' Use entire http path with LoadFromURL
 TChart1.Import.LoadFromURL("http://localhost/testscripts/ExportChart.asp")
End sub

Sub TChart1_OnAfterDraw()
End Sub


Sub TChart1_OnNearestToolChange()
TChart1.Header.Text.Clear
TChart1.Header.Text.Add "Nearest Point = " & TChart1.Tools.Items(0).asNearest.Point
End Sub

Sub TChart1_OnClick()
msgbox "Nearest Point = " & TChart1.Tools.Items(0).asNearest.Point
End Sub

</SCRIPT>
<BODY>

<OBJECT
   id="TChart1" 
   width="400" 
   height="268" 
   type="application/x-oleobject" 
   hspace="0"
   vspace="0" 
   classid="CLSID:536600D3-70FE-4C50-92FB-640F6BFC49AD"
   codebase="http://locahost/testscripts/Teechart6.cab#version=6,0,0,0">
</OBJECT>
<br><br>

</BODY></HTML>
ExportChart.asp:

Code: Select all

<!--METADATA NAME="TeeChart Pro Activex control v6" TYPE="TypeLib" 
UUID="{54294AC6-FA71-4C7F-B67C-6C6405DFFD48}"-->
<%
' Meta data section above to permit use of TeeChart constants in script
Set Chart1 = CreateObject("TeeChart.TChart.6")

Chart1.AddSeries(scPoint)
Chart1.Aspect.View3D=False

Chart1.Series(0).FillSampleValues 9

Chart1.Tools.Add(tcNearest)
Chart1.Tools.Items(0).asNearest.Series = Chart1.Series(0)
Chart1.Tools.Items(0).asNearest.DrawLine = False
Chart1.Tools.Items(0).asNearest.Style = hsNone

Response.BinaryWrite (Chart1.Export.asNative.SaveToStream( True ))
%>
Best regards,

Christopher Ireland

Post Reply