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
Get points in ASP page
-
- Site Admin
- Posts: 1349
- Joined: Thu Jan 01, 1970 12:00 am
- Location: Riudellots de la Selva, Catalonia
- Contact:
Hi Geoff,
CallExportChart.htm:
ExportChart.asp:
Best regards,
Christopher Ireland
OK. Please find following a simple example: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.
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>
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 ))
%>
Christopher Ireland