Display multiple lines on 1 chart (ASP and OWC9)

P

purevil

I need help. I am trying to create a chart that has multiple lines
representing each transaction by on time. Here are the code.


dim objChartSpace
dim objChart
dim objSeries
dim objConn
dim objRS
dim c
dim series
dim strChartAbsPath
dim strChartRelPath
dim strChartFile
strChartAbsPath = "C:\Inetpub\wwwroot\Application\Charts"
strChartRelPath = "charts"

set objChartSpace = Server.CreateObject("OWC.Chart")
objChartSpace.HasChartSpaceTitle = True


objChartSpace.ChartSpaceTitle.Caption = "iPOS Transations Monitoring (" &
Date() & ")"

objChartSpace.ChartSpaceTitle.Font.Bold = True
set objChart = objChartSpace.Charts.Add()
set c = objChartSpace.Constants

'objChart.Type = c.chChartTypeLineMarkers
objChart.Type = c.chChartTypeLine
objChart.PlotArea.Interior.Color = "LightYellow"
objChart.HasLegend = True
ObjChart.Legend.Position = c.chLegendPositionBottom

set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open "provider=OraOLEDB.Oracle;data source=translog;user
id=global_readuser;password=h0tr0ds;"
set objRS = Server.CreateObject("ADODB.Recordset")
set objRS.ActiveConnection = objConn
objRS.CursorType = adOpenStatic
objRS.CursorLocation = adUseClient
'objRS.Open
objRS.Open "select TRANSACTION_NAME, AVG_ELAPSED_TIME/1000,
to_char(NEW_TIME(transaction_timestamp,'gmt','mst'),'HH24:MI') from
TRANSACTION_HISTORY_SHORTTERM where TRANSACTION_NAME in
('validateCustomer_2.0','getEligibleOffers_2.0','translateOffers_2.0','calculateTax_2.0','getAvailableDates_2.0','scheduleInstall_2.0','findOrders_2.0')
AND NEW_TIME(transaction_timestamp,'gmt','mst') >= trunc(sysdate) AND
MESSAGE_CD = 'UNDEFINED' Order By TRANSACTION_NAME,
to_char(NEW_TIME(transaction_timestamp,'gmt','mst'),'HH24:MI')"
set objChartSpace.DataSource = objRS
objChart.SetData c.chDimSeriesNames, 0, "TRANSACTION_NAME"
for each objSeries in objChart.SeriesCollection
objSeries.SetData c.chDimCategories, 0,
"to_char(NEW_TIME(transaction_timestamp,'gmt','mst'),'HH24:MI')"
objSeries.SetData c.chDimValues, 0, "AVG_ELAPSED_TIME/1000"
next

if objChart.SeriesCollection.count < 1 then
response.write "Chart is not available at this time for <b>" & sitename &
"</b>. Check back again later. Thanks."

else
for each axis in objChart.Axes
axis.HasTitle = True
if axis.Type = c.chCategoryAxis then
axis.Title.Caption = "Minutes (MTN Time)"
axis.NumberFormat = "Short Time"
'axis.Scaling.Minimum = 00:00
'axis.Scaling.maximum = 24:00
axis.MajorUnit = 30
axis.TickLabelSpacing = objChart.SeriesCollection(0).Points.Count
/ 10
'axis.Title.Font.Color = "Blue"
else

axis.Title.Caption = "Avg Response Time (Seconds)"
'axis.MajorUnit = 1
'axis.Scaling.Maximum = 20

end if
next

if objChart.SeriesCollection.count > 2 then
objChart.SeriesCollection(2).Interior.Color = "green"
objChart.SeriesCollection(2).Line.Color = "green"
end if

strChartFile = ExportChartToGIF(objChartSpace, strChartAbsPath,
strChartRelPath, "pos_today.gif")
Response.Write "<IMG SRC=""" & strChartFile & """ Alt="" Transaction
Statistics:" & date() & """>" & " "
'CleanUpGIF strChartAbsPath


end if
objRS.Close
set objRS = nothing
set objConn = nothing
set objSeries = nothing
set objChart = nothing
set objChartSpace = nothing


this is the error i am getting

A category axis does not support number formats.
 
A

Alvin Bruney [MVP]

This functionality was only added in version 10 and later. You may try
changing the raw data before you bind to the chart to see if that helps.

--
Regards,
Alvin Bruney [Microsoft MVP ASP.NET]

[Shameless Author plug]
The Microsoft Office Web Components Black Book with .NET
Now Available @ http://www.lulu.com/owc
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top