about picture's display problem?

TeeChart for ActiveX, COM and ASP
Post Reply
xghostzhao
Newbie
Newbie
Posts: 4
Joined: Sat Feb 09, 2002 5:00 am
Contact:

about picture's display problem?

Post by xghostzhao » Sun Feb 01, 2004 9:16 am

now i have a question

Code: Select all

<%
            set TChart1=Server.Createobject("TeeChart.TChart")
            TChart1.Height=250
            TChart1.Width=500
            TChart1.Header.Text.Clear
            TChart1.Header.Text.Add "DEMO"
            TChart1.Panel.Gradient.Visible=True
            TChart1.Panel.Gradient.StartColor=RGB(200,255,200)
            TChart1.Panel.Gradient.EndColor=RGB(255,255,255)
            TChart1.Aspect.view3d=false
            TChart1.AddSeries(scLine)
            TChart1.Series(0).Clear
            Set Rs=Server.CreateObject("ADODB.Recordset")    
            strsql = "select * from worktime_order"
            Rs.Open strsql,conn,1,1
            
            TChart1.Series(0).Add 180,"02/10",red
            IF rs.RecordCount > 0 THEN 
            TChart1.Series(0).Datasource = Rs
            TChart1.Series(0).LabelsSource="machine_id"
            TChart1.Series(0).YValues.ValueSource="machine_number"
            end if
            OutputStream=TChart1.Export.asPNG.SaveToStream

 Response.Binarywrite OutputStream

'TChart1.Export.SaveToJPEGFile server.Mappath("mychart.jpg"),False,JPEGBestQuality,85,Tchart1.Width,TChart1.Height
set Tchart1=nothing

           %>
because i didn't save picture,use savetostream
when code runs,i cann't see picture.
if i save ,i will see it
please tell me why?
thank you

xghostzhao
Newbie
Newbie
Posts: 4
Joined: Sat Feb 09, 2002 5:00 am
Contact:

Post by xghostzhao » Mon Feb 02, 2004 7:36 am

answer it by myself
before use response.binarywrite,you cann't output anything

Post Reply