X value display wrongly
Posted: Tue May 27, 2008 10:11 am
Hi all,
I'm new with TeeChart. I have create a simple TeeChart where the data read from our database.
For example:
I have wrote this codes for web application, and it's display nicely in my PC (localhost), but when I uploaded into the server and display on website the the X value not sort in order. its display 23 15 7 22 14 21 13 20 12 19 11 18 10 17 9 16 8 . It should be 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
Hope somebody can help me.
Thanks in advance
I'm new with TeeChart. I have create a simple TeeChart where the data read from our database.
For example:
Code: Select all
<!--#include file = "../Idle.asp"-->
<!--#include File = "../../DBConnection/epmiDB.asp"-->
<!--METADATA NAME="TeeChart Pro v6 ActiveX Control" TYPE="TypeLib" UUID="{54294AC6-FA71-4C7F-B67C-6C6405DFFD48}"-->
<%
if Request.QueryString("CreateChart")=1 Then
Response.BinaryWrite(RunChart)
else
CreatePage
end if
Function RunChart()
dim img
dim Chart
Set Chart = CreateObject("TeeChart.TChart")
Chart.AddSeries(scHistogram)
Chart.Series(0).Marks.Visible=false
Chart.Series(0).Color=vbBlue
Chart.Legend.Visible=false
Chart.Aspect.View3D =false
Chart.Axis.Bottom.Labels.Angle=0
Chart.Height=250
Chart.Width=400
Chart.Panel.Gradient.Visible=true
Chart.Panel.Gradient.StartColor=vbwhite
Chart.Panel.Gradient.EndColor = vbwhite
Chart.Header.Text(0)=" "
Chart.Header.Font.Bold=True
Chart.Axis.Bottom.Title.Font.Bold=True
Chart.Axis.Left.Title.Font.Bold=True
Chart.Axis.Left.Title.Caption="# of Patient Visits"
Chart.Axis.Bottom.Title.Caption="Hour"
Chart.Axis.Left.Increment = 1
Set RSt = Server.CreateObject("ADODB.RecordSet")
SQLtemp ="select datePart(hh, timeIn) as whour, count(patientID) as billPatient from visit where LicenseNo='"&session("LNo")&"' and timeIn between '"& session("b4Start") &"' and '"& session("b4End") &"' group by datePart(hh, timeIn);"
RSt.Open SQLtemp, epmi, 1, 1
if RSt.RecordCount > 0 then
Chart.Series(0).Datasource = RSt
Chart.Series(0).LabelsSource="whour"
Chart.Series(0).YValues.ValueSource="billPatient"
else
Chart.Header.Text(0)="No Record Found!"
end if
Rst.close
epmi.close
Set Rst=nothing
Set epmi=nothing
img=Chart.Export.asPNG.SaveToStream
Set Chart=nothing
RunChart=img
End function
%>
Code: Select all
Chart.Series(0).LabelsSource="whour"
Hope somebody can help me.
Thanks in advance